Commit Graph

5742 Commits

Author SHA1 Message Date
Thomas Lamprecht
128a24edf5 ui: form/API Token Selector: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:51:21 +02:00
Thomas Lamprecht
93365f47d7 ui: form/Priv.Selector: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:50:53 +02:00
Thomas Lamprecht
65c6c5d592 ui: form/Node Selector: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:50:38 +02:00
Thomas Lamprecht
86b60bd59e ui: form/Global Search: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:50:14 +02:00
Thomas Lamprecht
ecfd8bcd2f ui: form/Controller Selector: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:50:03 +02:00
Thomas Lamprecht
f155d934e2 ui: parser: fixup printing LXC network
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:42:35 +02:00
Thomas Lamprecht
8af03a8dbd ui: eslint auto-fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
f09f1c27ad ui: eslint: Miscellaneous eslint fixes
Function syntax, raw words, string templates, no prototype builtins

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
91a47a766f ui: eslint: State equalities more precisely
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
f1374bff13 ui: eslint: Remove useless escapes
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
5eb9b7b1b0 ui: eslint: Functions may not be completely empty
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
55ee6ba132 ui: eslint: No unused or duplicate variables
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
46d9a35c33 ui: eslint: fix usage of 'me'
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Thomas Lamprecht
03153d556b ui: dc: log, options, support: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
9f84f443aa ui: dc/StorageView: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
1a5df27f23 ui: dc/UserEdit: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
d74c3805d3 ui: dc/Tasks: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
12f237de8b ui: dc/TFA Edit: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
a30dca2f9f ui: dc/Summary: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
90d5bbb64d ui: dc/FW Security Group: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
a1abaf7064 ui: dc/RoleView: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
2dcb6bb046 ui: dc/NodeView: mark only usage over 75% with a warning
As 60% is pretty low, and normally still OK and even wanted to have
(no need for having an over-dimensioned setup with lots of unused
resources).

Note, this is not a off-by-one, I want to compare real bigger > 75%

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
ffc947807c ui: dc/NodeView: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
8295f55e56 ui: dc: health, config, guests; eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
95f59d0b89 ui: dc/corosync-link: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
4ed38e2569 ui: dc/cluster: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 10:05:05 +02:00
Thomas Lamprecht
12809bba4f ui: dc/Backup: eslint fixes and code cleanup/refactoring
this one would deserve much more, especially the newer backup job
detail and not-backed-up view should be split out and done in a
declarative way (view view-controller)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 20:40:11 +02:00
Thomas Lamprecht
1848bf9eb0 ui: dc/ACMEPlugins: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 20:11:28 +02:00
Thomas Lamprecht
cf696df332 ui: dc/ACLView: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 20:11:07 +02:00
Thomas Lamprecht
a0b5aa9096 ui: data/ResourceStore: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 20:03:47 +02:00
Thomas Lamprecht
f729096099 ui: buttons: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 19:58:52 +02:00
Thomas Lamprecht
063997ed16 ui: workspace: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 19:40:33 +02:00
Thomas Lamprecht
4d739f4a2a ui: utils: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 19:21:52 +02:00
Thomas Lamprecht
d6b661874c ui: state provider: try to find string encoded values in dictionary
My browser here is pretty fixated on the history, and due to some
unknown reason I got a history fragment string like:
`#v1:=0:=18:=4:::::::` so the "hashes" got into strings, and I was
not able to move them back.

Adding a match here to always try reverse-mapping the hash to the
original input helps to fix that here.

We'd only run into issues if we'd use a integer-string as id, but we
really don't (IIRC not even allowed in extjs) so this is safe to do.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 18:21:52 +02:00
Thomas Lamprecht
2f6cf848b6 ui: state provider: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 18:09:07 +02:00
Thomas Lamprecht
265f10ddac state provider: drop confirm-query when going back over initial history
eslint complains about the window.confirm call, and neither I nor
some other colleagues here did see that dialogue ever in practice.

The confirm here does not adds any real value, as all other back
navigation are unprotected, but have similar potential in loosing
state.

One can always navigate forward via their user agent and for console
(noVNC, xterm.js) we have now a separate check.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 17:30:39 +02:00
Thomas Lamprecht
0199b09144 ui: toolkit: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 17:30:39 +02:00
Thomas Lamprecht
a3aef0f5d9 ui: parser: eslint fixes and refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 17:30:39 +02:00
Thomas Lamprecht
c4cfc250bb ui: parser: drop old openVZ parser
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 15:49:27 +02:00
Lorenz Stechauner
91c729d300 fix #3426: ui: parser: adapt parseSSHKey to accept "sk-" prefix
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-05-17 15:42:49 +02:00
Lorenz Stechauner
963bb5c91f ui: cloudinit: use PVE.Parser.parseSSHKey
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-05-17 15:42:11 +02:00
Fabian Grünbichler
58f763e1aa fix #3430: handle hook script paths better
if passing the hook script command as string, it might get interpreted
as shell command with side-effects. this is pretty harmless, since only
root is allowed to set the script parameter anyway, but making it more
robust and future-proof does not hurt.

tested with a reproducer of "/bin/echo $(touch $(whoami))" as script
parameter, with a file with that name existing, being executable and
having the following contents:

----8<----
echo "hello from hook script"
---->8----

without this change, the hookscript itself is not executed, but
'/bin/sh -c "/bin/echo $(touch $(whoami)) job"' and similar calls are,
which cause the file 'root' to be touched in the current working
directory of the vzdump process (or task worker).

with this change, the file is executed as is without any side-effects of
shell commands in the file name, and the 'hello from hook script' lines
are printed whenever the hook script is called by vzdump.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-05-17 09:49:34 +02:00
Thomas Lamprecht
cdb638259d report: top: also print command line arguments
at least the first 512 characters, which is the biggest width one can
instruct `top` too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 16:27:30 +02:00
Thomas Lamprecht
bc415cf7cf report: top: list more processes and order them by CPU time spent
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 16:27:30 +02:00
Thomas Lamprecht
8b94e6bbd4 report: re-organize: add systemd-load, unify bios/pci in HW one
Also rename disks to blockdevices, as especially with the iSCSI stuff
the listed devices do not necessarily need to be real disks.

Grouping current(ish) load info in it's own system-load section seems
to be a better fit in general too.

bios/pci stuff is all hardware, so group it there to avoid adding to
much sections.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 16:27:30 +02:00
Thomas Lamprecht
6b72e9dd74 report: dir2text: print what we process on STDERR
to avoid those "lonely" "OK" prints for those

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 15:12:18 +02:00
Thomas Lamprecht
f784b92573 report: avoid extra oder array, define it inline
Makes all report-def entries hashes which allows to drop some
handling for the ARRAY ref case.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 15:02:38 +02:00
Thomas Lamprecht
3a0b2c40d2 report: avoid adding to report by side-effects, be more explicit
And move the helper methods up and scope them to module-local only

Uses the fact that perl methods return the last statement, so the
dir2text sub closures in the command list do not need to be changed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 14:28:47 +02:00
Thomas Lamprecht
73cdcc98be report: set timeout and PATH env only locally
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 14:27:40 +02:00
Thomas Lamprecht
fb925d656a report: whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-11 14:26:15 +02:00