This commit is contained in:
mr
2025-06-13 13:33:24 +02:00
parent c4ea1541c4
commit ab593a45b9
26 changed files with 219 additions and 221 deletions

View File

@@ -10,12 +10,13 @@ import 'package:oc_front/core/services/specialized_services/logs_service.dart';
bool isLoading = true;
Map<String, bool> valid = {};
// ignore: must_be_immutable
class LogsWidget extends StatefulWidget {
String? level;
String search = "";
WorkflowExecution? exec;
List<Log> logs = [];
LogsWidget ({ Key? key, this.search = "", this.level, this.exec }): super(key: key);
LogsWidget ({ super.key, this.search = "", this.level, this.exec });
@override LogsWidgetState createState() => LogsWidgetState();
}
@@ -73,12 +74,12 @@ class LogsWidgetState extends State<LogsWidget> {
List<LogWidget> itemRows = logs.where((element) => (element.message?.toLowerCase().contains(widget.search.toLowerCase()) ?? true)
&& (widget.level?.contains(element.level ?? "") ?? true) ).map((e) => LogWidget(item: e)).toList();
if (isLoading) {
return Container( height: getMainHeight(context) - 100,
child: Center( child: CircularProgressIndicator()) );
return SizedBox( height: getMainHeight(context) - 100,
child: const Center( child: CircularProgressIndicator()) );
}
return Stack( children: [
SingleChildScrollView( child: itemRows.isEmpty ?
Container( height: getMainHeight(context) - 100,
SizedBox( height: getMainHeight(context) - 100,
child: const Center( child: Text("no log registered", style: TextStyle(color: Colors.grey, fontSize: 25 ),)))
: Column( children: [...itemRows, Container(height: 50,) ] ) ),
]);
@@ -88,10 +89,11 @@ class LogsWidgetState extends State<LogsWidget> {
}
}
// ignore: must_be_immutable
class LogWidget extends StatefulWidget {
final Log item;
bool expanded = false;
LogWidget ({ Key? key, required this.item }): super(key: key);
LogWidget ({ super.key, required this.item });
@override LogWidgetState createState() => LogWidgetState();
}
class LogWidgetState extends State<LogWidget> {