mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: collapse custom cmd output
This commit is contained in:
@@ -63,4 +63,17 @@ final class ServerCustom {
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is ServerCustom &&
|
||||
//other.temperature == temperature &&
|
||||
other.pveAddr == pveAddr &&
|
||||
other.pveIgnoreCert == pveIgnoreCert &&
|
||||
other.cmds == cmds &&
|
||||
other.preferTempDev == preferTempDev;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => toString().hashCode;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,13 @@ extension ServerX on Server {
|
||||
return l10n.disconnected;
|
||||
case ServerState.finished:
|
||||
// Highest priority of temperature display
|
||||
final cmdTemp = status.customCmds['server_card_top_right'];
|
||||
final cmdTemp = () {
|
||||
final val = status.customCmds['server_card_top_right'];
|
||||
if (val == null) return null;
|
||||
// This returned value is used on server card top right, so it should
|
||||
// be a single line string.
|
||||
return val.split('\n').lastOrNull;
|
||||
}();
|
||||
final temperatureVal = () {
|
||||
// Second priority
|
||||
final preferTempDev = spi.custom?.preferTempDev;
|
||||
|
||||
Reference in New Issue
Block a user