new: edit settings in json

This commit is contained in:
lollipopkit
2023-08-28 18:08:26 +08:00
parent 11c3bf795b
commit 0420793e21
13 changed files with 83 additions and 31 deletions

View File

@@ -43,6 +43,28 @@ enum NetViewType {
);
}
}
int toJson() {
switch (this) {
case NetViewType.conn:
return 0;
case NetViewType.speed:
return 1;
case NetViewType.traffic:
return 2;
}
}
static NetViewType fromJson(int json) {
switch (json) {
case 0:
return NetViewType.conn;
case 2:
return NetViewType.traffic;
default:
return NetViewType.speed;
}
}
}
class NetViewData {