@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.
- package/components/User/Settings.vue +4 -0
- package/composables/app/useAppVersion.ts +27 -0
- package/i18n/locales/de.yaml +1 -0
- package/i18n/locales/en.yaml +1 -0
- package/i18n/locales/fr.yaml +1 -0
- package/i18n/locales/it.yaml +1 -0
- package/package.json +1 -1
- package/sdk/client/schemas.gen.ts +6 -1
- package/sdk/client/types.gen.ts +6 -0
|
@@ -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
|
+
})
|
package/i18n/locales/de.yaml
CHANGED
package/i18n/locales/en.yaml
CHANGED
package/i18n/locales/fr.yaml
CHANGED
package/i18n/locales/it.yaml
CHANGED
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.
|
|
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;
|
package/sdk/client/types.gen.ts
CHANGED