draft booking scheduler page

This commit is contained in:
mr
2024-11-13 08:12:37 +01:00
parent 1ca77b6611
commit 062042b590
15 changed files with 288 additions and 72 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_box_transform/flutter_box_transform.dart';
import 'package:oc_front/core/sections/header/header.dart';
import 'package:oc_front/main.dart';
import 'package:oc_front/models/logs.dart';
import 'package:oc_front/models/workflow.dart';
@@ -19,7 +18,9 @@ class ScheduleWidget extends StatefulWidget {
bool loading = true;
Map<String, List<WorkflowExecution>> data;
bool isList = true;
ScheduleWidget ({ super.key, required this.data, required this.start, required this.end, this.isList = true, this.loading = false});
bool isBox = true;
ScheduleWidget ({ super.key, required this.data, required this.start, required this.end,
this.isBox =true, this.isList = true, this.loading = false});
@override ScheduleWidgetState createState() => ScheduleWidgetState();
}
String? selected;
@@ -27,8 +28,8 @@ String? selectedReal;
class ScheduleWidgetState extends State<ScheduleWidget> {
String search = "";
String? level;
List<Color> colors = [Colors.blue, Colors.orange, redColor, Colors.green];
List<String> titles = ["SCHEDULED", "RUNNING", "FAILURE", "SUCCESS"];
List<Color> colors = [Colors.blue, Colors.orange, redColor, Colors.green, redColor];
List<String> titles = ["SCHEDULED", "RUNNING", "FAILURE", "SUCCESS", "FORGOTTEN"];
DateTime getFocusedDay() {
if (selected != null) { return DateTime.parse(selected!); }
@@ -36,8 +37,8 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
}
@override Widget build(BuildContext context) {
bool isInfo = getMainWidth(context) <= 600 && selected != null;
double w = selected != null ? getMainWidth(context) - menuSize : getMainWidth(context);
bool isInfo = getMainWidth(context) <= 600 && selected != null && widget.isBox;
double w = selected != null && widget.isBox ? getMainWidth(context) - menuSize : getMainWidth(context);
List<Widget> children = [];
if (selected != null) {
for (var wf in widget.data[selected!] ?? (<WorkflowExecution>[])) {
@@ -94,7 +95,7 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
: SchedulerCalendarWidget(data: widget.data, start: widget.start,
end: widget.end, parent: this, focusedDay: getFocusedDay(),)
),
fork.TransformableBox(
!widget.isBox ? Container() : fork.TransformableBox(
rect: rect, constraints: BoxConstraints(
maxWidth: isInfo ? getMainWidth(context) : (selected != null ? getMainWidth(context) / 2 : 0),
minWidth: selected != null ? 300 : 0),