Shared WS

This commit is contained in:
mr
2024-08-27 15:38:21 +02:00
parent 36a70db69f
commit 6ba32a7dfa
19 changed files with 479 additions and 87 deletions

View File

@@ -10,6 +10,7 @@ class Workspace extends SerializerDeserializer<Workspace> {
List<StorageItem> storages;
List<ProcessingItem> processings;
List<WorkflowItem> workflows;
String? shared;
Workspace({
this.id,
@@ -20,13 +21,16 @@ class Workspace extends SerializerDeserializer<Workspace> {
this.datacenters = const [],
this.storages = const [],
this.processings = const [],
this.shared,
});
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return Workspace(); }
print(json);
return Workspace(
id: json.containsKey("id") ? json["id"] : null,
shared: json["shared"],
name: json.containsKey("name") ? json["name"] : null,
active: json.containsKey("active") ? json["active"] : false,
processings: json.containsKey("processing_resources") ? fromListJson(json["processing_resources"], ProcessingItem()) : [],