mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: display name of server func btns
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import 'package:dartssh2/dartssh2.dart';
|
||||
import 'package:toolbox/data/model/server/conn.dart';
|
||||
import 'package:toolbox/data/model/server/cpu.dart';
|
||||
import 'package:toolbox/data/model/server/disk.dart';
|
||||
import 'package:toolbox/data/model/server/memory.dart';
|
||||
import 'package:toolbox/data/model/server/net_speed.dart';
|
||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import 'package:toolbox/data/model/server/server_status.dart';
|
||||
import 'package:toolbox/data/model/server/system.dart';
|
||||
import 'package:toolbox/data/model/server/temp.dart';
|
||||
|
||||
import '../app/tag_pickable.dart';
|
||||
|
||||
@@ -10,9 +16,6 @@ class Server implements TagPickable {
|
||||
SSHClient? client;
|
||||
ServerState state;
|
||||
|
||||
/// Whether is connectting, parsing and etc.
|
||||
bool isBusy = false;
|
||||
|
||||
Server(this.spi, this.status, this.client, this.state);
|
||||
|
||||
@override
|
||||
@@ -28,6 +31,43 @@ class Server implements TagPickable {
|
||||
bool get canViewDetails => state == ServerState.finished;
|
||||
|
||||
String get id => spi.id;
|
||||
|
||||
bool get isBusy => status._isBusy;
|
||||
|
||||
set isBusy(bool value) => status._isBusy = value;
|
||||
}
|
||||
|
||||
class ServerStatus {
|
||||
Cpus cpu;
|
||||
Memory mem;
|
||||
Swap swap;
|
||||
String sysVer;
|
||||
String uptime;
|
||||
List<Disk> disk;
|
||||
Conn tcp;
|
||||
NetSpeed netSpeed;
|
||||
Temperatures temps;
|
||||
SystemType system;
|
||||
String? failedInfo;
|
||||
DiskIO diskIO;
|
||||
|
||||
/// Whether is connectting, parsing and etc.
|
||||
bool _isBusy = false;
|
||||
|
||||
ServerStatus({
|
||||
required this.cpu,
|
||||
required this.mem,
|
||||
required this.sysVer,
|
||||
required this.uptime,
|
||||
required this.disk,
|
||||
required this.tcp,
|
||||
required this.netSpeed,
|
||||
required this.swap,
|
||||
required this.temps,
|
||||
required this.system,
|
||||
required this.diskIO,
|
||||
this.failedInfo,
|
||||
});
|
||||
}
|
||||
|
||||
enum ServerState {
|
||||
|
||||
Reference in New Issue
Block a user