feat: add system information page and update account settings
All checks were successful
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 26s
Test Suite / pytest-backend (pull_request) Successful in 5s
Test Suite / lint-backend (pull_request) Successful in 1s
Test Suite / build-frontend (pull_request) Successful in 6s
Test Suite / playwright-tests (pull_request) Successful in 23s
All checks were successful
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 26s
Test Suite / pytest-backend (pull_request) Successful in 5s
Test Suite / lint-backend (pull_request) Successful in 1s
Test Suite / build-frontend (pull_request) Successful in 6s
Test Suite / playwright-tests (pull_request) Successful in 23s
- Introduced a new SettingsSystemInfoPage to display technical system information. - Updated AccountSettingsPage to include a link to the new system information page, enhancing user access to app version, build, environment, and database schema details. - Removed unused version state from Dashboard component to streamline data handling.
This commit is contained in:
parent
fe703ca414
commit
18fa4de055
|
|
@ -15,6 +15,7 @@ import LoginPage from './pages/LoginPage'
|
|||
import VerifyPage from './pages/VerifyPage'
|
||||
import Dashboard from './pages/Dashboard'
|
||||
import AccountSettingsPage from './pages/AccountSettingsPage'
|
||||
import SettingsSystemInfoPage from './pages/SettingsSystemInfoPage'
|
||||
import ExercisesListPage from './pages/ExercisesListPage'
|
||||
import ExerciseDetailPage from './pages/ExerciseDetailPage'
|
||||
import ExerciseFormPage from './pages/ExerciseFormPage'
|
||||
|
|
@ -156,6 +157,7 @@ function AppRoutes() {
|
|||
<Route index element={<Dashboard />} />
|
||||
<Route path="profile" element={<Navigate to="/settings" replace />} />
|
||||
<Route path="settings" element={<AccountSettingsPage />} />
|
||||
<Route path="settings/system" element={<SettingsSystemInfoPage />} />
|
||||
<Route path="exercises">
|
||||
<Route index element={<ExercisesListPage />} />
|
||||
<Route path="new" element={<ExerciseFormPage />} />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { useState, useEffect } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useAuth } from '../context/AuthContext'
|
||||
import api from '../utils/api'
|
||||
|
||||
|
|
@ -411,6 +412,11 @@ function AccountSettingsPage() {
|
|||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p className="muted" style={{ marginTop: '1.75rem', fontSize: '0.875rem', lineHeight: 1.5 }}>
|
||||
<Link to="/settings/system">Technische Systeminformationen</Link>
|
||||
{' — App-Version, Build, Umgebung, Datenbankschema'}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ function formatCappedCount(n, capped) {
|
|||
}
|
||||
|
||||
function Dashboard() {
|
||||
const [version, setVersion] = useState(null)
|
||||
const [profile, setProfile] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [trainingHome, setTrainingHome] = useState(null)
|
||||
|
|
@ -146,8 +145,7 @@ function Dashboard() {
|
|||
|
||||
const loadData = async () => {
|
||||
try {
|
||||
const [versionData, profileData] = await Promise.all([api.getVersion(), api.getCurrentProfile()])
|
||||
setVersion(versionData)
|
||||
const profileData = await api.getCurrentProfile()
|
||||
setProfile(profileData)
|
||||
} catch (err) {
|
||||
console.error('Failed to load data:', err)
|
||||
|
|
@ -372,34 +370,6 @@ function Dashboard() {
|
|||
</section>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{version ? (
|
||||
<div className="card dashboard-sys-card">
|
||||
<h3 className="dashboard-sys-card__title">System</h3>
|
||||
<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={
|
||||
profile?.tier === 'premium' ? 'dashboard-sys-card__pill dashboard-sys-card__pill--accent' : 'dashboard-sys-card__pill'
|
||||
}
|
||||
>
|
||||
{profile?.tier || 'free'}
|
||||
</span>
|
||||
</span>
|
||||
<strong>Rolle</strong>
|
||||
<span>{profile?.role || 'user'}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
100
frontend/src/pages/SettingsSystemInfoPage.jsx
Normal file
100
frontend/src/pages/SettingsSystemInfoPage.jsx
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
import { useState, useEffect } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useAuth } from '../context/AuthContext'
|
||||
import api from '../utils/api'
|
||||
|
||||
/**
|
||||
* 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' }}>
|
||||
<Link to="/settings" style={{ fontSize: '0.9rem' }}>
|
||||
← Zurück zu Einstellungen
|
||||
</Link>
|
||||
</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
|
||||
Loading…
Reference in New Issue
Block a user