From 8686ba103fb206ba21398675660801bde2f99837 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 20 Jan 2023 10:46:53 +0100 Subject: [PATCH] ui: schedule sim: denote if any simulation was done via empty text As subtle UX hint that the user first needs to press the Simulate button. Signed-off-by: Thomas Lamprecht --- www/manager6/window/ScheduleSimulator.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/manager6/window/ScheduleSimulator.js b/www/manager6/window/ScheduleSimulator.js index c8f8be7a..104e93c9 100644 --- a/www/manager6/window/ScheduleSimulator.js +++ b/www/manager6/window/ScheduleSimulator.js @@ -3,6 +3,15 @@ Ext.define('PVE.window.ScheduleSimulator', { title: gettext('Job Schedule Simulator'), + viewModel: { + data: { + simulatedOnce: false, + }, + formulas: { + gridEmptyText: get => get('simulatedOnce') ? Proxmox.Utils.NoneText : gettext('No simulation done'), + }, + }, + controller: { xclass: 'Ext.app.ViewController', close: function() { @@ -23,12 +32,14 @@ Ext.define('PVE.window.ScheduleSimulator', { iterations, }, failure: response => { + me.getViewModel().set('simulatedOnce', true); me.lookup('grid').getStore().setData([]); Ext.Msg.alert(gettext('Error'), response.htmlStatus); }, success: function(response) { let schedules = response.result.data; me.lookup('grid').getStore().setData(schedules); + me.getViewModel().set('simulatedOnce', true); }, }); }, @@ -105,7 +116,9 @@ Ext.define('PVE.window.ScheduleSimulator', { { xtype: 'grid', reference: 'grid', - emptyText: Proxmox.Utils.NoneText, + bind: { + emptyText: '{gridEmptyText}', + }, scrollable: true, height: 300, columns: [ -- 2.39.2