@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,203 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog
|
|
3
|
+
:visible="modelValue"
|
|
4
|
+
modal
|
|
5
|
+
:header="t('knowledge.form.create.title')"
|
|
6
|
+
:style="{ width: '35rem' }"
|
|
7
|
+
@update:visible="emit('update:modelValue', $event)"
|
|
8
|
+
@hide="resetForm"
|
|
9
|
+
>
|
|
10
|
+
<div class="flex flex-col gap-4">
|
|
11
|
+
<div class="flex flex-col gap-2">
|
|
12
|
+
<label
|
|
13
|
+
for="namespace-database-select"
|
|
14
|
+
class="text-sm font-medium"
|
|
15
|
+
>
|
|
16
|
+
{{ t('knowledge.form.database.label') }}
|
|
17
|
+
<span class="ml-1 text-xs text-red-500">*</span>
|
|
18
|
+
</label>
|
|
19
|
+
<Dropdown
|
|
20
|
+
v-model="selectedDatabase"
|
|
21
|
+
input-id="namespace-database-select"
|
|
22
|
+
:options="databaseOptions"
|
|
23
|
+
option-label="displayName"
|
|
24
|
+
option-value="name"
|
|
25
|
+
:placeholder="t('knowledge.form.database.placeholder')"
|
|
26
|
+
:class="{ 'p-invalid': error }"
|
|
27
|
+
:disabled="isCreating"
|
|
28
|
+
class="w-full"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="flex flex-col gap-2">
|
|
33
|
+
<label
|
|
34
|
+
for="namespace-name-input"
|
|
35
|
+
class="text-sm font-medium"
|
|
36
|
+
>
|
|
37
|
+
{{ t('knowledge.form.folder_name.label') }}
|
|
38
|
+
<span class="ml-1 text-xs text-red-500">*</span>
|
|
39
|
+
</label>
|
|
40
|
+
<InputText
|
|
41
|
+
v-model="name"
|
|
42
|
+
input-id="namespace-name-input"
|
|
43
|
+
:placeholder="t('knowledge.form.folder_name.placeholder')"
|
|
44
|
+
:class="{ 'p-invalid': error || nameValidationError }"
|
|
45
|
+
:disabled="isCreating"
|
|
46
|
+
/>
|
|
47
|
+
<small
|
|
48
|
+
v-if="nameValidationError"
|
|
49
|
+
class="text-red-500"
|
|
50
|
+
>{{ nameValidationError }}</small>
|
|
51
|
+
<small
|
|
52
|
+
v-else
|
|
53
|
+
class="text-gray-500"
|
|
54
|
+
>{{ t('knowledge.form.folder_name.help') }}</small>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="flex flex-col gap-2">
|
|
58
|
+
<label
|
|
59
|
+
for="namespace-display-name-input"
|
|
60
|
+
class="text-sm font-medium"
|
|
61
|
+
>
|
|
62
|
+
{{ t('knowledge.form.display_name.label') }}
|
|
63
|
+
<span class="ml-1 text-xs text-gray-400">(optional)</span>
|
|
64
|
+
</label>
|
|
65
|
+
<InputText
|
|
66
|
+
v-model="displayName"
|
|
67
|
+
input-id="namespace-display-name-input"
|
|
68
|
+
:placeholder="t('knowledge.form.display_name.placeholder')"
|
|
69
|
+
:disabled="isCreating"
|
|
70
|
+
/>
|
|
71
|
+
<small class="text-gray-500">{{ t('knowledge.form.display_name.help') }}</small>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="flex flex-col gap-2">
|
|
75
|
+
<label
|
|
76
|
+
for="namespace-description-textarea"
|
|
77
|
+
class="text-sm font-medium"
|
|
78
|
+
>
|
|
79
|
+
{{ t('knowledge.form.description.label') }}
|
|
80
|
+
<span class="ml-1 text-xs text-gray-400">(optional)</span>
|
|
81
|
+
</label>
|
|
82
|
+
<Textarea
|
|
83
|
+
v-model="description"
|
|
84
|
+
input-id="namespace-description-textarea"
|
|
85
|
+
:placeholder="t('knowledge.form.description.placeholder')"
|
|
86
|
+
:disabled="isCreating"
|
|
87
|
+
rows="3"
|
|
88
|
+
/>
|
|
89
|
+
<small class="text-gray-500">{{ t('knowledge.form.description.help') }}</small>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<small
|
|
93
|
+
v-if="error"
|
|
94
|
+
class="text-red-500"
|
|
95
|
+
>{{ error }}</small>
|
|
96
|
+
</div>
|
|
97
|
+
<template #footer>
|
|
98
|
+
<div class="flex justify-end gap-2">
|
|
99
|
+
<Button
|
|
100
|
+
:label="t('knowledge.actions.cancel')"
|
|
101
|
+
severity="secondary"
|
|
102
|
+
outlined
|
|
103
|
+
@click="closeModal"
|
|
104
|
+
/>
|
|
105
|
+
<Button
|
|
106
|
+
:label="t('knowledge.actions.create')"
|
|
107
|
+
:disabled="!canSubmit"
|
|
108
|
+
:loading="isCreating"
|
|
109
|
+
@click="handleCreate"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
</Dialog>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<script setup lang="ts">
|
|
117
|
+
import { useChangeCase } from '@vueuse/integrations/useChangeCase'
|
|
118
|
+
|
|
119
|
+
import type { CreateNamespaceRequest, DatabaseDto } from '@core/sdk/client'
|
|
120
|
+
|
|
121
|
+
const { t } = useI18n()
|
|
122
|
+
|
|
123
|
+
const props = defineProps<{
|
|
124
|
+
modelValue: boolean
|
|
125
|
+
databases: DatabaseDto[]
|
|
126
|
+
initialDatabase?: string
|
|
127
|
+
}>()
|
|
128
|
+
|
|
129
|
+
const emit = defineEmits<{
|
|
130
|
+
'update:modelValue': [value: boolean]
|
|
131
|
+
'success': [data: { database: string, namespace: string }]
|
|
132
|
+
}>()
|
|
133
|
+
|
|
134
|
+
const { mutateAsync: createNamespace } = useCreateNamespace()
|
|
135
|
+
const { tenantId } = useTenant()
|
|
136
|
+
|
|
137
|
+
const selectedDatabase = ref('')
|
|
138
|
+
const name = ref('')
|
|
139
|
+
const displayName = ref('')
|
|
140
|
+
const description = ref('')
|
|
141
|
+
const error = ref('')
|
|
142
|
+
const isCreating = ref(false)
|
|
143
|
+
|
|
144
|
+
const databaseOptions = computed(() =>
|
|
145
|
+
(props.databases || [])
|
|
146
|
+
.filter(db => !db.auto_sync)
|
|
147
|
+
.map(db => ({
|
|
148
|
+
name: db.name,
|
|
149
|
+
displayName: useChangeCase(db.name, 'capitalCase'),
|
|
150
|
+
})),
|
|
151
|
+
)
|
|
152
|
+
const nameValidationError = computed(() => {
|
|
153
|
+
if (!name.value.trim()) return ''
|
|
154
|
+
|
|
155
|
+
const namePattern = /^[a-zA-Z0-9_-]+$/
|
|
156
|
+
if (!namePattern.test(name.value)) {
|
|
157
|
+
return t('knowledge.form.folder_name.validation_error')
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return ''
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
const canSubmit = computed(() => selectedDatabase.value.trim() && name.value.trim() && !nameValidationError.value && !isCreating.value)
|
|
164
|
+
|
|
165
|
+
const closeModal = () => {
|
|
166
|
+
emit('update:modelValue', false)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const resetForm = () => {
|
|
170
|
+
selectedDatabase.value = ''
|
|
171
|
+
name.value = ''
|
|
172
|
+
displayName.value = ''
|
|
173
|
+
description.value = ''
|
|
174
|
+
error.value = ''
|
|
175
|
+
isCreating.value = false
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const handleCreate = async () => {
|
|
179
|
+
if (!canSubmit.value) return
|
|
180
|
+
|
|
181
|
+
isCreating.value = true
|
|
182
|
+
error.value = ''
|
|
183
|
+
|
|
184
|
+
const requestBody: CreateNamespaceRequest & { database: string, namespace: string, tenantId: string } = {
|
|
185
|
+
database: selectedDatabase.value,
|
|
186
|
+
namespace: name.value,
|
|
187
|
+
folder_name: name.value,
|
|
188
|
+
display_name: displayName.value,
|
|
189
|
+
description: description.value,
|
|
190
|
+
tenantId: tenantId.value!,
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
await createNamespace(requestBody)
|
|
194
|
+
emit('success', { database: selectedDatabase.value, namespace: name.value })
|
|
195
|
+
closeModal()
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
watch(() => props.modelValue, (isVisible) => {
|
|
199
|
+
if (isVisible) {
|
|
200
|
+
selectedDatabase.value = props.initialDatabase || ''
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
</script>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog
|
|
3
|
+
:visible="modelValue"
|
|
4
|
+
modal
|
|
5
|
+
:header="t('knowledge.form.edit.title')"
|
|
6
|
+
:style="{ width: '35rem' }"
|
|
7
|
+
@update:visible="emit('update:modelValue', $event)"
|
|
8
|
+
>
|
|
9
|
+
<div class="flex flex-col gap-4">
|
|
10
|
+
<div class="flex flex-col gap-2">
|
|
11
|
+
<p class="text-sm font-medium">
|
|
12
|
+
{{ t('knowledge.form.folder_name.label') }}
|
|
13
|
+
</p>
|
|
14
|
+
<InputText
|
|
15
|
+
:value="namespace?.name || ''"
|
|
16
|
+
disabled
|
|
17
|
+
class="bg-surface-100 dark:bg-surface-800"
|
|
18
|
+
/>
|
|
19
|
+
<small class="text-gray-500">{{ t('knowledge.form.folder_name.edit_help') }}</small>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="flex flex-col gap-2">
|
|
23
|
+
<label
|
|
24
|
+
for="edit-namespace-display-name-input"
|
|
25
|
+
class="text-sm font-medium"
|
|
26
|
+
>
|
|
27
|
+
{{ t('knowledge.form.display_name.label') }}
|
|
28
|
+
<span class="ml-1 text-xs text-gray-400">(optional)</span>
|
|
29
|
+
</label>
|
|
30
|
+
<InputText
|
|
31
|
+
v-model="displayName"
|
|
32
|
+
input-id="edit-namespace-display-name-input"
|
|
33
|
+
:placeholder="t('knowledge.form.display_name.placeholder')"
|
|
34
|
+
/>
|
|
35
|
+
<small class="text-gray-500">{{ t('knowledge.form.display_name.help') }}</small>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="flex flex-col gap-2">
|
|
39
|
+
<label
|
|
40
|
+
for="edit-namespace-description-textarea"
|
|
41
|
+
class="text-sm font-medium"
|
|
42
|
+
>
|
|
43
|
+
{{ t('knowledge.form.description.label') }}
|
|
44
|
+
<span class="ml-1 text-xs text-gray-400">(optional)</span>
|
|
45
|
+
</label>
|
|
46
|
+
<Textarea
|
|
47
|
+
v-model="description"
|
|
48
|
+
input-id="edit-namespace-description-textarea"
|
|
49
|
+
:placeholder="t('knowledge.form.description.placeholder')"
|
|
50
|
+
rows="3"
|
|
51
|
+
/>
|
|
52
|
+
<small class="text-gray-500">{{ t('knowledge.form.description.help') }}</small>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<small
|
|
56
|
+
v-if="error"
|
|
57
|
+
class="text-red-500"
|
|
58
|
+
>{{ error }}</small>
|
|
59
|
+
</div>
|
|
60
|
+
<template #footer>
|
|
61
|
+
<div class="flex justify-end gap-2">
|
|
62
|
+
<Button
|
|
63
|
+
:label="t('knowledge.actions.cancel')"
|
|
64
|
+
severity="secondary"
|
|
65
|
+
outlined
|
|
66
|
+
@click="closeModal"
|
|
67
|
+
/>
|
|
68
|
+
<Button
|
|
69
|
+
:label="t('knowledge.actions.save')"
|
|
70
|
+
@click="handleSave"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
</Dialog>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import type { NamespaceDto, UpdateNamespaceRequest } from '@core/sdk/client'
|
|
79
|
+
|
|
80
|
+
import { useI18n } from '#i18n'
|
|
81
|
+
|
|
82
|
+
const props = defineProps<{
|
|
83
|
+
modelValue: boolean
|
|
84
|
+
namespace: NamespaceDto | null
|
|
85
|
+
}>()
|
|
86
|
+
|
|
87
|
+
const emit = defineEmits<{
|
|
88
|
+
'update:modelValue': [value: boolean]
|
|
89
|
+
'success': []
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const { t } = useI18n()
|
|
93
|
+
const { mutateAsync: updateNamespace } = useUpdateNamespace()
|
|
94
|
+
const { tenantId } = useTenant()
|
|
95
|
+
|
|
96
|
+
const displayName = ref('')
|
|
97
|
+
const description = ref('')
|
|
98
|
+
const error = ref('')
|
|
99
|
+
|
|
100
|
+
const closeModal = () => {
|
|
101
|
+
emit('update:modelValue', false)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const handleSave = async () => {
|
|
105
|
+
if (!props.namespace) return
|
|
106
|
+
|
|
107
|
+
error.value = ''
|
|
108
|
+
|
|
109
|
+
const namespaceId = props.namespace.id
|
|
110
|
+
const databaseId = props.namespace.database_id
|
|
111
|
+
const updatePayload: UpdateNamespaceRequest = {
|
|
112
|
+
display_name: displayName.value || props.namespace.name,
|
|
113
|
+
description: description.value || null,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
await updateNamespace({
|
|
117
|
+
namespace: namespaceId,
|
|
118
|
+
database: databaseId,
|
|
119
|
+
payload: ref(updatePayload),
|
|
120
|
+
tenantId: tenantId.value!,
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
emit('success')
|
|
124
|
+
closeModal()
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
watch(() => props.namespace, (newNamespace) => {
|
|
128
|
+
if (newNamespace) {
|
|
129
|
+
displayName.value = newNamespace.display_name || newNamespace.name
|
|
130
|
+
description.value = newNamespace.description || ''
|
|
131
|
+
error.value = ''
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
</script>
|
|
@@ -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-folder-plus 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('knowledge.add_folder.title') }}
|
|
17
|
+
</h3>
|
|
18
|
+
<p class="text-sm text-surface-500 dark:text-surface-400">
|
|
19
|
+
{{ t('knowledge.add_folder.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,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="group relative rounded-lg border border-surface-200 bg-white p-4 dark:border-surface-700 dark:bg-surface-800"
|
|
4
|
+
:class="{ 'opacity-50': !active }"
|
|
5
|
+
>
|
|
6
|
+
<Tag
|
|
7
|
+
v-if="node.score"
|
|
8
|
+
v-tooltip="scoreText"
|
|
9
|
+
class="absolute right-1 top-1 hidden text-xs group-hover:block"
|
|
10
|
+
:class="{ '!block': alwaysShowScore }"
|
|
11
|
+
|
|
12
|
+
:value="scoreRank"
|
|
13
|
+
:severity="scoreColor"
|
|
14
|
+
/>
|
|
15
|
+
<MarkdownRenderer
|
|
16
|
+
:md="node.content"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import type { IngestedNode } from '@core/sdk/client'
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<{
|
|
25
|
+
node: IngestedNode
|
|
26
|
+
alwaysShowScore?: boolean
|
|
27
|
+
active?: boolean
|
|
28
|
+
}>(), {
|
|
29
|
+
alwaysShowScore: false,
|
|
30
|
+
active: true,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const scoreColor = computed<string>(() => {
|
|
34
|
+
const score = props.node.score
|
|
35
|
+
if (!score) return ''
|
|
36
|
+
if (score <= 0.5) {
|
|
37
|
+
return 'danger'
|
|
38
|
+
}
|
|
39
|
+
if (score <= 0.85) {
|
|
40
|
+
return 'warn'
|
|
41
|
+
}
|
|
42
|
+
return 'success'
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const scoreText = computed<string>(() => {
|
|
46
|
+
const score = props.node.score
|
|
47
|
+
if (!score) return ''
|
|
48
|
+
return `Relevance: ${Math.round(score * 100)}%`
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const scoreRank = computed<string>(() => {
|
|
52
|
+
const score = props.node.score
|
|
53
|
+
if (!score) return ''
|
|
54
|
+
if (score <= 0.5) {
|
|
55
|
+
return 'D'
|
|
56
|
+
}
|
|
57
|
+
if (score <= 0.75) {
|
|
58
|
+
return 'C'
|
|
59
|
+
}
|
|
60
|
+
if (score <= 0.85) {
|
|
61
|
+
return 'B'
|
|
62
|
+
}
|
|
63
|
+
if (score <= 0.90) {
|
|
64
|
+
return 'A'
|
|
65
|
+
}
|
|
66
|
+
if (score <= 0.95) {
|
|
67
|
+
return 'A+'
|
|
68
|
+
}
|
|
69
|
+
return 'A++'
|
|
70
|
+
})
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="content overflow-x-auto">
|
|
3
|
+
<MDC
|
|
4
|
+
:value="md"
|
|
5
|
+
:tag="false"
|
|
6
|
+
/>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
defineProps<{
|
|
12
|
+
md: string
|
|
13
|
+
}>()
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.content {
|
|
18
|
+
@apply font-light text-xs
|
|
19
|
+
}
|
|
20
|
+
.content :deep(h1) {
|
|
21
|
+
@apply my-8 text-xl font-bold before:content-['#'] before:pr-1 before:text-gray-400;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.content :deep(h2) {
|
|
25
|
+
@apply mt-12 text-lg font-bold before:content-['##'] before:pr-1 before:text-gray-400;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.content :deep(h3) {
|
|
29
|
+
@apply mt-10 text-base font-bold before:content-['###'] before:pr-1 before:text-gray-400;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content :deep(h4) {
|
|
33
|
+
@apply mt-8 font-bold before:content-['####'] before:pr-1 before:text-gray-400;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.content :deep(h5) {
|
|
37
|
+
@apply mt-6 font-bold before:content-['#####'] before:pr-1 before:text-gray-400;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.content :deep(h6) {
|
|
41
|
+
@apply mt-4 font-bold before:content-['######'] before:pr-1 before:text-gray-400;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.content :deep(p) {
|
|
45
|
+
@apply mt-2 ;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.content :deep(blockquote) {
|
|
49
|
+
@apply px-4 py-3 my-4 italic border-s-4 dark:border-gray-500/20 dark:bg-surface-800/20;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.content :deep(ul) {
|
|
53
|
+
@apply list-disc list-outside mt-2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.content :deep(ol) {
|
|
57
|
+
@apply list-decimal list-outside mt-2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.content :deep(ul > li) {
|
|
61
|
+
@apply ml-4 mt-2;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.content :deep(ol > li) {
|
|
65
|
+
@apply ml-6 mt-2;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.content :deep(strong) {
|
|
69
|
+
@apply font-bold;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.content :deep(p a) {
|
|
73
|
+
@apply border-b border-dotted border-gray-400 after:content-['↗'] after:pl-[1px];
|
|
74
|
+
}
|
|
75
|
+
.content :deep(ul a) {
|
|
76
|
+
@apply border-b border-dotted border-gray-400 after:content-['↗'] after:pl-[1px];
|
|
77
|
+
}
|
|
78
|
+
.content :deep(table) {
|
|
79
|
+
@apply my-8;
|
|
80
|
+
}
|
|
81
|
+
.content :deep(th) {
|
|
82
|
+
@apply border border-surface-200 dark:border-surface-500 p-2 text-left font-bold bg-surface-100 dark:bg-surface-800;
|
|
83
|
+
}
|
|
84
|
+
.content :deep(td) {
|
|
85
|
+
@apply border border-surface-200 dark:border-surface-500 p-2 text-left;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<StructuralColumn
|
|
3
|
+
v-if="selectedMemory"
|
|
4
|
+
:close-route="closeRoute"
|
|
5
|
+
child-column
|
|
6
|
+
:title="t('memory.detail.title')"
|
|
7
|
+
>
|
|
8
|
+
<MemoryEdit
|
|
9
|
+
:memory="selectedMemory"
|
|
10
|
+
@update="handleUpdate"
|
|
11
|
+
@delete="handleDelete"
|
|
12
|
+
@close="handleClose"
|
|
13
|
+
/>
|
|
14
|
+
</StructuralColumn>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
memoryType: 'user' | 'organization'
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const { t } = useI18n()
|
|
23
|
+
const route = useRoute()
|
|
24
|
+
|
|
25
|
+
const closeRoute = computed(() => `/service/${props.memoryType}-memories/list`)
|
|
26
|
+
|
|
27
|
+
// Create memory composables using factory based on type
|
|
28
|
+
const { useMemories, useUpdateMemory, useDeleteMemory } = createMemoryComposables({
|
|
29
|
+
type: props.memoryType,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const { paginatedMemories } = useMemories()
|
|
33
|
+
const { updateMemory } = useUpdateMemory()
|
|
34
|
+
const { deleteMemory } = useDeleteMemory()
|
|
35
|
+
|
|
36
|
+
const selectedMemory = computed(() => {
|
|
37
|
+
const memoryId = route.params.memory_id as string
|
|
38
|
+
return paginatedMemories.value.find(m => m.id === memoryId)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// Use shared CRUD composable
|
|
42
|
+
const { handleUpdate, handleDelete, handleClose } = useMemoryCRUD({
|
|
43
|
+
selectedMemory,
|
|
44
|
+
updateMemory,
|
|
45
|
+
deleteMemory,
|
|
46
|
+
closeRoute: closeRoute.value,
|
|
47
|
+
})
|
|
48
|
+
</script>
|