feat: ajout de serveurs depuis l'app + charte flamme sombre
Build APK / build (push) Successful in 2m49s
Build APK / build (push) Successful in 2m49s
- backend: GET /api/containers (liste lisible), POST/DELETE /api/servers (serveurs custom persistés en /data/servers.json, mergés aux intégrés), champ custom dans le statut. - app: écran AddServer (form + sélecteur multi-conteneurs filtrable), FAB Ajouter, suppression depuis le détail (serveurs custom only). - thème: palette flamme/chaud sombre (anthracite + orange→rouge), remplace le Material violet/teal par défaut (scaffold, appbar, tabs, boutons, FAB, champs). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fb4ab95f13
commit
30786f9706
@@ -87,6 +87,27 @@ class _ServerDetailScreenState extends State<ServerDetailScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _confirmDelete() async {
|
||||
final ok = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('Supprimer ce serveur ?'),
|
||||
content: Text('« ${s.name} » sera retiré de l\'app (le conteneur Docker n\'est pas touché).'),
|
||||
actions: [
|
||||
TextButton(onPressed: () => Navigator.pop(ctx, false), child: const Text('Annuler')),
|
||||
FilledButton(onPressed: () => Navigator.pop(ctx, true), child: const Text('Supprimer')),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (ok != true) return;
|
||||
try {
|
||||
await widget.api.deleteServer(s.id);
|
||||
if (mounted) Navigator.pop(context);
|
||||
} catch (e) {
|
||||
_snack('$e');
|
||||
}
|
||||
}
|
||||
|
||||
void _snack(String m) {
|
||||
if (mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(m)));
|
||||
}
|
||||
@@ -96,7 +117,17 @@ class _ServerDetailScreenState extends State<ServerDetailScreen> {
|
||||
final t = s.theme;
|
||||
final badge = s.statusBadge;
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(s.name)),
|
||||
appBar: AppBar(
|
||||
title: Text(s.name),
|
||||
actions: [
|
||||
if (s.custom)
|
||||
IconButton(
|
||||
tooltip: 'Supprimer',
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
onPressed: _confirmDelete,
|
||||
),
|
||||
],
|
||||
),
|
||||
body: RefreshIndicator(
|
||||
onRefresh: _load,
|
||||
child: ListView(
|
||||
|
||||
Reference in New Issue
Block a user