@antelopejs/dms-automation 0.2.7 → 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 +101 -45
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +818 -206
- 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 +373 -101
- 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 +7 -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 -170
- package/frontend-vue/app/components/Catalog/TypeList.vue +0 -203
- package/frontend-vue/app/components/DataNodes.vue +0 -275
- 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
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
builderRunUrl,
|
|
5
|
+
opensInBuilder,
|
|
6
|
+
type RunDetail,
|
|
7
|
+
type RunNeighbour,
|
|
8
|
+
type TraceStep,
|
|
9
|
+
useAutomationRuns,
|
|
10
|
+
} from '../composables/useAutomationRuns'
|
|
11
|
+
import { useRunActions } from '../composables/useRunActions'
|
|
12
|
+
import {
|
|
13
|
+
describeDateTime,
|
|
14
|
+
describeDuration,
|
|
15
|
+
type StepName,
|
|
16
|
+
} from '../utils/describe'
|
|
17
|
+
|
|
18
|
+
// The run trace page (`?run=<id>`): one run, linkable. Why it failed comes
|
|
19
|
+
// first, under the header; then its steps on a time line, the payload and the
|
|
20
|
+
// log in tabs, and beside them the path it took and how it compares with the
|
|
21
|
+
// last success.
|
|
22
|
+
|
|
23
|
+
const props = defineProps<{
|
|
24
|
+
apiUrl: string
|
|
25
|
+
runsUrl: string
|
|
26
|
+
builderUrl: string
|
|
27
|
+
traceUrl: string
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
const route = useDmsRoute()
|
|
31
|
+
const router = useDmsRouter()
|
|
32
|
+
const { processText } = useComposedText()
|
|
33
|
+
const { t, locale } = useI18n()
|
|
34
|
+
const { dateTimeFormat } = useRegionalFormat()
|
|
35
|
+
const runs = useAutomationRuns(props.apiUrl)
|
|
36
|
+
const { rerun, rerunning } = useRunActions({ apiUrl: props.apiUrl, traceUrl: props.traceUrl })
|
|
37
|
+
|
|
38
|
+
const runId = computed(() => {
|
|
39
|
+
const q = route.query.run
|
|
40
|
+
return typeof q === 'string' ? q : Array.isArray(q) ? (q[0] ?? null) : null
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const run = ref<RunDetail | null>(null)
|
|
44
|
+
const loading = ref(true)
|
|
45
|
+
/** Why the run did not load: no id given, no such run, or another error. */
|
|
46
|
+
const failure = ref<{ reason: 'noRun' | 'notFound' | 'error'; message?: string } | null>(null)
|
|
47
|
+
const tab = ref('steps')
|
|
48
|
+
const pathOnly = ref(false)
|
|
49
|
+
|
|
50
|
+
const HTTP_NOT_FOUND = 404
|
|
51
|
+
|
|
52
|
+
function statusOf(e: unknown): number | undefined {
|
|
53
|
+
const error = e as { statusCode?: number; response?: { status?: number } }
|
|
54
|
+
return error.statusCode ?? error.response?.status
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function load() {
|
|
58
|
+
if (!runId.value) {
|
|
59
|
+
run.value = null
|
|
60
|
+
failure.value = { reason: 'noRun' }
|
|
61
|
+
loading.value = false
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
loading.value = true
|
|
65
|
+
try {
|
|
66
|
+
run.value = await runs.getRun(runId.value)
|
|
67
|
+
failure.value = null
|
|
68
|
+
} catch (e) {
|
|
69
|
+
run.value = null
|
|
70
|
+
failure.value = statusOf(e) === HTTP_NOT_FOUND
|
|
71
|
+
? { reason: 'notFound' }
|
|
72
|
+
: { reason: 'error', message: describeApiError(e) }
|
|
73
|
+
} finally {
|
|
74
|
+
loading.value = false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
watch(runId, () => void load(), { immediate: true })
|
|
79
|
+
|
|
80
|
+
const names = computed(() => {
|
|
81
|
+
const map = new Map<string, StepName>()
|
|
82
|
+
for (const step of run.value?.trace.steps ?? []) map.set(step.nodeId, step.name)
|
|
83
|
+
return map
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const deleted = computed(() => !!run.value && !run.value.procedure)
|
|
87
|
+
const procedureName = computed(
|
|
88
|
+
() => run.value?.procedure?.name ?? run.value?.procedureName ?? t('dms_automation.feed.deletedProcedure'),
|
|
89
|
+
)
|
|
90
|
+
const failed = computed(() => run.value?.status === 'failed')
|
|
91
|
+
const startedAt = computed(() => describeDateTime(run.value?.startedAt, dateTimeFormat))
|
|
92
|
+
const statusLabel = computed(() => (failed.value ? t('dms_automation.runs.status.failed') : t('dms_automation.runs.status.ok')))
|
|
93
|
+
|
|
94
|
+
useHead({
|
|
95
|
+
title: () => (run.value ? `${statusLabel.value} · ${procedureName.value} · ${startedAt.value}` : t('dms_automation.trace.title')),
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const historyUrl = computed(() =>
|
|
99
|
+
run.value ? `${props.runsUrl}?procedure=${encodeURIComponent(run.value.procedureId)}` : props.runsUrl,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
/** The steps of the graph the run went through, each once, in order. */
|
|
103
|
+
const ranSteps = computed(() => [...new Set((run.value?.trace.steps ?? []).map((s) => s.nodeId))])
|
|
104
|
+
const totalSteps = computed(() => ranSteps.value.length + (run.value?.trace.skipped.length ?? 0))
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The step that stopped the run: the last failure no Try/Catch or Retry
|
|
108
|
+
* caught, at the node the run failed at.
|
|
109
|
+
*/
|
|
110
|
+
const fatalStep = computed<TraceStep | undefined>(() => {
|
|
111
|
+
const steps = run.value?.trace.steps ?? []
|
|
112
|
+
const fatal = steps.filter((s) => s.status === 'failed' && !s.handled)
|
|
113
|
+
const last = [...fatal].reverse()
|
|
114
|
+
return last.find((s) => s.nodeId === run.value?.failedNodeId) ?? last[0]
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const stepPosition = computed(() => ({
|
|
118
|
+
index: fatalStep.value ? ranSteps.value.indexOf(fatalStep.value.nodeId) + 1 : 0,
|
|
119
|
+
total: totalSteps.value,
|
|
120
|
+
}))
|
|
121
|
+
|
|
122
|
+
// Without the graph that ran, or with a gap in the log, the steps the run did
|
|
123
|
+
// not reach are unknown: so is the total.
|
|
124
|
+
const totalKnown = computed(() => !!run.value?.graph && !run.value.graphOutdated && !run.value.trace.truncated)
|
|
125
|
+
|
|
126
|
+
const durationDelta = computed(() => {
|
|
127
|
+
const r = run.value
|
|
128
|
+
if (!r || r.durationMs === null || r.usualDurationMs === null) return null
|
|
129
|
+
return r.durationMs - r.usualDurationMs
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const olderVersion = computed(() => {
|
|
133
|
+
const r = run.value
|
|
134
|
+
if (!r?.procedure || !r.procedureVersion) return false
|
|
135
|
+
return r.procedureVersion < r.procedure.version
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
/** The version tile: the draft a test ran, the version, or why it is unknown. */
|
|
139
|
+
const version = computed(() => {
|
|
140
|
+
const r = run.value
|
|
141
|
+
if (!r) return { value: '', detail: '', tone: 'neutral' as const }
|
|
142
|
+
if (r.kind === 'test') {
|
|
143
|
+
return { value: t('dms_automation.trace.draft'), detail: t('dms_automation.trace.draftDetail'), tone: 'neutral' as const }
|
|
144
|
+
}
|
|
145
|
+
const value = r.procedureVersion ? `v${r.procedureVersion}` : '—'
|
|
146
|
+
if (!r.procedure) return { value, detail: t('dms_automation.trace.procedureDeleted'), tone: 'neutral' as const }
|
|
147
|
+
if (!r.procedureVersion) return { value, detail: t('dms_automation.trace.versionUnknown'), tone: 'neutral' as const }
|
|
148
|
+
if (olderVersion.value) {
|
|
149
|
+
return { value, detail: t('dms_automation.trace.olderVersionShort', { version: r.procedure.version }), tone: 'warning' as const }
|
|
150
|
+
}
|
|
151
|
+
return { value, detail: t('dms_automation.trace.currentVersion'), tone: 'neutral' as const }
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
// A webhook path can be long: the tile keeps its last segment, the detail
|
|
155
|
+
// line and the header say it whole.
|
|
156
|
+
function shortTrigger(r: RunDetail): string {
|
|
157
|
+
const full = processText(r.triggerText)
|
|
158
|
+
const path = r.trigger?.path
|
|
159
|
+
if (!path) return full
|
|
160
|
+
const segments = path.split('/').filter(Boolean)
|
|
161
|
+
return segments.length > 1 ? `${r.trigger?.method ?? 'POST'} …/${segments.at(-1)}` : full
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const stats = computed(() => {
|
|
165
|
+
const r = run.value
|
|
166
|
+
if (!r) return []
|
|
167
|
+
const delta = durationDelta.value
|
|
168
|
+
const trigger = processText(r.triggerText)
|
|
169
|
+
const triggerShort = shortTrigger(r)
|
|
170
|
+
const kind = r.kind && r.kind !== 'run' ? t(`dms_automation.runs.kind.${r.kind}`) : ''
|
|
171
|
+
return [
|
|
172
|
+
{
|
|
173
|
+
id: 'status',
|
|
174
|
+
eyebrow: t('dms_automation.trace.status'),
|
|
175
|
+
value: statusLabel.value,
|
|
176
|
+
detail: failed.value && stepPosition.value.index > 0
|
|
177
|
+
? t(totalKnown.value ? 'dms_automation.trace.atStep' : 'dms_automation.trace.atStepOnly', stepPosition.value)
|
|
178
|
+
: t('dms_automation.trace.stepsDone', { count: ranSteps.value.length }, ranSteps.value.length),
|
|
179
|
+
detailTone: failed.value ? ('error' as const) : ('neutral' as const),
|
|
180
|
+
icon: failed.value ? 'i-ph-x-circle' : 'i-ph-check-circle',
|
|
181
|
+
tone: failed.value ? ('error' as const) : ('success' as const),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'duration',
|
|
185
|
+
eyebrow: t('dms_automation.trace.duration'),
|
|
186
|
+
value: describeDuration(r.durationMs, locale.value),
|
|
187
|
+
detail: delta === null
|
|
188
|
+
? ''
|
|
189
|
+
: t(delta >= 0 ? 'dms_automation.trace.slowerThanUsual' : 'dms_automation.trace.fasterThanUsual', {
|
|
190
|
+
delta: describeDuration(Math.abs(delta), locale.value),
|
|
191
|
+
}),
|
|
192
|
+
detailTone: delta !== null && delta > (r.usualDurationMs ?? 0) ? ('warning' as const) : ('neutral' as const),
|
|
193
|
+
icon: 'i-ph-timer',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: 'trigger',
|
|
197
|
+
eyebrow: t('dms_automation.trace.trigger'),
|
|
198
|
+
value: triggerShort,
|
|
199
|
+
detail: [kind, triggerShort === trigger ? '' : trigger].filter(Boolean).join(' · '),
|
|
200
|
+
icon: 'i-ph-lightning',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: 'version',
|
|
204
|
+
eyebrow: t('dms_automation.trace.version'),
|
|
205
|
+
value: version.value.value,
|
|
206
|
+
detail: version.value.detail,
|
|
207
|
+
detailTone: version.value.tone,
|
|
208
|
+
icon: 'i-ph-git-commit',
|
|
209
|
+
},
|
|
210
|
+
]
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
const tabs = computed(() => {
|
|
214
|
+
const r = run.value
|
|
215
|
+
const skipped = r?.trace.skipped.length ?? 0
|
|
216
|
+
return [
|
|
217
|
+
{
|
|
218
|
+
label: t('dms_automation.trace.tabs.steps'),
|
|
219
|
+
value: 'steps',
|
|
220
|
+
badge: skipped ? `${ranSteps.value.length}/${totalSteps.value}` : ranSteps.value.length,
|
|
221
|
+
},
|
|
222
|
+
{ label: t('dms_automation.trace.tabs.payload'), value: 'payload' },
|
|
223
|
+
{ label: t('dms_automation.trace.tabs.logs'), value: 'logs', badge: r?.logCount ?? r?.logs?.entries.length },
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
/** Whose graph was not kept: the draft a test ran, a version, or an unknown one. */
|
|
228
|
+
const outdatedTitle = computed(() => {
|
|
229
|
+
const r = run.value
|
|
230
|
+
if (r?.kind === 'test') return t('dms_automation.trace.draftNotKept')
|
|
231
|
+
return r?.procedureVersion
|
|
232
|
+
? t('dms_automation.trace.graphNotKept', { version: r.procedureVersion })
|
|
233
|
+
: t('dms_automation.trace.graphNotKeptUnknown')
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
// A test ran a draft the builder does not have: its builder buttons stay,
|
|
237
|
+
// disabled, saying why.
|
|
238
|
+
const builderHint = computed(() =>
|
|
239
|
+
run.value?.procedure && !opensInBuilder(run.value) ? t('dms_automation.trace.builderDraftHint') : '',
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
function debugInBuilder(node?: string) {
|
|
243
|
+
if (run.value && opensInBuilder(run.value)) void router.push(builderRunUrl(props.builderUrl, run.value, node))
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** The previous and next runs of the procedure, with how they ended. */
|
|
247
|
+
const neighbours = computed(() => {
|
|
248
|
+
const r = run.value
|
|
249
|
+
const list: Array<{ key: string; label: string; icon: string; run: RunNeighbour }> = []
|
|
250
|
+
if (r?.previous) list.push({ key: 'previous', label: t('dms_automation.trace.previousRun'), icon: 'i-ph-arrow-left', run: r.previous })
|
|
251
|
+
if (r?.next) list.push({ key: 'next', label: t('dms_automation.trace.nextRun'), icon: 'i-ph-arrow-right', run: r.next })
|
|
252
|
+
return list
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
function openRun(id: string) {
|
|
256
|
+
void router.push(`${props.traceUrl}?run=${encodeURIComponent(id)}`)
|
|
257
|
+
}
|
|
258
|
+
</script>
|
|
259
|
+
|
|
260
|
+
<template>
|
|
261
|
+
<div class="flex flex-col gap-5">
|
|
262
|
+
<div v-if="loading && !run" class="flex flex-col gap-4">
|
|
263
|
+
<USkeleton class="h-8 w-80" />
|
|
264
|
+
<USkeleton class="h-20 w-full" />
|
|
265
|
+
<USkeleton class="h-80 w-full" />
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<DmsEmptyState
|
|
269
|
+
v-else-if="failure?.reason === 'noRun'"
|
|
270
|
+
icon="i-ph-path"
|
|
271
|
+
size="lg"
|
|
272
|
+
:title="$t('dms_automation.trace.noRun')"
|
|
273
|
+
:description="$t('dms_automation.trace.noRunHint')"
|
|
274
|
+
:actions="[{ label: $t('dms_automation.runs.title'), icon: 'i-ph-list-bullets', to: runsUrl }]"
|
|
275
|
+
/>
|
|
276
|
+
|
|
277
|
+
<DmsEmptyState
|
|
278
|
+
v-else-if="failure?.reason === 'notFound'"
|
|
279
|
+
icon="i-ph-magnifying-glass"
|
|
280
|
+
size="lg"
|
|
281
|
+
:title="$t('dms_automation.trace.notFound')"
|
|
282
|
+
:description="$t('dms_automation.trace.notFoundHint')"
|
|
283
|
+
:actions="[{ label: $t('dms_automation.runs.title'), icon: 'i-ph-list-bullets', to: runsUrl }]"
|
|
284
|
+
/>
|
|
285
|
+
|
|
286
|
+
<DmsEmptyState
|
|
287
|
+
v-else-if="failure"
|
|
288
|
+
variant="error"
|
|
289
|
+
size="lg"
|
|
290
|
+
:title="$t('dms_automation.trace.loadError')"
|
|
291
|
+
:description="failure.message"
|
|
292
|
+
:actions="[
|
|
293
|
+
{ label: $t('dms_automation.common.retry'), icon: 'i-ph-arrow-clockwise', onClick: load },
|
|
294
|
+
{ label: $t('dms_automation.runs.title'), variant: 'outline', color: 'neutral', to: runsUrl },
|
|
295
|
+
]"
|
|
296
|
+
/>
|
|
297
|
+
|
|
298
|
+
<template v-else-if="run">
|
|
299
|
+
<header class="flex flex-wrap items-start gap-4">
|
|
300
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
301
|
+
<DmsLink :to="historyUrl" class="inline-flex w-fit items-center gap-1 text-xs text-muted hover:text-highlighted">
|
|
302
|
+
<UIcon name="i-ph-arrow-left" class="size-3.5" />
|
|
303
|
+
{{ $t('dms_automation.runs.title') }}
|
|
304
|
+
</DmsLink>
|
|
305
|
+
<div class="flex min-w-0 flex-wrap items-center gap-2">
|
|
306
|
+
<h1 class="truncate text-xl font-semibold text-highlighted">{{ procedureName }}</h1>
|
|
307
|
+
<DmsStatusPill :tone="failed ? 'error' : 'success'" :label="statusLabel" />
|
|
308
|
+
<UBadge v-if="run.kind === 'test'" color="info" variant="subtle" size="sm">
|
|
309
|
+
{{ $t('dms_automation.runs.kind.test') }}
|
|
310
|
+
</UBadge>
|
|
311
|
+
<UBadge v-if="deleted" color="neutral" variant="subtle" size="sm">
|
|
312
|
+
{{ $t('dms_automation.trace.deleted') }}
|
|
313
|
+
</UBadge>
|
|
314
|
+
</div>
|
|
315
|
+
<!-- Spaced, not dotted: a separator would dangle where the line wraps. -->
|
|
316
|
+
<p class="flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted">
|
|
317
|
+
<span class="inline-flex items-center gap-1">
|
|
318
|
+
<span class="font-mono text-xs">{{ run._id }}</span>
|
|
319
|
+
<DmsCopyButton :value="run._id" />
|
|
320
|
+
</span>
|
|
321
|
+
<span>{{ $t('dms_automation.trace.startedBy', { time: startedAt, trigger: processText(run.triggerText) }) }}</span>
|
|
322
|
+
<span v-if="run.instanceId" class="font-mono text-xs text-dimmed" :title="$t('dms_automation.trace.instance')">
|
|
323
|
+
{{ $t('dms_automation.trace.onInstance', { instance: run.instanceId.slice(0, 8) }) }}
|
|
324
|
+
</span>
|
|
325
|
+
</p>
|
|
326
|
+
</div>
|
|
327
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
328
|
+
<UButton
|
|
329
|
+
v-for="neighbour in neighbours"
|
|
330
|
+
:key="neighbour.key"
|
|
331
|
+
color="neutral"
|
|
332
|
+
variant="ghost"
|
|
333
|
+
:icon="neighbour.icon"
|
|
334
|
+
@click="openRun(neighbour.run.runId)"
|
|
335
|
+
>
|
|
336
|
+
{{ neighbour.label }}
|
|
337
|
+
<span class="sr-only">({{ neighbour.run.status === 'failed' ? $t('dms_automation.runs.status.failed') : $t('dms_automation.runs.status.ok') }})</span>
|
|
338
|
+
<UIcon
|
|
339
|
+
:name="neighbour.run.status === 'failed' ? 'i-ph-x-circle' : 'i-ph-check-circle'"
|
|
340
|
+
class="size-4"
|
|
341
|
+
:class="neighbour.run.status === 'failed' ? 'text-error' : 'text-success'"
|
|
342
|
+
/>
|
|
343
|
+
</UButton>
|
|
344
|
+
<UButton
|
|
345
|
+
v-if="run.procedure && run.payloadKept"
|
|
346
|
+
color="neutral"
|
|
347
|
+
variant="outline"
|
|
348
|
+
icon="i-ph-arrow-clockwise"
|
|
349
|
+
:loading="rerunning"
|
|
350
|
+
@click="rerun(run._id, procedureName)"
|
|
351
|
+
>
|
|
352
|
+
{{ $t('dms_automation.runs.rerunWithPayload') }}
|
|
353
|
+
</UButton>
|
|
354
|
+
<UTooltip v-if="run.procedure" :text="builderHint" :disabled="!builderHint">
|
|
355
|
+
<span class="inline-flex">
|
|
356
|
+
<UButton color="primary" icon="i-ph-bug" :disabled="!!builderHint" @click="debugInBuilder()">
|
|
357
|
+
{{ $t('dms_automation.trace.debugInBuilder') }}
|
|
358
|
+
</UButton>
|
|
359
|
+
</span>
|
|
360
|
+
</UTooltip>
|
|
361
|
+
</div>
|
|
362
|
+
</header>
|
|
363
|
+
|
|
364
|
+
<DmsAutomationRunFailure v-if="failed" :run="run" :trace-url="traceUrl">
|
|
365
|
+
<UTooltip v-if="run.procedure" :text="builderHint" :disabled="!builderHint">
|
|
366
|
+
<span class="inline-flex">
|
|
367
|
+
<UButton
|
|
368
|
+
size="xs"
|
|
369
|
+
color="error"
|
|
370
|
+
variant="soft"
|
|
371
|
+
icon="i-ph-crosshair"
|
|
372
|
+
:disabled="!!builderHint"
|
|
373
|
+
@click="debugInBuilder(run.failedNodeId)"
|
|
374
|
+
>
|
|
375
|
+
{{ $t('dms_automation.trace.openStep') }}
|
|
376
|
+
</UButton>
|
|
377
|
+
</span>
|
|
378
|
+
</UTooltip>
|
|
379
|
+
<p v-if="builderHint" class="basis-full text-xs text-muted">{{ builderHint }}</p>
|
|
380
|
+
</DmsAutomationRunFailure>
|
|
381
|
+
|
|
382
|
+
<DmsBanner
|
|
383
|
+
v-if="run.graphOutdated"
|
|
384
|
+
size="sm"
|
|
385
|
+
tone="warning"
|
|
386
|
+
icon="i-ph-git-commit"
|
|
387
|
+
:title="outdatedTitle"
|
|
388
|
+
:description="$t('dms_automation.trace.graphNotKeptHint', { current: run.procedure?.version })"
|
|
389
|
+
/>
|
|
390
|
+
<DmsBanner
|
|
391
|
+
v-else-if="olderVersion"
|
|
392
|
+
size="sm"
|
|
393
|
+
tone="info"
|
|
394
|
+
icon="i-ph-git-commit"
|
|
395
|
+
:title="$t('dms_automation.trace.olderVersion', { version: run.procedureVersion })"
|
|
396
|
+
:description="$t('dms_automation.trace.olderVersionHint', { current: run.procedure?.version })"
|
|
397
|
+
/>
|
|
398
|
+
<DmsBanner
|
|
399
|
+
v-if="run.rerunOf"
|
|
400
|
+
size="sm"
|
|
401
|
+
tone="info"
|
|
402
|
+
icon="i-ph-arrow-clockwise"
|
|
403
|
+
:title="$t('dms_automation.trace.rerunOf')"
|
|
404
|
+
>
|
|
405
|
+
<template #actions>
|
|
406
|
+
<UButton size="xs" variant="soft" color="info" @click="openRun(run.rerunOf)">
|
|
407
|
+
{{ $t('dms_automation.trace.openOriginal') }}
|
|
408
|
+
</UButton>
|
|
409
|
+
</template>
|
|
410
|
+
</DmsBanner>
|
|
411
|
+
|
|
412
|
+
<DmsStatGroup :items="stats" layout="joined" :columns="4" />
|
|
413
|
+
|
|
414
|
+
<div class="grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_22rem]">
|
|
415
|
+
<DmsCard :padded="false">
|
|
416
|
+
<div class="flex flex-wrap items-center justify-between gap-2 border-b border-default px-3 pt-2">
|
|
417
|
+
<UTabs v-model="tab" :items="tabs" variant="link" :content="false" size="sm" />
|
|
418
|
+
<USwitch
|
|
419
|
+
v-if="tab === 'steps'"
|
|
420
|
+
v-model="pathOnly"
|
|
421
|
+
size="xs"
|
|
422
|
+
:label="$t('dms_automation.trace.pathOnly')"
|
|
423
|
+
class="pb-2"
|
|
424
|
+
/>
|
|
425
|
+
</div>
|
|
426
|
+
<DmsAutomationRunWaterfall
|
|
427
|
+
v-if="tab === 'steps'"
|
|
428
|
+
:steps="run.trace.steps"
|
|
429
|
+
:skipped="run.trace.skipped"
|
|
430
|
+
:total-ms="run.durationMs"
|
|
431
|
+
:path-only="pathOnly"
|
|
432
|
+
:truncated="run.trace.truncated"
|
|
433
|
+
/>
|
|
434
|
+
<div v-else-if="tab === 'payload'" class="p-3">
|
|
435
|
+
<DmsAutomationRunPayload :raw="run.triggerPayload" :kept="run.payloadKept" />
|
|
436
|
+
</div>
|
|
437
|
+
<DmsAutomationRunLogList v-else :api-url="apiUrl" :run-id="run._id" :log="run.logs" :names="names" />
|
|
438
|
+
</DmsCard>
|
|
439
|
+
|
|
440
|
+
<div class="flex flex-col gap-4">
|
|
441
|
+
<DmsCard>
|
|
442
|
+
<template #header>
|
|
443
|
+
<DmsEyebrow as="h2" tone="muted" truncate :label="$t('dms_automation.trace.pathTaken')" />
|
|
444
|
+
</template>
|
|
445
|
+
<template v-if="opensInBuilder(run) && !run.graphOutdated" #actions>
|
|
446
|
+
<UButton size="xs" variant="ghost" color="neutral" trailing-icon="i-ph-arrow-up-right" @click="debugInBuilder()">
|
|
447
|
+
{{ $t('dms_automation.trace.openInBuilder') }}
|
|
448
|
+
</UButton>
|
|
449
|
+
</template>
|
|
450
|
+
<DmsAutomationRunPathTaken :run="run" :builder-url="builderUrl" />
|
|
451
|
+
</DmsCard>
|
|
452
|
+
<DmsCard>
|
|
453
|
+
<template #header>
|
|
454
|
+
<DmsEyebrow as="h2" tone="muted" truncate :label="$t('dms_automation.trace.compared')" />
|
|
455
|
+
</template>
|
|
456
|
+
<DmsAutomationRunCompare :run="run" :trace-url="traceUrl" />
|
|
457
|
+
</DmsCard>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
</template>
|
|
461
|
+
</div>
|
|
462
|
+
</template>
|