@swiss-ai-hub/web 0.292.3 → 0.293.0

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.
@@ -32,6 +32,9 @@
32
32
  icon-pos="right"
33
33
  @click="auth.logout"
34
34
  />
35
+ <div class="text-center text-xs text-surface-500 dark:text-surface-400">
36
+ {{ t('user.version') }} {{ versionDisplay }}
37
+ </div>
35
38
  </div>
36
39
  </Popover>
37
40
  </template>
@@ -40,6 +43,7 @@
40
43
  import { changeLocale } from '@formkit/vue'
41
44
 
42
45
  const auth = useAuth()
46
+ const { versionDisplay } = useAppVersion()
43
47
  const { t, locale, locales } = useI18n()
44
48
  const queryCache = useQueryCache()
45
49
  const switchLocalePath = useSwitchLocalePath()
@@ -0,0 +1,27 @@
1
+ import { getHealth } from '@core/sdk/client'
2
+ import { minutesToMilliseconds } from 'date-fns'
3
+
4
+ // Surfaces the running version of both services. The UI service version is baked
5
+ // into the static bundle at build time (runtimeConfig.public.appVersion); the API
6
+ // version is read from the health endpoint. When both match a single number is
7
+ // shown, otherwise both are shown as `UI / API`.
8
+ export const useAppVersion = defineQuery(() => {
9
+ const uiVersion = useRuntimeConfig().public.appVersion as string
10
+
11
+ const { data: apiVersion } = useQuery<string>({
12
+ key: () => ['app-version', 'api'],
13
+ staleTime: minutesToMilliseconds(60),
14
+ query: async () => {
15
+ const health = await getHealth({ composable: '$fetch' })
16
+ return health.version
17
+ },
18
+ })
19
+
20
+ const versionDisplay = computed(() => {
21
+ const api = apiVersion.value
22
+ if (!api || api === uiVersion) return uiVersion
23
+ return `${uiVersion} / ${api}`
24
+ })
25
+
26
+ return { uiVersion, apiVersion, versionDisplay }
27
+ })
@@ -92,6 +92,7 @@ user:
92
92
  title: Benutzer
93
93
  logout: Abmelden
94
94
  language: Sprache
95
+ version: Version
95
96
  role_chips:
96
97
  no_roles: Keine Rollen zugewiesen
97
98
  assign: Rolle zuweisen
@@ -91,6 +91,7 @@ user:
91
91
  title: Users
92
92
  logout: Logout
93
93
  language: Language
94
+ version: Version
94
95
  role_chips:
95
96
  no_roles: No roles assigned
96
97
  assign: Assign role
@@ -91,6 +91,7 @@ user:
91
91
  title: Utilisateurs
92
92
  logout: Déconnexion
93
93
  language: Langue
94
+ version: Version
94
95
  role_chips:
95
96
  no_roles: Aucun rôle assigné
96
97
  assign: Assigner un rôle
@@ -91,6 +91,7 @@ user:
91
91
  title: Utenti
92
92
  logout: Esci
93
93
  language: Lingua
94
+ version: Versione
94
95
  role_chips:
95
96
  no_roles: Nessun ruolo assegnato
96
97
  assign: Assegna ruolo
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "bbv Software Services AG (https://www.bbv.ch)",
5
5
  "type": "module",
6
- "version": "0.292.3",
6
+ "version": "0.293.0",
7
7
  "description": "Swiss AI Hub - Admin & Management UI (Nuxt 3 layer)",
8
8
  "main": "./nuxt.config.ts",
9
9
  "repository": {
@@ -8258,6 +8258,11 @@ export const HealthResponseSchema = {
8258
8258
  title: "Code",
8259
8259
  description: "HTTP status code.",
8260
8260
  },
8261
+ version: {
8262
+ type: "string",
8263
+ title: "Version",
8264
+ description: "Running service version.",
8265
+ },
8261
8266
  checks: {
8262
8267
  anyOf: [
8263
8268
  {
@@ -8278,7 +8283,7 @@ export const HealthResponseSchema = {
8278
8283
  },
8279
8284
  },
8280
8285
  type: "object",
8281
- required: ["status", "code"],
8286
+ required: ["status", "code", "version"],
8282
8287
  title: "HealthResponse",
8283
8288
  description: "Standard health check response.",
8284
8289
  } as const;
@@ -5745,6 +5745,12 @@ export type HealthResponse = {
5745
5745
  * HTTP status code.
5746
5746
  */
5747
5747
  code: number;
5748
+ /**
5749
+ * Version
5750
+ *
5751
+ * Running service version.
5752
+ */
5753
+ version: string;
5748
5754
  /**
5749
5755
  * Checks
5750
5756
  *