@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,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<EventDisplayBase
|
|
3
|
+
:event="event"
|
|
4
|
+
:thread="thread"
|
|
5
|
+
icon="mynaui:tool"
|
|
6
|
+
>
|
|
7
|
+
<p class="text-2xl font-bold">
|
|
8
|
+
{{ event.event.name }}
|
|
9
|
+
</p>
|
|
10
|
+
<p class="font-bold">
|
|
11
|
+
{{ event.event.description }}
|
|
12
|
+
</p>
|
|
13
|
+
<br>
|
|
14
|
+
<div class="grid grid-cols-2 gap-4">
|
|
15
|
+
<InputGroup
|
|
16
|
+
v-for="(val, key) in event.event.parameters"
|
|
17
|
+
:key="key"
|
|
18
|
+
>
|
|
19
|
+
<Button :label="useChangeCase(key, 'capitalCase')" />
|
|
20
|
+
<InputText
|
|
21
|
+
:placeholder="val"
|
|
22
|
+
readonly
|
|
23
|
+
/>
|
|
24
|
+
</InputGroup>
|
|
25
|
+
</div>
|
|
26
|
+
</EventDisplayBase>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import { useChangeCase } from '@vueuse/integrations/useChangeCase'
|
|
31
|
+
|
|
32
|
+
import type { ThreadDto, ToolEvent, ContextualizedAgentEvent } from '@core/sdk/client'
|
|
33
|
+
|
|
34
|
+
defineProps<{
|
|
35
|
+
event: ContextualizedAgentEvent & { event: ToolEvent }
|
|
36
|
+
thread: ThreadDto
|
|
37
|
+
}>()
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<EventDisplayBase
|
|
3
|
+
is-empty
|
|
4
|
+
:event="event"
|
|
5
|
+
:thread="thread"
|
|
6
|
+
icon="mage:question-mark-circle"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import type { ThreadDto, ContextualizedAgentEvent } from '@core/sdk/client'
|
|
12
|
+
|
|
13
|
+
defineProps<{
|
|
14
|
+
event: ContextualizedAgentEvent
|
|
15
|
+
thread: ThreadDto
|
|
16
|
+
}>()
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<EventDisplayBase
|
|
3
|
+
:event="event"
|
|
4
|
+
:thread="thread"
|
|
5
|
+
icon="mage:message"
|
|
6
|
+
is-external
|
|
7
|
+
>
|
|
8
|
+
<div class="flex flex-col gap-8">
|
|
9
|
+
<div
|
|
10
|
+
v-for="(message, index) in event.event.messages"
|
|
11
|
+
:key="index"
|
|
12
|
+
class="flex flex-col gap-2"
|
|
13
|
+
>
|
|
14
|
+
<ChatMessage
|
|
15
|
+
:message="message"
|
|
16
|
+
:name="message.role == 'user' ? event.event.user.name : message.role"
|
|
17
|
+
:email="message.role == 'user' ? event.event.user.email : ''"
|
|
18
|
+
:date="new Date(event.event.created_at / 1_000_000)"
|
|
19
|
+
:icon="agentIcon"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</EventDisplayBase>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import type { ThreadDto, UserMessageEvent, ContextualizedAgentEvent } from '@core/sdk/client'
|
|
28
|
+
|
|
29
|
+
const props = defineProps<{
|
|
30
|
+
event: ContextualizedAgentEvent & { event: UserMessageEvent }
|
|
31
|
+
thread: ThreadDto
|
|
32
|
+
}>()
|
|
33
|
+
|
|
34
|
+
const agentIcon = useAgentIconFromThread(props.event, props.thread)
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-12 pt-4">
|
|
3
|
+
<Panel
|
|
4
|
+
v-if="showChat"
|
|
5
|
+
:header="t('event.list.chat')"
|
|
6
|
+
toggleable
|
|
7
|
+
>
|
|
8
|
+
<div class="flex flex-col gap-8">
|
|
9
|
+
<ChatThread
|
|
10
|
+
:events="eventsInRuns"
|
|
11
|
+
:thread="thread"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</Panel>
|
|
15
|
+
<div class="flex flex-col gap-8">
|
|
16
|
+
<div class="grid grid-cols-2 gap-4 px-4 xl:grid-cols-4">
|
|
17
|
+
<div class="flex flex-col items-start gap-2">
|
|
18
|
+
<span class="font-semibold">{{ t('event.list.firstInteraction') }}</span>
|
|
19
|
+
<Tag
|
|
20
|
+
:value="firstInteraction"
|
|
21
|
+
severity="secondary"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex flex-col items-start gap-2">
|
|
25
|
+
<span class="font-semibold">{{ t('event.list.lastInteraction') }}</span>
|
|
26
|
+
<Tag
|
|
27
|
+
:value="lastInteraction"
|
|
28
|
+
severity="secondary"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="flex flex-col items-start gap-2">
|
|
32
|
+
<span class="font-semibold">{{ t('event.list.duration') }}</span>
|
|
33
|
+
<Tag
|
|
34
|
+
:value="runDuration"
|
|
35
|
+
severity="secondary"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="flex flex-col items-start gap-2">
|
|
39
|
+
<span class="font-semibold">{{ t('event.list.costs') }}</span>
|
|
40
|
+
<Tag
|
|
41
|
+
:value="totalCost"
|
|
42
|
+
severity="secondary"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<MeterGroup
|
|
47
|
+
:value="eventMeterValues"
|
|
48
|
+
class="px-4"
|
|
49
|
+
/>
|
|
50
|
+
<div class="flex w-full items-center justify-end gap-2 pr-4">
|
|
51
|
+
<MultiSelect
|
|
52
|
+
v-model="activeRuns"
|
|
53
|
+
display="chip"
|
|
54
|
+
input-id="agents"
|
|
55
|
+
:options="display.runs"
|
|
56
|
+
:option-label="runNameFn"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
<Timeline
|
|
60
|
+
:value="eventsInRuns"
|
|
61
|
+
data-key="event_id"
|
|
62
|
+
align="left"
|
|
63
|
+
class="customized-timeline w-full"
|
|
64
|
+
>
|
|
65
|
+
<template #opposite="{ item: event }">
|
|
66
|
+
<div class="flex w-full flex-row justify-end">
|
|
67
|
+
<div class="flex flex-col text-xs text-surface-500 dark:text-surface-400">
|
|
68
|
+
<div class="font-semibold">
|
|
69
|
+
{{ useDateFormat(event.event.created_at / 1_000_000, 'DD.MM.YYYY') }}
|
|
70
|
+
</div>
|
|
71
|
+
<div>{{ useDateFormat(event.event.created_at / 1_000_000, 'hh:mm:ss') }}</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
<template #content="{ item: event }">
|
|
76
|
+
<div class="w-full pb-12">
|
|
77
|
+
<component
|
|
78
|
+
:is="resolveComponentForEvent(event)"
|
|
79
|
+
:event="event"
|
|
80
|
+
:thread="thread"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
<template #marker>
|
|
85
|
+
<span
|
|
86
|
+
class="z-10 flex size-5 items-center justify-center rounded-full border border-surface-100 bg-white text-white shadow-md shadow-surface-200 dark:border-surface-800 dark:bg-surface-700 dark:shadow-surface-950"
|
|
87
|
+
>
|
|
88
|
+
<Icon
|
|
89
|
+
class="text-green-700"
|
|
90
|
+
name="mage:check"
|
|
91
|
+
size="xs"
|
|
92
|
+
/>
|
|
93
|
+
</span>
|
|
94
|
+
</template>
|
|
95
|
+
</Timeline>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script setup lang="ts">
|
|
101
|
+
import { formatDuration, intervalToDuration } from 'date-fns'
|
|
102
|
+
import { de } from 'date-fns/locale/de'
|
|
103
|
+
import { enUS } from 'date-fns/locale/en-US'
|
|
104
|
+
import { frCH } from 'date-fns/locale/fr-CH'
|
|
105
|
+
import { itCH } from 'date-fns/locale/it-CH'
|
|
106
|
+
|
|
107
|
+
import type {
|
|
108
|
+
DisplayStatistics, RunStatistics,
|
|
109
|
+
ThreadDto,
|
|
110
|
+
ContextualizedAgentEvent,
|
|
111
|
+
} from '@core/sdk/client'
|
|
112
|
+
|
|
113
|
+
const props = withDefaults(defineProps<{
|
|
114
|
+
events: ContextualizedAgentEvent[]
|
|
115
|
+
thread: ThreadDto
|
|
116
|
+
displayId?: string
|
|
117
|
+
showChat?: boolean
|
|
118
|
+
}>(), {
|
|
119
|
+
showChat: false,
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
const route = useRoute()
|
|
123
|
+
const { locale, t } = useI18n()
|
|
124
|
+
|
|
125
|
+
const localeMap = { de, en: enUS, fr: frCH, it: itCH } as const
|
|
126
|
+
|
|
127
|
+
const activeRuns = ref<RunStatistics[]>([])
|
|
128
|
+
|
|
129
|
+
const display = computed(() => {
|
|
130
|
+
const displayId = props.displayId ?? route.params.display_id
|
|
131
|
+
return props.thread.displays?.find((display: DisplayStatistics) => display.display_id === displayId)
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
watch(display, () => {
|
|
135
|
+
activeRuns.value = display.value?.runs ?? []
|
|
136
|
+
}, { immediate: true })
|
|
137
|
+
|
|
138
|
+
const eventsInRuns = computed<ContextualizedAgentEvent[]>(() => {
|
|
139
|
+
const runIds = new Set(activeRuns.value.map((run: RunStatistics) => run.run_id))
|
|
140
|
+
return props.events.filter((event: ContextualizedAgentEvent) => runIds.has(event.run_id))
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
const { resolveComponentForEvent } = useEventComponent()
|
|
144
|
+
|
|
145
|
+
const runNameFn = (run: RunStatistics) => run.agent.agent_config.name
|
|
146
|
+
|
|
147
|
+
const getEventTimestamp = (event: AgentEventReadable): number =>
|
|
148
|
+
(event.event as { created_at?: number }).created_at ?? 0
|
|
149
|
+
|
|
150
|
+
const sortedEvents = computed(() =>
|
|
151
|
+
[...eventsInRuns.value].sort((a, b) => getEventTimestamp(a) - getEventTimestamp(b)),
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
const firstInteraction = computed<string>(() => {
|
|
155
|
+
if (!sortedEvents.value.length) return '-'
|
|
156
|
+
const ts = getEventTimestamp(sortedEvents.value[0])
|
|
157
|
+
if (!ts) return '-'
|
|
158
|
+
return useDateFormat(ts / 1_000_000, 'DD.MM.YYYY HH:mm:ss').value
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const lastInteraction = computed<string>(() => {
|
|
162
|
+
if (!sortedEvents.value.length) return '-'
|
|
163
|
+
const ts = getEventTimestamp(sortedEvents.value[sortedEvents.value.length - 1])
|
|
164
|
+
if (!ts) return '-'
|
|
165
|
+
return useDateFormat(ts / 1_000_000, 'DD.MM.YYYY HH:mm:ss').value
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
const runDuration = computed<string>(() => {
|
|
169
|
+
const events = sortedEvents.value
|
|
170
|
+
if (events.length < 2) return '-'
|
|
171
|
+
const startNs = getEventTimestamp(events[0])
|
|
172
|
+
const endNs = getEventTimestamp(events[events.length - 1])
|
|
173
|
+
const startMs = startNs / 1_000_000
|
|
174
|
+
const endMs = endNs / 1_000_000
|
|
175
|
+
const dur = intervalToDuration({ start: new Date(startMs), end: new Date(endMs) })
|
|
176
|
+
if (dur.minutes || dur.hours || dur.days) dur.seconds = 0
|
|
177
|
+
if (dur.days || dur.weeks) dur.minutes = 0
|
|
178
|
+
return formatDuration(dur, { locale: localeMap[locale.value as keyof typeof localeMap] }) || '< 1s'
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
const totalCost = computed<string>(() => {
|
|
182
|
+
let cost = 0
|
|
183
|
+
for (const event of eventsInRuns.value) {
|
|
184
|
+
if (event._event_name !== 'LLMCostEvent' && !(event._parent_event_names as string[])?.includes('LLMCostEvent')) continue
|
|
185
|
+
const e = event.event as { prompt_tokens_costs?: number, completion_tokens_costs?: number, embedding_tokens_costs?: number }
|
|
186
|
+
cost += (e.prompt_tokens_costs ?? 0) + (e.completion_tokens_costs ?? 0) + (e.embedding_tokens_costs ?? 0)
|
|
187
|
+
}
|
|
188
|
+
return `${cost.toFixed(6)} CHF`
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const { getEventColor } = useEventColor()
|
|
192
|
+
|
|
193
|
+
const eventMeterValues = computed(() => {
|
|
194
|
+
const sorted = sortedEvents.value
|
|
195
|
+
if (sorted.length < 2) return []
|
|
196
|
+
|
|
197
|
+
const durations = new Map<string, { label: string, duration: number }>()
|
|
198
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
199
|
+
const curr = sorted[i]
|
|
200
|
+
const prev = sorted[i - 1]
|
|
201
|
+
const delta = getEventTimestamp(curr) - getEventTimestamp(prev)
|
|
202
|
+
const name = curr.event_display_name as string ?? curr._event_name
|
|
203
|
+
|
|
204
|
+
const existing = durations.get(name)
|
|
205
|
+
if (existing) {
|
|
206
|
+
existing.duration += delta
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
durations.set(name, { label: name, duration: delta })
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const totalDuration = Array.from(durations.values()).reduce((sum, e) => sum + e.duration, 0)
|
|
214
|
+
if (totalDuration === 0) return []
|
|
215
|
+
|
|
216
|
+
const MIN_DURATION_NS = 100_000_000 // 0.1s in nanoseconds
|
|
217
|
+
const insertionOrder = Array.from(durations.keys())
|
|
218
|
+
const entries = Array.from(durations.values())
|
|
219
|
+
.filter(e => e.duration >= MIN_DURATION_NS)
|
|
220
|
+
.sort((a, b) => insertionOrder.indexOf(a.label) - insertionOrder.indexOf(b.label))
|
|
221
|
+
|
|
222
|
+
const rawValues = entries.map(e => (e.duration / totalDuration) * 100)
|
|
223
|
+
const floored = rawValues.map(v => Math.floor(v))
|
|
224
|
+
let remainder = 100 - floored.reduce((sum, v) => sum + v, 0)
|
|
225
|
+
const fractionals = rawValues.map((v, i) => ({ i, frac: v - floored[i] }))
|
|
226
|
+
.sort((a, b) => b.frac - a.frac)
|
|
227
|
+
for (const { i } of fractionals) {
|
|
228
|
+
if (remainder <= 0) break
|
|
229
|
+
floored[i]++
|
|
230
|
+
remainder--
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return entries.map((entry, index) => ({
|
|
234
|
+
label: entry.label,
|
|
235
|
+
value: floored[index],
|
|
236
|
+
color: getEventColor(entry.label),
|
|
237
|
+
}))
|
|
238
|
+
})
|
|
239
|
+
</script>
|
|
240
|
+
|
|
241
|
+
<style scoped>
|
|
242
|
+
.customized-timeline :deep(.p-timeline-event-opposite) {
|
|
243
|
+
width: 60px;
|
|
244
|
+
max-width: 60px;
|
|
245
|
+
}
|
|
246
|
+
.panel :deep(.p-panel-header) {
|
|
247
|
+
padding: 0 !important;
|
|
248
|
+
}
|
|
249
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex w-full flex-col gap-8"
|
|
4
|
+
>
|
|
5
|
+
<div class="flex w-full justify-end">
|
|
6
|
+
<SelectButton
|
|
7
|
+
:model-value="modelValue"
|
|
8
|
+
size="small"
|
|
9
|
+
:options="options"
|
|
10
|
+
:allow-empty="false"
|
|
11
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
class="grid w-full grid-cols-1 lg:grid-cols-2"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
v-for="(chart, index) in charts"
|
|
19
|
+
:key="index"
|
|
20
|
+
class="flex h-[350px] w-full items-center justify-center"
|
|
21
|
+
>
|
|
22
|
+
<EventTimeseries
|
|
23
|
+
v-if="!chart.isLoading"
|
|
24
|
+
:title="chart.title"
|
|
25
|
+
:series-inputs="chart.timeseriesInputs"
|
|
26
|
+
/>
|
|
27
|
+
<ProgressSpinner
|
|
28
|
+
v-else
|
|
29
|
+
class="size-12"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import type { EventChartInput } from '@core/types/EventChartInput'
|
|
38
|
+
|
|
39
|
+
defineProps<{
|
|
40
|
+
modelValue: string
|
|
41
|
+
charts: EventChartInput[]
|
|
42
|
+
}>()
|
|
43
|
+
|
|
44
|
+
const emit = defineEmits<{
|
|
45
|
+
'update:modelValue': [string]
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const options = ref<string[]>(['1h', '24h', '30d', '365d'])
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<VueApexChart
|
|
4
|
+
class="w-full"
|
|
5
|
+
type="bar"
|
|
6
|
+
:height="height"
|
|
7
|
+
:options="chartOptions"
|
|
8
|
+
:series="chartSeries"
|
|
9
|
+
/>
|
|
10
|
+
</ClientOnly>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { computed } from 'vue'
|
|
15
|
+
import VueApexChart from 'vue3-apexcharts'
|
|
16
|
+
|
|
17
|
+
import type { EventBucket } from '@core/sdk/client'
|
|
18
|
+
import type { TimeseriesInput } from '@core/types/TimeseriesInput'
|
|
19
|
+
import type { ApexOptions } from 'apexcharts'
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<{
|
|
22
|
+
title: string
|
|
23
|
+
seriesInputs: TimeseriesInput[]
|
|
24
|
+
height?: number
|
|
25
|
+
}>(), {
|
|
26
|
+
height: 350,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const { t } = useI18n()
|
|
30
|
+
const isDark = useDarkMode()
|
|
31
|
+
|
|
32
|
+
const chartSeries = computed(() => {
|
|
33
|
+
if (!props.seriesInputs || props.seriesInputs.length === 0) {
|
|
34
|
+
return []
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return props.seriesInputs
|
|
38
|
+
.map(input => ({
|
|
39
|
+
name: input.name,
|
|
40
|
+
data: input.timeseries?.buckets?.map(bucket => bucket.total_events || 0) ?? [],
|
|
41
|
+
}))
|
|
42
|
+
.filter(series => series.data.some(value => value > 0))
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const chartOptions = computed<ApexOptions>(() => {
|
|
46
|
+
const representativeTimeseries = props.seriesInputs?.find(s => s.timeseries?.buckets?.length > 0)?.timeseries
|
|
47
|
+
|
|
48
|
+
if (!representativeTimeseries) {
|
|
49
|
+
// Fallback options if no data is available to derive categories, etc.
|
|
50
|
+
return {
|
|
51
|
+
chart: {
|
|
52
|
+
type: 'bar',
|
|
53
|
+
height: props.height,
|
|
54
|
+
foreColor: isDark.value ? 'var(--p-surface-200)' : 'var(--p-surface-800)',
|
|
55
|
+
},
|
|
56
|
+
theme: {
|
|
57
|
+
mode: isDark.value ? 'dark' : 'light',
|
|
58
|
+
},
|
|
59
|
+
noData: {
|
|
60
|
+
text: t('chart.no_data'),
|
|
61
|
+
align: 'center',
|
|
62
|
+
verticalAlign: 'middle',
|
|
63
|
+
style: {
|
|
64
|
+
fontSize: '14px',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
yaxis: {
|
|
68
|
+
title: {
|
|
69
|
+
text: `# ${props.title}`,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
legend: {
|
|
73
|
+
show: false,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const { buckets, time_range, resolution } = representativeTimeseries
|
|
79
|
+
|
|
80
|
+
// Generate categories for the X-axis from bucket start times
|
|
81
|
+
const categories = buckets.map((bucket: EventBucket) => {
|
|
82
|
+
const date = new Date(bucket.start_time)
|
|
83
|
+
return date.toISOString()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const activeSeriesColors = props.seriesInputs
|
|
87
|
+
.filter(input =>
|
|
88
|
+
input.timeseries.buckets.some(bucket => (bucket.total_events || 0) > 0) && input.color,
|
|
89
|
+
)
|
|
90
|
+
.map(input => input.color!)
|
|
91
|
+
|
|
92
|
+
const getXAxisLabelFormatter = () => {
|
|
93
|
+
return (value: string, _: string, opts?: { i?: number }) => {
|
|
94
|
+
const date = new Date(value)
|
|
95
|
+
const dataPointIndex = opts?.i ?? 0
|
|
96
|
+
|
|
97
|
+
// Determine max labels based on time range to avoid clutter
|
|
98
|
+
let maxLabels = 31 // For 1 month, all days have labels, for 1 year, each month has exactly 12 labels
|
|
99
|
+
if (time_range === '1h') maxLabels = 12 // e.g., every 5 minutes for 1 hour
|
|
100
|
+
else if (time_range === '24h') maxLabels = 8 // e.g., every 3 hours for 24 hours
|
|
101
|
+
|
|
102
|
+
const totalDataPoints = categories.length
|
|
103
|
+
const skipInterval = Math.max(1, Math.ceil(totalDataPoints / maxLabels))
|
|
104
|
+
|
|
105
|
+
if (dataPointIndex % skipInterval !== 0 && dataPointIndex !== totalDataPoints - 1) {
|
|
106
|
+
return ''
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Format date based on time range
|
|
110
|
+
if (time_range === '1h' || time_range === '24h') {
|
|
111
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
112
|
+
hour: '2-digit',
|
|
113
|
+
minute: '2-digit',
|
|
114
|
+
hour12: false,
|
|
115
|
+
}
|
|
116
|
+
return date.toLocaleTimeString('de-CH', options)
|
|
117
|
+
}
|
|
118
|
+
return date.toLocaleDateString('de-CH', { month: 'short', day: '2-digit' })
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
chart: {
|
|
124
|
+
type: 'bar',
|
|
125
|
+
height: props.height,
|
|
126
|
+
stacked: true,
|
|
127
|
+
toolbar: {
|
|
128
|
+
show: false,
|
|
129
|
+
},
|
|
130
|
+
zoom: {
|
|
131
|
+
enabled: false,
|
|
132
|
+
},
|
|
133
|
+
foreColor: isDark.value ? 'var(--p-surface-200)' : 'var(--p-surface-800)',
|
|
134
|
+
},
|
|
135
|
+
plotOptions: {
|
|
136
|
+
bar: {
|
|
137
|
+
horizontal: false,
|
|
138
|
+
columnWidth: resolution === '1m' ? '80%' : '50%',
|
|
139
|
+
dataLabels: {
|
|
140
|
+
total: {
|
|
141
|
+
enabled: true,
|
|
142
|
+
style: {
|
|
143
|
+
fontSize: '13px',
|
|
144
|
+
fontWeight: 900,
|
|
145
|
+
color: isDark.value ? 'var(--p-surface-200)' : 'var(--p-surface-800)',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
dataLabels: {
|
|
152
|
+
enabled: false,
|
|
153
|
+
},
|
|
154
|
+
responsive: [
|
|
155
|
+
{
|
|
156
|
+
breakpoint: 480,
|
|
157
|
+
options: {
|
|
158
|
+
legend: {
|
|
159
|
+
position: 'bottom',
|
|
160
|
+
offsetX: -10,
|
|
161
|
+
offsetY: 0,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
xaxis: {
|
|
167
|
+
type: 'category',
|
|
168
|
+
categories: categories,
|
|
169
|
+
labels: {
|
|
170
|
+
formatter: getXAxisLabelFormatter(),
|
|
171
|
+
rotate: -45,
|
|
172
|
+
rotateAlways: true,
|
|
173
|
+
hideOverlappingLabels: false,
|
|
174
|
+
trim: true,
|
|
175
|
+
style: {
|
|
176
|
+
fontSize: '10px',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
yaxis: {
|
|
181
|
+
title: {
|
|
182
|
+
text: `# ${props.title}`,
|
|
183
|
+
offsetX: 5,
|
|
184
|
+
},
|
|
185
|
+
min: 0,
|
|
186
|
+
labels: {
|
|
187
|
+
formatter: (value: number) => Number.isInteger(value) ? String(value) : '',
|
|
188
|
+
},
|
|
189
|
+
tickAmount: 5,
|
|
190
|
+
forceNiceScale: true,
|
|
191
|
+
},
|
|
192
|
+
legend: {
|
|
193
|
+
show: true,
|
|
194
|
+
showForSingleSeries: true,
|
|
195
|
+
position: 'top',
|
|
196
|
+
offsetY: 0,
|
|
197
|
+
},
|
|
198
|
+
fill: {
|
|
199
|
+
opacity: 1,
|
|
200
|
+
},
|
|
201
|
+
tooltip: {
|
|
202
|
+
theme: isDark.value ? 'dark' : 'light',
|
|
203
|
+
x: {
|
|
204
|
+
formatter: (value: string) => {
|
|
205
|
+
const date = new Date(value)
|
|
206
|
+
if (time_range === '1h' || time_range === '24h') {
|
|
207
|
+
return date.toLocaleString('de-CH', { dateStyle: 'medium', timeStyle: 'medium', hour12: false })
|
|
208
|
+
}
|
|
209
|
+
return date.toLocaleDateString('de-CH', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' })
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
colors: activeSeriesColors.length > 0 ? activeSeriesColors : undefined,
|
|
214
|
+
noData: {
|
|
215
|
+
text: t('chart.no_data'),
|
|
216
|
+
align: 'center',
|
|
217
|
+
verticalAlign: 'middle',
|
|
218
|
+
style: {
|
|
219
|
+
fontSize: '14px',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
</script>
|