Add exercise numbers, image uploads, version display, session resume, and training sparklines
- Exercise number (UF#): optional field on exercises, displayed in cards, training, and sets - Import training plan numbers via migration 005 (UPDATE by name) - Exercise images: JPG upload with multi-image support per exercise (migration 006) - Version endpoint (GET /api/v1/version) with ldflags injection in Makefile and Dockerfile - Version displayed on settings page - Session resume: GET /api/v1/sessions/active endpoint, auto-resume on training page load - Block new session while one is active (409 Conflict) - e1RM sparkline chart per exercise during training (Epley formula) - Fix CORS: add X-User-ID to allowed headers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useUserStore } from '../stores/userStore';
|
||||
import { api } from '../api/client';
|
||||
|
||||
export function SettingsPage() {
|
||||
const { users, activeUser, setActiveUser, fetchUsers, createUser, deleteUser } =
|
||||
useUserStore();
|
||||
const [newName, setNewName] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [version, setVersion] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
fetchUsers();
|
||||
api.version().then((v) => setVersion(v.version)).catch(() => {});
|
||||
}, [fetchUsers]);
|
||||
|
||||
async function handleCreate(e: React.FormEvent) {
|
||||
@@ -90,6 +93,10 @@ export function SettingsPage() {
|
||||
</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{version && (
|
||||
<p className="text-xs text-gray-600 pt-4">Version {version}</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user