prune sim: rework simulation options layout

move the two columns to a field set each, one for the backup job
config, containing weekdays and schedule, and one for the simulation
time, which contains the end date/time and the duration, which got
moved over, as it better fits along the new date/time.

Note that I used end instead of start as its the later point in time,
so hopefully less confusing, but one could argue either.

Flex and width of the fields got adapted such that they now better
work on smaller resolutions (< 1500px total width) and look better
on both, low and high resolutions/width.

The button got moved into the docked area  mostly due to me being to
lazy to add yet another container indirection for having the hbox
nested inside a vbox, but also as it makes sense to have it big and
centered available.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-10-05 13:11:16 +02:00
parent 3ac9b04a26
commit 87cbd8c48a

View File

@ -639,7 +639,7 @@ Ext.onReady(function() {
border: false, border: false,
items: [ items: [
{ {
title: 'View', title: 'View Options',
layout: 'anchor', layout: 'anchor',
flex: 1, flex: 1,
border: false, border: false,
@ -668,14 +668,28 @@ Ext.onReady(function() {
layout: 'hbox', layout: 'hbox',
flex: 2, flex: 2,
border: false, border: false,
title: 'Simulated Backup Schedule', title: 'Backup Job Simulation',
bodyPadding: 10, dockedItems: [{
xtype: 'button',
text: 'Update Simulation',
handler: 'reloadFull',
formBind: true,
dock: 'bottom',
margin: '1 15',
}],
bodyPadding: 3,
items: [ items: [
{ {
xtype: 'container', xtype: 'fieldset',
title: 'Backup Job',
layout: 'anchor', layout: 'anchor',
flex: 4,
height: 110,
defaults: { defaults: {
labelWidth: 120, labelWidth: 90,
padding: '0 0 0 10',
width: '95%',
minWidth: 150,
}, },
items: [ items: [
{ {
@ -685,48 +699,35 @@ Ext.onReady(function() {
value: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'], value: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
allowBlank: false, allowBlank: false,
multiSelect: true, multiSelect: true,
padding: '0 0 0 10',
}, },
{ {
xtype: 'prunesimulatorCalendarEvent', xtype: 'prunesimulatorCalendarEvent',
name: 'schedule-time', name: 'schedule-time',
allowBlank: false, allowBlank: false,
value: '0/6:00', value: '0/6:00',
fieldLabel: 'Backup schedule', fieldLabel: 'Schedule',
padding: '0 0 0 10',
},
{
xtype: 'numberfield',
name: 'numberOfWeeks',
allowBlank: false,
fieldLabel: 'Number of weeks',
minValue: 1,
value: 15,
maxValue: 260, // five years
padding: '0 0 0 10',
},
{
xtype: 'button',
name: 'schedule-button',
text: 'Update Schedule',
formBind: true,
handler: 'reloadFull',
}, },
], ],
}, },
{ {
xtype: 'container', xtype: 'fieldset',
title: 'Simulation Time Range',
layout: 'anchor', layout: 'anchor',
flex: 3,
height: 110,
defaults: { defaults: {
labelWidth: 60, labelWidth: 70,
width: 220,
padding: '0 0 0 10',
width: '95%',
minWidth: 150,
}, },
items: [ items: [
{ {
xtype: 'datefield', xtype: 'datefield',
name: 'currentDate', name: 'currentDate',
fieldLabel: 'Date', fieldLabel: 'End Date',
allowBlank: false, allowBlank: false,
padding: '0 0 0 10',
format: 'Y-m-d', format: 'Y-m-d',
value: vm.get('now'), value: vm.get('now'),
listeners: { listeners: {
@ -747,13 +748,11 @@ Ext.onReady(function() {
xtype: 'timefield', xtype: 'timefield',
name: 'currentTime', name: 'currentTime',
reference: 'currentTime', reference: 'currentTime',
fieldLabel: 'Time', fieldLabel: 'End Time',
allowBlank: false, allowBlank: false,
padding: '0 0 0 10',
format: 'H:i', format: 'H:i',
// cant bind value because ExtJS sets the year // cant bind value because ExtJS sets the year to 2008 to
// to 2008 to protect against DST issues // protect against DST issues and date picker zeroes hour/minute
// and date picker zeroes hour/minute
value: vm.get('now'), value: vm.get('now'),
listeners: { listeners: {
change: function(self, time) { change: function(self, time) {
@ -766,6 +765,28 @@ Ext.onReady(function() {
}, },
}, },
}, },
{
xtype: 'fieldcontainer',
fieldLabel: 'Duration',
layout: 'hbox',
items: [{
xtype: 'numberfield',
name: 'numberOfWeeks',
hideLabel: true,
allowBlank: false,
minValue: 1,
value: 15,
maxValue: 260, // five years
flex: 1,
}, {
xtype: 'displayfield',
value: 'Weeks',
submitValue: false,
hideLabel: true,
padding: '0 0 0 5',
width: 40,
}],
},
], ],
}, },
], ],