From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 widget-toolkit 1/7] task status: create helper for formatting
Date: Fri, 9 Apr 2021 10:44:30 +0200 [thread overview]
Message-ID: <20210409084436.2454-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210409084436.2454-1-f.ebner@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
New in v2.
src/Utils.js | 12 ++++++++++++
src/node/Tasks.js | 10 +---------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/Utils.js b/src/Utils.js
index 3fd8f91..21bdbe3 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -736,6 +736,18 @@ utilities: {
return 'error';
},
+ format_task_status: function(value) {
+ let parsed = Proxmox.Utils.parse_task_status(value);
+ switch (parsed) {
+ case 'unknown': return Proxmox.Utils.unknownText;
+ case 'error': return Proxmox.Utils.errorText + ': ' + value;
+ case 'warning': return Proxmox.Utils.warningsText +
+ value.replace('WARNINGS', '');
+ case 'ok': // fall-through
+ default: return value;
+ }
+ },
+
render_duration: function(value) {
if (value === undefined) {
return '-';
diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index b01f65e..7f20a8a 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -198,15 +198,7 @@ Ext.define('Proxmox.node.Tasks', {
return '';
}
- let parsed = Proxmox.Utils.parse_task_status(value);
- switch (parsed) {
- case 'unknown': return Proxmox.Utils.unknownText;
- case 'error': return Proxmox.Utils.errorText + ': ' + value;
- case 'warning': return Proxmox.Utils.warningsText +
- value.replace('WARNINGS', '');
- case 'ok': // fall-through
- default: return value;
- }
+ return Proxmox.Utils.format_task_status(value);
},
},
],
--
2.20.1
next prev parent reply other threads:[~2021-04-09 8:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 8:44 [pve-devel] [PATCH-SERIES v2] improve warnings handling in UI and add to PVE Fabian Ebner
2021-04-09 8:44 ` Fabian Ebner [this message]
2021-04-23 12:54 ` [pve-devel] applied: [PATCH v2 widget-toolkit 1/7] task status: create helper for formatting Thomas Lamprecht
2021-04-09 8:44 ` [pve-devel] [PATCH v2 widget-toolkit 2/7] format task status: rename variable Fabian Ebner
2021-04-23 12:54 ` [pve-devel] applied: " Thomas Lamprecht
2021-04-09 8:44 ` [pve-devel] [PATCH v2 widget-toolkit 3/7] format task status: improve replace() usage Fabian Ebner
2021-04-23 12:54 ` [pve-devel] applied: " Thomas Lamprecht
2021-04-09 8:44 ` [pve-devel] [PATCH v2 proxmox-backup 4/7] ui: tasks: use format_task_status Fabian Ebner
2021-04-09 8:44 ` [pve-devel] [PATCH v2 manager 5/7] ui: cluster task log: handle warnings like the node task log does Fabian Ebner
2021-04-09 8:44 ` [pve-devel] [PATCH/RFC v2 common 6/7] allow workers to count warnings and finish tasks in a WARNINGS state Fabian Ebner
2021-04-23 12:36 ` [pve-devel] applied: " Thomas Lamprecht
2021-04-09 8:44 ` [pve-devel] [PATCH/RFC v2 container 7/7] restore: sanitize config: use new warn() function Fabian Ebner
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=20210409084436.2454-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pbs-devel@lists.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