修复服务器状态图标

This commit is contained in:
xkeyC 2023-10-19 19:44:23 +08:00
parent 02b2ba4d15
commit a6605cf2da
2 changed files with 15 additions and 11 deletions

View File

@ -232,17 +232,17 @@ class HomeUI extends BaseUI<HomeUIModel> {
for (final item in model.scServerStatus ?? []) for (final item in model.scServerStatus ?? [])
Row( Row(
children: [ children: [
Center( SizedBox(
child: Icon( height: 14,
item["status"] == "ok" child: Center(
? FontAwesomeIcons.circleCheck child: Icon(
: FluentIcons.error, FontAwesomeIcons.solidCircle,
color: (item["status"] == color:
"operational" || model.isRSIServerStatusOK(item)
item["status"] == "ok") ? Colors.green
? Colors.green : Colors.red,
: Colors.red, size: 12,
size: 18, ),
), ),
), ),
const SizedBox(width: 3), const SizedBox(width: 3),

View File

@ -465,4 +465,8 @@ class HomeUIModel extends BaseUIModel {
isRsiLauncherStarting = false; isRsiLauncherStarting = false;
notifyListeners(); notifyListeners();
} }
bool isRSIServerStatusOK(Map map) {
return (map["status"] == "ok" || map["status"] == "operational");
}
} }