Thomas Lamprecht [Thu, 28 May 2020 16:31:21 +0000 (18:31 +0200)]
format_duration_short: rename to format_duration_human and change semantics a bit
The rationale is that things like 11.4d or 22.6h is hard to parse for
humans (base 10 to base 60 or base 24 conversion). So try to emulate
what a human would tell another human to pass a duration information
along with reasonable good but not high accuracy.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 26 May 2020 16:26:52 +0000 (18:26 +0200)]
form/display edit: use the 'fit' layout to avoid width glitch
As else we get some issues with inner field adding some space on
outer fieldcontainer, which let a mix of "normal" fields and this one
appear asymmetrical.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 26 May 2020 08:13:04 +0000 (10:13 +0200)]
JournalView: avoid null dereference on quick tab switch
the updateView method can be called through an XHR request callback,
which may get triggered once the user switched already over to
another panel and viewmodel isn't valid (or did not get valid at the
first place) anymore.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 25 May 2020 16:32:00 +0000 (18:32 +0200)]
ui: task history: handle running tasks
normally this is used as strict task history, meaning no running
tasks included. But we can have running tasks in PBS here, so at
least avoid that they're shown as error.
Also add a refresh button as a simple workaround to the auto-refresh
problem, which isn't straightforward to solve with the buffered
reader we have here.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 25 May 2020 16:20:24 +0000 (18:20 +0200)]
utils: task descriptions: allow to add/override entries
Allows having only the common ones here, and more special ones in the
per product code. Sometimes there are simple worker IDs which can
have a very different meaning for one product, with this that clash
can be resolved in a standardized way.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 19 May 2020 19:17:22 +0000 (21:17 +0200)]
input panel: call setValue on all fields
Fixes the displayedit field and makes some rarer case much easier to
do. Normally we only need this if there are two viewmodel synced
fields, where only one is enabled at a time..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
this sets the max/min value for the underlying date and time fields,
and allowing to only change the value respecting both current date
and time fields
e.g.
if the new maxValue is 2020-10-10 12:00
and the current value is 2020-10-09 15:00
do not allow to set the date to 2020-10-10
and vice versa (if the new limit is on the same day, limit the time range)
Thomas Lamprecht [Sat, 18 Apr 2020 17:26:18 +0000 (19:26 +0200)]
StdRemoveButton: enable by default if no selection model
As in that case we normally want it to be enabled from the start, as
no selection model is there and so we cannot wait until one item is
selected until we enable it.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Sat, 18 Apr 2020 17:10:12 +0000 (19:10 +0200)]
button: don't auto set selection model if explicitly set to false
while one could use `selModel: null` to achieve this it feels really
weird that `selModel: false` could result in a selection model being
auto searched and set
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
in some cases, we provide a config with interval set to 'undefined',
which gets happily applied to the config, but gets interpreted as '0'
when actually starting the task, resulting in constant api requests
In a more schematic way, as it can now be controlled by either our
CBind mixin or ExtJS native data binding.
Use a Field container to add both, they editable and they display,
variants of a form field. As default use "textfield" for the editable
and "displayfield" xtype for the read only one.
Pass all but the editConfig and editable members of our initial
config to the display field, allow further to configure the editable
field with an editConfig object, which overwrites the config
properties inherited from the displayConfig/parent config.
This gives full control while not enforcing to specify anything extra
for most default cases.
Enforce initial state of the fields even if the databinding would
handle it to avoid glitches after first render for simple boolean expression
cases.
Here, cbind could also be a bind or a native boolean expression.
For something else than a texfield one would use the editConfig, e.g.:
> {
> ....
> editConfig: {
> xtype: 'pveUserSelector',
> allowBlank: false,
> },
> },
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
update store: move store parameter into config, use getter/setter
this allows to drop setting the default values and ensures that when
interval is updated it actually effects the used update frequency.
Anything which was saved in "me" before, for example me.autoStart, is
still there and gets also updated on a me.setIsStopped(), so there
should be no effects on code using internals.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 31 Mar 2020 12:50:34 +0000 (14:50 +0200)]
form: add Proxmox.form.field.ExpireDate
Behaves like a 'datefield' but treats the 0/empty value as "never",
and sets all defaults for behaving like one would expect from a date
expire field.
This allows to replaces hacks (e.g. [0]) from our various expire date
fields, mostly in PVE/PMG user accounts, and also for the soon to be
applied API token gui.
Stefan Reiter [Mon, 3 Feb 2020 14:14:42 +0000 (15:14 +0100)]
ComboGrid: fix validation for !allowBlank disabled fields
Used in "Add USB to VM" dialog for example.
This was broken before 15206214d9 "ComboGrid: fix on-load validation for blank
values" (only the one you enabled first was validated, the other always showed
as valid), and afterwards too, but in a different way (both are now immediately
marked invalid until you select and unselect them) - which is how I noticed.
With this the validation now works correctly.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Thu, 30 Jan 2020 16:36:43 +0000 (17:36 +0100)]
net/node: add some "hint" for VLAN add window
The three naming schemes are not ideal, but well here we are for now.
Add some hint to explain what one can do with which version - try to
keep it rather short. It's not ideal but hopefully better than
nothing :)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Reiter [Wed, 29 Jan 2020 10:27:18 +0000 (11:27 +0100)]
ComboGrid: fix on-load validation for blank values
Commit f32aa3df74 fixed marking multi-select fields with where the store
did not contain a valid value after loading.
However, it introduced a bug for single-select fields where the value
(before the store-load) was explicitly set to be empty (when that should
be invalid because of allowBlank === false).
Fix the logic to correctly detect all scenarios (with def being the
value selected before the store loaded, i.e. undefined or an empty
array):
!allowBlank &&
( def is an array but empty || def is not an array and falsy )
Also use correct error message (localized by ExtJS itself).
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Thomas Lamprecht [Thu, 23 Jan 2020 12:42:02 +0000 (13:42 +0100)]
mixin cbind: avoid undefined cbindData access
Else we can fail at the first fallback check in getConfigValue while
we still have the possibility to have the cbinded key available in
"me" (initial config).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>