Major Change Inputs & Co
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/widgets/items/item_row.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
|
||||
class CatalogWidget extends StatefulWidget {
|
||||
double? itemWidth;
|
||||
bool readOnly = false;
|
||||
final List<AbstractItem>? items;
|
||||
CatalogWidget ({ Key? key, this.items, this.itemWidth, this.readOnly = false }): super(key: key);
|
||||
CatalogWidget ({ super.key, this.items, this.itemWidth, this.readOnly = false });
|
||||
@override CatalogWidgetState createState() => CatalogWidgetState();
|
||||
}
|
||||
class CatalogWidgetState extends State<CatalogWidget> {
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:oc_front/core/services/auth.service.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/pages/workflow.dart';
|
||||
|
||||
class LoginWidget extends StatefulWidget {
|
||||
LoginWidget ({ Key? key }): super(key: key);
|
||||
@@ -30,26 +31,32 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
loading = false;
|
||||
error = "Invalid username or password";
|
||||
});
|
||||
}).then( (e) {
|
||||
if (error == null) {
|
||||
// ignore: use_build_context_synchronously
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
loginIsSet = false;
|
||||
dash.inDialog = false;
|
||||
context.pop();
|
||||
mainKey?.currentState?.setState(() {});
|
||||
}
|
||||
});
|
||||
if (error == null) {
|
||||
// ignore: use_build_context_synchronously
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(50), child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
const Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)),
|
||||
child: Container( padding: const EdgeInsets.all(50), child: Column(children: [
|
||||
getMainHeight(context) < 600 ? Container() : SizedBox( width: getMainWidth(context) / 4, height: getMainHeight(context) / 4,
|
||||
child: FittedBox(
|
||||
child:const Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)))),
|
||||
Center(child: Padding( padding: const EdgeInsets.only(top: 5, bottom: 20),
|
||||
child: Text("WELCOME ON OPENCLOUD", style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600,
|
||||
color: lightColor ) ))),
|
||||
Container( margin: const EdgeInsets.only(bottom: 10), child: Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
color: lightColor ), overflow: TextOverflow.ellipsis, ))),
|
||||
Container( margin: const EdgeInsets.only(bottom: 10),
|
||||
child: Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: getMainWidth(context) / 3,
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
alignment : Alignment.center,
|
||||
child: TextField(
|
||||
controller: usernameCtrl,
|
||||
@@ -69,7 +76,7 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: getMainWidth(context) / 3,
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
alignment : Alignment.center,
|
||||
child: TextField(
|
||||
controller: passwordCtrl,
|
||||
@@ -105,20 +112,22 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
loading = false;
|
||||
error = "Invalid username or password";
|
||||
});
|
||||
}).then( (e) {
|
||||
if (error == null) {
|
||||
// ignore: use_build_context_synchronously
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
loginIsSet = false;
|
||||
dash.inDialog = false;
|
||||
context.pop();
|
||||
mainKey?.currentState?.setState(() {});
|
||||
}
|
||||
});
|
||||
|
||||
if (error == null) {
|
||||
// ignore: use_build_context_synchronously
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
context.pop();
|
||||
//mainKey?.currentState!.setState(() {});
|
||||
}
|
||||
},
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
child: Container(
|
||||
width: getMainWidth(context) / 3,
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
color: usernameCtrl.text == "" || passwordCtrl.text == "" ? Colors.grey : lightColor,
|
||||
child: Center( child: loading ? SpinKitWave(color: Colors.white, size: 20) : Text("LOGIN", style: TextStyle(
|
||||
|
||||
@@ -3,9 +3,11 @@ import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/response.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/pages/shared.dart';
|
||||
import 'package:oc_front/pages/workflow.dart';
|
||||
import 'package:oc_front/widgets/inputs/shallow_dropdown_input.dart';
|
||||
import 'package:oc_front/widgets/inputs/shallow_text_input.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ShallowCreationDialogWidget extends StatefulWidget {
|
||||
GlobalKey<ShallowTextInputWidgetState>? formKey;
|
||||
BuildContext context;
|
||||
@@ -43,6 +45,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
|
||||
Tooltip( message: "back", child: InkWell(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
dash.inDialog = false;
|
||||
AppRouter.catalog.go(context, {});
|
||||
},
|
||||
child: const Icon(Icons.arrow_back, color: Colors.black))),
|
||||
@@ -50,7 +53,10 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
|
||||
widget.canClose != null && !widget.canClose!() ? Container() : Row ( mainAxisAlignment: MainAxisAlignment.end, children: [
|
||||
Tooltip( message: "close", child: InkWell(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () { Navigator.pop(context); },
|
||||
onTap: () {
|
||||
dash.inDialog = false;
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(Icons.close, color: Colors.black))),
|
||||
]),
|
||||
],),
|
||||
@@ -62,6 +68,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
|
||||
width: getMainWidth(context) <= 540 ? getMainWidth(context) - 140 : 400,
|
||||
load: (e) async {
|
||||
await widget.load!(e);
|
||||
dash.inDialog = false;
|
||||
Navigator.pop(widget.context);
|
||||
},
|
||||
iconLoad: Icons.open_in_browser_outlined,
|
||||
@@ -83,6 +90,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
|
||||
width: getMainWidth(context) <= 540 ? getMainWidth(context) - 140 : 400,
|
||||
load: (e) async {
|
||||
await widget.create!(e);
|
||||
dash.inDialog = false;
|
||||
Navigator.pop(widget.context);
|
||||
},
|
||||
forms: widget.form,
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/widgets/inputs/sub_text_input.dart';
|
||||
|
||||
class ComputeFormsWidget extends StatefulWidget {
|
||||
dynamic item;
|
||||
ComputeFormsWidget ({ super.key, required this.item });
|
||||
@override ComputeFormsWidgetState createState() => ComputeFormsWidgetState();
|
||||
}
|
||||
class ComputeFormsWidgetState extends State<ComputeFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Column( children: [
|
||||
SubTextInputWidget(subkey: "technology", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.getTechnology(), readOnly: true,),
|
||||
SubTextInputWidget(subkey: "architecture", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.architecture, readOnly: true,),
|
||||
SubTextInputWidget(subkey: "access", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.getAccess(), readOnly: true,),
|
||||
SubTextInputWidget(subkey: "localisation", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.localisation, readOnly: true,),
|
||||
]);
|
||||
}
|
||||
}
|
||||
105
lib/widgets/forms/container_forms.dart
Normal file
105
lib/widgets/forms/container_forms.dart
Normal file
@@ -0,0 +1,105 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
import 'package:oc_front/models/resources/processing.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/widgets/forms/sub_expose_forms.dart';
|
||||
import 'package:oc_front/widgets/inputs/sub_text_input.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ContainerFormsWidget extends StatefulWidget {
|
||||
int instanceID = 0;
|
||||
Dashboard dash;
|
||||
AbstractItem item;
|
||||
String elementID;
|
||||
ContainerFormsWidget({ super.key, required this.item, required this.dash, required this.elementID });
|
||||
@override ContainerFormsWidgetState createState() => ContainerFormsWidgetState();
|
||||
}
|
||||
|
||||
class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> widgets = [];
|
||||
var instance = widget.item.getSelectedInstance();
|
||||
if (instance != null && instance is ProcessingInstance && instance.access?.container != null) {
|
||||
var container = instance.access!.container!;
|
||||
widgets.add(Container(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
width: 180,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("<CONTAINER>", style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||
SubTextInputWidget(subkey: "image", width: 180, empty: false, change: (value) { },
|
||||
initialValue: container.image, readOnly: true),
|
||||
SubTextInputWidget(subkey: "command", width: 180, empty: false, change: (value) {
|
||||
container.command = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
if (el.id == widget.elementID) {
|
||||
el.element = widget.item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
widget.dash.saveDash(widget.dash.id, context);
|
||||
}, initialValue: container.command, readOnly: false,),
|
||||
SubTextInputWidget(subkey: "args", width: 180, empty: false, change: (value) {
|
||||
container.args = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
if (el.id == widget.elementID) {
|
||||
el.element = widget.item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
widget.dash.saveDash(widget.dash.id, context);
|
||||
},
|
||||
initialValue: container.args, readOnly: false,)
|
||||
],)
|
||||
));
|
||||
widgets.add(Container(
|
||||
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||
));
|
||||
widgets.add(Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
width: 180,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Padding(padding: EdgeInsets.only(bottom: 5), child: Text("<EXPOSE>",
|
||||
style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center)),
|
||||
Row( children: [
|
||||
InkWell( onTap: () {
|
||||
container.exposes.add(Expose());
|
||||
var el = widget.dash.getElement(widget.elementID);
|
||||
el!.element = widget.item as dynamic;
|
||||
setState(() {});
|
||||
}, child:
|
||||
Container( margin: const EdgeInsets.only(top: 5),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 125, height: 30,
|
||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [ Padding( padding: EdgeInsets.only(right: 5), child: Icon(Icons.add)), Text("add expose")]),
|
||||
)
|
||||
),
|
||||
InkWell( onTap: () {
|
||||
if (container.exposes.isEmpty) { return; }
|
||||
container.exposes = container.exposes.sublist(0, container.exposes.length - 1);
|
||||
var el = widget.dash.getElement(widget.elementID);
|
||||
el!.element = widget.item as dynamic;
|
||||
setState(() {});
|
||||
}, child:
|
||||
Container( margin: const EdgeInsets.only(left: 5, top: 5),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 45, height: 30,
|
||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [ Icon(Icons.delete, color: Colors.black) ]),
|
||||
)
|
||||
)
|
||||
]),
|
||||
],)
|
||||
));
|
||||
for (var expose in container.exposes) {
|
||||
widgets.add(SubExposeFormsWidget( readOnly: true, width: 180, dash: widget.dash, empty: widgets.isEmpty,
|
||||
item: expose, elementID: widget.elementID));
|
||||
}
|
||||
}
|
||||
return Column(children: widgets);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/widgets/forms/web_reference_forms.dart';
|
||||
|
||||
class DataFormsWidget extends StatefulWidget {
|
||||
DataItem item;
|
||||
String purpose = "";
|
||||
Function validate = () {};
|
||||
DataFormsWidget ({ super.key, required this.item });
|
||||
@override DataFormsWidgetState createState() => DataFormsWidgetState();
|
||||
}
|
||||
class DataFormsWidgetState extends State<DataFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Column( children: [
|
||||
WebReferenceFormsWidget(item: widget.item),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:alert_banner/exports.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:json_string/json_string.dart';
|
||||
import 'package:oc_front/core/services/specialized_services/logs_service.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/logs.dart';
|
||||
import 'package:oc_front/models/workflow.dart';
|
||||
import 'package:oc_front/widgets/dialog/alert.dart';
|
||||
import 'package:json_string/json_string.dart';
|
||||
import 'package:oc_front/core/services/specialized_services/logs_service.dart';
|
||||
|
||||
class LogsWidget extends StatefulWidget {
|
||||
String? level;
|
||||
@@ -26,7 +26,7 @@ class LogsWidgetState extends State<LogsWidget> {
|
||||
String end = "";
|
||||
try {
|
||||
if (widget.exec!.endDate != null && widget.exec!.endDate != "") {
|
||||
var startD = DateTime.parse(widget.exec!.executionData!);
|
||||
var startD = DateTime.parse(widget.exec!.startDate!);
|
||||
var endD = DateTime.parse(widget.exec!.endDate!);
|
||||
var diff = endD.difference(startD);
|
||||
if (diff.inDays < 30) {
|
||||
@@ -38,8 +38,8 @@ class LogsWidgetState extends State<LogsWidget> {
|
||||
end = (startD.add( const Duration(days: 29)).microsecondsSinceEpoch).toString();
|
||||
}
|
||||
} else {
|
||||
start = (DateTime.parse(widget.exec!.executionData!).subtract( const Duration(days: 14)).microsecondsSinceEpoch).toString();
|
||||
end = (DateTime.parse(widget.exec!.executionData!).add( const Duration(days: 14)).microsecondsSinceEpoch).toString();
|
||||
start = (DateTime.parse(widget.exec!.startDate!).subtract( const Duration(days: 14)).microsecondsSinceEpoch).toString();
|
||||
end = (DateTime.parse(widget.exec!.startDate!).add( const Duration(days: 14)).microsecondsSinceEpoch).toString();
|
||||
}
|
||||
} catch(e) { /* */ }
|
||||
return FutureBuilder(future: LogsService().search(context, [], {
|
||||
|
||||
Reference in New Issue
Block a user