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
@@ -17,6 +17,7 @@ class GameServer {
|
||||
final String? motd;
|
||||
final bool hasIcon;
|
||||
final bool hasImage;
|
||||
final bool custom;
|
||||
|
||||
const GameServer({
|
||||
required this.id,
|
||||
@@ -34,6 +35,7 @@ class GameServer {
|
||||
this.motd,
|
||||
this.hasIcon = false,
|
||||
this.hasImage = false,
|
||||
this.custom = false,
|
||||
});
|
||||
|
||||
factory GameServer.fromJson(Map<String, dynamic> json) => GameServer(
|
||||
@@ -52,6 +54,7 @@ class GameServer {
|
||||
motd: json['motd'] as String?,
|
||||
hasIcon: json['has_icon'] as bool? ?? false,
|
||||
hasImage: json['has_image'] as bool? ?? false,
|
||||
custom: json['custom'] as bool? ?? false,
|
||||
);
|
||||
|
||||
bool get isUp => status == 'online' || status == 'running';
|
||||
@@ -84,3 +87,27 @@ class GameServer {
|
||||
_ => (label: 'Éteint', color: const Color(0xFF8E8E93)),
|
||||
};
|
||||
}
|
||||
|
||||
/// Conteneur Docker (pour lier un serveur depuis l'app).
|
||||
class DockerContainer {
|
||||
DockerContainer({required this.name, required this.image, required this.state});
|
||||
final String name;
|
||||
final String image;
|
||||
final String state;
|
||||
|
||||
factory DockerContainer.fromJson(Map<String, dynamic> j) => DockerContainer(
|
||||
name: j['name'] as String,
|
||||
image: (j['image'] as String?) ?? '',
|
||||
state: (j['state'] as String?) ?? '',
|
||||
);
|
||||
|
||||
bool get running => state == 'running';
|
||||
|
||||
/// Image sans le registre ni le digest, pour la lisibilité.
|
||||
/// ex: git.nfteam.ovh/neckfire/the-cycle:preprod → the-cycle:preprod
|
||||
String get prettyImage {
|
||||
var s = image.split('/').last;
|
||||
if (s.length > 34) s = '${s.substring(0, 33)}…';
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user