feat(frontend): Mobile-App-Version im Download-Bereich anzeigen
Liest version.txt aus dem gleichen static/downloads/-Verzeichnis wie die APK und zeigt sie neben "Mobile App (Android)" in der ProfilePage. Muss bei jedem APK-Deploy manuell mitgepflegt werden (kein automatischer Abgleich mit der mobilen App-Version). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1
This commit is contained in:
1 parent
fd752878b0
commit
4398632880
1 file changed
+31
@@ -167,6 +167,34 @@ function TotpSection({ enabled, onToggle }: { enabled: boolean; onToggle: () =>
|
||||
)
|
||||
}
|
||||
|
||||
// ── Mobile App ────────────────────────────────────────────────────────────────
|
||||
|
||||
function MobileAppSection() {
|
||||
const [version, setVersion] = useState<string | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
fetch('/static/downloads/version.txt')
|
||||
.then(r => (r.ok ? r.text() : Promise.reject()))
|
||||
.then(v => setVersion(v.trim()))
|
||||
.catch(() => setVersion(null))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className='bg-white rounded-xl shadow-sm border border-gray-200 p-6'>
|
||||
<h2 className='font-semibold text-gray-700 mb-1'>
|
||||
Mobile App (Android){version && <span className='ml-2 text-xs font-normal text-gray-400'>v{version}</span>}
|
||||
</h2>
|
||||
<p className='text-xs text-gray-400 mb-4'>
|
||||
Ein-/Ausstempeln und Pause direkt vom Smartphone. Nur im Firmennetzwerk erreichbar.
|
||||
</p>
|
||||
<a href='/static/downloads/timemaster.apk' download
|
||||
className='inline-block px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700'>
|
||||
APK herunterladen
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ── iCal-Abo ──────────────────────────────────────────────────────────────────
|
||||
|
||||
function IcalSection() {
|
||||
@@ -400,6 +428,9 @@ export function ProfilePage() {
|
||||
{/* Kalender-Abo (iCal) */}
|
||||
<IcalSection />
|
||||
|
||||
{/* Mobile App */}
|
||||
<MobileAppSection />
|
||||
|
||||
{/* Passwort ändern */}
|
||||
<div className='bg-white rounded-xl shadow-sm border border-gray-200 p-6'>
|
||||
<h2 className='font-semibold text-gray-700 mb-4'>Passwort ändern</h2>
|
||||
|
||||
Reference in new issue
Block a user