{% extends 'formie/_layouts/settings' %} {% block actionButton %} {% if craft.app.config.general.allowAdminChanges %} {{ 'New Integration' | t('formie') }} {% endif %} {% endblock %} {% block content %}
{% endblock %} {% set supportsConnection = false %} {% if integrations | length and integrations[0].supportsConnection() %} {% set supportsConnection = true %} {% endif %} {% set tableData = [] %} {% for integration in integrations %} {% set integrationIsMissing = false %} {% if integration is missing %} {% set integrationIsMissing = true %} {% endif %} {% set tableData = tableData | merge([{ id: integration.id, title: integration.getName() | t('formie'), url: integration.getCpEditUrl(), name: integration.getName() | t('formie') | e, enabled: integration.getEnabled(), connected: integration.getIsConnected(), type: { isMissing: integrationIsMissing, label: integrationIsMissing ? integration.expectedType : integration.displayName(), icon: integration.getIconUrl(), }, }]) %} {% endfor %} {% js %} var columns = [ { name: '__slot:title', title: Craft.t('app', 'Name') }, { name: 'type', title: Craft.t('app', 'Type'), callback: function(value) { if (value.isMissing) { return '' + value.label + ''; } return '
' + '' + value.label '
'; } }, { name: 'enabled', title: Craft.t('formie', 'Enabled'), callback: function(value) { if (value) { return '
' + Craft.t('formie', 'Enabled') + '
'; } else { return '
' + Craft.t('formie', 'Disabled') + '
'; } } }, {% if supportsConnection %} { name: 'connected', title: Craft.t('formie', 'Connected'), callback: function(value) { if (value) { return '
' + Craft.t('formie', 'Connected') + '
'; } else { return '
' + Craft.t('formie', 'Not connected') + '
'; } } }, {% endif %} ]; new Craft.VueAdminTable({ columns: columns, container: '#integrations-vue-admin-table', emptyMessage: Craft.t('formie', 'No integrations exist yet.'), tableData: {{ tableData | json_encode | raw }}, {% if craft.app.config.general.allowAdminChanges %} deleteAction: 'formie/integrations/delete-integration', reorderAction: '{{ integrations | length > 1 ? 'formie/integrations/reorder-integrations' : ''}}', {% endif %} }); {% endjs %}