fix
This commit is contained in:
@@ -169,8 +169,8 @@
|
||||
</div>
|
||||
|
||||
<!-- Версия сборки (всегда внизу) -->
|
||||
<div v-if="!sidebarCollapsed" class="px-4 py-3 border-t border-gray-200 text-xs text-gray-500">
|
||||
{{ versionStore.getFormattedVersion(t) }}
|
||||
<div v-if="!sidebarCollapsed" class="px-4 py-3 border-t border-gray-200 text-xs text-gray-500 text-center" :title="versionStore.getFormattedVersion(t)">
|
||||
{{ versionStore.getShortVersion(t) }}
|
||||
</div>
|
||||
<div v-else class="p-2 border-t border-gray-200 flex justify-center">
|
||||
<div class="text-xs text-gray-500 font-mono" :title="versionStore.getFormattedVersion(t)">
|
||||
|
||||
@@ -45,11 +45,18 @@ export const useVersionStore = defineStore('version', () => {
|
||||
// Полная строка версии: "Версия: 1.2.3 (build abc1234 от 2025-04-03)"
|
||||
// Принимает функцию перевода для слова "от"/"from"
|
||||
const getFormattedVersion = (t: (key: string) => string) => {
|
||||
if (!version.value) return t('common.version') + ': ...'
|
||||
if (!version.value) return t('common.version') + '...'
|
||||
const { version: ver, commitHash } = version.value
|
||||
const datePart = buildDateFormatted.value ? ` ${t('common.versionFrom')} ${buildDateFormatted.value}` : ''
|
||||
return `${t('common.version')}: ${ver} (build ${commitHash}${datePart})`
|
||||
}
|
||||
|
||||
return { version, loading, error, fetchVersion, buildDateFormatted, getFormattedVersion }
|
||||
const getShortVersion = () => {
|
||||
if (!version.value) return '...'
|
||||
const { version: ver, commitHash } = version.value
|
||||
const datePart = buildDateFormatted.value ? ` ${buildDateFormatted.value}` : ''
|
||||
return `${ver} (build ${commitHash}${datePart})`
|
||||
}
|
||||
|
||||
return { version, loading, error, fetchVersion, buildDateFormatted, getFormattedVersion, getShortVersion }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user