+ {#if (enabled && (!pinging || error)) || (!enabled && error) || (enabled && !server_id)}
+
+
+
+
+
+ {#snippet text()}
+
+ {#if enabled}
+ {#if !server_id}
+ Azure Event Grid trigger is starting...
+ {:else}
+ Could not connect to Azure Event Grid{error ? ': ' + error : ''}
+ {/if}
+ {:else}
+ Disabled because of an error: {error}
+ {/if}
+
+ {/snippet}
+
+ {:else if enabled}
+
+
+
+
+ {#snippet text()}
+
+ Connected to Azure Event Grid{!server_id
+ ? ' (shutting down...)'
+ : ''}
+ {/snippet}
+
+ {/if}
+
onToggleMode(path, newMode)}
+ triggerMode={mode}
+ includeModalConfig={{
+ triggerPath: path,
+ triggerKind: 'azure',
+ runnableConfig: {
+ path: script_path,
+ kind: is_flow ? 'flow' : 'script',
+ retry,
+ errorHandlerPath: error_handler_path,
+ errorHandlerArgs: error_handler_args
+ }
+ }}
+ {canWrite}
+ hideToggleLabels
+ hideDropdown
+ />
+ {/if}
+
+
+ {#if !is_pull}
+
+ {/if}
+
+ {
+ goto(href)
+ }
+ },
+ ...(canWrite && mode !== 'suspended'
+ ? [
+ {
+ displayName: 'Suspend job execution',
+ icon: Pause,
+ action: () => {
+ onToggleMode(path, 'suspended')
+ }
+ }
+ ]
+ : []),
+ {
+ displayName: canWrite ? 'Edit' : 'View',
+ icon: canWrite ? Pen : Eye,
+ action: () => {
+ azureTriggerEditor?.openEdit(path, is_flow)
+ }
+ },
+ ...(isDeployable('trigger', path, deployUiSettings)
+ ? [
+ {
+ displayName: 'Deploy to prod/staging',
+ icon: FileUp,
+ action: () => {
+ deploymentDrawer?.openDrawer(path, 'trigger', {
+ triggers: {
+ kind: 'azure'
+ }
+ })
+ }
+ }
+ ]
+ : []),
+ {
+ displayName: 'Audit logs',
+ icon: Eye,
+ href: `${base}/audit_logs?resource=${path}`
+ },
+ {
+ displayName: 'Permissions',
+ icon: Shield,
+ action: () => {
+ shareModal?.openDrawer(path, 'azure_trigger')
+ }
+ },
+ {
+ displayName: 'Delete',
+ type: 'delete',
+ icon: Trash,
+ disabled: !canWrite,
+ action: async () => {
+ isDeleting = false
+ deleteSubscription = false
+ subscriptionToDelete = subscription_name
+ subscriptionDeletePayload = {
+ azure_mode,
+ scope_resource_id,
+ topic_name: topic_name ?? undefined,
+ subscription_name,
+ azure_resource_path
+ }
+ deleteAzureTriggerCallback = async () => {
+ const message = await AzureTriggerService.deleteAzureTrigger({
+ workspace: $workspaceStore ?? '',
+ path
+ })
+ sendUserToast(message)
+ loadTriggers()
+ }
+ }
+ }
+ ]}
+ />
+
+