@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,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="scrollContainerRef"
|
|
4
|
+
class="fixed flex h-[calc(100vh-50px)] w-[260px] flex-col gap-5 overflow-y-auto overflow-x-hidden bg-surface-50 dark:bg-surface-950"
|
|
5
|
+
>
|
|
6
|
+
<p class="pl-3 pt-10 text-sm font-medium text-surface-900 dark:text-white">
|
|
7
|
+
{{ title }}
|
|
8
|
+
</p>
|
|
9
|
+
<div class="flex flex-col gap-5">
|
|
10
|
+
<div
|
|
11
|
+
v-for="(navItems, group) in navItemsMap"
|
|
12
|
+
:key="group"
|
|
13
|
+
>
|
|
14
|
+
<div class="w-full pb-1.5 pl-2.5 text-xs font-medium text-surface-500 dark:text-surface-500">
|
|
15
|
+
{{ group }}
|
|
16
|
+
</div>
|
|
17
|
+
<div class="flex flex-col gap-2 pr-2 text-surface-700 dark:text-surface-200">
|
|
18
|
+
<div
|
|
19
|
+
v-for="navItem in navItems"
|
|
20
|
+
:key="navItem.key"
|
|
21
|
+
class="flex w-full cursor-pointer justify-between text-ellipsis whitespace-nowrap rounded-lg px-[11px] py-[6px] hover:bg-surface-100 dark:hover:bg-surface-950"
|
|
22
|
+
:class="{ 'bg-surface-200 dark:bg-surface-900': navItem.isActive() }"
|
|
23
|
+
@click="toNavItem(navItem)"
|
|
24
|
+
>
|
|
25
|
+
<div class="flex w-full flex-1 self-center">
|
|
26
|
+
<div
|
|
27
|
+
dir="auto"
|
|
28
|
+
class="h-[20px] w-full self-center overflow-hidden text-left"
|
|
29
|
+
>
|
|
30
|
+
{{ navItem.name }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- Loading indicator at the bottom -->
|
|
38
|
+
<div
|
|
39
|
+
v-if="loading"
|
|
40
|
+
class="flex justify-center py-4"
|
|
41
|
+
>
|
|
42
|
+
<i class="pi pi-spin pi-spinner text-primary" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="min-w-[260px]" />
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import { useInfiniteScroll } from '@vueuse/core'
|
|
51
|
+
import { ref } from 'vue'
|
|
52
|
+
|
|
53
|
+
import type { NavItem } from '@core/types/NavItem'
|
|
54
|
+
|
|
55
|
+
const props = defineProps<{
|
|
56
|
+
title: string
|
|
57
|
+
navItemsMap: Record<string, NavItem[]>
|
|
58
|
+
hasMore?: boolean
|
|
59
|
+
loading?: boolean
|
|
60
|
+
}>()
|
|
61
|
+
|
|
62
|
+
const emit = defineEmits<{
|
|
63
|
+
loadMore: []
|
|
64
|
+
}>()
|
|
65
|
+
|
|
66
|
+
const router = useRouter()
|
|
67
|
+
const tenantPath = useTenantPath()
|
|
68
|
+
const scrollContainerRef = ref<HTMLElement | null>(null)
|
|
69
|
+
|
|
70
|
+
const toNavItem = (navItem: NavItem) => {
|
|
71
|
+
router.push(tenantPath(navItem.path))
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Set up infinite scroll using vueuse
|
|
75
|
+
useInfiniteScroll(
|
|
76
|
+
scrollContainerRef,
|
|
77
|
+
() => {
|
|
78
|
+
emit('loadMore')
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
distance: 10,
|
|
82
|
+
canLoadMore: () => props.hasMore ?? false,
|
|
83
|
+
},
|
|
84
|
+
)
|
|
85
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-full">
|
|
3
|
+
<div class="flex gap-2 p-1">
|
|
4
|
+
<Button
|
|
5
|
+
v-for="navItem in navItems"
|
|
6
|
+
:key="navItem.key"
|
|
7
|
+
:label="navItem.name"
|
|
8
|
+
:variant="navItem.isActive() ? undefined : 'text'"
|
|
9
|
+
size="small"
|
|
10
|
+
severity="secondary"
|
|
11
|
+
@click="toNavItem(navItem)"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
<Divider class="my-0" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import type { NavItem } from '@core/types/NavItem'
|
|
20
|
+
|
|
21
|
+
defineProps<{
|
|
22
|
+
navItems: NavItem[]
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const router = useRouter()
|
|
26
|
+
const tenantPath = useTenantPath()
|
|
27
|
+
|
|
28
|
+
const toNavItem = (navItem: NavItem) => {
|
|
29
|
+
router.push(tenantPath(navItem.path))
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li
|
|
3
|
+
class="flex cursor-pointer items-start gap-4 border-b border-surface-100 p-4 transition-colors duration-200 hover:bg-surface-50 dark:border-surface-800 dark:hover:bg-surface-800"
|
|
4
|
+
:class="notification.done ? 'opacity-40' : ''"
|
|
5
|
+
>
|
|
6
|
+
<Checkbox
|
|
7
|
+
v-if="showCheckbox"
|
|
8
|
+
:model-value="isSelected"
|
|
9
|
+
:binary="true"
|
|
10
|
+
class="mt-1 shrink-0"
|
|
11
|
+
@change="$emit('toggle-selection', notification)"
|
|
12
|
+
/>
|
|
13
|
+
<div class="size-2.5 shrink-0 self-center">
|
|
14
|
+
<div
|
|
15
|
+
v-if="!notification.read"
|
|
16
|
+
class="size-full rounded-full"
|
|
17
|
+
:class="unreadCircleClasses"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="min-w-0 grow">
|
|
21
|
+
<div class="flex items-start justify-between gap-2">
|
|
22
|
+
<button
|
|
23
|
+
type="button"
|
|
24
|
+
class="min-w-0 grow cursor-pointer rounded text-left focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
25
|
+
@click="$emit('click', notification)"
|
|
26
|
+
>
|
|
27
|
+
<p class="mb-1 text-xs font-light opacity-70">
|
|
28
|
+
{{ timeAgoText }}
|
|
29
|
+
</p>
|
|
30
|
+
<h3 class="font-semibold opacity-80">
|
|
31
|
+
{{ notification.title }}
|
|
32
|
+
</h3>
|
|
33
|
+
<p class="text-xs font-light opacity-70">
|
|
34
|
+
{{ notification.message }}
|
|
35
|
+
</p>
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
<Button
|
|
39
|
+
:label="t('notification.view_button')"
|
|
40
|
+
icon="pi pi-arrow-right"
|
|
41
|
+
icon-pos="right"
|
|
42
|
+
size="small"
|
|
43
|
+
text
|
|
44
|
+
class="shrink-0 self-start"
|
|
45
|
+
@click.stop="$emit('click', notification)"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</li>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup lang="ts">
|
|
53
|
+
import { useTimeAgo } from '@core/composables/useTimeAgo'
|
|
54
|
+
import { computed } from 'vue'
|
|
55
|
+
import { useI18n } from 'vue-i18n'
|
|
56
|
+
|
|
57
|
+
import type { NotificationDto } from '@core/sdk/client'
|
|
58
|
+
|
|
59
|
+
const props = defineProps<{
|
|
60
|
+
notification: NotificationDto
|
|
61
|
+
isSelected: boolean
|
|
62
|
+
showCheckbox?: boolean
|
|
63
|
+
}>()
|
|
64
|
+
|
|
65
|
+
defineEmits<{
|
|
66
|
+
'click': [notification: NotificationDto]
|
|
67
|
+
'toggle-selection': [notification: NotificationDto]
|
|
68
|
+
}>()
|
|
69
|
+
|
|
70
|
+
const { t } = useI18n()
|
|
71
|
+
const { getTimeAgo } = useTimeAgo()
|
|
72
|
+
|
|
73
|
+
const timeAgoText = computed(() => getTimeAgo(new Date(props.notification.created_at)).text)
|
|
74
|
+
|
|
75
|
+
const unreadCircleClasses = computed(() => {
|
|
76
|
+
switch (props.notification.severity) {
|
|
77
|
+
case 'critical':
|
|
78
|
+
return 'bg-red-500'
|
|
79
|
+
case 'high':
|
|
80
|
+
return 'bg-orange-500'
|
|
81
|
+
case 'medium':
|
|
82
|
+
return 'bg-blue-500'
|
|
83
|
+
case 'low':
|
|
84
|
+
default:
|
|
85
|
+
return 'bg-surface-500'
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
</script>
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative inline-flex cursor-pointer">
|
|
3
|
+
<Button
|
|
4
|
+
v-tooltip.bottom="{ value: t('bar.show_notifications') }"
|
|
5
|
+
icon="pi pi-bell"
|
|
6
|
+
variant="text"
|
|
7
|
+
rounded
|
|
8
|
+
:aria-label="t('bar.show_notifications')"
|
|
9
|
+
@click="togglePanel"
|
|
10
|
+
/>
|
|
11
|
+
<Badge
|
|
12
|
+
v-if="unreadCount > 0"
|
|
13
|
+
:value="unreadCount"
|
|
14
|
+
size="small"
|
|
15
|
+
severity="danger"
|
|
16
|
+
class="absolute right-0 top-0 flex -translate-y-1 translate-x-1"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<Popover
|
|
21
|
+
ref="op"
|
|
22
|
+
class="[--p-popover-background:#f9f9f9] [--p-popover-border-color:#e3e3e3] dark:[--p-popover-background:#0d0d0d] dark:[--p-popover-border-color:#333]"
|
|
23
|
+
@hide="isPanelOpen = false"
|
|
24
|
+
>
|
|
25
|
+
<ScrollPanel>
|
|
26
|
+
<DataView
|
|
27
|
+
:value="unreadNotifications"
|
|
28
|
+
:loading="isLoading"
|
|
29
|
+
:style="{
|
|
30
|
+
'--p-dataview-content-background': 'transparent',
|
|
31
|
+
'--p-dataview-header-background': 'transparent',
|
|
32
|
+
'--p-dataview-footer-background': 'transparent',
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
<template #header>
|
|
36
|
+
<div class="flex items-center justify-between">
|
|
37
|
+
<h2 class="text-xl">
|
|
38
|
+
{{ t('notification.title') }} ({{ unreadCount }})
|
|
39
|
+
</h2>
|
|
40
|
+
<Button
|
|
41
|
+
v-if="unreadCount > 0"
|
|
42
|
+
:label="t('notification.mark_all_as_read')"
|
|
43
|
+
severity="secondary"
|
|
44
|
+
variant="text"
|
|
45
|
+
size="small"
|
|
46
|
+
@click="markAllAsRead"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<template #list="{ items }">
|
|
52
|
+
<ul class="m-0 flex list-none flex-col p-0">
|
|
53
|
+
<NotificationItem
|
|
54
|
+
v-for="item in items"
|
|
55
|
+
:key="item.id"
|
|
56
|
+
:notification="item"
|
|
57
|
+
@click="handleNotificationClick"
|
|
58
|
+
/>
|
|
59
|
+
</ul>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<template #empty>
|
|
63
|
+
<div class="flex flex-col items-center justify-center p-8 text-center">
|
|
64
|
+
<i class="pi pi-bell-slash p-4 text-2xl text-surface-400" />
|
|
65
|
+
<p class="text-sm text-surface-500 dark:text-surface-400">
|
|
66
|
+
{{ t('notification.no_unread_notifications') }}
|
|
67
|
+
</p>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<template #footer>
|
|
72
|
+
<div class="text-center dark:border-surface-700">
|
|
73
|
+
<Button
|
|
74
|
+
:label="t('notification.view_all')"
|
|
75
|
+
class="w-full"
|
|
76
|
+
variant="text"
|
|
77
|
+
@click="viewAll"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
</DataView>
|
|
82
|
+
</ScrollPanel>
|
|
83
|
+
</Popover>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import { computed, ref, watch } from 'vue'
|
|
88
|
+
import { useI18n } from 'vue-i18n'
|
|
89
|
+
import { useRouter } from 'vue-router'
|
|
90
|
+
|
|
91
|
+
import type { NotificationDto } from '@core/sdk/client'
|
|
92
|
+
|
|
93
|
+
const { t } = useI18n()
|
|
94
|
+
const op = ref()
|
|
95
|
+
const router = useRouter()
|
|
96
|
+
const tenantPath = useTenantPath()
|
|
97
|
+
const isPanelOpen = ref(false)
|
|
98
|
+
|
|
99
|
+
const readFilter = ref<boolean | undefined>(false)
|
|
100
|
+
const currentPage = ref(1)
|
|
101
|
+
const pageSize = ref(15)
|
|
102
|
+
const listMinHeight = ref('auto')
|
|
103
|
+
|
|
104
|
+
const { notifications, isLoading, refetch } = useNotifications({
|
|
105
|
+
currentPage,
|
|
106
|
+
pageSize,
|
|
107
|
+
filters: { read: readFilter },
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const { mutate: updateNotification } = useUpdateNotification()
|
|
111
|
+
const { mutate: updateMultipleNotifications } = useUpdateMultipleNotifications()
|
|
112
|
+
const { tenantId } = useTenant()
|
|
113
|
+
|
|
114
|
+
const unreadNotifications = computed(() => {
|
|
115
|
+
if (!notifications.value) return []
|
|
116
|
+
return notifications.value.filter(n => !n.read)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const unreadCount = computed(() => unreadNotifications.value.length)
|
|
120
|
+
|
|
121
|
+
watch(notifications, (newVal) => {
|
|
122
|
+
if (newVal.length > 0 && listMinHeight.value === 'auto') {
|
|
123
|
+
const calculatedHeight = Math.min(newVal.length * 80, 400)
|
|
124
|
+
listMinHeight.value = `${calculatedHeight}px`
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const togglePanel = (event: Event) => {
|
|
129
|
+
op.value.toggle(event)
|
|
130
|
+
isPanelOpen.value = !isPanelOpen.value
|
|
131
|
+
if (isPanelOpen.value) {
|
|
132
|
+
listMinHeight.value = 'auto'
|
|
133
|
+
readFilter.value = false
|
|
134
|
+
refetch()
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const handleNotificationClick = (notification: NotificationDto) => {
|
|
139
|
+
if (!notification.read) {
|
|
140
|
+
updateNotification({ id: notification.id, payload: ref({ read: true }), tenantId: tenantId.value! })
|
|
141
|
+
}
|
|
142
|
+
if (notification.link) {
|
|
143
|
+
router.push(tenantPath(notification.link))
|
|
144
|
+
op.value.hide()
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const markAllAsRead = () => {
|
|
149
|
+
const unreadIds = unreadNotifications.value.map(n => n.id)
|
|
150
|
+
if (unreadIds.length > 0) {
|
|
151
|
+
updateMultipleNotifications({
|
|
152
|
+
ids: unreadIds,
|
|
153
|
+
payload: ref({ read: true }),
|
|
154
|
+
tenantId: tenantId.value!,
|
|
155
|
+
})
|
|
156
|
+
op.value.hide()
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const viewAll = () => {
|
|
161
|
+
op.value.hide()
|
|
162
|
+
router.push(tenantPath('/notifications'))
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex cursor-pointer flex-col gap-3 rounded-xl border border-surface-200 p-4 hover:bg-surface-100 dark:border-surface-800 hover:dark:bg-surface-800"
|
|
4
|
+
:class="{ 'bg-surface-100 dark:bg-surface-800': isActive }"
|
|
5
|
+
@click="emit('click', process)"
|
|
6
|
+
>
|
|
7
|
+
<div class="flex items-center justify-between gap-4">
|
|
8
|
+
<div class="flex items-center justify-start gap-2">
|
|
9
|
+
<div
|
|
10
|
+
class="flex items-center justify-center rounded-full bg-white p-3 dark:bg-surface-900"
|
|
11
|
+
>
|
|
12
|
+
<Icon
|
|
13
|
+
:name="process.process_config.icon"
|
|
14
|
+
size="1.5em"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<div>
|
|
18
|
+
<h3 class="font-semibold opacity-80">
|
|
19
|
+
{{ process?.process_config.name }}
|
|
20
|
+
</h3>
|
|
21
|
+
<p class="text-xs font-light opacity-70">
|
|
22
|
+
{{ process.process_class }} / {{ process.process_id }}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="flex items-center gap-2">
|
|
27
|
+
<Tag
|
|
28
|
+
v-if="process.is_online"
|
|
29
|
+
severity="success"
|
|
30
|
+
:value="t('process.list.online')"
|
|
31
|
+
/>
|
|
32
|
+
<Tag
|
|
33
|
+
v-else
|
|
34
|
+
severity="danger"
|
|
35
|
+
:value="t('process.list.offline')"
|
|
36
|
+
/>
|
|
37
|
+
<Button
|
|
38
|
+
v-if="showDelete"
|
|
39
|
+
icon="pi pi-trash"
|
|
40
|
+
severity="secondary"
|
|
41
|
+
text
|
|
42
|
+
rounded
|
|
43
|
+
size="small"
|
|
44
|
+
:loading="isDeleting"
|
|
45
|
+
@click.stop="confirmDelete"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
<span class="text-xs">
|
|
51
|
+
{{ process.process_config.description }}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup lang="ts">
|
|
58
|
+
import type { FullProcessInstanceDtoReadable } from '@core/sdk/client'
|
|
59
|
+
|
|
60
|
+
const props = withDefaults(defineProps<{
|
|
61
|
+
process: FullProcessInstanceDtoReadable
|
|
62
|
+
showDelete?: boolean
|
|
63
|
+
}>(), {
|
|
64
|
+
showDelete: true,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits<{
|
|
68
|
+
deleted: [processClass: string, processId: string]
|
|
69
|
+
click: [process: FullProcessInstanceDtoReadable]
|
|
70
|
+
}>()
|
|
71
|
+
|
|
72
|
+
const route = useRoute()
|
|
73
|
+
const { t } = useI18n()
|
|
74
|
+
const toast = useToast()
|
|
75
|
+
const confirm = useConfirm()
|
|
76
|
+
const { deleteProcessInstance, isDeleting } = useDeleteProcessInstance()
|
|
77
|
+
|
|
78
|
+
const isActive = computed(() => {
|
|
79
|
+
return route.params.process_id === props.process.process_id && route.params.process_class === props.process.process_class
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
function confirmDelete() {
|
|
83
|
+
confirm.require({
|
|
84
|
+
message: t('process.delete.confirmMessage'),
|
|
85
|
+
header: t('process.delete.title'),
|
|
86
|
+
icon: 'pi pi-exclamation-triangle',
|
|
87
|
+
rejectLabel: t('process.create.cancel'),
|
|
88
|
+
acceptLabel: t('process.delete.button'),
|
|
89
|
+
acceptClass: 'p-button-danger',
|
|
90
|
+
accept: handleDelete,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function handleDelete() {
|
|
95
|
+
try {
|
|
96
|
+
await deleteProcessInstance({
|
|
97
|
+
processClass: props.process.process_class,
|
|
98
|
+
processId: props.process.process_id,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
toast.add({
|
|
102
|
+
severity: 'success',
|
|
103
|
+
summary: t('process.delete.success'),
|
|
104
|
+
life: 3000,
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
emit('deleted', props.process.process_class, props.process.process_id)
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error('Failed to delete process:', error)
|
|
111
|
+
toast.add({
|
|
112
|
+
severity: 'error',
|
|
113
|
+
summary: t('process.delete.error'),
|
|
114
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
115
|
+
life: 5000,
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FormKitDynamicConfiguration
|
|
3
|
+
:form="form"
|
|
4
|
+
:initial-data="initialData"
|
|
5
|
+
@submit="emit('submit', $event)"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { FormkitElement } from '@core/sdk/client'
|
|
11
|
+
|
|
12
|
+
defineProps<{
|
|
13
|
+
form: FormkitElement[]
|
|
14
|
+
initialData?: Record<string, unknown>
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits<{
|
|
18
|
+
submit: [Record<string, unknown>]
|
|
19
|
+
}>()
|
|
20
|
+
</script>
|