Commit Graph

48 Commits

Author SHA1 Message Date
Fabian Ebner
7c65b8bfe0 utils: add helper to format node's repository status
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-09 16:58:51 +02:00
Thomas Lamprecht
5c085daf0b add schema and move authDomains there
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-09 16:11:19 +02:00
Dominik Csapak
8f30708d44 add generic OpenIDInputPanel
mostly copied from pve, but includes a realm displayeditfield
as well as the comment field

in contrast to the inputpanel in PVE, this is not extended
from a base input panel (where in pve the comment/realm/default/etc.
fields come from)

we do this, since not all products can define a default or tfa

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Dominik Csapak
402964713a Utils: add authSchema from PVE and make it overrideable
like we do for the task_descriptions.
This way we can have a basic config that is true for all products
and override where necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Thomas Lamprecht
fb4bb95e9d utils: fix typo in variable name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 10:11:46 +02:00
Thomas Lamprecht
5b2485ace3 utils: updateColumnWidth: allow overriding tresholdWidth and make that more general
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 09:46:58 +02:00
Thomas Lamprecht
8b7e349a25 utils: column width handler: drop duplicate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 09:34:32 +02:00
Dominik Csapak
fbbe68fd69 Utils: add get_health_icon from PVE
we'll need it here too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-02 15:31:25 +02:00
Thomas Lamprecht
cd20320b7f utils: followup: fix base class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 15:17:47 +02:00
Thomas Lamprecht
e722f108aa ui: Utils: refactor userid parsing to Utils
Originally-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 15:06:26 +02:00
Thomas Lamprecht
e8c60b3215 utils: add getOpenIDRedirectionAuthorization: to avoid code-duplication
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 13:53:11 +02:00
Thomas Lamprecht
b46ad78c2d format/render size: allow one to specifiy if base 2 or 10 is desired
Storage capacity and usage seems to prefer the base ten (SI unit) use
(makes the capacity a bigger number) while memory (RAM) is normally
preferred to use base 2.

So allow both, mostly to allow consistent displaying of metrics.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-07 17:56:04 +02:00
Thomas Lamprecht
ce8289fc58 utils: code cleanup/refactoring
no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 10:27:19 +02:00
Thomas Lamprecht
fc0a18e6c2 utils: add comment note for task descriptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-30 14:10:55 +02:00
Fabian Ebner
9b4b243aa1 format task status: improve replace() usage
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
9865b73e56 format task status: rename variable
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
4294143f92 task status: create helper for formatting
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Stefan Reiter
661faeedf5 Utils: add errorCallback to monStoreErrors
Call a function to decide if we want to mask the component. If the
callback returns true, we assume it has already handled the error (i.e.
shown a messagebox or similar) and skip masking.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +02:00
Thomas Lamprecht
1334cdcabc utils: render_cpu: fix theoretical bug
seems almost like this came from a failed application of the rules of
de-morgan...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 17:48:41 +02:00
Thomas Lamprecht
9e663a6a64 utils: code cleanup and refactoring
Looks like more change than it actually is, see
`--word-diff=color --word-diff-regex='\w+'`.

The single semantic change is the added space in the render_cpu,
between the maxcpu value and CPU/s text

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 17:47:41 +02:00
Dominik Csapak
d365540e14 Utils: refactor updateColumns from pve-manager
we want to reuse this in pbs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Dominik Csapak
ef3f1cfcc4 Utils: add several render functions from PVE
we need the 'render_cpu_model' and '*_usage' methods in PBS,
the rest are the dependencies

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Fabian Ebner
64d85d96b3 tasks: add warningsText
to avoid having capitalized 'WARNINGS' (especially since 'Error' is not) and
support different languages.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-24 07:01:55 +01:00
Thomas Lamprecht
106fe29ef2 utils: async api: reject with whole failure response and add helper to alert it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 11:26:17 +01:00
Thomas Lamprecht
c2c12542d7 utils: copy over async helpers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-22 16:17:56 +01:00
Wolfgang Bumiller
25680ef503 Utils: add ACME related utilities
copied from PVE with linter fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Dominic Jäger
7bff067a38 vlan edit: Fix automatic field disabling
The regex are are created as literals (with // and not new RegExp).
Therefore
 - The old Vlan_match value with double \\  has matched e.g. vlan\ddd instead
   of e.g. vlan123 and
 - the old VlanInterface_match value with double \\ has matched e.g.
   \www\X\dddd instead of e.g. vmbr0.1234

This fixes automatically disabling the fields vlan-raw-device and vlan-id (VLAN
tag) in the VLAN edit window.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Thomas Lamprecht
63ec56e5bc utils: get help info: fix normalization with multiple minuses
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-10 16:27:43 +01:00
Thomas Lamprecht
1f905769b1 Revert "Utils: fix help section normalization"
replaceAll is not supported by all browser we try to guarantee to
support.

This reverts commit f7b816a399.
2020-11-10 16:26:27 +01:00
Aaron Lauterer
f7b816a399 Utils: fix help section normalization
We need to replace all occurences when normalizing underscores or
dashes.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-11-10 11:53:29 +01:00
Thomas Lamprecht
6fb81c1519 enable ARIA again
we have everything updated to ExtJS 6.x since quite a bit, and some
quick checks on various components did not show any error - lets
enable this again.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-09 07:56:42 +01:00
Dominik Csapak
3571d71343 Utils: remove product specific task descriptions
we use 'override_task_descriptions' in the specific products to
add the ones that are not used everywhere

took the chance and sorted the remaining alphabetically

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-03 12:40:45 +01:00
Thomas Lamprecht
57ba4cdcb3 make subscription status check compare lower case
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 14:18:42 +01:00
Thomas Lamprecht
31780db0bb eslint fixup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 13:24:20 +02:00
Dietmar Maurer
6221e40cdd implement and use systemd_unescape 2020-10-22 12:10:29 +02:00
Hannes Laimer
c63c63111f utils: add task description for directory removal
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Thomas Lamprecht
abfc18575e add Korean as translation choice
it was recently contributed by 김 주철

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-15 13:25:20 +02:00
Dominik Csapak
a1d40d37ed Utils: improve matching groups of ip/host regexes
we only ever want to match the whole hostname/ip, never just some part of it
and we do not want to have the ':' as part of the port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-01 10:09:41 +02:00
Thomas Lamprecht
6127ba8883 language_map: add Dutch
Contributed-by: Jorren Schauwaert <jorren.schauwaert@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-27 14:53:06 +02:00
Thomas Lamprecht
998237fcd7 utils: order languages after rendered name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-27 14:52:44 +02:00
Thomas Lamprecht
a718654e76 utils: improve indentation and better check API result
to avoid dereferencing a null/undefined value.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-26 20:20:41 +02:00
Thomas Lamprecht
7f56fd0cb0 onlineHelp: try finding - and _ normalized blockid variants
allows easy support of both separation variants, commonly used in
asciidoc or sphinx.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-21 16:28:25 +02:00
Thomas Lamprecht
b6d1735ae1 followup: s/storedUser/storedAuth/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 13:27:29 +02:00
Tim Marx
63252ab6ab adapt auth utils for proxmox token authentication
Signed-off-by: Tim Marx <t.marx@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 13:25:14 +02:00
Dominik Csapak
f29e6a669e Utils: add render_zfs_health
from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-25 15:58:18 +02:00
Dominik Csapak
b2d7d422ec format_duration_human: say <0.1s instead of 0s
if we get a duration of <=0.1s it should actually be somewhere
betweeen 0 and 0.1 so return <0.1s

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 09:56:23 +02:00
Dominik Csapak
b1d446d0b2 show Task warnings differently
tasks can now show also 'WARNINGS: <count>'
filter it out and provide a 'parse_task_status' function for easy reuse

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 09:55:17 +02:00
Thomas Lamprecht
ecabd4379c cleanly separate sources from package build, move to own folder
compared result with `diffoscope`, saw now difference

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 17:43:03 +02:00