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>
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>
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>
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>
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>
the calling code did require that authOK returns the cookie if
there is a valid one
make it now very explicit that the cookie gets returned instead
of using implicit short-circuit behaviour
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
return false on authOK when the ticket is a tfa ticket
(starts with PVE:tfa!)
when a user now loads the page with only a tfa ticket, it shows the
login window again
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
copied+refactored from pve-manager
for use with other projects
also show privs now in the combobox
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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>
copied from pve-manager, with adaptions for modern js
(let, parameter destructuring,...)
and dropped the not needed 'needOTP' method
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
copied from pmg-gui, adapted to be able to set a custom url prefix
when we want to use something other than '/pve2'
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
we want to have the digest in the top level object, like:
{
data: { /* the real data */ },
digest: "fa123asf123123123", // the digest
}
instead of in the data itself, so read it preferably from there
(with fallback to stay compatible)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
when rstore is not instanciated but only a config,
auto-create it with its type
this allows us to configure an diff/rstore combination completely
declaratively like this:
store: {
type: 'diff',
autoDestroy: true,
autoDestroyRstore: true,
rstore: {
type: 'update',
model: 'some-model',
autoStart: true,
interval: 5000,
},
},
the only thing we have to be careful about is to either
do a manual 'stopUpdate' somewhere, or use the 'autoDestroyRstore' flag
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
when this flag is set, the diffstore will automatically try to destroy
the rstore when it is destroyed itself
for this we have to move the rstore into the object (instead of using a closure)
Signed-off-by: Dominik Csapak <d.csapak@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)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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>
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>