oclib
This commit is contained in:
@@ -12,7 +12,6 @@ class AppConfig {
|
||||
Future<void> loadConfig() async {
|
||||
final response = await rootBundle.loadString('assets/config/front.json');
|
||||
_config = Map<String, String>.from(json.decode(response));
|
||||
print('Config loaded: $_config');
|
||||
}
|
||||
|
||||
String get(String key, {String defaultValue = ''}) {
|
||||
|
||||
@@ -29,6 +29,7 @@ class WorkspaceLocal {
|
||||
static List<AbstractItem> items = [];
|
||||
|
||||
static Future<void> init(BuildContext? context, bool changeCurrent) async {
|
||||
WorkspaceLocal.createWorkspace("default workspace", null);
|
||||
var value = await _service.all(context);
|
||||
if (value.data != null && value.data!.values.isNotEmpty ) {
|
||||
var vals = value.data!.values;
|
||||
@@ -47,8 +48,6 @@ class WorkspaceLocal {
|
||||
fill();
|
||||
HeaderConstants.headerKey.currentState?.setState(() {});
|
||||
}
|
||||
} else {
|
||||
await WorkspaceLocal.createWorkspace("default workspace", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +107,7 @@ class WorkspaceLocal {
|
||||
WorkflowFactory.key.currentState?.setState(() {});
|
||||
HeaderConstants.headerKey.currentState?.setState(() {});
|
||||
}
|
||||
});
|
||||
}).catchError( (e) {});
|
||||
}
|
||||
|
||||
static void changeWorkspaceByName(String name) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class APIService<T extends SerializerDeserializer> {
|
||||
|
||||
Dio _dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: const String.fromEnvironment('HOST', defaultValue: 'http://localhost:8080'), // you can keep this blank
|
||||
baseUrl: const String.fromEnvironment('HOST', defaultValue: 'http://localhost:8000'), // you can keep this blank
|
||||
headers: { 'Content-Type': 'application/json; charset=UTF-8', 'Access-Control-Allow-Origin': '*' },
|
||||
),
|
||||
)..interceptors.add(LogInterceptor(
|
||||
|
||||
@@ -5,10 +5,10 @@ import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/response.dart';
|
||||
|
||||
class AuthService {
|
||||
static var isAuth = const bool.fromEnvironment('AUTH_MODE', defaultValue: false);
|
||||
static var isAuth = const bool.fromEnvironment('AUTH_MODE', defaultValue: true);
|
||||
static const _clientID = String.fromEnvironment('CLIENT_ID', defaultValue: 'test-client');
|
||||
static APIService<SimpleData> service = APIService(
|
||||
baseURL: const String.fromEnvironment('AUTH_HOST', defaultValue: 'http://localhost:8080/auth'),
|
||||
baseURL: const String.fromEnvironment('AUTH_HOST', defaultValue: 'http://localhost:8000/auth'),
|
||||
);
|
||||
|
||||
static Future<void> init() async {
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:oc_front/core/services/api_service.dart';
|
||||
class EnumService {
|
||||
static final APIService<EnumData> _service = APIService<EnumData>(
|
||||
baseURL: const String.fromEnvironment('ITEM_HOST',
|
||||
defaultValue: 'http://localhost:8080/catalog')
|
||||
defaultValue: 'http://localhost:8000/catalog')
|
||||
);
|
||||
static String subPath = "/enum/";
|
||||
static Map<String, Map<String,dynamic>> enums = {};
|
||||
|
||||
@@ -71,7 +71,6 @@ class PermsService {
|
||||
try {
|
||||
var what = json.decode(foo);
|
||||
what = what["session"]["access_token"] as Map<String, dynamic>;
|
||||
|
||||
for (var w in perms.keys) {
|
||||
if (what.keys.contains(perms[w])) {
|
||||
_perms[w] = true;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:oc_front/core/sections/header/header.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/pages/abstract_page.dart';
|
||||
@@ -42,7 +44,8 @@ class RouterItem {
|
||||
|
||||
void go(BuildContext context, Map<String, String> params) {
|
||||
AppRouter.currentRoute = this;
|
||||
var newPath = "$path";
|
||||
var newPath = path;
|
||||
AppRouter.setRouteCookie(newPath, params, context);
|
||||
for (var arg in args) { newPath = newPath.replaceAll(":$arg", params[arg] ?? ""); }
|
||||
Future.delayed( const Duration(seconds: 1), () {
|
||||
HeaderConstants.setTitle(null);
|
||||
@@ -87,6 +90,29 @@ class AppRouter {
|
||||
});
|
||||
}
|
||||
|
||||
static verifyRoute(context) async {
|
||||
var url = await getRouteCookie();
|
||||
if (url != null && url != "") {
|
||||
for (var zone in zones) {
|
||||
print("URL: $url ${zone.route}");
|
||||
if (zone.route == url.replaceAll("/", "")) {
|
||||
Map<String, String> params = {};
|
||||
var srcParams = await getRouteParamsCookie();
|
||||
for (var key in srcParams.keys) {
|
||||
params[key] = "${srcParams[key]}";
|
||||
}
|
||||
zone.go(context, params);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String,dynamic>> getRouteParamsCookie() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
return prefs.getString("params") != null && prefs.getString("params") != "" ? json.decode(prefs.getString("params")!) : {};
|
||||
}
|
||||
|
||||
static Future<String?> getRouteCookie() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
return prefs.getString("url") != "" ? prefs.getString("url") : null;
|
||||
@@ -95,11 +121,13 @@ class AppRouter {
|
||||
static removeRouteCookie() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.remove("url");
|
||||
prefs.remove("params");
|
||||
}
|
||||
|
||||
static setRouteCookie( String path , BuildContext context ) async {
|
||||
static setRouteCookie( String path, Map<String, String> params, BuildContext context ) async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setString("url", path);
|
||||
prefs.setString("params", params.toString());
|
||||
if (realHistory.isNotEmpty && realHistory.last != path || realHistory.isEmpty) {
|
||||
try {
|
||||
var index = history.indexOf(realHistory.last);
|
||||
@@ -122,7 +150,6 @@ class AppRouter {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setString("url", realHistory.last);
|
||||
prefs.setString("history", realHistory.join(","));
|
||||
var splitted = realHistory.last.split(":");
|
||||
routerKey.currentState?.setState(() { });
|
||||
scaffoldKey.currentState?.setState(() {});
|
||||
}
|
||||
@@ -139,7 +166,6 @@ class AppRouter {
|
||||
realHistory.add(history[index + 1]);
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setString("url", realHistory.last);
|
||||
var splitted = realHistory.last.split(":");
|
||||
prefs.setString("history", realHistory.join(","));
|
||||
routerKey.currentState?.setState(() { });
|
||||
scaffoldKey.currentState?.setState(() {});
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:oc_front/models/workflow.dart';
|
||||
|
||||
class BookingExecutionService extends AbstractService<WorkflowExecution> {
|
||||
@override APIService<WorkflowExecution> service = APIService<WorkflowExecution>(
|
||||
baseURL: const String.fromEnvironment('DATACENTER_HOST', defaultValue: 'http://localhost:8080/datacenter')
|
||||
baseURL: const String.fromEnvironment('DATACENTER_HOST', defaultValue: 'http://localhost:8000/datacenter')
|
||||
);
|
||||
@override String subPath = "/booking/";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:oc_front/models/response.dart';
|
||||
|
||||
class DatacenterService extends AbstractService<Resource> {
|
||||
@override APIService<Resource> service = APIService<Resource>(
|
||||
baseURL: const String.fromEnvironment('DATACENTER_HOST', defaultValue: 'http://localhost:8080/datacenter')
|
||||
baseURL: const String.fromEnvironment('DATACENTER_HOST', defaultValue: 'http://localhost:8000/datacenter')
|
||||
);
|
||||
@override String subPath = "/";
|
||||
|
||||
|
||||
@@ -11,10 +11,9 @@ class LogsService extends AbstractService<LogsResult> {
|
||||
@override
|
||||
String subPath = "/loki/api/v1/";
|
||||
|
||||
LogService() {
|
||||
LogsService() {
|
||||
service = APIService<LogsResult>(
|
||||
baseURL:
|
||||
super.conf.get('LOGS_HOST', defaultValue: 'http://localhost:3100'));
|
||||
baseURL: super.conf.get('LOGS_HOST', defaultValue: 'http://localhost:8000/tools/loki'));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -12,6 +12,6 @@ class PeerService extends AbstractService<Peer> {
|
||||
service = APIService<Peer>(
|
||||
baseURL: super
|
||||
.conf
|
||||
.get('PEER_HOST', defaultValue: 'http://localhost:8080/peer'));
|
||||
.get('PEER_HOST', defaultValue: 'http://localhost:8000/peer'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class ResourceService extends AbstractService<Resource> {
|
||||
service = APIService<Resource>(
|
||||
baseURL: super
|
||||
.conf
|
||||
.get('ITEM_HOST', defaultValue: 'http://localhost:8080/catalog'));
|
||||
.get('ITEM_HOST', defaultValue: 'http://localhost:8000/catalog'));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -14,7 +14,7 @@ class SharedService extends AbstractService<CollaborativeArea> {
|
||||
SharedService() {
|
||||
service = APIService<CollaborativeArea>(
|
||||
baseURL: super.conf.get('COLLABORATIVE_AREA_HOST',
|
||||
defaultValue: 'http://localhost:8080/shared'));
|
||||
defaultValue: 'http://localhost:8000/shared'));
|
||||
}
|
||||
|
||||
Future<APIResponse<CollaborativeArea>> addWorkspace(
|
||||
|
||||
@@ -6,14 +6,14 @@ import 'package:oc_front/models/workflow.dart';
|
||||
|
||||
class WorkflowExecutionService extends AbstractService<WorkflowExecutions> {
|
||||
@override APIService<WorkflowExecutions> service = APIService<WorkflowExecutions>(
|
||||
baseURL: const String.fromEnvironment('SCHEDULER_HOST', defaultValue: 'http://localhost:8080/scheduler')
|
||||
baseURL: const String.fromEnvironment('SCHEDULER_HOST', defaultValue: 'http://localhost:8000/scheduler')
|
||||
);
|
||||
@override String subPath = "/execution/";
|
||||
|
||||
WorkflowExecutionService() {
|
||||
service = APIService<WorkflowExecutions>(
|
||||
baseURL: super.conf.get('SCHEDULER_HOST',
|
||||
defaultValue: 'http://localhost:8080/scheduler'));
|
||||
defaultValue: 'http://localhost:8000/scheduler'));
|
||||
}
|
||||
@override
|
||||
Future<APIResponse<WorkflowExecutions>> search(
|
||||
|
||||
@@ -6,12 +6,11 @@ import 'package:oc_front/models/workflow.dart';
|
||||
|
||||
class SchedulerService extends AbstractService<WorkflowExecutions> {
|
||||
@override APIService<WorkflowExecutions> service = APIService<WorkflowExecutions>(
|
||||
baseURL: const String.fromEnvironment('SCHEDULER_HOST', defaultValue: 'http://localhost:8080/scheduler')
|
||||
baseURL: const String.fromEnvironment('SCHEDULER_HOST', defaultValue: 'http://localhost:8000/scheduler')
|
||||
);
|
||||
@override String subPath = "/";
|
||||
|
||||
Future<APIResponse<WorkflowExecutions>> schedule(BuildContext? context, String id, Map<String, dynamic> body, Map<String, dynamic> params) {
|
||||
print(body);
|
||||
return service.post("$subPath$id", body, context);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ class WorflowService extends AbstractService<Workflow> {
|
||||
WorflowService() {
|
||||
service = APIService<Workflow>(
|
||||
baseURL: super.conf.get('WORKFLOW_HOST',
|
||||
defaultValue: 'http://localhost:8080/workflow'));
|
||||
defaultValue: 'http://localhost:8000/workflow'));
|
||||
serviceCheck = APIService<Check>(
|
||||
baseURL: super.conf.get('WORKFLOW_HOST',
|
||||
defaultValue: 'http://localhost:8080/workflow'));
|
||||
defaultValue: 'http://localhost:8000/workflow'));
|
||||
}
|
||||
|
||||
Future<APIResponse<Check>> check(
|
||||
|
||||
@@ -12,6 +12,6 @@ class WorkspaceService extends AbstractService<Workspace> {
|
||||
WorkspaceService() {
|
||||
service = APIService<Workspace>(
|
||||
baseURL: super.conf.get('WORKSPACE_HOST',
|
||||
defaultValue: 'http://localhost:8080/workspace'));
|
||||
defaultValue: 'http://localhost:8000/workspace'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:localstorage/localstorage.dart';
|
||||
import 'package:oc_front/core/models/shared_workspace_local.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
import 'package:oc_front/core/sections/header/header.dart';
|
||||
import 'package:oc_front/core/sections/header/menu.dart';
|
||||
@@ -14,7 +15,6 @@ import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/core/sections/end_drawer.dart';
|
||||
import 'package:oc_front/widgets/dialog/login.dart';
|
||||
import 'package:oc_front/core/conf/conf_reader.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
@@ -35,6 +35,7 @@ class MyApp extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AppRouter.verifyRoute(context);
|
||||
AuthService.init();
|
||||
EnumService.init();
|
||||
SearchConstants.clear();
|
||||
@@ -88,7 +89,6 @@ double getMainWidth(BuildContext context) {
|
||||
}
|
||||
bool loginIsSet = false;
|
||||
class MainPageState extends State<MainPage> {
|
||||
bool isCtrl = false;
|
||||
final FocusNode node = FocusNode();
|
||||
@override
|
||||
void initState() {
|
||||
@@ -106,13 +106,13 @@ class MainPageState extends State<MainPage> {
|
||||
// fast, so that you can just rebuild anything that needs updating rather
|
||||
// than having to individually change instances of widgets.i
|
||||
scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
isCtrl = false;
|
||||
if (!AuthService.isConnected() && !loginIsSet) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
loginIsSet = true;
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context ?? context, builder: (context) {
|
||||
// ignore: use_build_context_synchronously
|
||||
context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
insetPadding: EdgeInsets.zero,
|
||||
backgroundColor: Colors.white,
|
||||
@@ -137,23 +137,20 @@ class MainPageState extends State<MainPage> {
|
||||
Container( padding: const EdgeInsets.symmetric(vertical: 30),
|
||||
decoration: BoxDecoration( color: darkColor),
|
||||
width: 50, height: getHeight(context) - 50,
|
||||
child: SingleChildScrollView( child: LeftMenuWidget() )),
|
||||
child: const SingleChildScrollView( child: LeftMenuWidget() )),
|
||||
SizedBox( width: getMainWidth(context), height: getHeight(context) - 50,
|
||||
child: KeyboardListener(
|
||||
focusNode: node,
|
||||
onKeyEvent: (event) async {
|
||||
if ( event.logicalKey == LogicalKeyboardKey.controlLeft ) {
|
||||
isCtrl = (event is KeyDownEvent);
|
||||
node.requestFocus();
|
||||
} else if( (event is KeyDownEvent) && event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
AppRouter.currentRoute.factory.search(context, isCtrl);
|
||||
if( (event is KeyDownEvent) && event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
AppRouter.currentRoute.factory.search(context, false);
|
||||
node.requestFocus();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
HeaderWidget(),
|
||||
const HeaderWidget(),
|
||||
widget.page ?? Container() // CatalogPageWidget(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -72,6 +72,7 @@ class Log extends SerializerDeserializer<Log> {
|
||||
|
||||
String getMessage(String mess) {
|
||||
var jsonString = mess;
|
||||
print(mess);
|
||||
try {
|
||||
var j = JsonString(mess.replaceAll("\\", "")).decodedValue as Map<String, dynamic>;
|
||||
map = j;
|
||||
@@ -87,9 +88,8 @@ class Log extends SerializerDeserializer<Log> {
|
||||
|
||||
@override deserialize(dynamic json) {
|
||||
try { json = json as List<dynamic>;
|
||||
} catch (e) { return Log(); }
|
||||
var l = Log(
|
||||
timestamp: json.isNotEmpty ? DateTime.fromMillisecondsSinceEpoch(int.parse(json[0]) ~/ 1000) : null,
|
||||
} catch (e) { return Log(); } var l = Log(
|
||||
timestamp: json.isNotEmpty ? DateTime.fromMillisecondsSinceEpoch(int.parse(json[0]) ~/ 1000, isUtc : true) : null,
|
||||
message: json.length > 1 ? getMessage(json[1].toString()) : null,
|
||||
rawMessage : json.length > 1 ? json[1].toString() : null,
|
||||
);
|
||||
|
||||
@@ -67,9 +67,9 @@ class MapPageWidgetState extends State<MapPageWidget> {
|
||||
height: 30,
|
||||
point: coordinates[topic]![coord]!,
|
||||
child: HoverMenu( width: 110, title: Container( alignment: Alignment.center,
|
||||
constraints: BoxConstraints( maxHeight: 100, maxWidth: 100 ),
|
||||
constraints: const BoxConstraints( maxHeight: 100, maxWidth: 100 ),
|
||||
child: Icon(FontAwesomeIcons.locationDot,
|
||||
shadows: <Shadow>[Shadow(color: Color.fromRGBO(0, 0, 0, 1), blurRadius: 10.0)],
|
||||
shadows: const <Shadow>[Shadow(color: Color.fromRGBO(0, 0, 0, 1), blurRadius: 10.0)],
|
||||
color: getColor(topic)) ),
|
||||
items: [ Container(color: Colors.white,
|
||||
child: ItemRowWidget(low: true, contextWidth: 290, item: coord)) ]
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user