@antelopejs/dms-automation 0.2.7 → 0.3.1
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 +111 -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 +8 -6
- 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
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
import {
|
|
2
|
+
import { computed, nextTick, onMounted, ref, useTemplateRef, watch } from 'vue'
|
|
3
|
+
import { isIconName } from './IconPicker.vue'
|
|
4
|
+
import { queryString } from '../utils/automation'
|
|
4
5
|
|
|
5
|
-
//
|
|
6
|
-
|
|
6
|
+
// The library's templates: reusable groups other procedures place as linked
|
|
7
|
+
// blocks. The detail edits the name, icon and description, lists the ports
|
|
8
|
+
// (edited inside the graph) and where the template is used — procedures and
|
|
9
|
+
// other templates; deleting forks every usage into a local group so they keep
|
|
10
|
+
// working. The picked template is kept in the URL (`?template=`).
|
|
7
11
|
|
|
8
|
-
// JSON Schema allows `type` to be a single name or a list (`["string", "null"]`).
|
|
9
12
|
interface JsonSchema {
|
|
10
13
|
type?: string | string[]
|
|
11
14
|
[key: string]: unknown
|
|
@@ -26,651 +29,493 @@ interface TemplateRow {
|
|
|
26
29
|
ports: TemplatePort[]
|
|
27
30
|
subgraph: unknown
|
|
28
31
|
usageCount?: number
|
|
29
|
-
|
|
30
|
-
updated_at?: string | Date
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface TemplateListResponse {
|
|
34
|
-
results: TemplateRow[]
|
|
35
|
-
total: number
|
|
36
|
-
page: number
|
|
37
|
-
limit: number
|
|
32
|
+
updated_at?: string
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
interface TemplateUsage {
|
|
41
36
|
procedureId: string
|
|
42
37
|
nodeId: string
|
|
38
|
+
groupPath: string[]
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
interface
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
interface TemplateNesting {
|
|
42
|
+
templateId: string
|
|
43
|
+
nodeId: string
|
|
44
|
+
groupPath: string[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface TemplateUsages {
|
|
48
|
+
procedures: TemplateUsage[]
|
|
49
|
+
templates: TemplateNesting[]
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
interface
|
|
51
|
-
|
|
52
|
+
interface ProcedureSummary {
|
|
53
|
+
procedureId: string
|
|
54
|
+
name: string
|
|
55
|
+
status: 'failing' | 'degraded' | 'healthy' | 'paused' | 'draft'
|
|
52
56
|
}
|
|
53
57
|
|
|
58
|
+
const props = defineProps<{
|
|
59
|
+
apiUrl: string
|
|
60
|
+
builderUrl: string
|
|
61
|
+
}>()
|
|
62
|
+
|
|
54
63
|
const DEFAULT_ICON = 'i-ph-package'
|
|
64
|
+
const STATE_TONES = {
|
|
65
|
+
failing: 'error',
|
|
66
|
+
degraded: 'warning',
|
|
67
|
+
healthy: 'success',
|
|
68
|
+
paused: 'neutral',
|
|
69
|
+
draft: 'info',
|
|
70
|
+
} as const
|
|
71
|
+
const NO_USAGES: TemplateUsages = { procedures: [], templates: [] }
|
|
55
72
|
|
|
56
73
|
const { $authFetch } = useAuthFetch()
|
|
74
|
+
const route = useDmsRoute()
|
|
57
75
|
const router = useDmsRouter()
|
|
58
76
|
const toast = useToast()
|
|
77
|
+
const { t } = useI18n()
|
|
78
|
+
const { confirm } = useConfirm()
|
|
59
79
|
|
|
60
80
|
const items = ref<TemplateRow[]>([])
|
|
61
|
-
|
|
81
|
+
/** How many templates exist, when the server sent fewer than that. */
|
|
82
|
+
const total = ref(0)
|
|
83
|
+
const loading = ref(true)
|
|
62
84
|
const loadError = ref<string | null>(null)
|
|
63
85
|
const selectedId = ref<string | null>(null)
|
|
86
|
+
const search = ref('')
|
|
87
|
+
const detail = useTemplateRef<HTMLElement>('detail')
|
|
88
|
+
const list = useTemplateRef<HTMLElement>('list')
|
|
64
89
|
|
|
65
|
-
// Form state for the currently selected template.
|
|
66
90
|
const formName = ref('')
|
|
67
91
|
const formDescription = ref('')
|
|
68
92
|
const formIcon = ref(DEFAULT_ICON)
|
|
69
93
|
const saving = ref(false)
|
|
70
|
-
const saveError = ref<string | null>(null)
|
|
71
94
|
|
|
72
|
-
|
|
73
|
-
const usages = ref<TemplateUsage[]>([])
|
|
95
|
+
const usages = ref<TemplateUsages>(NO_USAGES)
|
|
74
96
|
const usagesLoading = ref(false)
|
|
75
|
-
const
|
|
76
|
-
const procedureNames = ref<Map<string, string>>(new Map())
|
|
97
|
+
const procedures = ref<Map<string, ProcedureSummary>>(new Map())
|
|
77
98
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const deleteError = ref<string | null>(null)
|
|
99
|
+
function queryTemplate(): string | null {
|
|
100
|
+
return queryString(route.query.template)
|
|
101
|
+
}
|
|
82
102
|
|
|
83
103
|
async function loadList() {
|
|
84
104
|
loading.value = true
|
|
85
|
-
loadError.value = null
|
|
86
105
|
try {
|
|
87
|
-
const
|
|
88
|
-
'/api/automation/templates',
|
|
89
|
-
)
|
|
90
|
-
const list = unwrapList<TemplateRow>(data)
|
|
106
|
+
const { results: list, total: count } = await $authFetch<{ results: TemplateRow[]; total: number }>(`${props.apiUrl}/templates`)
|
|
91
107
|
items.value = list
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
selectedId.value = list[0]?._id ?? null
|
|
97
|
-
}
|
|
108
|
+
total.value = count
|
|
109
|
+
const wanted = selectedId.value ?? queryTemplate()
|
|
110
|
+
selectedId.value = list.some((x) => x._id === wanted) ? wanted : (sortedItems.value[0]?._id ?? null)
|
|
111
|
+
loadError.value = null
|
|
98
112
|
} catch (e) {
|
|
99
|
-
loadError.value = (e
|
|
113
|
+
loadError.value = describeApiError(e)
|
|
100
114
|
} finally {
|
|
101
115
|
loading.value = false
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// Lazily fetch the procedure list once so we can resolve procedureId -> name
|
|
108
|
-
// in the "Used in" panel. If the fetch fails, we silently fall back to showing
|
|
109
|
-
// the raw id (still wrapped in a link to the editor).
|
|
110
|
-
async function ensureProcedureNames() {
|
|
111
|
-
if (procedureNames.value.size > 0) return
|
|
119
|
+
async function loadProcedures() {
|
|
112
120
|
try {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
)
|
|
116
|
-
const list = unwrapList<ProcedureRow>(data)
|
|
117
|
-
const map = new Map<string, string>()
|
|
118
|
-
for (const p of list) map.set(p._id, p.name)
|
|
119
|
-
procedureNames.value = map
|
|
121
|
+
const rows = await $authFetch<ProcedureSummary[]>(`${props.apiUrl}/procedures/summary`)
|
|
122
|
+
procedures.value = new Map(rows.map((p) => [p.procedureId, p]))
|
|
120
123
|
} catch {
|
|
121
|
-
|
|
124
|
+
procedures.value = new Map()
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
)
|
|
128
|
+
onMounted(() => {
|
|
129
|
+
void loadList()
|
|
130
|
+
void loadProcedures()
|
|
131
|
+
})
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
133
|
+
const selected = computed(() => items.value.find((x) => x._id === selectedId.value) ?? null)
|
|
134
|
+
const templateNames = computed(() => new Map(items.value.map((x) => [x._id, x.name])))
|
|
135
|
+
|
|
136
|
+
const sortedItems = computed(() => [...items.value].sort((a, b) => a.name.localeCompare(b.name)))
|
|
137
|
+
const filteredItems = computed(() => {
|
|
132
138
|
const q = search.value.trim().toLowerCase()
|
|
133
|
-
if (!q) return
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
if (!q) return sortedItems.value
|
|
140
|
+
return sortedItems.value.filter((x) => x.name.toLowerCase().includes(q) || (x.description ?? '').toLowerCase().includes(q))
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// A malformed icon is said under the picker; it can't be saved.
|
|
144
|
+
const iconValid = computed(() => !formIcon.value || isIconName(formIcon.value))
|
|
145
|
+
|
|
146
|
+
const dirty = computed(() => {
|
|
147
|
+
const s = selected.value
|
|
148
|
+
if (!s) return false
|
|
149
|
+
return formName.value !== s.name || formDescription.value !== (s.description ?? '') || formIcon.value !== (s.icon || DEFAULT_ICON)
|
|
139
150
|
})
|
|
140
151
|
|
|
141
|
-
//
|
|
152
|
+
// Picking another template, leaving the page or the tab asks before the
|
|
153
|
+
// form's unsaved changes are lost.
|
|
154
|
+
const form = useTemplateRef<HTMLElement>('form')
|
|
155
|
+
const { confirmLeave } = useUnsavedChanges({ dirty, element: form })
|
|
156
|
+
|
|
142
157
|
watch(
|
|
143
158
|
selected,
|
|
144
|
-
(
|
|
145
|
-
formName.value =
|
|
146
|
-
formDescription.value =
|
|
147
|
-
formIcon.value =
|
|
148
|
-
saveError.value = null
|
|
149
|
-
// Reload usages for the new selection.
|
|
159
|
+
(s) => {
|
|
160
|
+
formName.value = s?.name ?? ''
|
|
161
|
+
formDescription.value = s?.description ?? ''
|
|
162
|
+
formIcon.value = s?.icon || DEFAULT_ICON
|
|
150
163
|
void loadUsages()
|
|
151
164
|
},
|
|
152
165
|
{ immediate: true },
|
|
153
166
|
)
|
|
154
167
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
watch(selectedId, (id) => {
|
|
169
|
+
if (id && id !== queryTemplate()) void router.replace({ query: { ...route.query, template: id } })
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
async function select(id: string) {
|
|
173
|
+
if (id === selectedId.value || !(await confirmLeave())) return
|
|
174
|
+
selectedId.value = id
|
|
175
|
+
// Below the two-column width the detail sits under the list: bring it into view.
|
|
176
|
+
await nextTick()
|
|
177
|
+
if (detail.value && list.value && detail.value.offsetTop > list.value.offsetTop) {
|
|
178
|
+
detail.value.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
|
161
179
|
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function backToList() {
|
|
183
|
+
list.value?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async function fetchUsages(id: string): Promise<TemplateUsages> {
|
|
187
|
+
return await $authFetch<TemplateUsages>(`${props.apiUrl}/templates/${id}/usages`)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function loadUsages() {
|
|
191
|
+
const s = selected.value
|
|
192
|
+
usages.value = NO_USAGES
|
|
193
|
+
if (!s) return
|
|
162
194
|
usagesLoading.value = true
|
|
163
|
-
usagesError.value = null
|
|
164
195
|
try {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
usages.value = unwrapList(data)
|
|
169
|
-
if (usages.value.length > 0) {
|
|
170
|
-
await ensureProcedureNames()
|
|
171
|
-
}
|
|
172
|
-
} catch (e) {
|
|
173
|
-
usagesError.value = (e as Error).message ?? 'Failed to load usages'
|
|
174
|
-
usages.value = []
|
|
196
|
+
usages.value = await fetchUsages(s._id)
|
|
197
|
+
} catch {
|
|
198
|
+
usages.value = NO_USAGES
|
|
175
199
|
} finally {
|
|
176
200
|
usagesLoading.value = false
|
|
177
201
|
}
|
|
178
202
|
}
|
|
179
203
|
|
|
180
|
-
|
|
181
|
-
|
|
204
|
+
/** One line per procedure or template placing it, with how many times. */
|
|
205
|
+
const usageRows = computed(() => {
|
|
206
|
+
const rows = new Map<string, { kind: 'procedure' | 'template'; id: string; first: TemplateUsage | TemplateNesting; count: number }>()
|
|
207
|
+
for (const usage of usages.value.procedures) {
|
|
208
|
+
const row = rows.get(`p:${usage.procedureId}`)
|
|
209
|
+
if (row) row.count++
|
|
210
|
+
else rows.set(`p:${usage.procedureId}`, { kind: 'procedure', id: usage.procedureId, first: usage, count: 1 })
|
|
211
|
+
}
|
|
212
|
+
for (const nesting of usages.value.templates) {
|
|
213
|
+
const row = rows.get(`t:${nesting.templateId}`)
|
|
214
|
+
if (row) row.count++
|
|
215
|
+
else rows.set(`t:${nesting.templateId}`, { kind: 'template', id: nesting.templateId, first: nesting, count: 1 })
|
|
216
|
+
}
|
|
217
|
+
return [...rows.values()]
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
const NAME_ID = 'template-name'
|
|
221
|
+
const NAME_MAX = 200
|
|
222
|
+
const DESCRIPTION_MAX = 2000
|
|
223
|
+
// A missing or taken name shows under its field; a refused save is a toast.
|
|
224
|
+
const fieldErrors = useFieldErrors({ fields: { name: NAME_ID } })
|
|
225
|
+
watch(formName, () => fieldErrors.clear('name'))
|
|
226
|
+
|
|
227
|
+
interface RefusalBody {
|
|
228
|
+
code?: string
|
|
229
|
+
error?: string
|
|
230
|
+
issues?: { path?: (string | number)[]; message?: string }[]
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** The `code` a refused request answered with, if any. */
|
|
234
|
+
function errorCode(e: unknown): string | undefined {
|
|
235
|
+
return (e as { data?: RefusalBody }).data?.code
|
|
182
236
|
}
|
|
183
237
|
|
|
184
|
-
|
|
185
|
-
|
|
238
|
+
/** What the server said was wrong, rather than the request's raw status line. */
|
|
239
|
+
function errorMessage(e: unknown): string {
|
|
240
|
+
const body = (e as { data?: RefusalBody }).data
|
|
241
|
+
const issues = body?.issues?.map((i) => (i.path?.length ? `${i.path.join('.')}: ${i.message}` : i.message)).filter(Boolean)
|
|
242
|
+
return issues?.length ? issues.join(' · ') : (body?.error ?? describeApiError(e))
|
|
186
243
|
}
|
|
187
244
|
|
|
188
245
|
async function onSave() {
|
|
189
|
-
const
|
|
190
|
-
if (!
|
|
246
|
+
const s = selected.value
|
|
247
|
+
if (!s) return
|
|
248
|
+
if (!formName.value.trim()) {
|
|
249
|
+
await fieldErrors.setError('name', t('dms_automation.templates.form.nameRequired'))
|
|
250
|
+
return
|
|
251
|
+
}
|
|
191
252
|
saving.value = true
|
|
192
|
-
saveError.value = null
|
|
193
253
|
try {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
subgraph: t.subgraph ?? {
|
|
203
|
-
nodes: [],
|
|
204
|
-
triggerEdges: [],
|
|
205
|
-
dataEdges: [],
|
|
254
|
+
const updated = await $authFetch<TemplateRow>(`${props.apiUrl}/templates/${s._id}`, {
|
|
255
|
+
method: 'PUT',
|
|
256
|
+
body: {
|
|
257
|
+
name: formName.value.trim(),
|
|
258
|
+
description: formDescription.value,
|
|
259
|
+
icon: formIcon.value || DEFAULT_ICON,
|
|
260
|
+
ports: s.ports ?? [],
|
|
261
|
+
subgraph: s.subgraph ?? { nodes: [], triggerEdges: [], dataEdges: [] },
|
|
206
262
|
},
|
|
207
|
-
}
|
|
208
|
-
const updated = await $authFetch<TemplateRow>(
|
|
209
|
-
`/api/automation/templates/${t._id}`,
|
|
210
|
-
{ method: 'PUT', body },
|
|
211
|
-
)
|
|
212
|
-
const idx = items.value.findIndex((x) => x._id === t._id)
|
|
213
|
-
if (idx >= 0) {
|
|
214
|
-
items.value[idx] = {
|
|
215
|
-
...t,
|
|
216
|
-
...updated,
|
|
217
|
-
usageCount: t.usageCount,
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
toast.add({
|
|
221
|
-
title: 'Template saved',
|
|
222
|
-
description: updated.name,
|
|
223
|
-
color: 'success',
|
|
224
|
-
icon: 'i-ph-check-circle',
|
|
225
263
|
})
|
|
264
|
+
const index = items.value.findIndex((x) => x._id === s._id)
|
|
265
|
+
if (index >= 0) items.value[index] = { ...s, ...updated, usageCount: s.usageCount }
|
|
266
|
+
toast.add({ title: t('dms_automation.templates.saved', { name: updated.name }), color: 'success', icon: 'i-ph-check-circle' })
|
|
226
267
|
} catch (e) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
icon: 'i-ph-warning',
|
|
233
|
-
})
|
|
268
|
+
if (errorCode(e) === 'name-taken') {
|
|
269
|
+
await fieldErrors.setError('name', t('dms_automation.templates.nameTaken'))
|
|
270
|
+
return
|
|
271
|
+
}
|
|
272
|
+
toast.add({ title: t('dms_automation.templates.saveError'), description: errorMessage(e), color: 'error', icon: 'i-ph-warning' })
|
|
234
273
|
} finally {
|
|
235
274
|
saving.value = false
|
|
236
275
|
}
|
|
237
276
|
}
|
|
238
277
|
|
|
239
|
-
function
|
|
240
|
-
|
|
241
|
-
if (!t) return
|
|
242
|
-
router.push({
|
|
243
|
-
path: '/modules/automation/builder',
|
|
244
|
-
query: { template: t._id },
|
|
245
|
-
})
|
|
278
|
+
function editGraph(id: string) {
|
|
279
|
+
void router.push(`${props.builderUrl}?template=${id}`)
|
|
246
280
|
}
|
|
247
281
|
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
|
|
282
|
+
function openUsage(usage: TemplateUsage) {
|
|
283
|
+
const path = usage.groupPath.length ? `&path=${usage.groupPath.map(encodeURIComponent).join(',')}` : ''
|
|
284
|
+
void router.push(`${props.builderUrl}?selected=${usage.procedureId}&node=${encodeURIComponent(usage.nodeId)}${path}`)
|
|
251
285
|
}
|
|
252
286
|
|
|
253
|
-
async function
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
|
|
257
|
-
|
|
287
|
+
async function onDelete() {
|
|
288
|
+
const s = selected.value
|
|
289
|
+
if (!s) return
|
|
290
|
+
// Counted now, not when the list loaded: a usage added since is forked too.
|
|
291
|
+
let fresh: TemplateUsages
|
|
258
292
|
try {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
293
|
+
fresh = await fetchUsages(s._id)
|
|
294
|
+
usages.value = fresh
|
|
295
|
+
} catch (e) {
|
|
296
|
+
toast.add({ title: t('dms_automation.templates.deleteError'), description: errorMessage(e), color: 'error', icon: 'i-ph-warning' })
|
|
297
|
+
return
|
|
298
|
+
}
|
|
299
|
+
const count = fresh.procedures.length + fresh.templates.length
|
|
300
|
+
const ok = await confirm({
|
|
301
|
+
title: t('dms_automation.templates.deleteTitle', { name: s.name }),
|
|
302
|
+
description: count > 0 ? t('dms_automation.templates.deleteForksIn', { owners: ownersOf(fresh), count }, count) : t('dms_automation.templates.unused'),
|
|
303
|
+
color: 'error',
|
|
304
|
+
icon: 'i-ph-trash',
|
|
305
|
+
confirmLabel: t('dms_automation.templates.delete'),
|
|
306
|
+
})
|
|
307
|
+
if (!ok) return
|
|
308
|
+
try {
|
|
309
|
+
await $authFetch(`${props.apiUrl}/templates/${s._id}?force=1`, { method: 'DELETE' })
|
|
310
|
+
} catch (e) {
|
|
311
|
+
const kept = errorCode(e) === 'fork-incomplete'
|
|
263
312
|
toast.add({
|
|
264
|
-
title: '
|
|
265
|
-
description: t.
|
|
266
|
-
color: '
|
|
267
|
-
icon: 'i-ph-
|
|
313
|
+
title: kept ? t('dms_automation.templates.forkIncomplete') : t('dms_automation.templates.deleteError'),
|
|
314
|
+
description: kept ? t('dms_automation.templates.forkIncompleteHint') : errorMessage(e),
|
|
315
|
+
color: 'error',
|
|
316
|
+
icon: 'i-ph-warning',
|
|
268
317
|
})
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
items.value = items.value.filter((x) => x._id !== t._id)
|
|
272
|
-
selectedId.value = items.value[0]?._id ?? null
|
|
273
|
-
} catch (e) {
|
|
274
|
-
deleteError.value = (e as Error).message ?? 'Failed to delete'
|
|
275
|
-
} finally {
|
|
276
|
-
deleting.value = false
|
|
318
|
+
await loadUsages()
|
|
319
|
+
return
|
|
277
320
|
}
|
|
321
|
+
toast.add({ title: t('dms_automation.templates.deleted', { name: s.name }), color: 'success', icon: 'i-ph-check-circle' })
|
|
322
|
+
items.value = items.value.filter((x) => x._id !== s._id)
|
|
323
|
+
total.value = Math.max(0, total.value - 1)
|
|
324
|
+
selectedId.value = sortedItems.value[0]?._id ?? null
|
|
325
|
+
// Forking may have changed other templates' graphs and usage counts.
|
|
326
|
+
void loadList()
|
|
278
327
|
}
|
|
279
328
|
|
|
280
|
-
|
|
281
|
-
|
|
329
|
+
/** "1 procedure", "2 procedures and 1 template": who places the template. */
|
|
330
|
+
function ownersOf(found: TemplateUsages): string {
|
|
331
|
+
const procedureCount = new Set(found.procedures.map((u) => u.procedureId)).size
|
|
332
|
+
const templateCount = new Set(found.templates.map((u) => u.templateId)).size
|
|
333
|
+
const parts = [
|
|
334
|
+
procedureCount ? t('dms_automation.templates.ownerProcedures', { count: procedureCount }, procedureCount) : '',
|
|
335
|
+
templateCount ? t('dms_automation.templates.ownerTemplates', { count: templateCount }, templateCount) : '',
|
|
336
|
+
].filter(Boolean)
|
|
337
|
+
return parts.length === 2 ? t('dms_automation.templates.ownersAnd', { first: parts[0], second: parts[1] }) : parts[0]!
|
|
282
338
|
}
|
|
283
339
|
|
|
284
340
|
function schemaTypeOf(p: TemplatePort): string {
|
|
285
341
|
if (p.kind !== 'data') return '—'
|
|
286
|
-
const
|
|
287
|
-
if (typeof
|
|
288
|
-
if (Array.isArray(
|
|
342
|
+
const type = p.schema?.type
|
|
343
|
+
if (typeof type === 'string') return type
|
|
344
|
+
if (Array.isArray(type)) return type.join(' | ')
|
|
289
345
|
return 'any'
|
|
290
346
|
}
|
|
291
347
|
</script>
|
|
292
348
|
|
|
293
349
|
<template>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
<UIcon name="i-ph-package" class="size-6" />
|
|
309
|
-
</div>
|
|
310
|
-
<div class="min-w-0 flex-1">
|
|
311
|
-
<h1 class="text-2xl font-semibold tracking-tight text-highlighted">
|
|
312
|
-
{{ $t('dms_automation.templates.title') }}
|
|
313
|
-
</h1>
|
|
314
|
-
<p class="text-sm text-muted">
|
|
315
|
-
{{ $t('dms_automation.templates.description') }}
|
|
316
|
-
</p>
|
|
317
|
-
</div>
|
|
318
|
-
<UButton
|
|
319
|
-
class="ml-auto"
|
|
320
|
-
color="neutral"
|
|
321
|
-
variant="outline"
|
|
322
|
-
icon="i-ph-arrows-clockwise"
|
|
323
|
-
:loading="loading"
|
|
324
|
-
@click="loadList"
|
|
325
|
-
>
|
|
326
|
-
{{ $t('dms_automation.templates.refresh') }}
|
|
327
|
-
</UButton>
|
|
328
|
-
</section>
|
|
329
|
-
|
|
330
|
-
<UAlert
|
|
331
|
-
v-if="loadError"
|
|
332
|
-
color="error"
|
|
333
|
-
variant="subtle"
|
|
334
|
-
icon="i-ph-warning"
|
|
335
|
-
:title="$t('dms_automation.templates.loadError')"
|
|
336
|
-
:description="loadError"
|
|
337
|
-
/>
|
|
338
|
-
|
|
339
|
-
<div
|
|
340
|
-
class="grid grid-cols-1 gap-5 lg:min-h-0 lg:flex-1 lg:grid-cols-[minmax(280px,360px)_1fr]"
|
|
341
|
-
>
|
|
342
|
-
<div class="flex flex-col gap-3 lg:min-h-0">
|
|
343
|
-
<UInput
|
|
344
|
-
v-model="search"
|
|
345
|
-
icon="i-ph-magnifying-glass"
|
|
346
|
-
:placeholder="$t('dms_automation.templates.search')"
|
|
350
|
+
<div class="@container">
|
|
351
|
+
<div class="grid grid-cols-1 items-start gap-5 @5xl:grid-cols-[20rem_minmax(0,1fr)]">
|
|
352
|
+
<div ref="list" class="dms-card flex flex-col gap-2 p-2">
|
|
353
|
+
<DmsSearchInput v-model="search" size="sm" :placeholder="$t('dms_automation.templates.search')" class="w-full" />
|
|
354
|
+
<div v-if="loading && items.length === 0" class="flex flex-col gap-2 p-1">
|
|
355
|
+
<USkeleton v-for="i in 3" :key="i" class="h-12 w-full" />
|
|
356
|
+
</div>
|
|
357
|
+
<DmsEmptyState
|
|
358
|
+
v-else-if="loadError"
|
|
359
|
+
size="sm"
|
|
360
|
+
variant="error"
|
|
361
|
+
:title="$t('dms_automation.templates.loadError')"
|
|
362
|
+
:description="loadError"
|
|
363
|
+
:actions="[{ label: $t('dms_automation.common.retry'), onClick: loadList }]"
|
|
347
364
|
/>
|
|
348
|
-
<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
365
|
+
<DmsEmptyState
|
|
366
|
+
v-else-if="items.length === 0"
|
|
367
|
+
size="sm"
|
|
368
|
+
icon="i-ph-stack"
|
|
369
|
+
:title="$t('dms_automation.templates.empty')"
|
|
370
|
+
:description="$t('dms_automation.templates.emptyHint')"
|
|
371
|
+
/>
|
|
372
|
+
<template v-else>
|
|
373
|
+
<button
|
|
374
|
+
v-for="row in filteredItems"
|
|
375
|
+
:key="row._id"
|
|
376
|
+
type="button"
|
|
377
|
+
class="flex w-full items-start gap-3 rounded-md border px-3 py-2.5 text-left transition-colors"
|
|
378
|
+
:class="row._id === selectedId ? 'border-primary bg-primary/10' : 'border-transparent hover:bg-elevated'"
|
|
379
|
+
:aria-current="row._id === selectedId ? 'true' : undefined"
|
|
380
|
+
@click="select(row._id)"
|
|
355
381
|
>
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
@click="selectedId = t._id"
|
|
369
|
-
>
|
|
370
|
-
<UIcon
|
|
371
|
-
:name="t.icon || DEFAULT_ICON"
|
|
372
|
-
class="mt-0.5 size-4 shrink-0"
|
|
373
|
-
:class="selectedId === t._id ? 'text-primary' : 'text-dimmed'"
|
|
374
|
-
/>
|
|
375
|
-
<div class="min-w-0 flex-1">
|
|
376
|
-
<div
|
|
377
|
-
class="truncate text-sm font-medium"
|
|
378
|
-
:class="selectedId === t._id ? 'text-primary' : 'text-highlighted'"
|
|
379
|
-
>
|
|
380
|
-
{{ t.name }}
|
|
381
|
-
</div>
|
|
382
|
-
<div v-if="t.description" class="truncate text-xs text-muted">
|
|
383
|
-
{{ t.description }}
|
|
384
|
-
</div>
|
|
385
|
-
</div>
|
|
386
|
-
<UBadge
|
|
387
|
-
color="neutral"
|
|
388
|
-
variant="subtle"
|
|
389
|
-
size="sm"
|
|
390
|
-
class="shrink-0 tabular-nums"
|
|
391
|
-
>
|
|
392
|
-
{{ t.usageCount ?? 0 }}
|
|
393
|
-
</UBadge>
|
|
394
|
-
</button>
|
|
395
|
-
</li>
|
|
396
|
-
</ul>
|
|
397
|
-
</DmsCard>
|
|
382
|
+
<UIcon :name="row.icon || DEFAULT_ICON" class="mt-0.5 size-4 shrink-0 text-muted" />
|
|
383
|
+
<span class="flex min-w-0 flex-1 flex-col">
|
|
384
|
+
<span class="truncate text-sm font-medium text-highlighted">{{ row.name }}</span>
|
|
385
|
+
<span v-if="row.description" class="truncate text-xs text-muted">{{ row.description }}</span>
|
|
386
|
+
</span>
|
|
387
|
+
<span class="shrink-0 font-mono text-[11px] text-dimmed">{{ $t('dms_automation.library.uses', { count: row.usageCount ?? 0 }) }}</span>
|
|
388
|
+
</button>
|
|
389
|
+
<p v-if="filteredItems.length === 0" class="p-3 text-center text-xs text-dimmed">{{ $t('dms_automation.library.noMatch') }}</p>
|
|
390
|
+
<p v-if="total > items.length" class="p-3 text-center text-xs text-warning">
|
|
391
|
+
{{ $t('dms_automation.templates.truncated', { shown: items.length, total }) }}
|
|
392
|
+
</p>
|
|
393
|
+
</template>
|
|
398
394
|
</div>
|
|
399
395
|
|
|
400
|
-
<
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
class="
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
</h2>
|
|
415
|
-
<p class="mt-1 font-mono text-xs text-dimmed">{{ selected._id }}</p>
|
|
396
|
+
<div v-if="selected" ref="detail" class="flex scroll-mt-4 flex-col gap-4">
|
|
397
|
+
<UButton class="self-start @5xl:hidden" size="sm" variant="ghost" color="neutral" icon="i-ph-arrow-up" @click="backToList">
|
|
398
|
+
{{ $t('dms_automation.library.backToList') }}
|
|
399
|
+
</UButton>
|
|
400
|
+
<DmsCard>
|
|
401
|
+
<div class="flex flex-wrap items-start gap-4">
|
|
402
|
+
<DmsIconWell :icon="formIcon || DEFAULT_ICON" tone="primary" size="xl" />
|
|
403
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
404
|
+
<h2 class="text-lg font-semibold break-words text-highlighted">{{ selected.name }}</h2>
|
|
405
|
+
<p class="font-mono text-xs break-all text-dimmed">{{ selected._id }}</p>
|
|
406
|
+
</div>
|
|
407
|
+
<UButton color="neutral" variant="outline" icon="i-ph-tree-structure" @click="editGraph(selected._id)">
|
|
408
|
+
{{ $t('dms_automation.templates.editGraph') }}
|
|
409
|
+
</UButton>
|
|
416
410
|
</div>
|
|
417
|
-
|
|
418
|
-
{{
|
|
419
|
-
$t('dms_automation.templates.usedInN', {
|
|
420
|
-
n: selected.usageCount ?? 0,
|
|
421
|
-
})
|
|
422
|
-
}}
|
|
423
|
-
</UBadge>
|
|
424
|
-
</div>
|
|
411
|
+
</DmsCard>
|
|
425
412
|
|
|
426
|
-
<div
|
|
427
|
-
<
|
|
428
|
-
<
|
|
429
|
-
:label="$t('dms_automation.templates.form.name')"
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
:label="$t('dms_automation.templates.form.description')"
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
>
|
|
443
|
-
<UInput
|
|
444
|
-
v-model="formIcon"
|
|
445
|
-
:placeholder="DEFAULT_ICON"
|
|
446
|
-
class="w-full"
|
|
447
|
-
/>
|
|
448
|
-
</UFormField>
|
|
449
|
-
<UAlert
|
|
450
|
-
v-if="saveError"
|
|
451
|
-
color="error"
|
|
452
|
-
variant="subtle"
|
|
453
|
-
icon="i-ph-warning"
|
|
454
|
-
:title="$t('dms_automation.templates.saveError')"
|
|
455
|
-
:description="saveError"
|
|
456
|
-
/>
|
|
457
|
-
<div class="flex justify-end gap-2">
|
|
458
|
-
<UButton
|
|
459
|
-
color="primary"
|
|
460
|
-
icon="i-ph-floppy-disk"
|
|
461
|
-
:loading="saving"
|
|
462
|
-
@click="onSave"
|
|
463
|
-
>
|
|
464
|
-
{{ $t('dms_automation.templates.save') }}
|
|
465
|
-
</UButton>
|
|
413
|
+
<div ref="form">
|
|
414
|
+
<DmsCard :title="$t('dms_automation.templates.details')">
|
|
415
|
+
<div>
|
|
416
|
+
<DmsFieldRow layout="form" :label="$t('dms_automation.templates.form.name')" :label-for="NAME_ID" required>
|
|
417
|
+
<div class="grid gap-1.5">
|
|
418
|
+
<DmsInputText :id="NAME_ID" v-model="formName" class="w-full" :maxlength="NAME_MAX" v-bind="fieldErrors.aria('name')" />
|
|
419
|
+
<DmsFieldError :id="fieldErrors.errorId('name')" :message="fieldErrors.errors.name" />
|
|
420
|
+
</div>
|
|
421
|
+
</DmsFieldRow>
|
|
422
|
+
<DmsFieldRow layout="form" :label="$t('dms_automation.templates.form.description')" label-for="template-description">
|
|
423
|
+
<DmsTextarea id="template-description" v-model="formDescription" class="w-full" :rows="2" :maxlength="DESCRIPTION_MAX" />
|
|
424
|
+
</DmsFieldRow>
|
|
425
|
+
<DmsFieldRow layout="form" :label="$t('dms_automation.templates.form.icon')">
|
|
426
|
+
<DmsAutomationIconPicker v-model="formIcon" />
|
|
427
|
+
</DmsFieldRow>
|
|
428
|
+
<DmsFormRequiredLegend class="px-[18px] pt-3" />
|
|
466
429
|
</div>
|
|
430
|
+
<template #footer>
|
|
431
|
+
<div class="flex w-full justify-end">
|
|
432
|
+
<UButton color="primary" icon="i-ph-floppy-disk" :disabled="!dirty || !iconValid" :loading="saving" @click="onSave">
|
|
433
|
+
{{ $t('dms_automation.common.save') }}
|
|
434
|
+
</UButton>
|
|
435
|
+
</div>
|
|
436
|
+
</template>
|
|
437
|
+
</DmsCard>
|
|
438
|
+
</div>
|
|
439
|
+
|
|
440
|
+
<DmsCard :title="$t('dms_automation.templates.ports.title')" :count="selected.ports?.length ?? 0">
|
|
441
|
+
<p class="mb-3 text-xs text-muted">{{ $t('dms_automation.templates.ports.editHint') }}</p>
|
|
442
|
+
<p v-if="(selected.ports ?? []).length === 0" class="text-xs text-dimmed">{{ $t('dms_automation.templates.ports.empty') }}</p>
|
|
443
|
+
<div v-else class="overflow-hidden rounded-md border border-default">
|
|
444
|
+
<table class="w-full text-left text-xs">
|
|
445
|
+
<thead class="bg-elevated/60 font-mono text-[10.5px] text-dimmed uppercase">
|
|
446
|
+
<tr>
|
|
447
|
+
<th class="px-3 py-1.5 font-normal">{{ $t('dms_automation.templates.ports.col.kind') }}</th>
|
|
448
|
+
<th class="px-3 py-1.5 font-normal">{{ $t('dms_automation.templates.ports.col.direction') }}</th>
|
|
449
|
+
<th class="px-3 py-1.5 font-normal">{{ $t('dms_automation.templates.ports.col.name') }}</th>
|
|
450
|
+
<th class="px-3 py-1.5 font-normal">{{ $t('dms_automation.templates.ports.col.type') }}</th>
|
|
451
|
+
</tr>
|
|
452
|
+
</thead>
|
|
453
|
+
<tbody class="divide-y divide-default">
|
|
454
|
+
<tr v-for="(port, index) in selected.ports" :key="`${port.direction}-${port.kind}-${port.name}-${index}`">
|
|
455
|
+
<td class="px-3 py-1.5">
|
|
456
|
+
<UBadge :color="port.kind === 'trigger' ? 'info' : 'success'" variant="subtle" size="sm">
|
|
457
|
+
{{ $t(`dms_automation.templates.ports.kind.${port.kind}`) }}
|
|
458
|
+
</UBadge>
|
|
459
|
+
</td>
|
|
460
|
+
<td class="px-3 py-1.5 text-muted">{{ $t(`dms_automation.templates.ports.direction.${port.direction}`) }}</td>
|
|
461
|
+
<td class="px-3 py-1.5 font-mono text-highlighted">{{ port.name }}</td>
|
|
462
|
+
<td class="px-3 py-1.5 font-mono text-muted">{{ schemaTypeOf(port) }}</td>
|
|
463
|
+
</tr>
|
|
464
|
+
</tbody>
|
|
465
|
+
</table>
|
|
467
466
|
</div>
|
|
467
|
+
</DmsCard>
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
469
|
+
<DmsCard :title="$t('dms_automation.templates.usedIn')" :count="usageRows.length">
|
|
470
|
+
<p v-if="usageRows.length" class="mb-3 text-xs text-muted">{{ $t('dms_automation.templates.usedInHint') }}</p>
|
|
471
|
+
<div v-if="usagesLoading" class="flex flex-col gap-2">
|
|
472
|
+
<USkeleton v-for="i in 2" :key="i" class="h-8 w-full" />
|
|
473
|
+
</div>
|
|
474
|
+
<p v-else-if="usageRows.length === 0" class="text-xs text-dimmed">{{ $t('dms_automation.templates.unused') }}</p>
|
|
475
|
+
<ul v-else class="divide-y divide-default">
|
|
476
|
+
<li v-for="row in usageRows" :key="`${row.kind}-${row.id}`" class="flex items-center gap-3 py-2">
|
|
477
|
+
<template v-if="row.kind === 'procedure'">
|
|
478
|
+
<DmsStatusPill
|
|
479
|
+
v-if="procedures.get(row.id)"
|
|
480
|
+
:tone="STATE_TONES[procedures.get(row.id)!.status]"
|
|
481
|
+
:label="$t(`dms_automation.procedures.status.${procedures.get(row.id)!.status}`)"
|
|
482
|
+
size="sm"
|
|
483
|
+
/>
|
|
484
|
+
<span class="min-w-0 flex-1 truncate text-sm text-highlighted">
|
|
485
|
+
{{ procedures.get(row.id)?.name ?? row.id }}
|
|
486
|
+
</span>
|
|
487
|
+
</template>
|
|
488
|
+
<template v-else>
|
|
489
|
+
<UBadge size="sm" color="neutral" variant="subtle" icon="i-ph-stack">{{ $t('dms_automation.templates.templateBadge') }}</UBadge>
|
|
490
|
+
<span class="min-w-0 flex-1 truncate text-sm text-highlighted">{{ templateNames.get(row.id) ?? row.id }}</span>
|
|
491
|
+
</template>
|
|
492
|
+
<span v-if="row.count > 1" class="shrink-0 font-mono text-[11px] text-dimmed">
|
|
493
|
+
{{ $t('dms_automation.templates.placements', { count: row.count }) }}
|
|
494
|
+
</span>
|
|
474
495
|
<UButton
|
|
475
|
-
|
|
496
|
+
v-if="row.kind === 'procedure'"
|
|
497
|
+
size="xs"
|
|
498
|
+
variant="ghost"
|
|
476
499
|
color="neutral"
|
|
477
|
-
icon="i-ph-
|
|
478
|
-
|
|
479
|
-
@click="onEditSubgraph"
|
|
500
|
+
trailing-icon="i-ph-arrow-up-right"
|
|
501
|
+
@click="openUsage(row.first as TemplateUsage)"
|
|
480
502
|
>
|
|
481
|
-
{{ $t('dms_automation.
|
|
503
|
+
{{ $t('dms_automation.library.open') }}
|
|
482
504
|
</UButton>
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
</
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
class="text-sm text-dimmed"
|
|
490
|
-
>
|
|
491
|
-
{{ $t('dms_automation.templates.ports.empty') }}
|
|
492
|
-
</div>
|
|
493
|
-
<div v-else class="overflow-hidden rounded-lg border border-default">
|
|
494
|
-
<table class="w-full text-sm">
|
|
495
|
-
<thead>
|
|
496
|
-
<tr class="border-b border-default bg-muted">
|
|
497
|
-
<th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
|
|
498
|
-
{{ $t('dms_automation.templates.ports.col.kind') }}
|
|
499
|
-
</th>
|
|
500
|
-
<th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
|
|
501
|
-
{{ $t('dms_automation.templates.ports.col.direction') }}
|
|
502
|
-
</th>
|
|
503
|
-
<th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
|
|
504
|
-
{{ $t('dms_automation.templates.ports.col.name') }}
|
|
505
|
-
</th>
|
|
506
|
-
<th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
|
|
507
|
-
{{ $t('dms_automation.templates.ports.col.type') }}
|
|
508
|
-
</th>
|
|
509
|
-
</tr>
|
|
510
|
-
</thead>
|
|
511
|
-
<tbody>
|
|
512
|
-
<tr
|
|
513
|
-
v-for="(p, idx) in selected.ports"
|
|
514
|
-
:key="portRowKey(p, idx)"
|
|
515
|
-
class="border-b border-default/60 last:border-0"
|
|
516
|
-
>
|
|
517
|
-
<td class="px-4 py-2.5">
|
|
518
|
-
<UBadge
|
|
519
|
-
:color="p.kind === 'trigger' ? 'primary' : 'neutral'"
|
|
520
|
-
variant="subtle"
|
|
521
|
-
>
|
|
522
|
-
{{ p.kind }}
|
|
523
|
-
</UBadge>
|
|
524
|
-
</td>
|
|
525
|
-
<td class="whitespace-nowrap px-4 py-2.5 text-muted">
|
|
526
|
-
{{ p.direction }}
|
|
527
|
-
</td>
|
|
528
|
-
<td class="px-4 py-2.5 font-mono text-highlighted">
|
|
529
|
-
{{ p.name }}
|
|
530
|
-
</td>
|
|
531
|
-
<td class="whitespace-nowrap px-4 py-2.5 font-mono text-primary">
|
|
532
|
-
{{ schemaTypeOf(p) }}
|
|
533
|
-
</td>
|
|
534
|
-
</tr>
|
|
535
|
-
</tbody>
|
|
536
|
-
</table>
|
|
537
|
-
</div>
|
|
538
|
-
</div>
|
|
539
|
-
|
|
540
|
-
<div class="flex flex-col gap-2">
|
|
541
|
-
<div class="text-sm font-semibold text-highlighted">
|
|
542
|
-
{{ $t('dms_automation.templates.usages.title') }}
|
|
543
|
-
</div>
|
|
544
|
-
<UAlert
|
|
545
|
-
v-if="usagesError"
|
|
546
|
-
color="error"
|
|
547
|
-
variant="subtle"
|
|
548
|
-
icon="i-ph-warning"
|
|
549
|
-
:title="$t('dms_automation.templates.usagesError')"
|
|
550
|
-
:description="usagesError"
|
|
551
|
-
/>
|
|
552
|
-
<div v-else-if="usagesLoading" class="text-sm text-dimmed">
|
|
553
|
-
Loading…
|
|
554
|
-
</div>
|
|
555
|
-
<div v-else-if="usages.length === 0" class="text-sm text-dimmed">
|
|
556
|
-
{{ $t('dms_automation.templates.usages.empty') }}
|
|
557
|
-
</div>
|
|
558
|
-
<ul v-else class="flex flex-col">
|
|
559
|
-
<li
|
|
560
|
-
v-for="(u, idx) in usages"
|
|
561
|
-
:key="`${u.procedureId}-${u.nodeId}-${idx}`"
|
|
562
|
-
class="flex items-center gap-3 border-b border-default/60 py-2 last:border-0"
|
|
563
|
-
>
|
|
564
|
-
<UIcon name="i-ph-puzzle-piece" class="size-4 shrink-0 text-dimmed" />
|
|
565
|
-
<DmsLink
|
|
566
|
-
:to="procedureLink(u.procedureId)"
|
|
567
|
-
class="truncate text-highlighted hover:text-primary hover:underline"
|
|
568
|
-
>
|
|
569
|
-
{{ procedureLabel(u.procedureId) }}
|
|
570
|
-
</DmsLink>
|
|
571
|
-
<span class="truncate font-mono text-xs text-dimmed">
|
|
572
|
-
{{ u.nodeId }}
|
|
573
|
-
</span>
|
|
574
|
-
</li>
|
|
575
|
-
</ul>
|
|
576
|
-
</div>
|
|
577
|
-
|
|
578
|
-
<div class="flex justify-end border-t border-default pt-4">
|
|
579
|
-
<UButton
|
|
580
|
-
color="error"
|
|
581
|
-
variant="subtle"
|
|
582
|
-
icon="i-ph-trash"
|
|
583
|
-
@click="openDelete"
|
|
584
|
-
>
|
|
585
|
-
{{ $t('dms_automation.templates.delete') }}
|
|
586
|
-
</UButton>
|
|
587
|
-
</div>
|
|
588
|
-
</div>
|
|
589
|
-
</DmsCard>
|
|
590
|
-
|
|
591
|
-
<DmsCard
|
|
592
|
-
v-else
|
|
593
|
-
class="flex min-h-[16rem] items-center justify-center text-center"
|
|
594
|
-
>
|
|
595
|
-
<div class="flex flex-col items-center gap-3 text-dimmed">
|
|
596
|
-
<UIcon name="i-ph-package" class="size-8" />
|
|
597
|
-
<p class="max-w-xs text-sm">
|
|
598
|
-
{{ $t('dms_automation.templates.empty') }}
|
|
599
|
-
</p>
|
|
600
|
-
</div>
|
|
601
|
-
</DmsCard>
|
|
602
|
-
</div>
|
|
505
|
+
<UButton v-else size="xs" variant="ghost" color="neutral" trailing-icon="i-ph-arrow-up-right" @click="editGraph(row.id)">
|
|
506
|
+
{{ $t('dms_automation.templates.editGraph') }}
|
|
507
|
+
</UButton>
|
|
508
|
+
</li>
|
|
509
|
+
</ul>
|
|
510
|
+
</DmsCard>
|
|
603
511
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
>
|
|
608
|
-
<template #body>
|
|
609
|
-
<div class="flex flex-col gap-3">
|
|
610
|
-
<p class="text-default text-sm">
|
|
611
|
-
{{
|
|
612
|
-
$t(
|
|
613
|
-
'dms_automation.templates.deleteConfirm.message',
|
|
614
|
-
{ name: selected?.name ?? '' },
|
|
615
|
-
)
|
|
616
|
-
}}
|
|
617
|
-
</p>
|
|
618
|
-
<UAlert
|
|
619
|
-
v-if="(selected?.usageCount ?? 0) > 0"
|
|
620
|
-
color="warning"
|
|
621
|
-
variant="subtle"
|
|
622
|
-
icon="i-ph-warning"
|
|
623
|
-
:title="
|
|
624
|
-
$t(
|
|
625
|
-
'dms_automation.templates.deleteConfirm.usageWarningTitle',
|
|
626
|
-
)
|
|
627
|
-
"
|
|
628
|
-
:description="
|
|
629
|
-
$t(
|
|
630
|
-
'dms_automation.templates.deleteConfirm.usageWarning',
|
|
631
|
-
{ n: selected?.usageCount ?? 0 },
|
|
632
|
-
)
|
|
633
|
-
"
|
|
634
|
-
/>
|
|
635
|
-
<UAlert
|
|
636
|
-
v-if="deleteError"
|
|
637
|
-
color="error"
|
|
638
|
-
variant="subtle"
|
|
639
|
-
icon="i-ph-warning"
|
|
640
|
-
:title="$t('dms_automation.templates.deleteError')"
|
|
641
|
-
:description="deleteError"
|
|
642
|
-
/>
|
|
643
|
-
</div>
|
|
644
|
-
</template>
|
|
645
|
-
<template #footer>
|
|
646
|
-
<div class="flex w-full justify-end gap-2">
|
|
647
|
-
<UButton
|
|
648
|
-
:label="$t('dms_automation.templates.deleteConfirm.cancel')"
|
|
649
|
-
variant="outline"
|
|
650
|
-
color="neutral"
|
|
651
|
-
:disabled="deleting"
|
|
652
|
-
@click="deleteOpen = false"
|
|
653
|
-
/>
|
|
654
|
-
<UButton
|
|
655
|
-
v-if="(selected?.usageCount ?? 0) > 0"
|
|
656
|
-
color="error"
|
|
657
|
-
icon="i-ph-trash"
|
|
658
|
-
:loading="deleting"
|
|
659
|
-
@click="confirmDelete(true)"
|
|
660
|
-
>
|
|
661
|
-
{{ $t('dms_automation.templates.forceDelete') }}
|
|
662
|
-
</UButton>
|
|
663
|
-
<UButton
|
|
664
|
-
v-else
|
|
665
|
-
color="error"
|
|
666
|
-
icon="i-ph-trash"
|
|
667
|
-
:loading="deleting"
|
|
668
|
-
@click="confirmDelete(false)"
|
|
669
|
-
>
|
|
512
|
+
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
513
|
+
<p class="text-xs text-muted">{{ $t('dms_automation.templates.deleteHint') }}</p>
|
|
514
|
+
<UButton color="error" variant="soft" icon="i-ph-trash" @click="onDelete">
|
|
670
515
|
{{ $t('dms_automation.templates.delete') }}
|
|
671
516
|
</UButton>
|
|
672
517
|
</div>
|
|
673
|
-
</
|
|
674
|
-
</
|
|
518
|
+
</div>
|
|
519
|
+
</div>
|
|
675
520
|
</div>
|
|
676
521
|
</template>
|