@swiss-ai-hub/web 0.290.11
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/LICENSE +661 -0
- package/README.md +479 -0
- package/app.config.ts +1 -0
- package/app.vue +52 -0
- package/assets/css/main.css +4 -0
- package/assets/images/logo.png +0 -0
- package/components/Agent/Avatar.vue +40 -0
- package/components/Agent/Card.vue +139 -0
- package/components/Agent/Configuration.vue +20 -0
- package/components/Agent/CreateModal.vue +287 -0
- package/components/Agent/EmptyCard.vue +35 -0
- package/components/Agent/List.vue +85 -0
- package/components/Agent/TemplateCard.vue +58 -0
- package/components/AppLoader.vue +55 -0
- package/components/Chat/Message.vue +90 -0
- package/components/Chat/SourceNodes.vue +120 -0
- package/components/Chat/Thread.vue +134 -0
- package/components/Costs/Table.vue +56 -0
- package/components/Dashboard/Component/BarChart.vue +46 -0
- package/components/Dashboard/Component/LineChart.vue +138 -0
- package/components/Dashboard/Component/Number.vue +31 -0
- package/components/Dashboard/Grid.vue +214 -0
- package/components/Dashboard/Item.vue +75 -0
- package/components/Dashboard/Trend.vue +34 -0
- package/components/Display/List/DisplayList.vue +93 -0
- package/components/Evaluation/Dataset/Card.vue +70 -0
- package/components/Evaluation/Dataset/Create.vue +81 -0
- package/components/Evaluation/Dataset/Edit.vue +132 -0
- package/components/Event/Display/AddMemoryToChatHistoryEvent.vue +60 -0
- package/components/Event/Display/AgentInTheLoopRequestEvent.vue +56 -0
- package/components/Event/Display/AgentInTheLoopResponseEvent.vue +17 -0
- package/components/Event/Display/Base.vue +125 -0
- package/components/Event/Display/BaseRetrieveMemoryEvent.vue +101 -0
- package/components/Event/Display/BaseStoreMemoryEvent.vue +182 -0
- package/components/Event/Display/ChunkEvent.vue +40 -0
- package/components/Event/Display/EmbeddingEvent.vue +25 -0
- package/components/Event/Display/ExceptionEvent.vue +21 -0
- package/components/Event/Display/GuardAcceptEvent.vue +25 -0
- package/components/Event/Display/GuardEvent.vue +17 -0
- package/components/Event/Display/GuardRejectionEvent.vue +25 -0
- package/components/Event/Display/HumanInTheLoopRequestEvent.vue +53 -0
- package/components/Event/Display/HumanInTheLoopResponseEvent.vue +40 -0
- package/components/Event/Display/LLMCostEvent.vue +25 -0
- package/components/Event/Display/LLMEvent.vue +92 -0
- package/components/Event/Display/LimitChatHistoryEvent.vue +60 -0
- package/components/Event/Display/RAGFailureStopEvent.vue +28 -0
- package/components/Event/Display/RAGStartEvent.vue +77 -0
- package/components/Event/Display/RAGSuccessStopEvent.vue +16 -0
- package/components/Event/Display/RawDataContent.vue +69 -0
- package/components/Event/Display/RerankerEvent.vue +39 -0
- package/components/Event/Display/RetrieverEvent.vue +22 -0
- package/components/Event/Display/RouterEvent.vue +54 -0
- package/components/Event/Display/StandaloneQuestionCondenserEvent.vue +38 -0
- package/components/Event/Display/StopEvent.vue +16 -0
- package/components/Event/Display/ThoughtEvent.vue +20 -0
- package/components/Event/Display/ToolEvent.vue +38 -0
- package/components/Event/Display/UnknownEvent.vue +17 -0
- package/components/Event/Display/UserMessageEvent.vue +35 -0
- package/components/Event/List/EventList.vue +249 -0
- package/components/Event/Statistics.vue +49 -0
- package/components/Event/Timeseries.vue +224 -0
- package/components/FormKit/AgentSelector.vue +307 -0
- package/components/FormKit/ChipsInput.vue +62 -0
- package/components/FormKit/DynamicConfiguration.vue +155 -0
- package/components/FormKit/IconSelector.vue +72 -0
- package/components/FormKit/KnowledgeDatabaseSelector.vue +92 -0
- package/components/FormKit/LocaleInput.vue +150 -0
- package/components/FormKit/ModelSelect.vue +110 -0
- package/components/FormKit/Repeater.vue +93 -0
- package/components/FormKit/VectorStoreInput.vue +247 -0
- package/components/Knowledge/Document/List.vue +140 -0
- package/components/Knowledge/Document/Overview.vue +28 -0
- package/components/Knowledge/Document/UploadModal.vue +298 -0
- package/components/Knowledge/Document/WithNodes.vue +105 -0
- package/components/Knowledge/Namespace/Card.vue +108 -0
- package/components/Knowledge/Namespace/CreateModal.vue +203 -0
- package/components/Knowledge/Namespace/EditModal.vue +134 -0
- package/components/Knowledge/Namespace/EmptyCard.vue +35 -0
- package/components/Knowledge/Node/Content.vue +71 -0
- package/components/Markdown/Renderer.vue +87 -0
- package/components/Memory/DetailPage.vue +48 -0
- package/components/Memory/Edit.vue +241 -0
- package/components/Memory/Graph.vue +318 -0
- package/components/Memory/List.vue +155 -0
- package/components/Memory/MemoryManagementPage.vue +178 -0
- package/components/Memory/OpenWebUIContent.vue +96 -0
- package/components/Memory/PageLayout.vue +72 -0
- package/components/Models/ModelDetailsPanel.vue +250 -0
- package/components/Models/NamespaceCard.vue +79 -0
- package/components/Navigation/Left.vue +85 -0
- package/components/Navigation/Top.vue +31 -0
- package/components/Notification/Item.vue +88 -0
- package/components/Notification/NotificationsOverlay.vue +164 -0
- package/components/Process/Card.vue +119 -0
- package/components/Process/Configuration.vue +20 -0
- package/components/Process/CreateModal.vue +276 -0
- package/components/Process/EmptyCard.vue +35 -0
- package/components/Process/Form.vue +153 -0
- package/components/Process/Starts.vue +44 -0
- package/components/Process/Walkthrough/List.vue +162 -0
- package/components/Role/AccessRulesEditor.vue +132 -0
- package/components/Role/Card.vue +68 -0
- package/components/Role/Create.vue +55 -0
- package/components/Role/Edit.vue +82 -0
- package/components/Role/UsageLimitsEditor.vue +225 -0
- package/components/Service/Selection.vue +148 -0
- package/components/Structural/Column.vue +74 -0
- package/components/Structural/Screen.vue +10 -0
- package/components/Structural/Substructure.vue +5 -0
- package/components/Tenant/Switcher.vue +102 -0
- package/components/Thread/Details.vue +135 -0
- package/components/Thread/Hierarchy.vue +136 -0
- package/components/Thread/Info.vue +41 -0
- package/components/Thread/List.vue +136 -0
- package/components/User/Bar.vue +74 -0
- package/components/User/List.vue +86 -0
- package/components/User/RoleChips.vue +83 -0
- package/components/User/Settings.vue +79 -0
- package/components/Workflow/Modal.vue +39 -0
- package/components/Workflow/NodeCard.vue +41 -0
- package/components/Workflow/StartNode.vue +24 -0
- package/components/Workflow/StepNode.vue +27 -0
- package/components/Workflow/StopNode.vue +24 -0
- package/components/Workflow/Visualization.vue +265 -0
- package/components/mdc/MarkdownFigure.vue +9 -0
- package/components/mdc/MarkdownTable.vue +9 -0
- package/components/mdc/ResolveImageComponent.vue +58 -0
- package/composables/agent/useAgentClass.ts +27 -0
- package/composables/agent/useAgentClassInstances.ts +27 -0
- package/composables/agent/useAgentClasses.ts +27 -0
- package/composables/agent/useAgentIconFromThread.ts +8 -0
- package/composables/agent/useAgentInstance.ts +28 -0
- package/composables/agent/useAgentInstanceThreads.ts +76 -0
- package/composables/agent/useAgentInstances.ts +25 -0
- package/composables/agent/useAgentNavigation.ts +35 -0
- package/composables/agent/useCreateAgentInstance.ts +33 -0
- package/composables/agent/useDeleteAgentInstance.ts +31 -0
- package/composables/agent/useUpdateAgentInstance.ts +40 -0
- package/composables/auth/useAuth.ts +54 -0
- package/composables/auth/useAuthProviders.ts +14 -0
- package/composables/chat/useChatCompletions.ts +30 -0
- package/composables/dashboard/useAgentNameFromDashboardWidget.ts +27 -0
- package/composables/dashboard/useDashboardComponent.ts +27 -0
- package/composables/dashboard/useSaveDashboard.ts +21 -0
- package/composables/document/useCreateNamespace.ts +26 -0
- package/composables/document/useDatabases.ts +23 -0
- package/composables/document/useDocument.ts +29 -0
- package/composables/document/useDocumentUrl.ts +20 -0
- package/composables/document/useDocuments.ts +107 -0
- package/composables/document/useNodes.ts +29 -0
- package/composables/document/useSummaryNodes.ts +32 -0
- package/composables/document/useUpdateNamespace.ts +22 -0
- package/composables/evaluation/useCreateDataset.ts +19 -0
- package/composables/evaluation/useDataset.ts +26 -0
- package/composables/evaluation/useDatasets.ts +25 -0
- package/composables/evaluation/useUpdateDataset.ts +23 -0
- package/composables/event/useBasicEventStatistics.ts +83 -0
- package/composables/event/useEventColor.ts +25 -0
- package/composables/event/useEventComponent.ts +87 -0
- package/composables/event/useEventTimeseries.ts +39 -0
- package/composables/event/useEventTimeseriesStats.ts +26 -0
- package/composables/file/useFileUpload.ts +91 -0
- package/composables/file/useSupportedFileTypes.ts +22 -0
- package/composables/form/useCreateInstanceForm.ts +251 -0
- package/composables/form/useFormKitTransform.ts +753 -0
- package/composables/memory/useMemoryCRUD.ts +88 -0
- package/composables/memory/useMemoryFactory.ts +319 -0
- package/composables/memory/useMemorySearchFilter.ts +74 -0
- package/composables/models/useModelsList.ts +24 -0
- package/composables/models/useSingleModel.ts +30 -0
- package/composables/notification/useNotificationPoller.ts +58 -0
- package/composables/notification/useNotifications.ts +57 -0
- package/composables/notification/useUpdateMultipleNotifications.ts +17 -0
- package/composables/notification/useUpdateNotification.ts +17 -0
- package/composables/process/useCreateProcessInstance.ts +32 -0
- package/composables/process/useDeleteProcessInstance.ts +31 -0
- package/composables/process/useProcessClasses.ts +27 -0
- package/composables/process/useProcessInstance.ts +28 -0
- package/composables/process/useProcessInstances.ts +27 -0
- package/composables/process/useProcessWalkthroughs.ts +73 -0
- package/composables/process/useSendProcessStartForm.ts +43 -0
- package/composables/process/useUpdateProcessInstance.ts +40 -0
- package/composables/role/useCreateRole.ts +19 -0
- package/composables/role/useDeleteRole.ts +21 -0
- package/composables/role/useRole.ts +30 -0
- package/composables/role/useRoles.ts +25 -0
- package/composables/role/useUpdateRole.ts +22 -0
- package/composables/suite/useApps.ts +31 -0
- package/composables/suite/useSuite.ts +26 -0
- package/composables/tenant/useActiveTenant.ts +27 -0
- package/composables/tenant/useSysadminNavigation.ts +19 -0
- package/composables/tenant/useTenant.ts +38 -0
- package/composables/tenant/useTenantMemberships.ts +15 -0
- package/composables/tenant/useTenantPath.ts +20 -0
- package/composables/tenant/useTenantPolling.ts +30 -0
- package/composables/tenant/useTenantReady.ts +12 -0
- package/composables/theme/useDarkMode.ts +5 -0
- package/composables/thread/useThread.ts +27 -0
- package/composables/thread/useThreadEvents.ts +91 -0
- package/composables/thread/useThreadUtils.ts +49 -0
- package/composables/thread/useThreads.ts +64 -0
- package/composables/thread/useThreadsInfinite.ts +56 -0
- package/composables/translation/useTranslate.ts +20 -0
- package/composables/useRouteReady.ts +21 -0
- package/composables/useTimeAgo.ts +40 -0
- package/composables/user/useAssignRoleToUser.ts +22 -0
- package/composables/user/useMyUser.ts +25 -0
- package/composables/user/useRevokeRoleFromUser.ts +21 -0
- package/composables/user/useUser.ts +30 -0
- package/composables/user/useUsers.ts +63 -0
- package/composables/utils/useJsonTree.ts +138 -0
- package/formkit.config.ts +44 -0
- package/i18n/locales/de.yaml +815 -0
- package/i18n/locales/en.yaml +804 -0
- package/i18n/locales/fr.yaml +812 -0
- package/i18n/locales/it.yaml +808 -0
- package/layouts/anonymous.vue +8 -0
- package/layouts/default.vue +116 -0
- package/middleware/auth.global.ts +62 -0
- package/nuxt.config.ts +145 -0
- package/package.json +114 -0
- package/pages/[tenant]/index.vue +31 -0
- package/pages/[tenant]/notifications/index.vue +235 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/chat.vue +67 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/configuration.vue +122 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/memories/[memory_id].vue +3 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/memories.vue +20 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/overview.vue +72 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/threads.vue +52 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id]/workflow.vue +19 -0
- package/pages/[tenant]/service/agents/[agent_class]-[agent_id].vue +63 -0
- package/pages/[tenant]/service/agents/templates.vue +102 -0
- package/pages/[tenant]/service/agents.vue +185 -0
- package/pages/[tenant]/service/datasets/[dataset_id].vue +81 -0
- package/pages/[tenant]/service/datasets.vue +53 -0
- package/pages/[tenant]/service/health/index.vue +3 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/nodes.vue +20 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/overview.vue +40 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id]/summary.vue +88 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id].vue +48 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace].vue +144 -0
- package/pages/[tenant]/service/knowledge.vue +126 -0
- package/pages/[tenant]/service/models/[model_name].vue +84 -0
- package/pages/[tenant]/service/models.vue +61 -0
- package/pages/[tenant]/service/my-account.vue +117 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/memories.vue +66 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/sources.vue +100 -0
- package/pages/[tenant]/service/openai/[thread_id]/[display_id]/tracing.vue +49 -0
- package/pages/[tenant]/service/openai.vue +101 -0
- package/pages/[tenant]/service/organization-memories/graph.vue +97 -0
- package/pages/[tenant]/service/organization-memories/list/[memory_id].vue +3 -0
- package/pages/[tenant]/service/organization-memories/list.vue +150 -0
- package/pages/[tenant]/service/organization-memories.vue +3 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/[process_walkthrough_id].vue +7 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/configuration.vue +106 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/overview.vue +67 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/start.vue +26 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/walkthroughs/[process_walkthrough_id]/overview.vue +14 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id]/walkthroughs.vue +54 -0
- package/pages/[tenant]/service/processes/[process_class]-[process_id].vue +60 -0
- package/pages/[tenant]/service/processes.vue +129 -0
- package/pages/[tenant]/service/roles/[role_id].vue +54 -0
- package/pages/[tenant]/service/roles.vue +84 -0
- package/pages/[tenant]/service/threads/[thread_id]/chat.vue +51 -0
- package/pages/[tenant]/service/threads/[thread_id]/display/[display_id].vue +21 -0
- package/pages/[tenant]/service/threads/[thread_id]/display.vue +29 -0
- package/pages/[tenant]/service/threads/[thread_id]/hierarchy.vue +14 -0
- package/pages/[tenant]/service/threads/[thread_id]/memories/[memory_id].vue +3 -0
- package/pages/[tenant]/service/threads/[thread_id]/memories.vue +19 -0
- package/pages/[tenant]/service/threads/[thread_id]/overview.vue +100 -0
- package/pages/[tenant]/service/threads/[thread_id].vue +54 -0
- package/pages/[tenant]/service/threads.vue +52 -0
- package/pages/[tenant]/service/user-memories/graph.vue +97 -0
- package/pages/[tenant]/service/user-memories/list/[memory_id].vue +3 -0
- package/pages/[tenant]/service/user-memories/list.vue +150 -0
- package/pages/[tenant]/service/user-memories.vue +3 -0
- package/pages/[tenant]/service/users/[user_id].vue +117 -0
- package/pages/[tenant]/service/users.vue +88 -0
- package/pages/auth/callback.vue +52 -0
- package/pages/auth/login.vue +80 -0
- package/pages/auth/renew.vue +24 -0
- package/pages/index.vue +59 -0
- package/pages/select-tenant.vue +76 -0
- package/plugins/0.runtime-config.client.ts +55 -0
- package/plugins/apexcharts.client.ts +5 -0
- package/plugins/api-client.client.ts +38 -0
- package/plugins/dark-mode.client.ts +12 -0
- package/plugins/keycloak-client.ts +41 -0
- package/plugins/oidc-client.ts +78 -0
- package/sdk/client/client/client.gen.ts +237 -0
- package/sdk/client/client/index.ts +24 -0
- package/sdk/client/client/types.gen.ts +213 -0
- package/sdk/client/client/utils.gen.ts +407 -0
- package/sdk/client/client.gen.ts +25 -0
- package/sdk/client/core/auth.gen.ts +42 -0
- package/sdk/client/core/bodySerializer.gen.ts +96 -0
- package/sdk/client/core/params.gen.ts +181 -0
- package/sdk/client/core/pathSerializer.gen.ts +180 -0
- package/sdk/client/core/queryKeySerializer.gen.ts +136 -0
- package/sdk/client/core/serverSentEvents.gen.ts +265 -0
- package/sdk/client/core/types.gen.ts +118 -0
- package/sdk/client/core/utils.gen.ts +143 -0
- package/sdk/client/index.ts +1013 -0
- package/sdk/client/schemas.gen.ts +35395 -0
- package/sdk/client/sdk.gen.ts +3438 -0
- package/sdk/client/transformers.gen.ts +143 -0
- package/sdk/client/types.gen.ts +27567 -0
- package/tailwind.config.mjs +27 -0
- package/themes/aihub-theme.ts +125 -0
- package/types/DashboardWidget.ts +13 -0
- package/types/EventChartInput.ts +7 -0
- package/types/NavItem.ts +6 -0
- package/types/TimeseriesInput.ts +7 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog
|
|
3
|
+
v-model:visible="visible"
|
|
4
|
+
modal
|
|
5
|
+
:header="t('process.create.title')"
|
|
6
|
+
:style="{ width: '50rem' }"
|
|
7
|
+
:closable="!isCreating"
|
|
8
|
+
>
|
|
9
|
+
<div class="flex flex-col gap-6">
|
|
10
|
+
<div
|
|
11
|
+
v-if="processClassesAreLoading"
|
|
12
|
+
class="flex items-center justify-center py-8"
|
|
13
|
+
>
|
|
14
|
+
<ProgressSpinner />
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
v-else-if="!processClasses || processClasses.length === 0"
|
|
19
|
+
class="py-8 text-center text-surface-500"
|
|
20
|
+
>
|
|
21
|
+
{{ t('process.create.noProcessClasses') }}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<template v-else>
|
|
25
|
+
<div
|
|
26
|
+
v-if="!hasFixedClass"
|
|
27
|
+
class="flex flex-col gap-2"
|
|
28
|
+
>
|
|
29
|
+
<label
|
|
30
|
+
for="processClass"
|
|
31
|
+
class="text-sm font-medium"
|
|
32
|
+
>
|
|
33
|
+
{{ t('process.create.selectClass') }}
|
|
34
|
+
</label>
|
|
35
|
+
<Select
|
|
36
|
+
v-model="selectedClass"
|
|
37
|
+
:options="processClasses"
|
|
38
|
+
option-label="process_class"
|
|
39
|
+
option-value="process_class"
|
|
40
|
+
:placeholder="t('process.create.selectClassPlaceholder')"
|
|
41
|
+
class="w-full"
|
|
42
|
+
:disabled="isCreating"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div
|
|
47
|
+
v-if="selectedClassData && configForm.length > 0 && formReady"
|
|
48
|
+
class="content flex flex-col gap-2"
|
|
49
|
+
>
|
|
50
|
+
<FormKit
|
|
51
|
+
id="create-process-form"
|
|
52
|
+
v-model="formData"
|
|
53
|
+
type="form"
|
|
54
|
+
:actions="false"
|
|
55
|
+
:config="{
|
|
56
|
+
validationVisibility: 'dirty',
|
|
57
|
+
}"
|
|
58
|
+
@submit="handleFormSubmit"
|
|
59
|
+
>
|
|
60
|
+
<Stepper
|
|
61
|
+
v-model:value="activeStep"
|
|
62
|
+
orientation="vertical"
|
|
63
|
+
>
|
|
64
|
+
<StepItem
|
|
65
|
+
v-if="simpleElementsSchema.length > 0"
|
|
66
|
+
:value="0"
|
|
67
|
+
>
|
|
68
|
+
<Step>{{ t('process.create.steps.basicInfo') }}</Step>
|
|
69
|
+
<StepPanel>
|
|
70
|
+
<div class="flex flex-col gap-6 py-4">
|
|
71
|
+
<FormKitSchema
|
|
72
|
+
:schema="simpleElementsSchema"
|
|
73
|
+
:data="formData"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
</StepPanel>
|
|
77
|
+
</StepItem>
|
|
78
|
+
<StepItem
|
|
79
|
+
v-for="(group, index) in groupConfigs"
|
|
80
|
+
:key="`group-${group.name}`"
|
|
81
|
+
:value="getGroupStepIndex(index)"
|
|
82
|
+
>
|
|
83
|
+
<Step>{{ group.label || group.name }}</Step>
|
|
84
|
+
<StepPanel>
|
|
85
|
+
<div class="content py-4">
|
|
86
|
+
<FormKitSchema
|
|
87
|
+
:schema="group.schema"
|
|
88
|
+
:data="formData"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</StepPanel>
|
|
92
|
+
</StepItem>
|
|
93
|
+
<StepItem
|
|
94
|
+
v-for="(rep, index) in repeaterConfigs"
|
|
95
|
+
:key="`repeater-${rep.path}`"
|
|
96
|
+
:value="getRepeaterStepIndex(index)"
|
|
97
|
+
>
|
|
98
|
+
<Step>{{ rep.label || rep.name }}</Step>
|
|
99
|
+
<StepPanel>
|
|
100
|
+
<div class="py-4">
|
|
101
|
+
<FormKitRepeater
|
|
102
|
+
:model-value="getRepeaterData(rep.path)"
|
|
103
|
+
:name="rep.name"
|
|
104
|
+
:label="rep.label"
|
|
105
|
+
:add-label="rep.addLabel"
|
|
106
|
+
:children-schema="rep.childrenSchema"
|
|
107
|
+
:min="rep.min"
|
|
108
|
+
:max="rep.max"
|
|
109
|
+
@update:model-value="setRepeaterData(rep.path, $event)"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
</StepPanel>
|
|
113
|
+
</StepItem>
|
|
114
|
+
</Stepper>
|
|
115
|
+
</FormKit>
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<template #footer>
|
|
121
|
+
<Button
|
|
122
|
+
:label="t('process.create.cancel')"
|
|
123
|
+
severity="secondary"
|
|
124
|
+
@click="closeModal"
|
|
125
|
+
/>
|
|
126
|
+
<Button
|
|
127
|
+
:label="t('process.create.submit')"
|
|
128
|
+
:disabled="!selectedClass || isCreating"
|
|
129
|
+
:loading="isCreating"
|
|
130
|
+
@click="triggerFormSubmit"
|
|
131
|
+
/>
|
|
132
|
+
</template>
|
|
133
|
+
</Dialog>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<script setup lang="ts">
|
|
137
|
+
import { type FormElement, normalizeFormLocaleStrings } from '@core/composables/form/useFormKitTransform'
|
|
138
|
+
import { getNode } from '@formkit/core'
|
|
139
|
+
|
|
140
|
+
const props = defineProps<{
|
|
141
|
+
modelValue: boolean
|
|
142
|
+
initialClass?: string
|
|
143
|
+
initialData?: Record<string, unknown> | null
|
|
144
|
+
}>()
|
|
145
|
+
|
|
146
|
+
const emit = defineEmits<{
|
|
147
|
+
'update:modelValue': [value: boolean]
|
|
148
|
+
'success': [processClass: string, processId: string]
|
|
149
|
+
}>()
|
|
150
|
+
|
|
151
|
+
const { t, locale } = useI18n()
|
|
152
|
+
const toast = useToast()
|
|
153
|
+
const { processClasses, processClassesAreLoading } = useProcessClasses()
|
|
154
|
+
const { createProcessInstance, isCreating } = useCreateProcessInstance()
|
|
155
|
+
|
|
156
|
+
const {
|
|
157
|
+
selectedClass,
|
|
158
|
+
formData,
|
|
159
|
+
activeStep,
|
|
160
|
+
selectedClassData,
|
|
161
|
+
configForm,
|
|
162
|
+
simpleElementsSchema,
|
|
163
|
+
groupConfigs,
|
|
164
|
+
repeaterConfigs,
|
|
165
|
+
getGroupStepIndex,
|
|
166
|
+
getRepeaterStepIndex,
|
|
167
|
+
getRepeaterData,
|
|
168
|
+
setRepeaterData,
|
|
169
|
+
cleanFormData,
|
|
170
|
+
coerceNullableToggles,
|
|
171
|
+
applyInitialData,
|
|
172
|
+
resetForm,
|
|
173
|
+
} = useCreateInstanceForm({
|
|
174
|
+
classes: processClasses,
|
|
175
|
+
classField: 'process_class',
|
|
176
|
+
idField: 'process_id',
|
|
177
|
+
initialClass: () => props.initialClass ?? '',
|
|
178
|
+
locale,
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
const formReady = ref(false)
|
|
182
|
+
const hasFixedClass = computed(() => !!props.initialClass)
|
|
183
|
+
|
|
184
|
+
const visible = computed({
|
|
185
|
+
get: () => props.modelValue,
|
|
186
|
+
set: (value: boolean) => emit('update:modelValue', value),
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
watch(visible, async (isVisible) => {
|
|
190
|
+
if (!isVisible) {
|
|
191
|
+
formReady.value = false
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
await nextTick()
|
|
195
|
+
if (props.initialData) {
|
|
196
|
+
applyInitialData(props.initialData)
|
|
197
|
+
}
|
|
198
|
+
formReady.value = true
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
function closeModal() {
|
|
202
|
+
visible.value = false
|
|
203
|
+
resetForm()
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function triggerFormSubmit() {
|
|
207
|
+
const formNode = getNode('create-process-form')
|
|
208
|
+
if (formNode) {
|
|
209
|
+
formNode.submit()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async function handleFormSubmit() {
|
|
214
|
+
try {
|
|
215
|
+
const cleanedData = cleanFormData(formData.value)
|
|
216
|
+
const coerced = coerceNullableToggles(cleanedData, configForm.value as FormElement[])
|
|
217
|
+
const normalizedConfig = normalizeFormLocaleStrings(coerced)
|
|
218
|
+
const processId = normalizedConfig.process_id as string
|
|
219
|
+
await createProcessInstance({
|
|
220
|
+
processClass: selectedClass.value,
|
|
221
|
+
request: {
|
|
222
|
+
process_id: processId,
|
|
223
|
+
configuration: normalizedConfig,
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
toast.add({
|
|
228
|
+
severity: 'success',
|
|
229
|
+
summary: t('process.create.success'),
|
|
230
|
+
life: 3000,
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
emit('success', selectedClass.value, processId)
|
|
234
|
+
closeModal()
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
console.error('Failed to create process:', error)
|
|
238
|
+
toast.add({
|
|
239
|
+
severity: 'error',
|
|
240
|
+
summary: t('process.create.error'),
|
|
241
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
242
|
+
life: 5000,
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</script>
|
|
247
|
+
|
|
248
|
+
<style scoped>
|
|
249
|
+
.content {
|
|
250
|
+
@apply font-light text-xs
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.content :deep(.formkit-group-fieldset) {
|
|
254
|
+
@apply flex flex-col gap-6;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.content :deep(.formkit-outer) {
|
|
258
|
+
@apply pt-3 pb-1;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.content :deep(.formkit-group-fieldset legend) {
|
|
262
|
+
@apply hidden;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.content :deep(.formkit-slider-value-input) {
|
|
266
|
+
@apply w-20;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.content :deep(.formkit-slider-value-input .p-inputnumber-input) {
|
|
270
|
+
@apply text-center text-sm;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.content :deep(#create-process-form-incomplete) {
|
|
274
|
+
@apply font-bold text-sm text-right pr-2;
|
|
275
|
+
}
|
|
276
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex cursor-pointer flex-col justify-center gap-3 rounded-xl border-2 border-dashed border-surface-300 p-4 hover:border-primary-500 hover:bg-surface-50 dark:border-surface-600 dark:hover:bg-surface-800"
|
|
4
|
+
@click="handleAdd"
|
|
5
|
+
>
|
|
6
|
+
<div class="flex items-center justify-center">
|
|
7
|
+
<div class="flex items-center justify-center p-3">
|
|
8
|
+
<i
|
|
9
|
+
class="pi pi-plus-circle text-surface-400"
|
|
10
|
+
style="font-size: 1.5rem"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="text-center">
|
|
15
|
+
<h3 class="font-medium text-surface-600 dark:text-surface-400">
|
|
16
|
+
{{ t('process.add_instance.title') }}
|
|
17
|
+
</h3>
|
|
18
|
+
<p class="text-sm text-surface-500 dark:text-surface-400">
|
|
19
|
+
{{ t('process.add_instance.description') }}
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
const { t } = useI18n()
|
|
27
|
+
|
|
28
|
+
const emit = defineEmits<{
|
|
29
|
+
add: []
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const handleAdd = () => {
|
|
33
|
+
emit('add')
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Panel
|
|
3
|
+
:header="title"
|
|
4
|
+
toggleable
|
|
5
|
+
>
|
|
6
|
+
<p class="text-xs dark:text-surface-500">
|
|
7
|
+
{{ description }}
|
|
8
|
+
</p>
|
|
9
|
+
<div class="content pt-6">
|
|
10
|
+
<div class="w-full">
|
|
11
|
+
<FormKit
|
|
12
|
+
id="form"
|
|
13
|
+
v-model="data"
|
|
14
|
+
type="form"
|
|
15
|
+
:submit-attrs="{
|
|
16
|
+
inputClass: 'p-button p-component w-full',
|
|
17
|
+
}"
|
|
18
|
+
:config="{
|
|
19
|
+
validationVisibility: 'blur',
|
|
20
|
+
}"
|
|
21
|
+
@submit="submitHandler"
|
|
22
|
+
>
|
|
23
|
+
<FormKitSchema
|
|
24
|
+
:schema="schema"
|
|
25
|
+
:data="data"
|
|
26
|
+
/>
|
|
27
|
+
</FormKit>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<pre>{{ data }}</pre>
|
|
31
|
+
</Panel>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import type { HtmlElement, InputText } from '@core/sdk/client'
|
|
36
|
+
import type { FormKitSchemaNode, FormKitSchemaDefinition } from '@formkit/core'
|
|
37
|
+
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
title: string
|
|
40
|
+
description: string
|
|
41
|
+
form: (HtmlElement | InputText)[]
|
|
42
|
+
}>()
|
|
43
|
+
const data = ref({ })
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits<{
|
|
46
|
+
submit: [Record<string, unknown>]
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
const schema = computed<FormKitSchemaDefinition>(() => {
|
|
50
|
+
const pattern = new RegExp(
|
|
51
|
+
Object.keys(data.value)
|
|
52
|
+
.map(key => `\\$${key}`)
|
|
53
|
+
.join('|'),
|
|
54
|
+
'g',
|
|
55
|
+
)
|
|
56
|
+
return props.form.map((form: HtmlElement | InputText) => {
|
|
57
|
+
const formkitNode = {
|
|
58
|
+
...form,
|
|
59
|
+
$formkit: form.formkit,
|
|
60
|
+
} as FormKitSchemaNode
|
|
61
|
+
if (formkitNode?.label) {
|
|
62
|
+
formkitNode.label = formkitNode.label.replace(pattern, (match: string) => {
|
|
63
|
+
const key = match.substring(1)
|
|
64
|
+
return data.value[key] || match
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
return formkitNode
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
console.log(schema.value)
|
|
72
|
+
|
|
73
|
+
async function submitHandler() {
|
|
74
|
+
console.log('submit', data.value)
|
|
75
|
+
emit('submit', data.value)
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style scoped>
|
|
80
|
+
.content {
|
|
81
|
+
@apply font-light text-xs
|
|
82
|
+
}
|
|
83
|
+
.content :deep(.formkit-outer){
|
|
84
|
+
@apply pt-3 pb-1;
|
|
85
|
+
}
|
|
86
|
+
.content :deep(h1) {
|
|
87
|
+
@apply pt-3 pb-1 text-xl font-bold;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.content :deep(h2) {
|
|
91
|
+
@apply pt-3 pb-1 text-lg font-bold;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.content :deep(h3) {
|
|
95
|
+
@apply pt-3 pb-1 text-base font-bold;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.content :deep(h4) {
|
|
99
|
+
@apply pt-3 pb-1 font-bold;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.content :deep(h5) {
|
|
103
|
+
@apply pt-3 pb-1 font-bold;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.content :deep(h6) {
|
|
107
|
+
@apply pt-3 pb-1 font-bold;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.content :deep(p) {
|
|
111
|
+
@apply pt-3 pb-1 ;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.content :deep(blockquote) {
|
|
115
|
+
@apply px-4 py-3 my-4 italic border-s-4 dark:border-gray-500/20 dark:bg-surface-800/20;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.content :deep(ul) {
|
|
119
|
+
@apply list-disc list-outside mt-2;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.content :deep(ol) {
|
|
123
|
+
@apply list-decimal list-outside mt-2;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.content :deep(ul > li) {
|
|
127
|
+
@apply ml-4 mt-2;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.content :deep(ol > li) {
|
|
131
|
+
@apply ml-6 mt-2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.content :deep(strong) {
|
|
135
|
+
@apply font-bold;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.content :deep(p a) {
|
|
139
|
+
@apply border-b border-dotted border-gray-400 after:content-['↗'] after:pl-[1px];
|
|
140
|
+
}
|
|
141
|
+
.content :deep(ul a) {
|
|
142
|
+
@apply border-b border-dotted border-gray-400 after:content-['↗'] after:pl-[1px];
|
|
143
|
+
}
|
|
144
|
+
.content :deep(table) {
|
|
145
|
+
@apply my-8;
|
|
146
|
+
}
|
|
147
|
+
.content :deep(th) {
|
|
148
|
+
@apply border border-surface-200 dark:border-surface-500 p-2 text-left font-bold bg-surface-100 dark:bg-surface-800;
|
|
149
|
+
}
|
|
150
|
+
.content :deep(td) {
|
|
151
|
+
@apply border border-surface-200 dark:border-surface-500 p-2 text-left;
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ProcessForm
|
|
4
|
+
v-for="(humanInput, index) in humanInputs"
|
|
5
|
+
:key="index"
|
|
6
|
+
class="w-1/2"
|
|
7
|
+
:title="resolveLocale(humanInput.name)"
|
|
8
|
+
:description="resolveLocale(humanInput.description)"
|
|
9
|
+
:form="humanInput.form"
|
|
10
|
+
@submit="submitForm($event, humanInput)"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { useRoute } from 'vue-router'
|
|
17
|
+
|
|
18
|
+
import type { HumanInSpecsReadable, LocaleString } from '@core/sdk/client'
|
|
19
|
+
|
|
20
|
+
defineProps<{
|
|
21
|
+
humanInputs: HumanInSpecsReadable[]
|
|
22
|
+
}>()
|
|
23
|
+
|
|
24
|
+
const route = useRoute()
|
|
25
|
+
const { locale } = useI18n()
|
|
26
|
+
const { sendProcessStartForm } = useSendProcessStartForm()
|
|
27
|
+
const { tenantId } = useTenant()
|
|
28
|
+
|
|
29
|
+
const resolveLocale = (localeString: LocaleString): string => {
|
|
30
|
+
const key = locale.value as keyof LocaleString
|
|
31
|
+
return localeString?.[key] ?? localeString?.en ?? localeString?.de ?? ''
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const submitForm = async (form: Record<string, unknown>, humanInput: HumanInSpecsReadable) => {
|
|
35
|
+
await sendProcessStartForm({
|
|
36
|
+
processClass: route.params.process_class as string,
|
|
37
|
+
processId: route.params.process_id as string,
|
|
38
|
+
submissionRoute: humanInput.route,
|
|
39
|
+
submissionMethod: humanInput.method,
|
|
40
|
+
data: form,
|
|
41
|
+
tenantId: tenantId.value!,
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DataTable
|
|
3
|
+
:value="walkthroughs"
|
|
4
|
+
table-style="min-width: 50rem"
|
|
5
|
+
selection-mode="single"
|
|
6
|
+
:selection="selectedWalkthrough"
|
|
7
|
+
size="small"
|
|
8
|
+
@update:selection="emit('selected', $event)"
|
|
9
|
+
>
|
|
10
|
+
<Column
|
|
11
|
+
field="Created"
|
|
12
|
+
:header="t('process.walkthrough.list.created')"
|
|
13
|
+
>
|
|
14
|
+
<template #body="{ data }">
|
|
15
|
+
<p>{{ formatted(data.created_at) }}</p>
|
|
16
|
+
</template>
|
|
17
|
+
</Column>
|
|
18
|
+
<Column
|
|
19
|
+
field="agents"
|
|
20
|
+
:header="t('process.walkthrough.list.agents')"
|
|
21
|
+
>
|
|
22
|
+
<template #body="{ data }">
|
|
23
|
+
<AvatarGroup>
|
|
24
|
+
<Avatar
|
|
25
|
+
v-for="agent in data.involved_agents"
|
|
26
|
+
:key="agent.agent_id + agent.agent_class"
|
|
27
|
+
v-tooltip.top="agent.agent_config.name"
|
|
28
|
+
>
|
|
29
|
+
<template #icon>
|
|
30
|
+
<Icon
|
|
31
|
+
:name="agent.agent_config.icon"
|
|
32
|
+
size="xl"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
</Avatar>
|
|
36
|
+
</AvatarGroup>
|
|
37
|
+
</template>
|
|
38
|
+
</Column>
|
|
39
|
+
<Column
|
|
40
|
+
field="users"
|
|
41
|
+
:header="t('process.walkthrough.list.users')"
|
|
42
|
+
>
|
|
43
|
+
<template #body="{ data }">
|
|
44
|
+
<AvatarGroup>
|
|
45
|
+
<Avatar
|
|
46
|
+
v-for="user in data.involved_humans"
|
|
47
|
+
:key="user.id"
|
|
48
|
+
v-tooltip.top="user.name"
|
|
49
|
+
:image="user?.profile_image ?? undefined"
|
|
50
|
+
:label="!user?.profile_image ? initials(user) : undefined"
|
|
51
|
+
shape="circle"
|
|
52
|
+
/>
|
|
53
|
+
</AvatarGroup>
|
|
54
|
+
</template>
|
|
55
|
+
</Column>
|
|
56
|
+
<Column
|
|
57
|
+
field="updated_at"
|
|
58
|
+
:header="t('process.walkthrough.list.updated')"
|
|
59
|
+
>
|
|
60
|
+
<template #body="{ data }">
|
|
61
|
+
<Tag
|
|
62
|
+
:value="getTimeAgo(data.updated_at / 1000000).text"
|
|
63
|
+
:severity="getTimeAgo(data.updated_at / 1000000).severity"
|
|
64
|
+
/>
|
|
65
|
+
</template>
|
|
66
|
+
</Column>
|
|
67
|
+
<Column
|
|
68
|
+
field="process_steps"
|
|
69
|
+
:header="t('process.walkthrough.list.steps')"
|
|
70
|
+
>
|
|
71
|
+
<template #body="{ data }">
|
|
72
|
+
<div class="relative flex w-fit flex-row gap-3">
|
|
73
|
+
<div class="absolute inset-x-12 top-4 border-t-4 border-dotted border-gray-400/50" />
|
|
74
|
+
<div
|
|
75
|
+
v-for="step in data.process_steps"
|
|
76
|
+
:key="step.step_index"
|
|
77
|
+
class="z-50 flex w-24 flex-col items-center justify-center gap-1"
|
|
78
|
+
>
|
|
79
|
+
<Avatar
|
|
80
|
+
v-tooltip.top="tooltipForStep(step)"
|
|
81
|
+
:class="{
|
|
82
|
+
'bg-green-200 text-green-800 dark:bg-green-800 dark:text-green-100': step.is_completed,
|
|
83
|
+
}"
|
|
84
|
+
shape="circle"
|
|
85
|
+
size="normal"
|
|
86
|
+
>
|
|
87
|
+
<Icon
|
|
88
|
+
:name="iconForStep(step)"
|
|
89
|
+
size="small"
|
|
90
|
+
/>
|
|
91
|
+
</Avatar>
|
|
92
|
+
<p class="w-full truncate text-center text-xs">
|
|
93
|
+
{{ nameForStep(step) }}
|
|
94
|
+
</p>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
</Column>
|
|
99
|
+
</DataTable>
|
|
100
|
+
</template>
|
|
101
|
+
|
|
102
|
+
<script setup lang="ts">
|
|
103
|
+
import type {
|
|
104
|
+
AgentProcessStepDto,
|
|
105
|
+
HumanProcessStepDto,
|
|
106
|
+
MinimalUserDto,
|
|
107
|
+
ProcessWalkthroughDto,
|
|
108
|
+
ProgramProcessStepDto,
|
|
109
|
+
} from '@core/sdk/client'
|
|
110
|
+
|
|
111
|
+
type ProcessStepDto = AgentProcessStepDto | ProgramProcessStepDto | HumanProcessStepDto
|
|
112
|
+
|
|
113
|
+
const props = defineProps<{
|
|
114
|
+
walkthroughs: ProcessWalkthroughDto[]
|
|
115
|
+
}>()
|
|
116
|
+
|
|
117
|
+
const emit = defineEmits<{
|
|
118
|
+
selected: [walkthrough: ProcessWalkthroughDto]
|
|
119
|
+
}>()
|
|
120
|
+
|
|
121
|
+
const { t } = useI18n()
|
|
122
|
+
const route = useRoute()
|
|
123
|
+
const { getTimeAgo } = useTimeAgo()
|
|
124
|
+
|
|
125
|
+
const iconForStep = (process_step: ProcessStepDto) => {
|
|
126
|
+
if (process_step.step_type === 'human') {
|
|
127
|
+
return 'mage:user'
|
|
128
|
+
}
|
|
129
|
+
if (process_step.step_type === 'program') {
|
|
130
|
+
return 'tdesign:code'
|
|
131
|
+
}
|
|
132
|
+
if (process_step.step_type === 'agent') {
|
|
133
|
+
return process_step.work_request?.agent_info?.agent_config?.icon ?? process_step.work_response?.agent_info?.agent_config?.icon ?? 'meteor-icons:robot'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const tooltipForStep = (process_step: ProcessStepDto) => {
|
|
137
|
+
if (process_step.step_type === 'human' && process_step.work_response) {
|
|
138
|
+
return process_step.work_response.data.submitted_by.email
|
|
139
|
+
}
|
|
140
|
+
if (process_step.step_type === 'program') {
|
|
141
|
+
return ''
|
|
142
|
+
}
|
|
143
|
+
if (process_step.step_type === 'agent') {
|
|
144
|
+
if (process_step.work_request) {
|
|
145
|
+
return process_step.work_request?.agent_info?.agent_config?.name
|
|
146
|
+
}
|
|
147
|
+
return process_step.work_response?.agent_info?.agent_config?.name
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const nameForStep = (process_step: ProcessStepDto) => {
|
|
151
|
+
return process_step.work_response?.event_name ?? process_step.work_request?.event_name
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const initials = (user: MinimalUserDto) => user.name?.split(' ').map(n => n[0]).join('')
|
|
155
|
+
const formatted = (timestamp: number) => useDateFormat(new Date(timestamp / 1000000), 'DD.MM.YYYY HH:mm:ss')
|
|
156
|
+
|
|
157
|
+
const selectedWalkthrough = computed(() => {
|
|
158
|
+
return props.walkthroughs.filter((walkthrough: ProcessWalkthroughDto) => {
|
|
159
|
+
return walkthrough.process_walkthrough_id === route.params.process_walkthrough_id
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
</script>
|