mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
APT/Docker manage
- view apt update - view docker container
This commit is contained in:
29
lib/data/model/docker/ps.dart
Normal file
29
lib/data/model/docker/ps.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class DockerPsItem {
|
||||
late String containerId;
|
||||
late String image;
|
||||
late String command;
|
||||
late String created;
|
||||
late String status;
|
||||
late String ports;
|
||||
late String name;
|
||||
|
||||
DockerPsItem(this.containerId, this.image, this.command, this.created,
|
||||
this.status, this.ports, this.name);
|
||||
|
||||
DockerPsItem.fromRawString(String rawString) {
|
||||
final List<String> parts = rawString.split(' ');
|
||||
containerId = parts[0];
|
||||
image = parts[1];
|
||||
command = parts[2];
|
||||
created = parts[3];
|
||||
status = parts[4];
|
||||
ports = parts[5];
|
||||
if (running && parts.length == 9) {
|
||||
name = parts[8];
|
||||
} else {
|
||||
name = parts[6];
|
||||
}
|
||||
}
|
||||
|
||||
bool get running => status.contains('Up ');
|
||||
}
|
||||
Reference in New Issue
Block a user