Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mortzaCFT authored Nov 14, 2024
1 parent 6ae63c6 commit 00a6e32
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
41 changes: 41 additions & 0 deletions lib/data/dashboard/RecentActivity.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class Recentactivity {
final int id;
final String app;
final int cr;
final int w;
final int n;
final int e;
final int r;

Recentactivity({
required this.id,
required this.app,
required this.cr,
required this.w,
required this.n,
required this.e,
required this.r,
});

factory Recentactivity.fromJson(Map<String, dynamic> json) {
return Recentactivity(
id: json['id'],
app: json['app'],
cr: json['cr'],
w: json['w'],
n: json['n'],
e: json['e'],
r: json['r'],
);
}

Map<String, dynamic> toJson() => {
'id': id,
'app': app,
'cr': cr,
'w': w,
'n': n,
'e': e,
'r': r,
};
}
63 changes: 63 additions & 0 deletions lib/data/dashboard/ResourceUsage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
class ResourceUsage {
int? cpuUsage;
int? cloudUsage;
int? memoryUsage;
int? trafficUsage;

int? cpuFiles;
int? cloudFiles;
int? memoryFiles;
int? trafficFiles;

String? cpuStorage;
String? cloudStorage;
String? memoryStorage;
String? trafficStorage;

ResourceUsage({
this.cpuUsage,
this.cloudUsage,
this.memoryUsage,
this.trafficUsage,
this.cpuFiles,
this.cloudFiles,
this.memoryFiles,
this.trafficFiles,
this.cpuStorage,
this.cloudStorage,
this.memoryStorage,
this.trafficStorage,
});

factory ResourceUsage.fromJson(Map<String, dynamic> json) {
return ResourceUsage(
cpuUsage: json['cpu_usage']?.toInt() ?? 0,
cloudUsage: json['cloud_usage_percentage']?.toInt() ?? 0,
memoryUsage: json['memory_usage_percentage']?.toInt() ?? 0,
trafficUsage: json['traffic_usage']?.toInt() ?? 0,
cpuFiles: json['cpu_files'] ?? 0,
cloudFiles: json['cloud_files'] ?? 0,
memoryFiles: json['memory_usage_used'] ?? 0,
trafficFiles: json['traffic_files'] ?? 0,
cpuStorage: json['cpu_storage'] ?? "0%",
cloudStorage: json['cloud_usage_total'] ?? "0 MB",
memoryStorage: json['memory_usage_total'] ?? "0 GB",
trafficStorage: json['traffic_usage_total'] ?? "0 GB",
);
}

Map<String, dynamic> toJson() => {
'cpuUsage': cpuUsage ?? 0,
'cloudUsage': cloudUsage ?? 0,
'memoryUsage': memoryUsage ?? 0,
'trafficUsage': trafficUsage ?? 0,
'cpuFiles': cpuFiles ?? 0,
'cloudFiles': cloudFiles ?? 0,
'memoryFiles': memoryFiles ?? 0,
'trafficFiles': trafficFiles ?? 0,
'cpuStorage': cpuStorage ?? "0%",
'cloudStorage': cloudStorage ?? "0 MB",
'memoryStorage': memoryStorage ?? "0 GB",
'trafficStorage': trafficStorage ?? "0 GB",
};
}
12 changes: 12 additions & 0 deletions lib/data/settings/UserData.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//if we gather them via backend too...
class Userdata {
String? username;
String? lang;
String? mode;

Userdata({
this.username = "defaultUser",
this.lang = "en",
this.mode = "light",
});
}
Empty file added lib/data/waf/RuleData.dart
Empty file.

0 comments on commit 00a6e32

Please sign in to comment.