+ {#if (enabled && (!pinging || error)) || (!enabled && error) || (enabled && !server_id)}
+
+
+
+
+
+
+ {#if enabled}
+ {#if !server_id}
+ GCP Pub/Sub trigger is starting...
+ {:else}
+ Could not connect to GCP Pub/Sub{error ? ': ' + error : ''}
+ {/if}
+ {:else}
+ Disabled because of an error: {error}
+ {/if}
+
+
+ {:else if enabled}
+
+
+
+
+
+ Connected to GCP Pub/Sub{!server_id ? ' (shutting down...)' : ''}
+
+ {/if}
+
{
+ setTriggerEnabled(path, e.detail)
+ }}
+ />
+ {/if}
+
+
+ {#if delivery_type === 'push'}
+
+ {/if}
+
+ {
+ goto(href)
+ }
+ },
+ {
+ displayName: 'Delete',
+ type: 'delete',
+ icon: Trash,
+ disabled: !canWrite,
+ action: async () => {
+ isDeleting = false
+ deleteSubscription = false
+ subscriptionToDelete = subscription_id
+ currentTopic = topic_id
+ deleteSubscriptionCallback = async () => {
+ const message = await GcpTriggerService.deleteGcpSubscription({
+ workspace: $workspaceStore ?? '',
+ path: gcp_resource_path,
+ requestBody: {
+ subscription_id
+ }
+ })
+ sendUserToast(message)
+ }
+ deleteGcpTriggerCallback = async () => {
+ const message = await GcpTriggerService.deleteGcpTrigger({
+ workspace: $workspaceStore ?? '',
+ path
+ })
+ sendUserToast(message)
+ loadTriggers()
+ }
+ }
+ },
+ {
+ displayName: canWrite ? 'Edit' : 'View',
+ icon: canWrite ? Pen : Eye,
+ action: () => {
+ gcpTriggerEditor?.openEdit(path, is_flow)
+ }
+ },
+ ...(isDeployable('trigger', path, deployUiSettings)
+ ? [
+ {
+ displayName: 'Deploy to prod/staging',
+ icon: FileUp,
+ action: () => {
+ deploymentDrawer.openDrawer(path, 'trigger', {
+ triggers: {
+ kind: 'gcp'
+ }
+ })
+ }
+ }
+ ]
+ : []),
+ {
+ displayName: 'Audit logs',
+ icon: Eye,
+ href: `${base}/audit_logs?resource=${path}`
+ },
+ {
+ displayName: canWrite ? 'Share' : 'See Permissions',
+ icon: Share,
+ action: () => {
+ shareModal.openDrawer(path, 'gcp_trigger')
+ }
+ }
+ ]}
+ />
+
+