Commit Graph

563 Commits

Author SHA1 Message Date
Thomas Lamprecht
05a977a227 make eslint 100% happy
lots of churn and changes but will allow to enforce linting again in
the build system.

Also switch over from var to let.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 17:16:22 +02:00
Thomas Lamprecht
4f1b9b8c3b some more eslint fixes
manually adapted after eslint --fix call due to our damn weird
indentation scheme

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 15:05:50 +02:00
Thomas Lamprecht
01031528ad eslint fixes all over the place
all autofixed by eslint with a slightly reduced base config rule set
to avoid rules which may give some undesired results in our code
base.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 15:02:29 +02:00
Thomas Lamprecht
94ac12f1bd utils: some eslint fixes and refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 14:43:18 +02:00
Thomas Lamprecht
eb9dfa15da utils: some eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:52:17 +02:00
Thomas Lamprecht
41a786fc86 task description: use 'Backup Job' if no id is set
We set the id for vzdump tasks only for single VM/CT backups, so if
it's undefined we got a job for sure.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-05 15:09:37 +02:00
Thomas Lamprecht
0545f1edb8 format task description: avoid printing undefined ID
fixes and regression for backup jobs which seems to get from empty
string to undefined ID in PVE 6.x - whyever...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-05 14:51:46 +02:00
Thomas Lamprecht
2d10a5977c bump version to 2.2-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-04 18:20:20 +02:00
Thomas Lamprecht
0855ba611e rrd: only move legend to header if both exists
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-04 18:19:16 +02:00
Dominik Csapak
335b5f3747 button: make xtype of parent configurable
to get the selection model of the parent, we use by default the xtype
'grid', but sometimes we want to use something else (e.g. 'treepanel')

to be flexible we make this configurable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-04 13:01:04 +02:00
Thomas Lamprecht
8617feb8fc bump version to 2.2-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-03 11:43:43 +02:00
Thomas Lamprecht
4febc669d5 utils: add updateColumnWidth helper from PVE
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-29 19:31:02 +02:00
Thomas Lamprecht
e662b4a0b8 rrd charts: add legend to header for better space usage
Docking the legend to the bottom took space away from the chart, and
was the just used as the simplest solution when it was implemented.

The panel header has enough spaces for any reasonable number of
different series in a chart, so move it there.

Drop then the legend toggle tool from the header as it isn't required
anymore..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-29 19:21:14 +02:00
Thomas Lamprecht
efa61051ac rrd charts: cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-29 19:21:14 +02:00
Thomas Lamprecht
c58d410099 rrd charts: render 3 decimal points for small values
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-29 19:21:14 +02:00
Thomas Lamprecht
9f1b3a70cb css: reduce chart legends space impact
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-29 19:21:14 +02:00
Thomas Lamprecht
c197c3f2bc bump version to 2.2-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-28 18:36:40 +02:00
Thomas Lamprecht
e2abd63cc2 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>
2020-05-28 18:31:24 +02:00
Dominik Csapak
e9fc81fabe Utils: add duration format/render
from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-28 13:31:24 +02:00
Dominik Csapak
6d812e6d8b css: add icon colors
from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-28 13:29:32 +02:00
Dominik Csapak
9fcd1bdb42 improve error extraction for monStoreErrors
by printing the whole error body when it cannot be parsed as JSON

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-26 19:04:54 +02:00
Thomas Lamprecht
187e9a6d3a 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>
2020-05-26 18:26:55 +02:00
Thomas Lamprecht
865be88ed5 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>
2020-05-26 10:14:53 +02:00
Thomas Lamprecht
8f9e331d8c bump version to 2.2-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 19:04:16 +02:00
Thomas Lamprecht
7e0a80cd16 task history: better default column width
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 18:56:56 +02:00
Thomas Lamprecht
122a207938 node/tasks: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 18:37:10 +02:00
Thomas Lamprecht
f138d11f0d 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>
2020-05-25 18:32:01 +02:00
Thomas Lamprecht
5e80efaeea utils: task descriptions: allow to use functions
Useful if we need to split the ID, or do some more complex rendering
for a task type.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 18:28:21 +02:00
Thomas Lamprecht
4afd5b2f9d 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>
2020-05-25 18:20:26 +02:00
Thomas Lamprecht
f4d366dc85 ui: network: make CIDR & gateway column broader by default
ensuring they fit at least always a full IPv4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 18:14:14 +02:00
Thomas Lamprecht
82b8bfb053 ui: network: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 18:13:34 +02:00
Thomas Lamprecht
2e6fdef087 render_upid: fallback to worker_{id,type}
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 16:47:17 +02:00
Thomas Lamprecht
88725b272a css: add proxmox-invalid-row class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 16:46:48 +02:00
Dominik Csapak
2561610c8e return cookie again in authOK
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>
2020-05-25 13:51:30 +02:00
Dominik Csapak
ac6184986c fix #2758: reject 'tfa' cookies
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>
2020-05-25 10:42:58 +02:00
Thomas Lamprecht
eaa0fcbd77 bump version to 2.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:08:16 +02:00
Thomas Lamprecht
4b5c6b3ff1 window: edit: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:08:07 +02:00
Thomas Lamprecht
b24601aff5 window: edit: call setValue on all fields
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:01:01 +02:00
Thomas Lamprecht
18a6f207ef window password edit: refactor to more schematic code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 11:27:28 +02:00
Thomas Lamprecht
6dc34e5525 PendingObjectGrid: mark pending changes as orange
as red is commonly associated with an error, which pending changes
ain't. But, they should be clearly visible - so use darkorange
2020-05-22 09:38:30 +02:00
Dominik Csapak
9a3c1cb408 add pmxRoleSelector
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>
2020-05-19 21:19:26 +02:00
Thomas Lamprecht
50e8bf4419 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>
2020-05-19 21:17:25 +02:00
Thomas Lamprecht
a307714b53 displayedit: fixup to correct version
it seems I made an error and applied an older version..
Apply the correct one[0] with Dominiks comment addressed[1].

[0]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043037.html
[1]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043043.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-19 21:14:52 +02:00
Thomas Lamprecht
809603790a bump version to 2.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-18 17:27:05 +02:00
Dominik Csapak
0391dee1a2 add Realm model and RealmComboBox
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>
2020-05-18 17:03:32 +02:00
Dominik Csapak
82014ef6f1 add PMX.image.Logo
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>
2020-05-18 17:03:32 +02:00
Dominik Csapak
8ae2f8c8b1 window/Edit: read digest also from top level response
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>
2020-05-18 17:03:32 +02:00
Thomas Lamprecht
d8f909e10a bump version to 2.1-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 17:00:10 +02:00
Thomas Lamprecht
50fea44c68 diff store: set autoDestroyRstore by default to true for rstore configs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 12:54:06 +02:00
Dominik Csapak
eb54b1142e data/DiffStore: auto-create the rstore if its just a config
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>
2020-05-07 12:47:20 +02:00