@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,312 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
import RunDetailDrawer from '../RunDetailDrawer.vue'
|
|
4
|
-
import { useAutomationRuns } from '../../composables/useAutomationRuns'
|
|
5
|
-
import { type ListEnvelope, unwrapList } from '../../utils/automation'
|
|
6
|
-
|
|
7
|
-
interface RunRecord {
|
|
8
|
-
_id: string
|
|
9
|
-
procedureId: string
|
|
10
|
-
startedAt: string | Date
|
|
11
|
-
endedAt?: string | Date | null
|
|
12
|
-
status: string
|
|
13
|
-
errorMessage?: string | null
|
|
14
|
-
triggerNodeId?: string
|
|
15
|
-
triggerPayload?: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const props = defineProps<{
|
|
19
|
-
procedureId: string | null
|
|
20
|
-
procedureName?: string
|
|
21
|
-
}>()
|
|
22
|
-
|
|
23
|
-
const { $authFetch } = useAuthFetch()
|
|
24
|
-
// DMS-themed drawer from the dms layer (dms ≥0.0.26, public API replacing the
|
|
25
|
-
// removed useSheets/addSheet). Opens the run-detail view sliding in from the
|
|
26
|
-
// right; `open` marks the body component raw and generates a containerId.
|
|
27
|
-
const { open: openRunDrawer } = useDrawer()
|
|
28
|
-
const { getRun } = useAutomationRuns()
|
|
29
|
-
const { t } = useI18n()
|
|
30
|
-
|
|
31
|
-
const PAGE_SIZE = 10
|
|
32
|
-
|
|
33
|
-
const runs = ref<RunRecord[]>([])
|
|
34
|
-
const loading = ref(false)
|
|
35
|
-
const open = ref(false)
|
|
36
|
-
const error = ref<string | null>(null)
|
|
37
|
-
const loadingDetailId = ref<string | null>(null)
|
|
38
|
-
const detailError = ref<string | null>(null)
|
|
39
|
-
const page = ref(0)
|
|
40
|
-
const hasMore = ref(false)
|
|
41
|
-
|
|
42
|
-
async function load(target = 0) {
|
|
43
|
-
if (!props.procedureId) {
|
|
44
|
-
runs.value = []
|
|
45
|
-
hasMore.value = false
|
|
46
|
-
page.value = 0
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
const p = Math.max(0, target)
|
|
50
|
-
loading.value = true
|
|
51
|
-
error.value = null
|
|
52
|
-
try {
|
|
53
|
-
const data = await $authFetch<RunRecord[] | ListEnvelope<RunRecord>>(
|
|
54
|
-
`/api/automation/procedures/${props.procedureId}/runs?page=${p}&limit=${PAGE_SIZE}`,
|
|
55
|
-
)
|
|
56
|
-
// The API over-fetches one row beyond PAGE_SIZE as a next-page probe;
|
|
57
|
-
// trim it for display and use its presence for `hasMore`, so an
|
|
58
|
-
// exactly-full final page never enables a dead "Next".
|
|
59
|
-
const list = unwrapList<RunRecord>(data)
|
|
60
|
-
runs.value = list.slice(0, PAGE_SIZE)
|
|
61
|
-
page.value = p
|
|
62
|
-
hasMore.value = list.length > PAGE_SIZE
|
|
63
|
-
} catch (e) {
|
|
64
|
-
error.value = (e as Error).message ?? 'Failed to load runs'
|
|
65
|
-
runs.value = []
|
|
66
|
-
hasMore.value = false
|
|
67
|
-
} finally {
|
|
68
|
-
loading.value = false
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
watch(
|
|
73
|
-
() => props.procedureId,
|
|
74
|
-
() => {
|
|
75
|
-
void load(0)
|
|
76
|
-
},
|
|
77
|
-
{ immediate: true },
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
// Reset to the first page when the panel closes so the trigger badge always
|
|
81
|
-
// reflects the most recent runs, not whatever page was left open.
|
|
82
|
-
watch(open, (isOpen) => {
|
|
83
|
-
if (!isOpen && page.value !== 0) void load(0)
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
// Let the editor refresh the list (and the trigger badge) after "Run now".
|
|
87
|
-
defineExpose({ reload: () => load(0) })
|
|
88
|
-
|
|
89
|
-
function fmtStarted(v: string | Date | null | undefined): string {
|
|
90
|
-
if (!v) return '—'
|
|
91
|
-
try {
|
|
92
|
-
return new Date(v).toLocaleString()
|
|
93
|
-
} catch {
|
|
94
|
-
return String(v)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function fmtDuration(
|
|
99
|
-
startedAt: string | Date | null | undefined,
|
|
100
|
-
endedAt: string | Date | null | undefined,
|
|
101
|
-
): string {
|
|
102
|
-
if (!endedAt || !startedAt) return '—'
|
|
103
|
-
try {
|
|
104
|
-
const s = new Date(startedAt).getTime()
|
|
105
|
-
const e = new Date(endedAt).getTime()
|
|
106
|
-
if (Number.isNaN(s) || Number.isNaN(e)) return '—'
|
|
107
|
-
return `${e - s} ms`
|
|
108
|
-
} catch {
|
|
109
|
-
return '—'
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function statusIcon(status: string): { name: string; color: string } {
|
|
114
|
-
if (status === 'ok')
|
|
115
|
-
return { name: 'i-ph-check-circle', color: 'text-success' }
|
|
116
|
-
if (status === 'failed')
|
|
117
|
-
return { name: 'i-ph-x-circle', color: 'text-error' }
|
|
118
|
-
return { name: 'i-ph-spinner', color: 'text-warning' }
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function truncate(s: string | null | undefined, n: number): string {
|
|
122
|
-
if (!s) return '—'
|
|
123
|
-
if (s.length <= n) return s
|
|
124
|
-
return `${s.slice(0, n)}…`
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const headerText = computed(() => {
|
|
128
|
-
if (!props.procedureId) return t('dms_automation.editor.runsDrawer.title')
|
|
129
|
-
if (loading.value) return t('dms_automation.editor.runsDrawer.loading')
|
|
130
|
-
return t('dms_automation.editor.runsDrawer.count', { n: runs.value.length })
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
async function onRefresh() {
|
|
134
|
-
await load()
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
async function openDetail(r: RunRecord) {
|
|
138
|
-
if (loadingDetailId.value === r._id) return
|
|
139
|
-
loadingDetailId.value = r._id
|
|
140
|
-
detailError.value = null
|
|
141
|
-
try {
|
|
142
|
-
// Bubble fetch errors up to the drawer (instead of pretending the
|
|
143
|
-
// summary is the detail — the fire tree would just render empty).
|
|
144
|
-
const full = await getRun(r._id)
|
|
145
|
-
openRunDrawer({
|
|
146
|
-
containerId: `dms-automation-run-${r._id}`,
|
|
147
|
-
title: `${r.status.toUpperCase()} · ${props.procedureName ?? r.procedureId}`,
|
|
148
|
-
description: new Date(r.startedAt).toLocaleString(),
|
|
149
|
-
direction: 'right',
|
|
150
|
-
component: RunDetailDrawer,
|
|
151
|
-
componentOptions: {
|
|
152
|
-
run: full,
|
|
153
|
-
procedureName: props.procedureName,
|
|
154
|
-
},
|
|
155
|
-
})
|
|
156
|
-
// Intentionally keep the runs list open BEHIND the detail. Closing it
|
|
157
|
-
// here (open.value = false) made the just-opened detail vanish ~a tick
|
|
158
|
-
// later — tearing down the runs USlideover cascades into the detail
|
|
159
|
-
// overlay. The detail is a separate dms `useDrawer` (a dismissible:false
|
|
160
|
-
// UDrawer) closed only via its own control, so leaving the list mounted
|
|
161
|
-
// lets you inspect runs back to back. Trade-off: while a detail is open
|
|
162
|
-
// the drawer stacks above the still-mounted list.
|
|
163
|
-
} catch (e) {
|
|
164
|
-
const msg = (e as Error).message ?? 'Failed to load run'
|
|
165
|
-
detailError.value = msg
|
|
166
|
-
console.error('[dms-automation] failed to open run detail', e)
|
|
167
|
-
} finally {
|
|
168
|
-
loadingDetailId.value = null
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
</script>
|
|
172
|
-
|
|
173
|
-
<template>
|
|
174
|
-
<UButton
|
|
175
|
-
icon="i-ph-clock-counter-clockwise"
|
|
176
|
-
variant="outline"
|
|
177
|
-
color="neutral"
|
|
178
|
-
:disabled="!procedureId"
|
|
179
|
-
@click="open = true"
|
|
180
|
-
>
|
|
181
|
-
{{ $t('dms_automation.editor.runsDrawer.title') }}
|
|
182
|
-
<UBadge
|
|
183
|
-
v-if="runs.length"
|
|
184
|
-
:label="hasMore ? `${runs.length}+` : String(runs.length)"
|
|
185
|
-
color="neutral"
|
|
186
|
-
variant="subtle"
|
|
187
|
-
size="sm"
|
|
188
|
-
/>
|
|
189
|
-
</UButton>
|
|
190
|
-
|
|
191
|
-
<USlideover v-model:open="open" side="right" :title="headerText">
|
|
192
|
-
<template #body>
|
|
193
|
-
<div class="flex flex-col gap-2">
|
|
194
|
-
<div class="flex items-center justify-between">
|
|
195
|
-
<div class="text-xs text-dimmed">
|
|
196
|
-
<span v-if="error" class="text-error">{{ error }}</span>
|
|
197
|
-
<span v-else-if="detailError" class="text-error">{{ detailError }}</span>
|
|
198
|
-
<span v-else-if="!procedureId">
|
|
199
|
-
{{ $t('dms_automation.editor.runsDrawer.selectProcedure') }}
|
|
200
|
-
</span>
|
|
201
|
-
<span v-else-if="loading">
|
|
202
|
-
{{ $t('dms_automation.editor.runsDrawer.loadingShort') }}
|
|
203
|
-
</span>
|
|
204
|
-
<span v-else>
|
|
205
|
-
{{ $t('dms_automation.editor.runsDrawer.runCount', { n: runs.length }) }}
|
|
206
|
-
</span>
|
|
207
|
-
</div>
|
|
208
|
-
<UButton
|
|
209
|
-
size="xs"
|
|
210
|
-
variant="ghost"
|
|
211
|
-
color="neutral"
|
|
212
|
-
icon="i-ph-arrows-clockwise"
|
|
213
|
-
:loading="loading"
|
|
214
|
-
:disabled="!procedureId"
|
|
215
|
-
@click="onRefresh"
|
|
216
|
-
>
|
|
217
|
-
{{ $t('dms_automation.editor.runsDrawer.refresh') }}
|
|
218
|
-
</UButton>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
<div
|
|
222
|
-
v-if="runs.length > 0"
|
|
223
|
-
class="overflow-hidden rounded-lg border border-default"
|
|
224
|
-
>
|
|
225
|
-
<table class="w-full text-xs">
|
|
226
|
-
<thead>
|
|
227
|
-
<tr class="border-b border-default bg-muted">
|
|
228
|
-
<th class="w-12 px-3 py-2 text-left font-semibold text-dimmed">
|
|
229
|
-
{{ $t('dms_automation.editor.runsDrawer.cols.status') }}
|
|
230
|
-
</th>
|
|
231
|
-
<th class="px-3 py-2 text-left font-semibold text-dimmed">
|
|
232
|
-
{{ $t('dms_automation.editor.runsDrawer.cols.started') }}
|
|
233
|
-
</th>
|
|
234
|
-
<th class="px-3 py-2 text-left font-semibold text-dimmed">
|
|
235
|
-
{{ $t('dms_automation.editor.runsDrawer.cols.duration') }}
|
|
236
|
-
</th>
|
|
237
|
-
<th class="px-3 py-2 text-left font-semibold text-dimmed">
|
|
238
|
-
{{ $t('dms_automation.editor.runsDrawer.cols.error') }}
|
|
239
|
-
</th>
|
|
240
|
-
</tr>
|
|
241
|
-
</thead>
|
|
242
|
-
<tbody>
|
|
243
|
-
<tr
|
|
244
|
-
v-for="r in runs"
|
|
245
|
-
:key="r._id"
|
|
246
|
-
class="cursor-pointer border-b border-default/60 transition-colors last:border-0 hover:bg-elevated/40"
|
|
247
|
-
:class="{ 'opacity-60': loadingDetailId === r._id }"
|
|
248
|
-
@click="openDetail(r)"
|
|
249
|
-
>
|
|
250
|
-
<td class="px-3 py-2">
|
|
251
|
-
<UIcon
|
|
252
|
-
v-if="loadingDetailId === r._id"
|
|
253
|
-
name="i-ph-spinner"
|
|
254
|
-
class="animate-spin text-dimmed"
|
|
255
|
-
/>
|
|
256
|
-
<UIcon
|
|
257
|
-
v-else
|
|
258
|
-
:name="statusIcon(r.status).name"
|
|
259
|
-
:class="statusIcon(r.status).color"
|
|
260
|
-
/>
|
|
261
|
-
</td>
|
|
262
|
-
<td class="whitespace-nowrap px-3 py-2 tabular-nums text-toned">
|
|
263
|
-
{{ fmtStarted(r.startedAt) }}
|
|
264
|
-
</td>
|
|
265
|
-
<td class="whitespace-nowrap px-3 py-2 tabular-nums text-toned">
|
|
266
|
-
{{ fmtDuration(r.startedAt, r.endedAt) }}
|
|
267
|
-
</td>
|
|
268
|
-
<td class="px-3 py-2 text-error">
|
|
269
|
-
{{ truncate(r.errorMessage, 60) }}
|
|
270
|
-
</td>
|
|
271
|
-
</tr>
|
|
272
|
-
</tbody>
|
|
273
|
-
</table>
|
|
274
|
-
</div>
|
|
275
|
-
|
|
276
|
-
<div
|
|
277
|
-
v-else-if="!loading && procedureId && !error"
|
|
278
|
-
class="p-2 text-xs text-dimmed"
|
|
279
|
-
>
|
|
280
|
-
{{ $t('dms_automation.editor.runsDrawer.empty') }}
|
|
281
|
-
</div>
|
|
282
|
-
|
|
283
|
-
<div
|
|
284
|
-
v-if="runs.length > 0"
|
|
285
|
-
class="flex items-center justify-between gap-3 pt-1"
|
|
286
|
-
>
|
|
287
|
-
<UButton
|
|
288
|
-
size="xs"
|
|
289
|
-
color="neutral"
|
|
290
|
-
variant="ghost"
|
|
291
|
-
icon="i-ph-caret-left"
|
|
292
|
-
:label="$t('dms_automation.common.previous')"
|
|
293
|
-
:disabled="page === 0 || loading"
|
|
294
|
-
@click="load(page - 1)"
|
|
295
|
-
/>
|
|
296
|
-
<span class="text-xs tabular-nums text-dimmed">
|
|
297
|
-
{{ $t('dms_automation.runs.pageLabel', { n: page + 1 }) }}
|
|
298
|
-
</span>
|
|
299
|
-
<UButton
|
|
300
|
-
size="xs"
|
|
301
|
-
color="neutral"
|
|
302
|
-
variant="ghost"
|
|
303
|
-
trailing-icon="i-ph-caret-right"
|
|
304
|
-
:label="$t('dms_automation.common.next')"
|
|
305
|
-
:disabled="!hasMore || loading"
|
|
306
|
-
@click="load(page + 1)"
|
|
307
|
-
/>
|
|
308
|
-
</div>
|
|
309
|
-
</div>
|
|
310
|
-
</template>
|
|
311
|
-
</USlideover>
|
|
312
|
-
</template>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
// The Library consolidates the former Triggers / Actions / Data Nodes /
|
|
5
|
-
// Templates pages into one tabbed page (per autov2-library). Each tab mounts
|
|
6
|
-
// the existing catalog component in `embedded` mode so it drops its own
|
|
7
|
-
// page-head — the Library owns the single page-head above the tabs.
|
|
8
|
-
type Tab = 'triggers' | 'actions' | 'dataNodes' | 'templates'
|
|
9
|
-
|
|
10
|
-
const { t } = useI18n()
|
|
11
|
-
const tab = ref<Tab>('triggers')
|
|
12
|
-
|
|
13
|
-
const tabs = computed<
|
|
14
|
-
ReadonlyArray<{ value: Tab; label: string; icon: string }>
|
|
15
|
-
>(() => [
|
|
16
|
-
{ value: 'triggers', label: t('dms_automation.library.tabs.triggers'), icon: 'i-ph-lightning' },
|
|
17
|
-
{ value: 'actions', label: t('dms_automation.library.tabs.actions'), icon: 'i-ph-gear' },
|
|
18
|
-
{ value: 'dataNodes', label: t('dms_automation.library.tabs.dataNodes'), icon: 'i-ph-cube' },
|
|
19
|
-
{ value: 'templates', label: t('dms_automation.library.tabs.templates'), icon: 'i-ph-package' },
|
|
20
|
-
])
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<!--
|
|
25
|
-
Title / icon / description come from the page's native dms header
|
|
26
|
-
(src/pages/library.ts), so this component starts at its tabs. The page
|
|
27
|
-
fills the panel (`fillHeight`): the active catalog takes the height
|
|
28
|
-
under the tabs.
|
|
29
|
-
-->
|
|
30
|
-
<div class="flex min-h-0 flex-1 flex-col gap-5">
|
|
31
|
-
<!-- Tabs -->
|
|
32
|
-
<div class="border-b border-default">
|
|
33
|
-
<div class="flex flex-wrap items-center gap-1">
|
|
34
|
-
<button
|
|
35
|
-
v-for="item in tabs"
|
|
36
|
-
:key="item.value"
|
|
37
|
-
type="button"
|
|
38
|
-
class="-mb-px flex items-center gap-2 border-b-2 px-3 py-2.5 text-sm font-medium transition-colors"
|
|
39
|
-
:class="
|
|
40
|
-
tab === item.value
|
|
41
|
-
? 'border-primary text-primary'
|
|
42
|
-
: 'border-transparent text-muted hover:text-highlighted'
|
|
43
|
-
"
|
|
44
|
-
@click="tab = item.value"
|
|
45
|
-
>
|
|
46
|
-
<UIcon :name="item.icon" class="size-4" />
|
|
47
|
-
{{ item.label }}
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<!-- Panels (catalog components, page-head suppressed via `embedded`).
|
|
53
|
-
Wrapped in Suspense because the catalog components use top-level
|
|
54
|
-
await (async setup); the local boundary also gives a skeleton while
|
|
55
|
-
a freshly-switched tab loads its data. -->
|
|
56
|
-
<Suspense>
|
|
57
|
-
<DmsAutomationTriggers v-if="tab === 'triggers'" embedded />
|
|
58
|
-
<DmsAutomationActions v-else-if="tab === 'actions'" embedded />
|
|
59
|
-
<DmsAutomationDataNodes v-else-if="tab === 'dataNodes'" embedded />
|
|
60
|
-
<DmsAutomationTemplates v-else embedded />
|
|
61
|
-
<template #fallback>
|
|
62
|
-
<div class="flex flex-col gap-3">
|
|
63
|
-
<USkeleton class="h-9 w-64" />
|
|
64
|
-
<USkeleton class="h-64 w-full" />
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
</Suspense>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|