@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,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex min-h-screen w-full flex-row bg-white dark:bg-surface-900">
|
|
3
|
+
<div class="fixed flex h-screen w-[50px] flex-col items-center justify-between bg-surface-50 dark:bg-surface-950">
|
|
4
|
+
<div class="flex h-[50px] w-full items-center justify-center">
|
|
5
|
+
<ServiceSelection />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="flex flex-col justify-center gap-2">
|
|
8
|
+
<NuxtLink
|
|
9
|
+
v-for="app in nonAdminApps"
|
|
10
|
+
:key="app.path"
|
|
11
|
+
:to="app.path === '/' ? tenantPath('/') : tenantPath(app.path)"
|
|
12
|
+
class="flex h-[50px] w-full items-center justify-center"
|
|
13
|
+
>
|
|
14
|
+
<Button
|
|
15
|
+
v-tooltip="{ value: app.label, showDelay: 0 }"
|
|
16
|
+
rounded
|
|
17
|
+
:aria-label="app.label"
|
|
18
|
+
:variant="appIsActive(app) ? undefined : 'text'"
|
|
19
|
+
size="large"
|
|
20
|
+
>
|
|
21
|
+
<Icon
|
|
22
|
+
:name="app.icon"
|
|
23
|
+
class="h-[1.7rem] w-[1.2rem]"
|
|
24
|
+
/>
|
|
25
|
+
</Button>
|
|
26
|
+
</NuxtLink>
|
|
27
|
+
</div>
|
|
28
|
+
<div>
|
|
29
|
+
<UserSettings />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="w-full pl-[50px]">
|
|
33
|
+
<div class="fixed z-50 flex h-[50px] w-full items-center justify-between bg-surface-50 pr-[50px] dark:bg-surface-950">
|
|
34
|
+
<Breadcrumb
|
|
35
|
+
class="!bg-transparent text-xs opacity-70"
|
|
36
|
+
:home="apps[0]"
|
|
37
|
+
:model="breadcrumbItems"
|
|
38
|
+
>
|
|
39
|
+
<template #item="{ item }">
|
|
40
|
+
<NuxtLink
|
|
41
|
+
:to="item.route"
|
|
42
|
+
class="hover:underline"
|
|
43
|
+
>
|
|
44
|
+
{{ item.label }}
|
|
45
|
+
</NuxtLink>
|
|
46
|
+
</template>
|
|
47
|
+
</Breadcrumb>
|
|
48
|
+
<img
|
|
49
|
+
:src="logo"
|
|
50
|
+
alt="AI Hub"
|
|
51
|
+
class="h-[25px]"
|
|
52
|
+
>
|
|
53
|
+
<div class="flex h-full items-center overflow-hidden">
|
|
54
|
+
<UserBar />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="h-[50px] w-full" />
|
|
58
|
+
<div v-if="online">
|
|
59
|
+
<slot />
|
|
60
|
+
</div>
|
|
61
|
+
<div
|
|
62
|
+
v-else
|
|
63
|
+
class="flex h-screen w-full items-center justify-center"
|
|
64
|
+
>
|
|
65
|
+
<AppLoader />
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import logo from '@core/assets/images/logo.png'
|
|
73
|
+
import { getHealth } from '@core/sdk/client'
|
|
74
|
+
|
|
75
|
+
import type { MenuItem } from 'primevue/menuitem'
|
|
76
|
+
|
|
77
|
+
const route = useRoute()
|
|
78
|
+
const tenantPath = useTenantPath()
|
|
79
|
+
|
|
80
|
+
const online = ref<boolean>(false)
|
|
81
|
+
|
|
82
|
+
const { apps } = useApps()
|
|
83
|
+
|
|
84
|
+
const nonAdminApps = computed<MenuItem>(() => {
|
|
85
|
+
return apps.value.filter((app: MenuItem) => !app.isAdmin)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const appIsActive = (app: MenuItem) => {
|
|
89
|
+
const resolvedPath = app.path === '/' ? tenantPath('/') : tenantPath(app.path)
|
|
90
|
+
if (app.path === '/') {
|
|
91
|
+
return route.path === resolvedPath
|
|
92
|
+
}
|
|
93
|
+
return route.path.startsWith(resolvedPath)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const breadcrumbItems = computed(() => {
|
|
97
|
+
const segments = route.path.split('/').filter(Boolean)
|
|
98
|
+
const prefixSegments = segments.slice(0, 2)
|
|
99
|
+
const contentSegments = segments.slice(2)
|
|
100
|
+
return contentSegments.map((label: string, index: number) => ({
|
|
101
|
+
label,
|
|
102
|
+
route: '/' + [...prefixSegments, ...contentSegments.slice(0, index + 1)].join('/'),
|
|
103
|
+
}))
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const response = await getHealth({
|
|
108
|
+
composable: '$fetch',
|
|
109
|
+
baseURL: '/api/v1',
|
|
110
|
+
})
|
|
111
|
+
online.value = response.code == 200
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
online.value = false
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the last tenant synced with the backend to avoid redundant PUT calls
|
|
3
|
+
* on every navigation within the same tenant.
|
|
4
|
+
*/
|
|
5
|
+
let lastSyncedTenant: string | null = null
|
|
6
|
+
|
|
7
|
+
const REDIRECT_KEY = 'aihub_redirect_after_login'
|
|
8
|
+
|
|
9
|
+
export default defineNuxtRouteMiddleware(async (to) => {
|
|
10
|
+
const { $auth, $i18n } = useNuxtApp()
|
|
11
|
+
const locale = $i18n.locale.value
|
|
12
|
+
|
|
13
|
+
const noAuthPaths = [
|
|
14
|
+
`/${locale}/auth/login`,
|
|
15
|
+
`/${locale}/auth/callback`,
|
|
16
|
+
`/${locale}/auth/renew`,
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
// No auth check for public paths (normalize trailing slashes on both sides)
|
|
20
|
+
const normalize = (p: string) => (p.endsWith('/') ? p.slice(0, -1) : p)
|
|
21
|
+
const normalizedPath = normalize(to.path)
|
|
22
|
+
if (noAuthPaths.some(p => normalize(p) === normalizedPath)) {
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const user = await $auth.getUser()
|
|
28
|
+
|
|
29
|
+
const isAuthPath = to.path.includes('/auth/')
|
|
30
|
+
|
|
31
|
+
if (!user) {
|
|
32
|
+
if (import.meta.client && to.fullPath !== '/' && !isAuthPath) {
|
|
33
|
+
sessionStorage.setItem(REDIRECT_KEY, to.fullPath)
|
|
34
|
+
}
|
|
35
|
+
return navigateTo(`/${locale}/auth/login`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (user.expired) {
|
|
39
|
+
try {
|
|
40
|
+
await $auth.signinSilent()
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
if (import.meta.client && to.fullPath !== '/' && !isAuthPath) {
|
|
44
|
+
sessionStorage.setItem(REDIRECT_KEY, to.fullPath)
|
|
45
|
+
}
|
|
46
|
+
return navigateTo(`/${locale}/auth/login`)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Tenant sync: track which tenant the frontend is operating in
|
|
51
|
+
const urlTenant = to.params.tenant as string | undefined
|
|
52
|
+
if (urlTenant && urlTenant !== lastSyncedTenant) {
|
|
53
|
+
lastSyncedTenant = urlTenant
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error('Error in auth middleware:', error)
|
|
60
|
+
return navigateTo(`/${locale}/auth/login`)
|
|
61
|
+
}
|
|
62
|
+
})
|
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
4
|
+
|
|
5
|
+
export const wrappedPrimeInputs: string[] = [
|
|
6
|
+
'AutoComplete',
|
|
7
|
+
'CascadeSelect',
|
|
8
|
+
'Checkbox',
|
|
9
|
+
'Chip',
|
|
10
|
+
'ColorPicker',
|
|
11
|
+
'DatePicker',
|
|
12
|
+
'Editor',
|
|
13
|
+
'InputMask',
|
|
14
|
+
'InputNumber',
|
|
15
|
+
'InputOtp',
|
|
16
|
+
'InputText',
|
|
17
|
+
'Knob',
|
|
18
|
+
'Listbox',
|
|
19
|
+
'MultiSelect',
|
|
20
|
+
'Password',
|
|
21
|
+
'RadioButton',
|
|
22
|
+
'Rating',
|
|
23
|
+
'Select',
|
|
24
|
+
'SelectButton',
|
|
25
|
+
'Slider',
|
|
26
|
+
'Textarea',
|
|
27
|
+
'ToggleButton',
|
|
28
|
+
'ToggleSwitch',
|
|
29
|
+
'TreeSelect',
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
export default defineNuxtConfig({
|
|
33
|
+
modules: [
|
|
34
|
+
'@vueuse/nuxt',
|
|
35
|
+
'@pinia/nuxt',
|
|
36
|
+
'@vee-validate/nuxt',
|
|
37
|
+
'@nuxtjs/tailwindcss',
|
|
38
|
+
'@nuxtjs/i18n',
|
|
39
|
+
'@nuxt/icon',
|
|
40
|
+
'@nuxt/fonts',
|
|
41
|
+
'@nuxtjs/robots',
|
|
42
|
+
'@pinia/colada-nuxt',
|
|
43
|
+
'@primevue/nuxt-module',
|
|
44
|
+
'@nuxtjs/mdc',
|
|
45
|
+
'@sfxcode/formkit-primevue-nuxt',
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
ssr: false,
|
|
49
|
+
|
|
50
|
+
imports: {
|
|
51
|
+
dirs: [
|
|
52
|
+
'composables',
|
|
53
|
+
'composables/**',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
app: {
|
|
58
|
+
head: {
|
|
59
|
+
// Runtime config for the static SPA. nginx envsubst's config.template.js
|
|
60
|
+
// into /config.js at container start; this classic <script> in <head>
|
|
61
|
+
// runs synchronously before Nuxt's deferred module entry, so
|
|
62
|
+
// window.__AIHUB_CONFIG__ exists before any plugin (see
|
|
63
|
+
// plugins/0.runtime-config.client.ts). Inherited by layer extenders.
|
|
64
|
+
// Build-time gated: dev has no nginx and no /config.js, so omit the tag
|
|
65
|
+
// (avoids a dev 404). Container images are always built with ENV != dev.
|
|
66
|
+
script: process.env.ENV === 'dev'
|
|
67
|
+
? []
|
|
68
|
+
: [{ src: '/config.js', tagPosition: 'head' as const }],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
css: [
|
|
73
|
+
fileURLToPath(new URL('./assets/css/main.css', import.meta.url)),
|
|
74
|
+
],
|
|
75
|
+
|
|
76
|
+
mdc: {
|
|
77
|
+
components: {
|
|
78
|
+
prose: false,
|
|
79
|
+
map: {
|
|
80
|
+
img: 'ResolveImageComponent',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
alias: {
|
|
86
|
+
'@core': fileURLToPath(new URL('./', import.meta.url)),
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
compatibilityDate: '2025-01-18',
|
|
90
|
+
|
|
91
|
+
formkit: {
|
|
92
|
+
configFile: fileURLToPath(new URL('./formkit.config', import.meta.url)),
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
formkitPrimevue: {
|
|
96
|
+
includePrimeIcons: true,
|
|
97
|
+
includeStyles: true,
|
|
98
|
+
installFormKit: true,
|
|
99
|
+
installI18N: true,
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
i18n: {
|
|
103
|
+
strategy: 'prefix',
|
|
104
|
+
detectBrowserLanguage: {
|
|
105
|
+
useCookie: true,
|
|
106
|
+
cookieKey: 'i18n_redirected',
|
|
107
|
+
redirectOn: 'root',
|
|
108
|
+
},
|
|
109
|
+
locales: [
|
|
110
|
+
{
|
|
111
|
+
code: 'en',
|
|
112
|
+
file: 'en.yaml',
|
|
113
|
+
name: 'English',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
code: 'de',
|
|
117
|
+
file: 'de.yaml',
|
|
118
|
+
name: 'Deutsch',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
code: 'it',
|
|
122
|
+
file: 'it.yaml',
|
|
123
|
+
name: 'Italiano',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
code: 'fr',
|
|
127
|
+
file: 'fr.yaml',
|
|
128
|
+
name: 'Français',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
lazy: true,
|
|
132
|
+
defaultLocale: 'en',
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
primevue: {
|
|
136
|
+
autoImport: true,
|
|
137
|
+
components: {
|
|
138
|
+
exclude: [...wrappedPrimeInputs, 'Button', 'Form', 'FormField', 'Chart'],
|
|
139
|
+
},
|
|
140
|
+
importTheme: {
|
|
141
|
+
from: fileURLToPath(new URL('./themes/aihub-theme.ts', import.meta.url)),
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@swiss-ai-hub/web",
|
|
3
|
+
"license": "AGPL-3.0-or-later",
|
|
4
|
+
"author": "bbv Software Services AG (https://www.bbv.ch)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"version": "0.290.11",
|
|
7
|
+
"description": "Swiss AI Hub - Admin & Management UI (Nuxt 3 layer)",
|
|
8
|
+
"main": "./nuxt.config.ts",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/bbvch-ai/aihub-core.git",
|
|
12
|
+
"directory": "packages/web"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"app.config.ts",
|
|
19
|
+
"app.vue",
|
|
20
|
+
"formkit.config.ts",
|
|
21
|
+
"nuxt.config.ts",
|
|
22
|
+
"tailwind.config.mjs",
|
|
23
|
+
"assets/",
|
|
24
|
+
"components/",
|
|
25
|
+
"composables/",
|
|
26
|
+
"i18n/",
|
|
27
|
+
"layouts/",
|
|
28
|
+
"middleware/",
|
|
29
|
+
"pages/",
|
|
30
|
+
"plugins/",
|
|
31
|
+
"sdk/",
|
|
32
|
+
"themes/",
|
|
33
|
+
"types/"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "nuxi prepare && nuxi dev .app --port 3333 --dotenv ../../../.env",
|
|
37
|
+
"dev:prepare": "nuxi prepare && nuxt prepare .app",
|
|
38
|
+
"build": "nuxt generate .app",
|
|
39
|
+
"preview": "nuxt preview .app",
|
|
40
|
+
"lint": "(test -f .app/.nuxt/eslint.config.mjs || nuxi prepare .app) && eslint . --fix",
|
|
41
|
+
"generate-sdk": "openapi-ts"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@formkit/i18n": "^1.7.2",
|
|
45
|
+
"@formkit/nuxt": "^2.0.0",
|
|
46
|
+
"@hey-api/nuxt": "^0.2.1",
|
|
47
|
+
"@nuxt/fonts": "^0.14.0",
|
|
48
|
+
"@nuxt/icon": "^1.15.0",
|
|
49
|
+
"@nuxtjs/i18n": "10.3.0",
|
|
50
|
+
"@nuxtjs/mdc": "^0.22.0",
|
|
51
|
+
"@nuxtjs/robots": "^6.0.8",
|
|
52
|
+
"@nuxtjs/tailwindcss": "^6.14.0",
|
|
53
|
+
"@pinia/colada": "^1.3.0",
|
|
54
|
+
"@pinia/colada-nuxt": "^1.0.1",
|
|
55
|
+
"@pinia/nuxt": "^0.11.3",
|
|
56
|
+
"@primeuix/themes": "1.2.5",
|
|
57
|
+
"@primevue/forms": "4.5.5",
|
|
58
|
+
"@primevue/nuxt-module": "4.5.5",
|
|
59
|
+
"@sfxcode/formkit-primevue": "4.0.0",
|
|
60
|
+
"@sfxcode/formkit-primevue-nuxt": "^1.7.0",
|
|
61
|
+
"@sigma/edge-curve": "^3.1.0",
|
|
62
|
+
"@vee-validate/nuxt": "^4.15.1",
|
|
63
|
+
"@vue-flow/background": "^1.3.2",
|
|
64
|
+
"@vue-flow/controls": "^1.1.3",
|
|
65
|
+
"@vue-flow/core": "^1.48.2",
|
|
66
|
+
"@vue-flow/minimap": "^1.5.4",
|
|
67
|
+
"@vueuse/integrations": "^13.9.0",
|
|
68
|
+
"@vueuse/math": "^13.9.0",
|
|
69
|
+
"@vueuse/nuxt": "^13.9.0",
|
|
70
|
+
"@vueuse/router": "^13.9.0",
|
|
71
|
+
"apexcharts": "^4.7.0",
|
|
72
|
+
"change-case": "^5.4.4",
|
|
73
|
+
"class-variance-authority": "^0.7.1",
|
|
74
|
+
"clsx": "^2.1.1",
|
|
75
|
+
"date-fns": "^4.1.0",
|
|
76
|
+
"graphology": "^0.26.0",
|
|
77
|
+
"graphology-layout-forceatlas2": "^0.10.1",
|
|
78
|
+
"gridstack": "^12.6.0",
|
|
79
|
+
"lodash-es": "^4.18.1",
|
|
80
|
+
"lucide-vue-next": "^0.577.0",
|
|
81
|
+
"oidc-client-ts": "^3.5.0",
|
|
82
|
+
"pinia": "^3.0.4",
|
|
83
|
+
"primeicons": "^7.0.0",
|
|
84
|
+
"quill": "^2.0.3",
|
|
85
|
+
"radix-vue": "^1.9.17",
|
|
86
|
+
"sigma": "^3.0.3",
|
|
87
|
+
"socket.io-client": "^4.8.3",
|
|
88
|
+
"tailwind-merge": "^3.6.0",
|
|
89
|
+
"tailwindcss-animate": "^1.0.7",
|
|
90
|
+
"tailwindcss-primeui": "^0.6.1",
|
|
91
|
+
"uuid": "^11.1.1",
|
|
92
|
+
"vue3-apexcharts": "^1.11.1"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@eslint/js": "^9.39.4",
|
|
96
|
+
"@hey-api/openapi-ts": "^0.97.1",
|
|
97
|
+
"@intlify/message-compiler": "^11.4.2",
|
|
98
|
+
"@nuxt/eslint": "^1.15.2",
|
|
99
|
+
"@types/lodash-es": "^4.17.12",
|
|
100
|
+
"@types/node": "^22.19.19",
|
|
101
|
+
"eslint": "^9.39.4",
|
|
102
|
+
"eslint-plugin-import": "^2.32.0",
|
|
103
|
+
"eslint-plugin-sonarjs": "^4.0.3",
|
|
104
|
+
"eslint-plugin-tailwindcss": "^3.18.3",
|
|
105
|
+
"nuxt": "3.21.0",
|
|
106
|
+
"tailwindcss": "^3.4.19",
|
|
107
|
+
"typescript": "^5.9.3",
|
|
108
|
+
"typescript-eslint": "^8.59.3"
|
|
109
|
+
},
|
|
110
|
+
"peerDependencies": {
|
|
111
|
+
"primevue": "4.5.5",
|
|
112
|
+
"vue": "3.5.17"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="isAgentAdmin">
|
|
3
|
+
<h1 class="w-full pb-32 pt-72 text-center text-6xl">
|
|
4
|
+
{{ t('welcome') }}
|
|
5
|
+
</h1>
|
|
6
|
+
<DashboardGrid />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const { t } = useI18n()
|
|
12
|
+
const { myUser, myUserIsLoading } = useMyUser()
|
|
13
|
+
const tenantPath = useTenantPath()
|
|
14
|
+
|
|
15
|
+
const ACCESS_LEVEL_ADMIN = 2
|
|
16
|
+
|
|
17
|
+
const isAgentAdmin = computed(() => {
|
|
18
|
+
const agents = myUser.value?.access?.agents ?? []
|
|
19
|
+
return agents.some(agent => agent.level === ACCESS_LEVEL_ADMIN)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
watch(
|
|
23
|
+
[myUserIsLoading, isAgentAdmin],
|
|
24
|
+
([isLoading, isAdmin]) => {
|
|
25
|
+
if (!isLoading && !isAdmin) {
|
|
26
|
+
navigateTo(tenantPath('/service/openai'), { replace: true })
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true },
|
|
30
|
+
)
|
|
31
|
+
</script>
|