This commit is contained in:
mr
2025-02-21 11:14:46 +01:00
parent 28510d0ba1
commit 863a35b878
34 changed files with 153 additions and 128 deletions

View File

@@ -61,7 +61,6 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
dash.error = "You need to link each processing element to a compute element";
}
}
print("qdjqksdn ${dash.error}");
if (dash.error != null) {
showAlertBanner( context, () {}, AlertAlertBannerChild(text: dash.error.toString()),// <-- Put any widget here you want!
alertBannerLocation: AlertBannerLocation.bottom,);
@@ -71,7 +70,6 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
for (var k in formKeys) {
if (k.currentState != null) {
if (!k.currentState!.validate()) {
print("bwak");
return;
} else { k.currentState!.save();}
}
@@ -84,14 +82,11 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
}
}
Duration durationBefore = widget.schedule.start!.difference(DateTime.now().toUtc()) + Duration(seconds: 5);
print("qdjqksdn ${widget.item.id}");
widget._schedulerService.schedule(context, widget.item.id ?? "", widget.schedule.serialize(), {}).catchError( (e) {
print("THERE2");
setState(() {
widget.error = e.toString();
});
}).then((value) {
print("THERE");
setState(() { widget.valid = true; });
Future.delayed(durationBefore, () {
try {
@@ -222,12 +217,11 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
);
});
} : null,
);
shallow.change =(p0) => Future.delayed( const Duration(seconds: 2), () async {
if (shallow.compare == p0) {
await WorflowService().put(context, widget.item.id ?? "", { "name" : p0 }, {});
} else {
shallow.compare = p0;
);
shallow.change =(p0) => Future.delayed( const Duration(milliseconds: 100), () async {
if (shallow.current == p0) {
dash.name = p0 ?? dash.name;
await WorflowService().put(context, widget.item.id ?? "", { "name" : dash.name }, {});
}
});
return Column( children: [
@@ -243,7 +237,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
bottom: const BorderSide(color: Colors.grey))),
child: shallow ),
const SizedBox(height: 20, width: 200 ),
isService ? Text("Warning a processing is a service, if no end execution it will run forever.") : Container(),
isService ? const Text("Warning a processing is a service, if no end execution it will run forever.") : Container(),
Tooltip( message: "start executions",
child: Container( height: 40, margin: const EdgeInsets.only(top: 5),
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),

View File

@@ -27,8 +27,8 @@ class LogsWidgetState extends State<LogsWidget> {
try { setState(() { });
} catch (e) { /**/ }
});
return Container( height: getMainHeight(context) - 100,
child: Center( child: CircularProgressIndicator()) );
return SizedBox( height: getMainHeight(context) - 100,
child: const Center( child: CircularProgressIndicator()) );
}
if (widget.exec == null) {
return Container();
@@ -53,11 +53,7 @@ class LogsWidgetState extends State<LogsWidget> {
end = (DateTime.parse(widget.exec!.startDate!).add( const Duration(days: 14)).microsecondsSinceEpoch).toString();
}
} catch(e) { /* */ }
Future.delayed(const Duration(minutes: 1), () {
try { setState(() {});
} catch (e) { /**/ }
});
return FutureBuilder(future: LogsService().search(context, [], {
return FutureBuilder(future: LogsService().search(null, [], {
"workflow_execution_id": widget.exec!.id,
"start": start,
"end": end

View File

@@ -44,6 +44,7 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
"${widget.end.year}-${widget.end.month > 9 ? widget.end.month : "0${widget.end.month}"}-${widget.end.day > 9 ? widget.end.day : "0${widget.end.day}"}"], {}),
builder: (ctx, as) {
Map<String, List<WorkflowExecution>> data = {};
DateTime? firstDate;
if (as.hasData && as.data!.data != null) {
for (var element in as.data!.data!.executions) {
if (element.startDate == null) { continue; }
@@ -52,9 +53,20 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
var str = "${date.toIso8601String()}Z";
if (data[str] == null) { data[str] = []; }
data[str]!.add(element);
data[str]!.sort((a, b) => DateTime.parse(a.startDate!).compareTo(DateTime.parse(b.startDate!)));
data[str]!.sort((a, b) => DateTime.parse(a.startDate!).compareTo(DateTime.parse(b.startDate!)));
}
}
List<WorkflowExecution> vals = [];
for (var val in data.values) {
vals.addAll(val);
}
if (vals.isNotEmpty) {
try {
Future.delayed(const Duration(minutes: 1), () {
setState(() {});
});
} catch (e) { /* */ }
}
bool isInfo = getMainWidth(context) <= 600 && selected != null && widget.isBox;
double w = selected != null && widget.isBox ? getMainWidth(context) - menuSize : getMainWidth(context);
List<Widget> children = [];

View File

@@ -34,7 +34,6 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
selected = selected != element || ev.startDate != selectedReal ? element : null;
widget.parent!.widget.selectedID = selected;
selectedReal = selected == null ? null : ev.startDate;
print("there");
if (selectedReal == null) {
widget.parent!.widget.isDayPlanner = true;
}