shinkan-jinkendo/frontend/src/pages/SettingsSystemInfoPage.jsx
Lars 4588ef4c7e
Some checks failed
Deploy Development / deploy (push) Failing after 24s
Test Suite / pytest-backend (push) Successful in 34s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Failing after 7s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m22s
Refactor navigation components and enhance return context handling
- Replaced `PageReturnLink` with `PageReturnButton` for consistent back navigation across various pages.
- Updated multiple components, including `ExercisePeekModal`, `PageFormEditorChrome`, and `ExerciseDetailPage`, to utilize the new return context features.
- Enhanced CSS styles for the new return button to improve visual consistency.
- Improved navigation logic in `TrainingFrameworkProgramEditPage` and `TrainingModuleEditPage` to ensure seamless user experience when navigating back to previous locations.
2026-05-20 07:42:46 +02:00

100 lines
3.0 KiB
JavaScript

import { useState, useEffect } from 'react'
import PageReturnButton from '../components/PageReturnButton'
import { useAuth } from '../context/AuthContext'
import api from '../utils/api'
import { SETTINGS_PATH } from '../utils/navReturnContext'
/**
* Technische System- und Build-Infos (ehemals Dashboard) — unter Einstellungen für Betrieb/Diagnose.
*/
function SettingsSystemInfoPage() {
const { user } = useAuth()
const [version, setVersion] = useState(null)
const [err, setErr] = useState(null)
const [loading, setLoading] = useState(true)
useEffect(() => {
let cancelled = false
;(async () => {
setErr(null)
try {
const v = await api.getVersion()
if (!cancelled) setVersion(v)
} catch (e) {
if (!cancelled) setErr(e.message || String(e))
} finally {
if (!cancelled) setLoading(false)
}
})()
return () => {
cancelled = true
}
}, [])
return (
<div className="page-padding app-page" style={{ padding: '1rem' }}>
<p style={{ marginBottom: '0.75rem' }}>
<PageReturnButton fallbackPath={SETTINGS_PATH} fallbackLabel="Zurück zu Einstellungen" />
</p>
<h1 style={{ marginBottom: '0.35rem', fontSize: '1.5rem' }}>Systeminformationen</h1>
<p
style={{
color: 'var(--text2)',
marginBottom: '1.25rem',
fontSize: '0.95rem',
lineHeight: 1.5,
maxWidth: '40rem',
}}
>
Build, Umgebung und Schema-Stand der App hilfreich für Support oder nach Deployments. Tarif und Rolle
beziehen sich auf dein Konto.
</p>
{loading ? (
<p className="muted" style={{ margin: 0 }}>
Version wird geladen
</p>
) : null}
{err ? (
<p role="alert" style={{ color: 'var(--danger)', marginBottom: '1rem' }}>
{err}
</p>
) : null}
{version ? (
<div className="card dashboard-sys-card">
<h2 className="dashboard-sys-card__title" style={{ marginTop: 0 }}>
System
</h2>
<div className="dashboard-sys-card__grid">
<strong>Version</strong>
<span>{version.app_version}</span>
<strong>Build</strong>
<span>{version.build_date}</span>
<strong>Umgebung</strong>
<span>{version.environment}</span>
<strong>DB Schema</strong>
<span>{version.db_schema_version}</span>
<strong>Dein Tier</strong>
<span>
<span
className={
user?.tier === 'premium'
? 'dashboard-sys-card__pill dashboard-sys-card__pill--accent'
: 'dashboard-sys-card__pill'
}
>
{user?.tier || 'free'}
</span>
</span>
<strong>Rolle</strong>
<span>{user?.role || 'user'}</span>
</div>
</div>
) : null}
</div>
)
}
export default SettingsSystemInfoPage