[pve-devel] [PATCH manager 7/7] ui: dc/backup: show id+schedule instead of dow+starttime
Fabian Ebner
f.ebner at proxmox.com
Wed Nov 3 10:21:37 CET 2021
Am 07.10.21 um 10:27 schrieb Dominik Csapak:
> we can now show the id (since its not autogenerated anymore),
But it's hidden below ;)
I get that the ID is not very telling for existing jobs, but for jobs
with user-chosen IDs it would allow to distinguish them more quickly.
> and we can always show/edit the schedule instead of the dow+starttime
>
> also add an 'ID' field to the edit/create window and update the
> backupinfo window as well
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> www/manager6/dc/Backup.js | 47 ++++++++++++++----------------
> www/manager6/dc/BackupJobDetail.js | 10 ++-----
> 2 files changed, 24 insertions(+), 33 deletions(-)
>
> diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
> index adefc5f4..87b3d70a 100644
> --- a/www/manager6/dc/Backup.js
> +++ b/www/manager6/dc/Backup.js
> @@ -176,24 +176,22 @@ Ext.define('PVE.dc.BackupEdit', {
> });
>
> let column1 = [
> - nodesel,
> - storagesel,
> {
> - xtype: 'pveDayOfWeekSelector',
> - name: 'dow',
> - fieldLabel: gettext('Day of week'),
> - multiSelect: true,
> - value: ['sat'],
> + xtype: 'pmxDisplayEditField',
> + name: 'id',
> + fieldLabel: gettext('ID'),
> + renderer: Ext.htmlEncode,
> allowBlank: false,
> + minLength: 4,
> + editable: me.isCreate,
> },
> + nodesel,
> + storagesel,
> {
> - xtype: 'timefield',
> - fieldLabel: gettext('Start Time'),
> - name: 'starttime',
> - format: 'H:i',
> - formatText: 'HH:MM',
> - value: '00:00',
> + xtype: 'pveCalendarEvent',
> + fieldLabel: gettext('Schedule'),
> allowBlank: false,
> + name: 'schedule',
> },
> selModeField,
> selPool,
> @@ -390,7 +388,7 @@ Ext.define('PVE.dc.BackupEdit', {
> success: function(response, options) {
> let data = response.result.data;
>
> - data.dow = data.dow.split(',');
> + data.dow = (data.dow || '').split(',');
>
> if (data.all || data.exclude) {
> if (data.exclude) {
> @@ -532,6 +530,8 @@ Ext.define('PVE.dc.BackupView', {
> delete job.starttime;
> delete job.dow;
> delete job.id;
> + delete job.schedule;
> + delete job.type;
> delete job.node;
> job.all = job.all === true ? 1 : 0;
>
> @@ -714,6 +714,11 @@ Ext.define('PVE.dc.BackupView', {
> disabledCls: 'x-item-enabled',
> stopSelection: false,
> },
> + {
> + header: gettext('ID'),
> + dataIndex: 'id',
> + hidden: true
Here (also misses trailing comma).
> + },
> {
> header: gettext('Node'),
> width: 100,
> @@ -727,17 +732,9 @@ Ext.define('PVE.dc.BackupView', {
> },
> },
> {
> - header: gettext('Day of week'),
> - width: 200,
> - sortable: false,
> - dataIndex: 'dow',
> - renderer: PVE.Utils.render_backup_days_of_week,
> - },
> - {
> - header: gettext('Start Time'),
> - width: 60,
> - sortable: true,
> - dataIndex: 'starttime',
> + header: gettext('Schedule'),
> + width: 150,
> + dataIndex: 'schedule',
> },
> {
> header: gettext('Storage'),
> diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js
> index b91cb1b7..19b3b1a3 100644
> --- a/www/manager6/dc/BackupJobDetail.js
> +++ b/www/manager6/dc/BackupJobDetail.js
> @@ -184,14 +184,8 @@ Ext.define('PVE.dc.BackupInfo', {
> },
> {
> xtype: 'displayfield',
> - name: 'dow',
> - fieldLabel: gettext('Day of week'),
> - renderer: PVE.Utils.render_backup_days_of_week,
> - },
> - {
> - xtype: 'displayfield',
> - name: 'starttime',
> - fieldLabel: gettext('Start Time'),
> + name: 'schedule',
> + fieldLabel: gettext('Schedule'),
> },
> {
> xtype: 'displayfield',
>
More information about the pve-devel
mailing list