UI debugging + git ignore

This commit is contained in:
mr
2024-08-22 15:46:16 +02:00
parent ceeebfc964
commit 1db9ef0794
26 changed files with 1568 additions and 302 deletions

View File

@@ -3,8 +3,31 @@ import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
import 'package:oc_front/core/models/workspace_local.dart';
import 'package:oc_front/models/abstract.dart';
import 'package:oc_front/models/logs.dart';
import 'package:oc_front/models/search.dart';
class Check extends SerializerDeserializer<Check> {
bool is_available = false;
Check({
this.is_available = false,
});
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return Check(); }
return Check(
is_available: json.containsKey("is_available") ? json["is_available"] : false,
);
}
@override Map<String, dynamic> serialize() {
return {
"is_available": is_available,
};
}
}
class WorkflowExecutions extends SerializerDeserializer<WorkflowExecutions> {
List<WorkflowExecution> executions = [];
String? executionData;
@@ -36,6 +59,8 @@ class WorkflowExecution extends SerializerDeserializer<WorkflowExecution> {
String? endDate;
int? status;
String? workflowId;
List<Log>? logs;
WorkflowExecution({
@@ -83,6 +108,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
List<dynamic> workflows;
Graph? graph;
Scheduler? schedule;
bool scheduleActive = false;
Workflow({
this.id,
@@ -94,6 +120,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
this.workflows = const [],
this.graph,
this.schedule,
this.scheduleActive = false,
});
String getID() {
@@ -110,6 +137,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
processing: json.containsKey("processings") ? json["processings"] : [],
datacenter: json.containsKey("datacenters") ? json["datacenters"] : [],
data: json.containsKey("datas") ? json["datas"] : [],
scheduleActive: json.containsKey("schedule_active") ? json["schedule_active"] : false,
storage: json.containsKey("storages") ? json["storages"] : [],
graph: json.containsKey("graph") ? Graph().deserialize(json["graph"]) : null,
schedule: json.containsKey("schedule") ? Scheduler().deserialize(json["schedule"]) : null,
@@ -124,6 +152,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
"storages": storage,
"processings": processing,
"workflows": workflows,
"schedule_active": scheduleActive,
"schedule": schedule?.serialize(),
};
if (graph != null) {
@@ -135,6 +164,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
void fromDashboard(Map<String, dynamic> j) {
id = j["id"];
name = j["name"];
scheduleActive = j["schedule_active"];
if (j.containsKey("graph")) {
graph = Graph();
graph!.fromDashboard(j["graph"]);
@@ -149,6 +179,7 @@ class Workflow extends SerializerDeserializer<Workflow> {
"id": id,
"name": name,
"graph": graph?.toDashboard(),
"schedule_active": scheduleActive,
"schedule": schedule?.toDashboard(),
};
}
@@ -160,13 +191,15 @@ class Scheduler extends SerializerDeserializer<Scheduler> {
String? cron;
DateTime? start;
DateTime? end;
int? mode;
Scheduler({
this.id,
this.name,
this.cron,
this.start,
this.end
this.end,
this.mode,
});
void fromDashboard(Map<String, dynamic> j) {
@@ -177,13 +210,14 @@ class Scheduler extends SerializerDeserializer<Scheduler> {
if (j.containsKey("end") && j["end"] != null) {
end = DateTime.parse(j["end"]);
}
mode = int.parse(j["mode"].toString());
}
Map<String, dynamic> toDashboard() {
return {
"id": id,
"name": name,
"cron": cron,
"mode": int.parse(mode.toString()),
"start": start?.toIso8601String(),
"end": end?.toIso8601String(),
};
@@ -196,6 +230,7 @@ class Scheduler extends SerializerDeserializer<Scheduler> {
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : "",
cron: json.containsKey("cron") ? json["cron"] : "",
mode: json.containsKey("mode") ? json["mode"] : "",
start: json.containsKey("start") ? DateTime.parse(json["start"]) : null,
end: json.containsKey("end") ? DateTime.parse(json["end"]) : null,
);
@@ -204,6 +239,7 @@ class Scheduler extends SerializerDeserializer<Scheduler> {
"id": id,
"name": name,
"cron": cron ?? "",
"mode": int.parse(mode.toString()),
"start": start?.toIso8601String(),
"end": end?.toIso8601String(),
};