From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-flutter-frontend 8/9] task logs: use separate color for warnings
Date: Fri, 12 Apr 2024 10:04:57 +0200 [thread overview]
Message-ID: <20240412080458.1066580-9-d.csapak@proxmox.com> (raw)
In-Reply-To: <20240412080458.1066580-1-d.csapak@proxmox.com>
orange instead of red, so one can differentiate between error and
warnings better.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
.../pve_task_log_expansiontile_widget.dart | 15 +++++++++++----
lib/widgets/pve_task_log_widget.dart | 5 ++++-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/lib/widgets/pve_task_log_expansiontile_widget.dart b/lib/widgets/pve_task_log_expansiontile_widget.dart
index 2073840..2ff5eb2 100644
--- a/lib/widgets/pve_task_log_expansiontile_widget.dart
+++ b/lib/widgets/pve_task_log_expansiontile_widget.dart
@@ -36,8 +36,10 @@ class _PveTaskExpansionTileState extends State<PveTaskExpansionTile> {
@override
Widget build(BuildContext context) {
- final hasError =
- widget.task.status != 'RUNNING' && widget.task.status != "OK";
+ final hasWarnings = widget.task.status.startsWith('WARNINGS:');
+ final hasError = widget.task.status != 'RUNNING' &&
+ widget.task.status != "OK" &&
+ !hasWarnings;
final isFinished = widget.task.endTime != null;
final taskLogBloc = Provider.of<PveTaskLogBloc>(context);
Duration duration;
@@ -48,6 +50,7 @@ class _PveTaskExpansionTileState extends State<PveTaskExpansionTile> {
}
final colorScheme = Theme.of(context).colorScheme;
final errorColor = widget.errorColor ?? colorScheme.error;
+ final warningColor = Colors.orange.shade200;
final headerColor = isExpanded
? (widget.headerColorExpanded ?? colorScheme.onSurface)
: (widget.headerColor ?? colorScheme.onBackground);
@@ -64,8 +67,12 @@ class _PveTaskExpansionTileState extends State<PveTaskExpansionTile> {
collapsedBackgroundColor: Theme.of(context).colorScheme.background,
key: PageStorageKey<PveClusterTasksModel>(widget.task),
leading: Icon(
- hasError ? Icons.warning : Icons.info,
- color: hasError ? errorColor : headerColor,
+ hasError || hasWarnings ? Icons.warning : Icons.info,
+ color: hasError
+ ? errorColor
+ : hasWarnings
+ ? warningColor
+ : headerColor,
),
title: Text(
'$taskText: ${widget.task.type}',
diff --git a/lib/widgets/pve_task_log_widget.dart b/lib/widgets/pve_task_log_widget.dart
index 97cbf03..5a12676 100644
--- a/lib/widgets/pve_task_log_widget.dart
+++ b/lib/widgets/pve_task_log_widget.dart
@@ -198,12 +198,15 @@ class _PveTaskLogScrollViewState extends State<PveTaskLogScrollView> {
child: ProxmoxStreamBuilder<PveTaskLogViewerBloc, PveTaskLogViewerState>(
bloc: Provider.of<PveTaskLogViewerBloc>(context),
builder: (context, state) {
- // TODO: fix color (for dark theme) and better handle warnings
var indicatorColor = Colors.teal.shade500;
var statusChipColor = Colors.teal.shade100;
if (state.status?.failed ?? false) {
indicatorColor = Colors.red;
statusChipColor = Colors.red.shade100;
+ } else if ((state.status?.exitStatus ?? '')
+ .startsWith('WARNINGS:')) {
+ indicatorColor = Colors.orange;
+ statusChipColor = Colors.orange.shade100;
}
return SizedBox(
height: MediaQuery.of(context).size.height * 0.5,
--
2.39.2
next prev parent reply other threads:[~2024-04-12 8:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 8:04 [pve-devel] [PATCH pve-flutter-frontend 0/9] small improvements Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 1/9] replace BottomNavigationBar with NavigationBar Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 2/9] resource tab: improve colors for headers Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 3/9] node overview: don't throw permission errors on every update Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 4/9] adapt to material 3 changes for themes Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 5/9] fix clipping for data card widget Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 6/9] set the color of the template indicator to that of the icon Dominik Csapak
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 7/9] task logs: don't always say 'Last Task: ' Dominik Csapak
2024-04-12 8:04 ` Dominik Csapak [this message]
2024-04-12 8:04 ` [pve-devel] [PATCH pve-flutter-frontend 9/9] task log list: make warning icon more distinct Dominik Csapak
2024-04-16 14:15 ` [pve-devel] applied: [PATCH pve-flutter-frontend 0/9] small improvements Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240412080458.1066580-9-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox