feat: показывать версию приложения в настройках, версия 1.1.0

Версии бэкенда и фронтенда были не синхронизированы и нигде не отображались
в интерфейсе — непонятно было, обновилось ли приложение после пересборки.
Теперь единая версия 1.1.0 приходит с бэкенда через /api/health и мелким
текстом выводится внизу страницы настроек.
This commit is contained in:
ZProger
2026-09-02 02:21:05 +03:00
parent c422fd1528
commit 946b78d989
8 changed files with 42 additions and 5 deletions

View File

@@ -2,14 +2,26 @@ import { AlertThresholdsCard } from "@/components/settings/AlertThresholdsCard";
import { BackupCard } from "@/components/settings/BackupCard";
import { CurrencyCard } from "@/components/settings/CurrencyCard";
import { PreferencesCard } from "@/components/settings/PreferencesCard";
import { useHealth } from "@/hooks/useHealth";
import { t } from "@/lib/i18n";
export function SettingsPage() {
// Purely informational — if /api/health hasn't answered yet (or is
// unreachable), just show nothing rather than a loading/error state for
// one line of fine print.
const { data: health } = useHealth();
return (
<div className="space-y-5">
<PreferencesCard />
<CurrencyCard />
<AlertThresholdsCard />
<BackupCard />
{health?.version && (
<p className="text-center text-xs text-text-muted">
{t("settings.version", { version: health.version })}
</p>
)}
</div>
);
}