@antelopejs/dms-automation 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -2
- package/dist/data/procedures-table.d.ts +38 -4
- package/dist/data/procedures-table.js +264 -82
- package/dist/data/procedures-table.js.map +1 -1
- package/dist/data/runs-table.d.ts +19 -3
- package/dist/data/runs-table.js +254 -19
- package/dist/data/runs-table.js.map +1 -1
- package/dist/db/index.d.ts +1 -2
- package/dist/db/index.js +1 -2
- package/dist/db/index.js.map +1 -1
- package/dist/db/models/automation_template.model.d.ts +16 -1
- package/dist/db/models/automation_template.model.js +31 -11
- package/dist/db/models/automation_template.model.js.map +1 -1
- package/dist/db/models/index.d.ts +1 -1
- package/dist/db/models/index.js +1 -1
- package/dist/db/models/procedure.model.d.ts +1 -0
- package/dist/db/models/procedure.model.js +7 -0
- package/dist/db/models/procedure.model.js.map +1 -1
- package/dist/db/models/procedure_run.model.d.ts +16 -9
- package/dist/db/models/procedure_run.model.js +96 -17
- package/dist/db/models/procedure_run.model.js.map +1 -1
- package/dist/db/models/stats.model.d.ts +60 -61
- package/dist/db/models/stats.model.js +189 -236
- package/dist/db/models/stats.model.js.map +1 -1
- package/dist/db/models/type_switch.model.d.ts +25 -0
- package/dist/db/models/type_switch.model.js +25 -0
- package/dist/db/models/type_switch.model.js.map +1 -0
- package/dist/db/tables/index.d.ts +1 -2
- package/dist/db/tables/index.js +1 -2
- package/dist/db/tables/index.js.map +1 -1
- package/dist/db/tables/procedure.table.d.ts +6 -0
- package/dist/db/tables/procedure.table.js +24 -0
- package/dist/db/tables/procedure.table.js.map +1 -1
- package/dist/db/tables/procedure_run.table.d.ts +15 -1
- package/dist/db/tables/procedure_run.table.js +54 -0
- package/dist/db/tables/procedure_run.table.js.map +1 -1
- package/dist/db/tables/type_switch.table.d.ts +8 -0
- package/dist/db/tables/{trigger_type_config.table.js → type_switch.table.js} +16 -15
- package/dist/db/tables/type_switch.table.js.map +1 -0
- package/dist/displays/index.d.ts +14 -0
- package/dist/displays/index.js +23 -0
- package/dist/displays/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/builder.d.ts +1 -1
- package/dist/pages/builder.js +10 -3
- package/dist/pages/builder.js.map +1 -1
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +2 -1
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/library.d.ts +2 -1
- package/dist/pages/library.js +54 -4
- package/dist/pages/library.js.map +1 -1
- package/dist/pages/overview.d.ts +6 -1
- package/dist/pages/overview.js +121 -2
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/procedures.js +106 -16
- package/dist/pages/procedures.js.map +1 -1
- package/dist/pages/runs.d.ts +4 -1
- package/dist/pages/runs.js +109 -13
- package/dist/pages/runs.js.map +1 -1
- package/dist/pages/shared.d.ts +18 -0
- package/dist/pages/shared.js +238 -0
- package/dist/pages/shared.js.map +1 -0
- package/dist/pages/trace.d.ts +10 -0
- package/dist/pages/trace.js +41 -0
- package/dist/pages/trace.js.map +1 -0
- package/dist/realtime.d.ts +3 -0
- package/dist/realtime.js +14 -0
- package/dist/realtime.js.map +1 -0
- package/dist/routes/action-types.d.ts +2 -14
- package/dist/routes/action-types.js +2 -32
- package/dist/routes/action-types.js.map +1 -1
- package/dist/routes/deleteConfirm.d.ts +3 -0
- package/dist/routes/deleteConfirm.js +64 -0
- package/dist/routes/deleteConfirm.js.map +1 -0
- package/dist/routes/graphSchema.d.ts +3 -90
- package/dist/routes/graphSchema.js +36 -9
- package/dist/routes/graphSchema.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/library.d.ts +40 -0
- package/dist/routes/library.js +147 -0
- package/dist/routes/library.js.map +1 -0
- package/dist/routes/procedureChecks.d.ts +16 -0
- package/dist/routes/procedureChecks.js +72 -0
- package/dist/routes/procedureChecks.js.map +1 -0
- package/dist/routes/procedureRuns.d.ts +21 -0
- package/dist/routes/procedureRuns.js +45 -0
- package/dist/routes/procedureRuns.js.map +1 -0
- package/dist/routes/procedureSchemas.d.ts +107 -0
- package/dist/routes/procedureSchemas.js +61 -0
- package/dist/routes/procedureSchemas.js.map +1 -0
- package/dist/routes/procedures.d.ts +125 -7
- package/dist/routes/procedures.js +363 -67
- package/dist/routes/procedures.js.map +1 -1
- package/dist/routes/requests.d.ts +15 -0
- package/dist/routes/requests.js +35 -0
- package/dist/routes/requests.js.map +1 -0
- package/dist/routes/runs.d.ts +107 -2
- package/dist/routes/runs.js +340 -37
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/stats.d.ts +19 -1
- package/dist/routes/stats.js +160 -4
- package/dist/routes/stats.js.map +1 -1
- package/dist/routes/templates.d.ts +6 -2
- package/dist/routes/templates.js +106 -36
- package/dist/routes/templates.js.map +1 -1
- package/dist/routes/trigger-types.d.ts +2 -15
- package/dist/routes/trigger-types.js +2 -32
- package/dist/routes/trigger-types.js.map +1 -1
- package/dist/routes/typeConfigShared.d.ts +7 -11
- package/dist/routes/typeConfigShared.js +25 -15
- package/dist/routes/typeConfigShared.js.map +1 -1
- package/dist/runtime/armErrors.d.ts +16 -0
- package/dist/runtime/armErrors.js +69 -0
- package/dist/runtime/armErrors.js.map +1 -0
- package/dist/runtime/boundRunLog.d.ts +24 -0
- package/dist/runtime/boundRunLog.js +202 -10
- package/dist/runtime/boundRunLog.js.map +1 -1
- package/dist/runtime/builtins/actions/http.d.ts +10 -1
- package/dist/runtime/builtins/actions/http.js +306 -19
- package/dist/runtime/builtins/actions/http.js.map +1 -1
- package/dist/runtime/builtins/actions/log.js +2 -2
- package/dist/runtime/builtins/actions/log.js.map +1 -1
- package/dist/runtime/builtins/data/boolean.d.ts +1 -0
- package/dist/runtime/builtins/data/boolean.js +18 -10
- package/dist/runtime/builtins/data/boolean.js.map +1 -1
- package/dist/runtime/builtins/data/compare.js +60 -11
- package/dist/runtime/builtins/data/compare.js.map +1 -1
- package/dist/runtime/builtins/data/constant.js +9 -12
- package/dist/runtime/builtins/data/constant.js.map +1 -1
- package/dist/runtime/builtins/data/json.js +4 -4
- package/dist/runtime/builtins/data/json.js.map +1 -1
- package/dist/runtime/builtins/data/math.js +44 -24
- package/dist/runtime/builtins/data/math.js.map +1 -1
- package/dist/runtime/builtins/data/object.js +10 -10
- package/dist/runtime/builtins/data/object.js.map +1 -1
- package/dist/runtime/builtins/data/string.js +31 -20
- package/dist/runtime/builtins/data/string.js.map +1 -1
- package/dist/runtime/builtins/nodes/action.js +4 -0
- package/dist/runtime/builtins/nodes/action.js.map +1 -1
- package/dist/runtime/builtins/nodes/delay.js +1 -1
- package/dist/runtime/builtins/nodes/delay.js.map +1 -1
- package/dist/runtime/builtins/nodes/forRange.d.ts +1 -1
- package/dist/runtime/builtins/nodes/forRange.js +10 -4
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
- package/dist/runtime/builtins/nodes/if.js +2 -1
- package/dist/runtime/builtins/nodes/if.js.map +1 -1
- package/dist/runtime/builtins/nodes/parallel.js +9 -2
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
- package/dist/runtime/builtins/nodes/retry.js +1 -1
- package/dist/runtime/builtins/nodes/retry.js.map +1 -1
- package/dist/runtime/builtins/nodes/setVariable.js +1 -3
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
- package/dist/runtime/builtins/triggers/cron.d.ts +3 -0
- package/dist/runtime/builtins/triggers/cron.js +21 -7
- package/dist/runtime/builtins/triggers/cron.js.map +1 -1
- package/dist/runtime/builtins/triggers/manual.js +2 -2
- package/dist/runtime/builtins/triggers/manual.js.map +1 -1
- package/dist/runtime/builtins/triggers/webhook.d.ts +14 -1
- package/dist/runtime/builtins/triggers/webhook.js +116 -30
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
- package/dist/runtime/describe.d.ts +23 -0
- package/dist/runtime/describe.js +114 -0
- package/dist/runtime/describe.js.map +1 -0
- package/dist/runtime/executionResult.d.ts +1 -0
- package/dist/runtime/executor.js +82 -5
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/graphIssues.d.ts +20 -0
- package/dist/runtime/graphIssues.js +290 -0
- package/dist/runtime/graphIssues.js.map +1 -0
- package/dist/runtime/graphVersion.d.ts +2 -0
- package/dist/runtime/graphVersion.js +43 -0
- package/dist/runtime/graphVersion.js.map +1 -0
- package/dist/runtime/nodeKinds.d.ts +4 -4
- package/dist/runtime/nodeKinds.js +1 -2
- package/dist/runtime/nodeKinds.js.map +1 -1
- package/dist/runtime/registry.d.ts +2 -1
- package/dist/runtime/registry.js +1 -2
- package/dist/runtime/registry.js.map +1 -1
- package/dist/runtime/resolveInputs.d.ts +3 -1
- package/dist/runtime/resolveInputs.js +12 -2
- package/dist/runtime/resolveInputs.js.map +1 -1
- package/dist/runtime/resolveSubgraph.d.ts +12 -1
- package/dist/runtime/resolveSubgraph.js +36 -0
- package/dist/runtime/resolveSubgraph.js.map +1 -1
- package/dist/runtime/retention.d.ts +6 -0
- package/dist/runtime/retention.js +54 -0
- package/dist/runtime/retention.js.map +1 -0
- package/dist/runtime/runProcedure.d.ts +12 -0
- package/dist/runtime/runProcedure.js +130 -0
- package/dist/runtime/runProcedure.js.map +1 -0
- package/dist/runtime/schedule.d.ts +2 -0
- package/dist/runtime/schedule.js +139 -0
- package/dist/runtime/schedule.js.map +1 -0
- package/dist/runtime/subscriptions.d.ts +11 -1
- package/dist/runtime/subscriptions.js +91 -125
- package/dist/runtime/subscriptions.js.map +1 -1
- package/dist/runtime/subwalk.js +2 -3
- package/dist/runtime/subwalk.js.map +1 -1
- package/dist/runtime/templateUsages.d.ts +4 -0
- package/dist/runtime/templateUsages.js +102 -0
- package/dist/runtime/templateUsages.js.map +1 -0
- package/dist/runtime/topo.d.ts +1 -0
- package/dist/runtime/topo.js +23 -0
- package/dist/runtime/topo.js.map +1 -1
- package/dist/runtime/trace.d.ts +44 -0
- package/dist/runtime/trace.js +240 -0
- package/dist/runtime/trace.js.map +1 -0
- package/dist/runtime/typeSwitches.d.ts +3 -0
- package/dist/runtime/typeSwitches.js +27 -0
- package/dist/runtime/typeSwitches.js.map +1 -0
- package/dist/runtime/validate.d.ts +11 -0
- package/dist/runtime/validate.js +118 -61
- package/dist/runtime/validate.js.map +1 -1
- package/dist/runtime/webhookRoutes.d.ts +4 -0
- package/dist/runtime/webhookRoutes.js +68 -0
- package/dist/runtime/webhookRoutes.js.map +1 -0
- package/dist/runtime/withTimeout.d.ts +1 -0
- package/dist/runtime/withTimeout.js +17 -0
- package/dist/runtime/withTimeout.js.map +1 -0
- package/dist/runtime/wording.d.ts +10 -0
- package/dist/runtime/wording.js +118 -0
- package/dist/runtime/wording.js.map +1 -0
- package/dist/stats/health-banner.d.ts +13 -0
- package/dist/stats/health-banner.js +149 -0
- package/dist/stats/health-banner.js.map +1 -0
- package/dist/stats/health.d.ts +49 -0
- package/dist/stats/health.js +130 -0
- package/dist/stats/health.js.map +1 -0
- package/dist/stats/kpi.d.ts +21 -0
- package/dist/stats/kpi.js +101 -0
- package/dist/stats/kpi.js.map +1 -0
- package/dist/stats/overview.d.ts +94 -0
- package/dist/stats/overview.js +244 -0
- package/dist/stats/overview.js.map +1 -0
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/constants.js +1 -2
- package/dist/types/constants.js.map +1 -1
- package/dist/types/runLog.d.ts +2 -0
- package/dist/types/runLog.js +4 -0
- package/dist/types/runLog.js.map +1 -1
- package/frontend-vue/app/components/AttentionList.vue +276 -0
- package/frontend-vue/app/components/Catalog/SchemaTable.vue +127 -0
- package/frontend-vue/app/components/Catalog.vue +457 -0
- package/frontend-vue/app/components/Editor/BottomDock.vue +188 -0
- package/frontend-vue/app/components/Editor/BuilderPalette.vue +105 -44
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +822 -207
- package/frontend-vue/app/components/Editor/GroupPortEditor.vue +29 -18
- package/frontend-vue/app/components/Editor/JsonField.vue +3 -3
- package/frontend-vue/app/components/Editor/NewProcedureDialog.vue +108 -0
- package/frontend-vue/app/components/Editor/NodeInspector.vue +382 -104
- package/frontend-vue/app/components/Editor/ProcedureSwitcher.vue +147 -0
- package/frontend-vue/app/components/Editor/RunNowDialog.vue +145 -0
- package/frontend-vue/app/components/Editor/WiredField.vue +3 -3
- package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +97 -91
- package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +5 -6
- package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +3 -2
- package/frontend-vue/app/components/Editor/nodes/styles.ts +14 -18
- package/frontend-vue/app/components/Editor.vue +1894 -705
- package/frontend-vue/app/components/IconPicker.vue +122 -0
- package/frontend-vue/app/components/LiveTopics.vue +20 -0
- package/frontend-vue/app/components/Run/RunCompare.vue +115 -0
- package/frontend-vue/app/components/Run/RunFailure.vue +54 -0
- package/frontend-vue/app/components/Run/RunLogList.vue +167 -0
- package/frontend-vue/app/components/Run/RunPathTaken.vue +139 -0
- package/frontend-vue/app/components/Run/RunPayload.vue +85 -0
- package/frontend-vue/app/components/Run/RunWaterfall.vue +374 -0
- package/frontend-vue/app/components/RunPeek.vue +132 -0
- package/frontend-vue/app/components/RunTrace.vue +462 -0
- package/frontend-vue/app/components/Templates.vue +382 -537
- package/frontend-vue/app/components/WebhookEndpoint.vue +81 -0
- package/frontend-vue/app/composables/useAutomationNodeKinds.ts +23 -6
- package/frontend-vue/app/composables/useAutomationRuns.ts +160 -25
- package/frontend-vue/app/composables/useGraphConnect.ts +103 -51
- package/frontend-vue/app/composables/useRunActions.ts +60 -0
- package/frontend-vue/app/plugins/cell-displays.ts +169 -0
- package/frontend-vue/app/utils/automation.ts +4 -36
- package/frontend-vue/app/utils/describe.ts +252 -0
- package/frontend-vue/app/utils/redactedHeaders.ts +31 -0
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +7 -4
- package/frontend-vue/i18n/locales/dms-automation-en-GB.json +1149 -309
- package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +1154 -314
- package/frontend-vue/package.json +1 -1
- package/package.json +8 -5
- package/dist/db/models/type_config.model.d.ts +0 -47
- package/dist/db/models/type_config.model.js +0 -51
- package/dist/db/models/type_config.model.js.map +0 -1
- package/dist/db/tables/action_type_config.table.d.ts +0 -7
- package/dist/db/tables/action_type_config.table.js +0 -35
- package/dist/db/tables/action_type_config.table.js.map +0 -1
- package/dist/db/tables/trigger_type_config.table.d.ts +0 -7
- package/dist/db/tables/trigger_type_config.table.js.map +0 -1
- package/frontend-vue/app/components/Actions.vue +0 -151
- package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +0 -166
- package/frontend-vue/app/components/Catalog/TypeList.vue +0 -198
- package/frontend-vue/app/components/DataNodes.vue +0 -272
- package/frontend-vue/app/components/Editor/ProcedureList.vue +0 -156
- package/frontend-vue/app/components/Editor/RunsDrawer.vue +0 -312
- package/frontend-vue/app/components/Library.vue +0 -69
- package/frontend-vue/app/components/Overview.vue +0 -503
- package/frontend-vue/app/components/RunDetailDrawer.vue +0 -165
- package/frontend-vue/app/components/RunFireTree.vue +0 -170
- package/frontend-vue/app/components/RunTraceDrawer.vue +0 -59
- package/frontend-vue/app/components/RunsStats.vue +0 -126
- package/frontend-vue/app/components/RunsTimelineDisplay.vue +0 -287
- package/frontend-vue/app/components/Triggers.vue +0 -147
- package/frontend-vue/app/plugins/runs-timeline-display.client.ts +0 -16
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import type { TraceStep } from '../../composables/useAutomationRuns'
|
|
4
|
+
import { describeDateTime, describeDuration, prettyJson } from '../../utils/describe'
|
|
3
5
|
import JsonField from './JsonField.vue'
|
|
4
6
|
import type { NodeKindEntry } from '../../composables/useAutomationNodeKinds'
|
|
5
7
|
import type {
|
|
@@ -19,8 +21,6 @@ const props = defineProps<{
|
|
|
19
21
|
dataEdges: DataEdge[]
|
|
20
22
|
triggerType: TriggerType | null
|
|
21
23
|
actionType: ActionType | null
|
|
22
|
-
triggerTypes: TriggerType[]
|
|
23
|
-
actionTypes: ActionType[]
|
|
24
24
|
dataNodeTypes: DataNodeType[]
|
|
25
25
|
// Per-NodeKind metadata served by `/api/automation/node-kinds`. The
|
|
26
26
|
// inspector reads each kind's optional `configSchema` to render its
|
|
@@ -28,6 +28,23 @@ const props = defineProps<{
|
|
|
28
28
|
nodeKinds: NodeKindEntry[]
|
|
29
29
|
// Read-only graphs (template-instance view) hide the delete button.
|
|
30
30
|
readOnly?: boolean
|
|
31
|
+
/** The node's step in the run shown over the canvas, for the "Last run" tab. */
|
|
32
|
+
runStep?: TraceStep | null
|
|
33
|
+
/** Says which run that is ("Test run · just now", "Run 8f3a2c · 14:28"). */
|
|
34
|
+
runLabel?: string
|
|
35
|
+
/** Opens the trace of that run. */
|
|
36
|
+
runTraceUrl?: string
|
|
37
|
+
/** The problem the validator found on this node (`code` translated, `message` as fallback). */
|
|
38
|
+
issue?: {
|
|
39
|
+
severity: 'error' | 'warning'
|
|
40
|
+
message: string
|
|
41
|
+
code?: string
|
|
42
|
+
params?: Record<string, unknown>
|
|
43
|
+
} | null
|
|
44
|
+
/** How a node is named in the builder, for the "From …" of wired fields. */
|
|
45
|
+
nodeName?: (id: string) => string
|
|
46
|
+
/** The saved graph's triggers, with the next time a schedule fires. */
|
|
47
|
+
savedTriggers?: Array<{ nodeId: string; cron?: string; timeZone?: string; nextAt: string | null }>
|
|
31
48
|
}>()
|
|
32
49
|
|
|
33
50
|
const emit = defineEmits<{
|
|
@@ -42,8 +59,109 @@ const emit = defineEmits<{
|
|
|
42
59
|
// removes the node and its edges from the current graph — the same outcome as
|
|
43
60
|
// pressing Delete/Backspace on the canvas, surfaced for discoverability.
|
|
44
61
|
(e: 'delete:node', payload: { id: string }): void
|
|
62
|
+
(e: 'duplicate:node', payload: { id: string }): void
|
|
63
|
+
(e: 'wrap:retry', payload: { id: string }): void
|
|
64
|
+
(e: 'close'): void
|
|
45
65
|
}>()
|
|
46
66
|
|
|
67
|
+
type InspectorTab = 'settings' | 'run' | 'docs'
|
|
68
|
+
const tab = ref<InspectorTab>('settings')
|
|
69
|
+
|
|
70
|
+
// A node with a run to show opens on it; otherwise on its settings.
|
|
71
|
+
watch(
|
|
72
|
+
[() => props.node?.id, () => !!props.runStep],
|
|
73
|
+
([, hasRun]) => {
|
|
74
|
+
tab.value = hasRun && props.runStep?.status === 'failed' ? 'run' : 'settings'
|
|
75
|
+
},
|
|
76
|
+
{ immediate: true },
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
const tabs = computed(() => [
|
|
80
|
+
{ label: t('dms_automation.editor.inspector.settings'), value: 'settings' },
|
|
81
|
+
...(props.runStep
|
|
82
|
+
? [{ label: props.runStep.status === 'failed' ? t('dms_automation.editor.inspector.runFailed') : t('dms_automation.editor.inspector.lastRun'), value: 'run' }]
|
|
83
|
+
: []),
|
|
84
|
+
{ label: t('dms_automation.editor.inspector.docs'), value: 'docs' },
|
|
85
|
+
])
|
|
86
|
+
|
|
87
|
+
// A group without a step name shows the name it was created with.
|
|
88
|
+
const label = computed({
|
|
89
|
+
get: () => {
|
|
90
|
+
const n = props.node as (GraphNode & { label?: string }) | null
|
|
91
|
+
return n?.label || (n?.kind === 'group' ? String(n.config?.name ?? '') : '')
|
|
92
|
+
},
|
|
93
|
+
set: (value: string) => {
|
|
94
|
+
if (!props.node) return
|
|
95
|
+
const next = { ...props.node, label: value.trim() ? value : undefined } as GraphNode
|
|
96
|
+
emit('update:node', next)
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const canWrapInRetry = computed(() => {
|
|
101
|
+
const n = props.node
|
|
102
|
+
return !!n && !props.readOnly && n.kind === 'action'
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
// Built-in blocks without a type (If, Retry…) are described by this module.
|
|
106
|
+
const typeDescription = computed(() => {
|
|
107
|
+
const n = props.node
|
|
108
|
+
if (!n) return ''
|
|
109
|
+
const type = n.kind === 'trigger' ? props.triggerType : n.kind === 'action' ? props.actionType : dataNodeType.value
|
|
110
|
+
if (type?.description) return processI18n(type.description)
|
|
111
|
+
const key = `dms_automation.nodes.docs.${n.kind}`
|
|
112
|
+
return te(key) ? t(key) : ''
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const kindUi = computed(() => props.nodeKinds.find((k) => k.kind === props.node?.kind)?.meta.ui)
|
|
116
|
+
|
|
117
|
+
function portsSchema(ports: Array<{ name: string; type?: string }>): JsonSchema {
|
|
118
|
+
return { properties: Object.fromEntries(ports.map((p) => [p.name, p.type ? { type: p.type } : {}])) }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// What the block reads: its type's fields, else its kind's data inputs and
|
|
122
|
+
// settings.
|
|
123
|
+
const inputSchema = computed<JsonSchema | null>(() => {
|
|
124
|
+
const n = props.node
|
|
125
|
+
if (!n || n.kind === 'trigger' || n.kind === 'action' || n.kind === 'data') return schema.value
|
|
126
|
+
const ui = kindUi.value
|
|
127
|
+
if (!ui) return null
|
|
128
|
+
const own = portsSchema(ui.staticDataIns)
|
|
129
|
+
return { properties: { ...own.properties, ...(ui.configSchema?.properties ?? {}) } }
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const outputSchema = computed(() => {
|
|
133
|
+
const n = props.node
|
|
134
|
+
if (!n) return null
|
|
135
|
+
if (n.kind === 'trigger') return props.triggerType?.outputSchema ?? null
|
|
136
|
+
if (n.kind === 'action') return props.actionType?.outputSchema ?? null
|
|
137
|
+
if (n.kind === 'data') return dataNodeType.value?.outputSchema ?? null
|
|
138
|
+
return kindUi.value ? portsSchema(kindUi.value.staticDataOuts) : null
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// The named ways out of a flow block (then / else, body, try / catch…).
|
|
142
|
+
const branches = computed(() => kindUi.value?.staticTriggerOuts ?? [])
|
|
143
|
+
|
|
144
|
+
// A template instance runs the template's steps and ports, edited in the
|
|
145
|
+
// template itself.
|
|
146
|
+
const templateId = computed(() => (props.node as (GraphNode & { templateId?: string }) | null)?.templateId)
|
|
147
|
+
|
|
148
|
+
const issueText = computed(() => {
|
|
149
|
+
const issue = props.issue
|
|
150
|
+
if (!issue) return ''
|
|
151
|
+
const key = `dms_automation.editor.problems.codes.${issue.code}`
|
|
152
|
+
if (!issue.code || !te(key)) return issue.message
|
|
153
|
+
// A setting's problem names it as the form above does.
|
|
154
|
+
const field = issue.params?.field
|
|
155
|
+
const prop = typeof field === 'string' ? schema.value?.properties?.[field] : undefined
|
|
156
|
+
return t(key, prop ? { ...issue.params, label: fieldLabel(String(field), prop) } : (issue.params ?? {}))
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
function unwrap(described: unknown): unknown {
|
|
160
|
+
if (!described || typeof described !== 'object') return described
|
|
161
|
+
if ('value' in described && 'type' in described) return (described as { value: unknown }).value
|
|
162
|
+
return Object.fromEntries(Object.entries(described as Record<string, unknown>).map(([k, v]) => [k, unwrap(v)]))
|
|
163
|
+
}
|
|
164
|
+
|
|
47
165
|
// Sentinel nodes (the group's input/output handles) are auto-managed and
|
|
48
166
|
// never user-deletable, mirroring the canvas keyboard-delete guard.
|
|
49
167
|
const SENTINEL_KINDS: ReadonlySet<string> = new Set(['groupInput', 'groupOutput'])
|
|
@@ -141,15 +259,67 @@ const fields = computed<
|
|
|
141
259
|
}))
|
|
142
260
|
})
|
|
143
261
|
|
|
262
|
+
// Type names may be `$`-prefixed DMS i18n keys shipped in the declaring
|
|
263
|
+
// module's locales; plain text is shown as written.
|
|
264
|
+
const { processI18n } = useTranslation()
|
|
265
|
+
const { t, te } = useI18n()
|
|
266
|
+
const { dateTimeFormat } = useRegionalFormat()
|
|
267
|
+
const typeName = (type: { name: string } | null | undefined) =>
|
|
268
|
+
type ? processI18n(type.name) : undefined
|
|
269
|
+
|
|
144
270
|
const nodeTypeLabel = computed<string>(() => {
|
|
145
271
|
const n = props.node
|
|
146
272
|
if (!n) return ''
|
|
147
|
-
if (n.kind === 'trigger') return props.triggerType
|
|
148
|
-
if (n.kind === 'action') return props.actionType
|
|
149
|
-
if (n.kind === 'data') return dataNodeType.value
|
|
150
|
-
|
|
273
|
+
if (n.kind === 'trigger') return typeName(props.triggerType) ?? n.typeId ?? 'Trigger'
|
|
274
|
+
if (n.kind === 'action') return typeName(props.actionType) ?? n.typeId ?? 'Action'
|
|
275
|
+
if (n.kind === 'data') return typeName(dataNodeType.value) ?? n.typeId ?? 'Data'
|
|
276
|
+
if (n.kind === 'group') return t('dms_automation.nodes.role.group')
|
|
277
|
+
return kindUi.value?.label ?? n.kind
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
// A field is named by its schema title when that is a translation key, by
|
|
281
|
+
// this module's name for it, by its plain title, else by its key in words
|
|
282
|
+
// ("maxAttempts" → "Max attempts").
|
|
283
|
+
function fieldLabel(name: string, prop: JsonSchemaProperty): string {
|
|
284
|
+
if (prop.title?.startsWith('$')) return processI18n(prop.title)
|
|
285
|
+
const key = `dms_automation.editor.inspector.fields.${name}`
|
|
286
|
+
if (te(key)) return t(key)
|
|
287
|
+
if (prop.title) return prop.title
|
|
288
|
+
const words = name
|
|
289
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
290
|
+
.replace(/[_-]+/g, ' ')
|
|
291
|
+
.toLowerCase()
|
|
292
|
+
.replace(/\b(id|url)(s?)\b/g, (_, word: string, plural: string) => word.toUpperCase() + plural)
|
|
293
|
+
return words.charAt(0).toUpperCase() + words.slice(1)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Under a schedule: when it fires next, in the server's time zone. The
|
|
297
|
+
// server works it out for the saved graph only.
|
|
298
|
+
const nextRunText = computed(() => {
|
|
299
|
+
const n = props.node
|
|
300
|
+
const cron = n?.config?.cron
|
|
301
|
+
if (!n || n.kind !== 'trigger' || typeof cron !== 'string' || !cron) return ''
|
|
302
|
+
const saved = props.savedTriggers?.find((tr) => tr.nodeId === n.id)
|
|
303
|
+
if (saved?.cron !== cron) return t('dms_automation.editor.inspector.nextRunAfterSave')
|
|
304
|
+
if (!saved.nextAt) return ''
|
|
305
|
+
return t('dms_automation.editor.inspector.nextRun', {
|
|
306
|
+
when: describeDateTime(saved.nextAt, dateTimeFormat, saved.timeZone),
|
|
307
|
+
zone: saved.timeZone ?? '',
|
|
308
|
+
})
|
|
151
309
|
})
|
|
152
310
|
|
|
311
|
+
function isRequired(name: string): boolean {
|
|
312
|
+
return schema.value?.required?.includes(name) ?? false
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Descriptions mark code with backticks (`*/5 * * * *`).
|
|
316
|
+
function descriptionParts(text: string): Array<{ text: string; code: boolean }> {
|
|
317
|
+
return processI18n(text)
|
|
318
|
+
.split('`')
|
|
319
|
+
.map((part, i) => ({ text: part, code: i % 2 === 1 }))
|
|
320
|
+
.filter((part) => part.text !== '')
|
|
321
|
+
}
|
|
322
|
+
|
|
153
323
|
function findIncoming(field: string): DataEdge | undefined {
|
|
154
324
|
if (!props.node) return undefined
|
|
155
325
|
const id = props.node.id
|
|
@@ -185,13 +355,15 @@ function asBool(v: unknown): boolean {
|
|
|
185
355
|
return !!v
|
|
186
356
|
}
|
|
187
357
|
|
|
188
|
-
// Returns true if `prop.type` is `"string"` OR an array of types that
|
|
189
|
-
// `"string"`. Used to render a plain string input instead of a JSON
|
|
190
|
-
// for multi-type fields like compare-node ports.
|
|
358
|
+
// Returns true if `prop.type` is `"string"` OR an array of scalar types that
|
|
359
|
+
// includes `"string"`. Used to render a plain string input instead of a JSON
|
|
360
|
+
// textarea for multi-type fields like compare-node ports. A type that also
|
|
361
|
+
// takes an object or an array (an HTTP body) keeps the JSON editor, which
|
|
362
|
+
// still accepts plain text.
|
|
191
363
|
function isStringish(prop: JsonSchemaProperty): boolean {
|
|
192
364
|
const t = prop.type
|
|
193
365
|
if (t === 'string') return true
|
|
194
|
-
if (Array.isArray(t)
|
|
366
|
+
if (Array.isArray(t)) return t.includes('string') && !t.includes('object') && !t.includes('array')
|
|
195
367
|
return false
|
|
196
368
|
}
|
|
197
369
|
|
|
@@ -226,21 +398,97 @@ function onUnwire(field: string) {
|
|
|
226
398
|
</script>
|
|
227
399
|
|
|
228
400
|
<template>
|
|
229
|
-
<
|
|
230
|
-
<
|
|
231
|
-
<div class="flex items-center gap-2">
|
|
232
|
-
<UIcon name="i-ph-faders" class="size-4 text-primary" />
|
|
233
|
-
<span class="text-sm font-semibold text-highlighted">
|
|
234
|
-
{{ $t('dms_automation.editor.inspector.title') }}
|
|
235
|
-
</span>
|
|
236
|
-
</div>
|
|
237
|
-
</template>
|
|
238
|
-
|
|
239
|
-
<div v-if="!node" class="p-2 text-sm text-dimmed">
|
|
401
|
+
<div class="flex h-full min-h-0 flex-col">
|
|
402
|
+
<div v-if="!node" class="p-4 text-sm text-dimmed">
|
|
240
403
|
{{ $t('dms_automation.editor.inspector.empty') }}
|
|
241
404
|
</div>
|
|
242
405
|
|
|
243
|
-
<
|
|
406
|
+
<template v-else>
|
|
407
|
+
<div class="flex flex-col gap-1 border-b border-default px-4 pt-3 pb-2">
|
|
408
|
+
<div class="flex items-center gap-1">
|
|
409
|
+
<span class="truncate font-mono text-[10.5px] text-dimmed uppercase">{{ nodeTypeLabel }}</span>
|
|
410
|
+
<!-- The span gives the tooltip a plain element: DMS components load
|
|
411
|
+
asynchronously and can't be its trigger. -->
|
|
412
|
+
<UTooltip :text="$t('dms_automation.editor.inspector.copyId')">
|
|
413
|
+
<span class="-my-1.5 ms-auto inline-flex">
|
|
414
|
+
<DmsCopyButton :value="node.id" />
|
|
415
|
+
</span>
|
|
416
|
+
</UTooltip>
|
|
417
|
+
<UButton
|
|
418
|
+
size="xs"
|
|
419
|
+
variant="ghost"
|
|
420
|
+
color="neutral"
|
|
421
|
+
icon="i-ph-x"
|
|
422
|
+
class="-my-1.5"
|
|
423
|
+
:aria-label="$t('dms_automation.editor.closeInspector')"
|
|
424
|
+
@click="emit('close')"
|
|
425
|
+
/>
|
|
426
|
+
</div>
|
|
427
|
+
<UInput
|
|
428
|
+
v-model.lazy="label"
|
|
429
|
+
size="sm"
|
|
430
|
+
variant="ghost"
|
|
431
|
+
:placeholder="nodeTypeLabel"
|
|
432
|
+
:disabled="readOnly"
|
|
433
|
+
:aria-label="$t('dms_automation.editor.inspector.stepName')"
|
|
434
|
+
class="-mx-2 font-medium"
|
|
435
|
+
/>
|
|
436
|
+
<UTabs v-model="tab" :items="tabs" variant="link" size="xs" :content="false" class="-mb-2" />
|
|
437
|
+
</div>
|
|
438
|
+
<div
|
|
439
|
+
v-if="issue"
|
|
440
|
+
class="mx-4 mt-3 flex items-start gap-2 rounded-md px-2 py-1.5 text-xs"
|
|
441
|
+
:class="issue.severity === 'error' ? 'bg-error/10 text-error' : 'bg-warning/10 text-warning'"
|
|
442
|
+
>
|
|
443
|
+
<UIcon name="i-ph-warning" class="mt-0.5 size-3.5 shrink-0" />
|
|
444
|
+
{{ issueText }}
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div v-if="tab === 'run' && runStep" class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
|
|
448
|
+
<div class="flex items-center justify-between gap-2">
|
|
449
|
+
<DmsStatusPill
|
|
450
|
+
:tone="runStep.status === 'failed' ? 'error' : 'success'"
|
|
451
|
+
:label="runStep.status === 'failed' ? $t('dms_automation.runs.status.failed') : $t('dms_automation.runs.status.ok')"
|
|
452
|
+
size="sm"
|
|
453
|
+
/>
|
|
454
|
+
<span class="font-mono text-xs text-muted">{{ describeDuration(runStep.durationMs) }}</span>
|
|
455
|
+
</div>
|
|
456
|
+
<p v-if="runLabel" class="text-xs text-muted">{{ runLabel }}</p>
|
|
457
|
+
<div class="flex flex-col gap-1">
|
|
458
|
+
<span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.trace.input') }}</span>
|
|
459
|
+
<pre class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap text-toned">{{ prettyJson(unwrap(runStep.inputs)) || '—' }}</pre>
|
|
460
|
+
</div>
|
|
461
|
+
<div class="flex flex-col gap-1">
|
|
462
|
+
<span class="font-mono text-[10.5px] text-dimmed uppercase">
|
|
463
|
+
{{ runStep.status === 'failed' ? $t('dms_automation.trace.error') : $t('dms_automation.trace.output') }}
|
|
464
|
+
</span>
|
|
465
|
+
<pre
|
|
466
|
+
class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap"
|
|
467
|
+
:class="runStep.status === 'failed' ? 'text-error' : 'text-toned'"
|
|
468
|
+
>{{ runStep.status === 'failed' ? runStep.error : prettyJson(unwrap(runStep.output)) || '—' }}</pre>
|
|
469
|
+
</div>
|
|
470
|
+
<UButton v-if="runTraceUrl" size="xs" variant="ghost" color="neutral" trailing-icon="i-ph-arrow-up-right" :to="runTraceUrl" class="self-start">
|
|
471
|
+
{{ $t('dms_automation.trace.openFull') }}
|
|
472
|
+
</UButton>
|
|
473
|
+
</div>
|
|
474
|
+
|
|
475
|
+
<div v-else-if="tab === 'docs'" class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
|
|
476
|
+
<p class="text-sm text-toned">{{ typeDescription || $t('dms_automation.editor.inspector.noDocs') }}</p>
|
|
477
|
+
<div class="flex flex-col gap-1">
|
|
478
|
+
<span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.inputs') }}</span>
|
|
479
|
+
<DmsAutomationSchemaTable :schema="inputSchema" />
|
|
480
|
+
</div>
|
|
481
|
+
<div v-if="branches.length" class="flex flex-col gap-1">
|
|
482
|
+
<span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.editor.inspector.branches') }}</span>
|
|
483
|
+
<p class="font-mono text-xs text-toned">{{ branches.join(' · ') }}</p>
|
|
484
|
+
</div>
|
|
485
|
+
<div class="flex flex-col gap-1">
|
|
486
|
+
<span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.outputs') }}</span>
|
|
487
|
+
<DmsAutomationSchemaTable :schema="outputSchema" />
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
|
|
491
|
+
<div v-else class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
|
|
244
492
|
<UButton
|
|
245
493
|
v-if="canEnterGroup"
|
|
246
494
|
block
|
|
@@ -251,18 +499,12 @@ function onUnwire(field: string) {
|
|
|
251
499
|
>
|
|
252
500
|
{{ $t('dms_automation.editor.inspector.enterSubgraph') }}
|
|
253
501
|
</UButton>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<div>
|
|
261
|
-
<div class="text-xs text-dimmed">
|
|
262
|
-
{{ $t('dms_automation.editor.inspector.nodeId') }}
|
|
263
|
-
</div>
|
|
264
|
-
<div class="truncate font-mono text-xs text-toned">{{ node.id }}</div>
|
|
265
|
-
</div>
|
|
502
|
+
|
|
503
|
+
<DmsAutomationWebhookEndpoint
|
|
504
|
+
v-if="node.kind === 'trigger' && node.typeId === 'webhook' && typeof node.config.path === 'string' && node.config.path"
|
|
505
|
+
:path="node.config.path"
|
|
506
|
+
:method="typeof node.config.method === 'string' ? node.config.method : undefined"
|
|
507
|
+
/>
|
|
266
508
|
|
|
267
509
|
<div
|
|
268
510
|
v-if="fields.length === 0 && node.kind !== 'group'"
|
|
@@ -271,86 +513,122 @@ function onUnwire(field: string) {
|
|
|
271
513
|
{{ $t('dms_automation.editor.inspector.noFields') }}
|
|
272
514
|
</div>
|
|
273
515
|
|
|
516
|
+
<div v-if="templateId" class="flex flex-col gap-1.5 rounded-md border border-default p-3">
|
|
517
|
+
<span class="text-xs text-muted">{{ $t('dms_automation.editor.inspector.templateInstance') }}</span>
|
|
518
|
+
<UButton
|
|
519
|
+
size="xs"
|
|
520
|
+
variant="soft"
|
|
521
|
+
color="neutral"
|
|
522
|
+
icon="i-ph-pencil-simple"
|
|
523
|
+
:to="`/modules/automation/builder?template=${templateId}`"
|
|
524
|
+
class="self-start"
|
|
525
|
+
>
|
|
526
|
+
{{ $t('dms_automation.editor.inspector.editTemplate') }}
|
|
527
|
+
</UButton>
|
|
528
|
+
</div>
|
|
529
|
+
|
|
274
530
|
<!-- Group port editor — declared ports drive the sentinel handles
|
|
275
|
-
inside the subgraph (see syncSentinels in Editor.vue).
|
|
531
|
+
inside the subgraph (see syncSentinels in Editor.vue). A
|
|
532
|
+
template instance shows the template's ports, read-only. -->
|
|
276
533
|
<DmsAutomationGroupPortEditor
|
|
277
534
|
v-if="node.kind === 'group'"
|
|
278
535
|
:ports="groupPorts"
|
|
536
|
+
:read-only="readOnly || !!templateId"
|
|
279
537
|
@ports:update="onGroupPortsUpdate"
|
|
280
538
|
/>
|
|
281
539
|
|
|
282
|
-
<
|
|
540
|
+
<DmsFieldRow
|
|
283
541
|
v-for="f in fields"
|
|
284
542
|
:key="f.name"
|
|
285
|
-
|
|
543
|
+
layout="stack"
|
|
544
|
+
spacing="list"
|
|
545
|
+
:inset="false"
|
|
546
|
+
:label="fieldLabel(f.name, f.prop)"
|
|
547
|
+
:required="isRequired(f.name)"
|
|
548
|
+
:label-for="findIncoming(f.name) || isBoolish(f.prop) ? undefined : `inspector-${f.name}`"
|
|
286
549
|
>
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
port: findIncoming(f.name)!.from.port,
|
|
295
|
-
}"
|
|
296
|
-
:source-label="findIncoming(f.name)!.from.node"
|
|
297
|
-
@unwire="onUnwire(f.name)"
|
|
298
|
-
/>
|
|
299
|
-
</template>
|
|
300
|
-
|
|
301
|
-
<template v-else>
|
|
302
|
-
<USelect
|
|
303
|
-
v-if="Array.isArray(f.prop.enum) && f.prop.enum.length > 0"
|
|
304
|
-
:items="(f.prop.enum as unknown[]).map((v) => String(v))"
|
|
305
|
-
:model-value="asString(getValue(f.name) ?? f.prop.default)"
|
|
306
|
-
@update:model-value="(v: string) => emitUpdated(f.name, v)"
|
|
307
|
-
/>
|
|
308
|
-
<UInput
|
|
309
|
-
v-else-if="isStringish(f.prop)"
|
|
310
|
-
:model-value="asString(getValue(f.name))"
|
|
311
|
-
@update:model-value="(v: string | number) => emitUpdated(f.name, String(v))"
|
|
312
|
-
/>
|
|
313
|
-
<UInput
|
|
314
|
-
v-else-if="isNumberish(f.prop)"
|
|
315
|
-
type="number"
|
|
316
|
-
:model-value="asNumber(getValue(f.name))"
|
|
317
|
-
@update:model-value="(v: string | number) => emitUpdated(f.name, asNumber(v))"
|
|
318
|
-
/>
|
|
319
|
-
<USwitch
|
|
320
|
-
v-else-if="isBoolish(f.prop)"
|
|
321
|
-
:model-value="asBool(getValue(f.name))"
|
|
322
|
-
@update:model-value="(v: boolean) => emitUpdated(f.name, v)"
|
|
323
|
-
/>
|
|
324
|
-
<UTextarea
|
|
325
|
-
v-else-if="f.prop.type === 'array'"
|
|
326
|
-
:rows="3"
|
|
327
|
-
:placeholder="$t('dms_automation.editor.inspector.arrayPlaceholder')"
|
|
328
|
-
:model-value="arrayToText(getValue(f.name))"
|
|
329
|
-
@update:model-value="(v: string | number) => emitUpdated(f.name, textToArray(String(v)))"
|
|
330
|
-
/>
|
|
331
|
-
<JsonField
|
|
332
|
-
v-else
|
|
333
|
-
:model-value="getValue(f.name)"
|
|
334
|
-
@update:model-value="(v: unknown) => emitUpdated(f.name, v)"
|
|
335
|
-
/>
|
|
550
|
+
<template v-if="f.prop.description" #details>
|
|
551
|
+
<p class="mt-0.5 text-[12.5px] leading-normal text-muted">
|
|
552
|
+
<template v-for="(part, i) in descriptionParts(f.prop.description)" :key="i">
|
|
553
|
+
<code v-if="part.code" class="rounded bg-elevated px-1 font-mono text-[11.5px] text-toned">{{ part.text }}</code>
|
|
554
|
+
<template v-else>{{ part.text }}</template>
|
|
555
|
+
</template>
|
|
556
|
+
</p>
|
|
336
557
|
</template>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
{
|
|
340
|
-
|
|
558
|
+
<DmsAutomationWiredField
|
|
559
|
+
v-if="findIncoming(f.name)"
|
|
560
|
+
:source="{
|
|
561
|
+
node: findIncoming(f.name)!.from.node,
|
|
562
|
+
port: findIncoming(f.name)!.from.port,
|
|
563
|
+
}"
|
|
564
|
+
:source-label="nodeName ? nodeName(findIncoming(f.name)!.from.node) : findIncoming(f.name)!.from.node"
|
|
565
|
+
@unwire="onUnwire(f.name)"
|
|
566
|
+
/>
|
|
567
|
+
<DmsSelect
|
|
568
|
+
v-else-if="Array.isArray(f.prop.enum) && f.prop.enum.length > 0"
|
|
569
|
+
:id="`inspector-${f.name}`"
|
|
570
|
+
:items="(f.prop.enum as unknown[]).map((v) => String(v))"
|
|
571
|
+
:model-value="asString(getValue(f.name) ?? f.prop.default)"
|
|
572
|
+
class="w-full"
|
|
573
|
+
@update:model-value="(v: string) => emitUpdated(f.name, v)"
|
|
574
|
+
/>
|
|
575
|
+
<DmsInputText
|
|
576
|
+
v-else-if="isStringish(f.prop)"
|
|
577
|
+
:id="`inspector-${f.name}`"
|
|
578
|
+
:model-value="asString(getValue(f.name))"
|
|
579
|
+
class="w-full"
|
|
580
|
+
@update:model-value="(v: string | number) => emitUpdated(f.name, String(v))"
|
|
581
|
+
/>
|
|
582
|
+
<DmsInputNumber
|
|
583
|
+
v-else-if="isNumberish(f.prop)"
|
|
584
|
+
:id="`inspector-${f.name}`"
|
|
585
|
+
:model-value="asNumber(getValue(f.name))"
|
|
586
|
+
class="w-full"
|
|
587
|
+
@update:model-value="(v: number | null | undefined) => emitUpdated(f.name, asNumber(v))"
|
|
588
|
+
/>
|
|
589
|
+
<DmsSwitch
|
|
590
|
+
v-else-if="isBoolish(f.prop)"
|
|
591
|
+
:model-value="asBool(getValue(f.name) ?? f.prop.default)"
|
|
592
|
+
@update:model-value="(v: boolean) => emitUpdated(f.name, v)"
|
|
593
|
+
/>
|
|
594
|
+
<DmsTextarea
|
|
595
|
+
v-else-if="f.prop.type === 'array'"
|
|
596
|
+
:id="`inspector-${f.name}`"
|
|
597
|
+
:rows="3"
|
|
598
|
+
:placeholder="$t('dms_automation.editor.inspector.arrayPlaceholder')"
|
|
599
|
+
:model-value="arrayToText(getValue(f.name))"
|
|
600
|
+
class="w-full"
|
|
601
|
+
@update:model-value="(v: string | number) => emitUpdated(f.name, textToArray(String(v)))"
|
|
602
|
+
/>
|
|
603
|
+
<JsonField
|
|
604
|
+
v-else
|
|
605
|
+
:model-value="getValue(f.name)"
|
|
606
|
+
@update:model-value="(v: unknown) => emitUpdated(f.name, v)"
|
|
607
|
+
/>
|
|
608
|
+
<p v-if="f.name === 'cron' && nextRunText" class="text-xs text-muted">{{ nextRunText }}</p>
|
|
609
|
+
</DmsFieldRow>
|
|
610
|
+
|
|
611
|
+
<div v-if="canWrapInRetry" class="flex flex-col gap-1.5 rounded-md border border-default p-3">
|
|
612
|
+
<span class="text-xs font-medium text-highlighted">{{ $t('dms_automation.editor.inspector.ifItFails') }}</span>
|
|
613
|
+
<span class="text-xs text-muted">{{ $t('dms_automation.editor.inspector.ifItFailsHint') }}</span>
|
|
614
|
+
<UButton size="xs" variant="soft" color="neutral" icon="i-ph-arrow-counter-clockwise" class="self-start" @click="emit('wrap:retry', { id: node.id })">
|
|
615
|
+
{{ $t('dms_automation.editor.inspector.wrapInRetry') }}
|
|
616
|
+
</UButton>
|
|
617
|
+
</div>
|
|
618
|
+
<p v-if="node.kind === 'action' && node.typeId === 'http.request'" class="text-xs text-dimmed">
|
|
619
|
+
{{ $t('dms_automation.editor.inspector.credentialsHint') }}
|
|
620
|
+
</p>
|
|
621
|
+
<div v-if="canDelete" class="mt-1 flex gap-2">
|
|
622
|
+
<UTooltip :text="$t('dms_automation.editor.inspector.duplicate')" :kbds="['meta', 'd']">
|
|
623
|
+
<UButton size="sm" color="neutral" icon="i-ph-copy" variant="outline" @click="emit('duplicate:node', { id: node.id })">
|
|
624
|
+
{{ $t('dms_automation.editor.inspector.duplicate') }}
|
|
625
|
+
</UButton>
|
|
626
|
+
</UTooltip>
|
|
627
|
+
<UButton size="sm" color="error" icon="i-ph-trash" variant="soft" @click="emitDelete">
|
|
628
|
+
{{ $t('dms_automation.editor.inspector.deleteNode') }}
|
|
629
|
+
</UButton>
|
|
341
630
|
</div>
|
|
342
|
-
|
|
343
|
-
<UButton
|
|
344
|
-
v-if="canDelete"
|
|
345
|
-
block
|
|
346
|
-
color="error"
|
|
347
|
-
icon="i-ph-trash"
|
|
348
|
-
variant="outline"
|
|
349
|
-
class="mt-1"
|
|
350
|
-
@click="emitDelete"
|
|
351
|
-
>
|
|
352
|
-
{{ $t('dms_automation.editor.inspector.deleteNode') }}
|
|
353
|
-
</UButton>
|
|
354
631
|
</div>
|
|
355
|
-
|
|
632
|
+
</template>
|
|
633
|
+
</div>
|
|
356
634
|
</template>
|