Commit Graph

685 Commits

Author SHA1 Message Date
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
Lorenz Stechauner
df096ae3fc toolkit: update email regex for acme account
Email regex only allowed two domain parts.
(probably copy/paste error from PVE::Tools)
Now allowing multiple domain parts.

Reported in our community forum:
https://forum.proxmox.com/threads/wrong-email-validation-when-adding-acme-account.88074/

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-04-23 10:36:41 +02:00
Thomas Lamprecht
b9a9ae8c75 bump version to 2.5-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 20:34:45 +02:00
Thomas Lamprecht
689fa8a52c status view: query and update pveInfoWidget too for now
we may want to replace them someday, at least with an intermediate
widget xtype for unified querying, but it's only going through the
local descendant, which is not that bad size-wise, so don't care..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 20:30:31 +02:00
Wolfgang Bumiller
ef7a8290db acme: separate flag to disable the 'domains=' array
PVE has 2 domain lists, PMG only 1 since it requires the
additional type.

In PBS I do not want to have 2 lists either, since it seems
rather inconvenient to have 2 different ways to access the
same list.

Currently we decide this based on whether we have multiple
certificate types, which in PBS we don't, so we need a
separate option for this.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-22 19:57:28 +02:00
Stefan Reiter
6f9f9c71b3 FileBrowser: show errors in messagebox and allow expand 'all'
If an error is received upon expanding a node, chances are the rest of
the tree is still valid (i.e. opening a partition fails because it
doesn't contain a supported filesystem). Only show an error box for the
user, but don't mask the component in that case. Additionally, disable
the download button.

Also support an archive set to 'all' to expand all children, useful for
initializing a file-restore VM on initial load.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +02:00
Stefan Reiter
c1c8cfa85b FileBrowser: support 'virtual'/'v' file type
Denotes objects like disks ".img.fidx" files, which shouldn't be
downloadable, but should still approximate a directory entry.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +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
Thomas Lamprecht
0d58bef75c node status view: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 15:32:27 +02:00
Dominik Csapak
b87d473347 panel: add StatusView from PVE
with 2 minor fixups:
* one lint error
* binding of the 'updateValues' function in the event
  (we want to avoid breaking this when used in a context where
  a controller exists, in that case using a string will only look in
  the controller and not in the component itself anymore, so use
  the function directly)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +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
bf147dccb8 bring over some icons from PVE
we want to reuse them 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
Thomas Lamprecht
cca5fa0ad9 safe destroy: fix class alias
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 13:22:05 +02:00
Thomas Lamprecht
f2d18cd7b3 safe destroy: code/readability cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 12:47:54 +02:00
Fabian Ebner
1488907695 safe destroy: allow specifing additional items
to be used to add more checkboxes for PVE's guest destroy use case.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:39:44 +02:00
Fabian Ebner
2b1f7bb066 safe destroy: remove purge checkbox
To be replaced by generic additional items specified by the user of the window
or child class. AFAICS there are no existing users of this widget yet, so this
shouldn't break anything.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:39:44 +02:00
Thomas Lamprecht
9531c6594e rrd chart: fix y-axis segmentation when using powerOfTwo
The chart axis get initialized really, so changing the segmenter in
initComponent is not possible anymore, we can only alter the chart
base config in the constructor.

Luckily, the actual segmentation happens later, so we can pass a
flag to the y-axis and hook into the segmenter directly by creating
a new one derived from 'Ext.chart.axis.segmenter.Numeric'.

There we override the preferStep and exactStep methods to decide if
we want to calculate with base 10 or base 2.

So add a constructor to RRDChart and set the axis with the respective
segmenter, depending on the powerOfTwo config, up there initially.

Note: that makes overwriting the axes from a caller impossible, but
we do not use that anywhere, and we can control the more important
parts of the axes, like label or units already otherwise, so seems
not really required, and if, its not to hard to solve (either by
always using our new segmenter by default and handle the different
bases there directly, or by adding an explicit do not touch axes
config flag, or the like).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-17 19:20:53 +02:00
Thomas Lamprecht
4337ad5b74 rrd chart: add option to render values as power of two base
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:02:33 +02:00
Thomas Lamprecht
c3b900f958 bump version to 2.5-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-13 09:11:54 +02:00
Stoiko Ivanov
dcd5a0c61f toolkit: override email VType validation
ExtJS email validation regex has a length limit of 6 on the TLD.
This breaks some new gTLDs (e.g. .systems)

Override the validation function and verify against the EMAILRE from
PVE::Tools (used for 'e-mail' in JSONSchema)

Reported in our community forum:
https://forum.proxmox.com/threads/acme-account-register-dialog-does-not-accept-gtlds.87305/

Quickly tested (by using test@test.systems(|test)? on my test-installation)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-13 09:09:23 +02:00
Aaron Lauterer
95bba12dec window/edit: add option to disable reset button
Sometimes the reset button does not make sense and the isCreate option
does not fit as well because with it, the submit button will be enabled
right away instead of waiting for the form to be valid.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-04-13 09:08:29 +02:00
Thomas Lamprecht
fd8ed0d84f file browser: add config and comments for params, uper case URL
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-13 09:01:28 +02:00
Stefan Reiter
2a778ef98c FileBrowser: allow downloading root folder and simplify code
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 08:02:27 +02:00
Stefan Reiter
68b29adede FileBrowser: remove PBS dependencies
Don't construct any URLs locally, instead have them (and their static
parameters) be passed in. This removes the need to have the datastore.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 07:59:08 +02:00
Stefan Reiter
09195cb6f9 window: add FileBrowser
from proxmox-backup, only names changed

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 07:59:08 +02:00
Thomas Lamprecht
c5cade500a acme domains: fix ui-reload gettext + code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-28 16:54:51 +02:00
Thomas Lamprecht
08d092b679 certs: ui-reload: code cleanup and better gettext
there's no "GUI Server" in Proxmox projects..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-28 14:31:13 +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
9ae7fe04e2 panel/acme-domains: fix cyclic dependency in view model
A view model forumla cannot depend on itself, as that is a dependency
cycle.

In this specific case we can just drop the `hasUsage` forumla entry
completely, it is bogus as it was just returning its value, and that
is actually taken care of by the `hasUsage` data binding.

The debug build of ExtJS throws an exception on such cycles, the
release build does not cares to much and seems to do the right thing
already here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 17:26:29 +01:00
Thomas Lamprecht
ff9dbaa706 bump version to 2.4-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 11:29:51 +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
ea2b3fd736 checkbox model: optimize ranged de/selections
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 11:03:56 +01:00
Thomas Lamprecht
d1ff6c593e bump version to 2.4-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-22 16:55:22 +01:00
Thomas Lamprecht
1f628e9ca6 override deselection in CheckboxModel to improve performance
After the UI hang for tens of seconds for a few thousand elements got
deselected I investigated with Firefox developer tools performance
analysis, where the waterfall view showed that most of the time was
spent in array splicing.

Previously, all removed elements got removed on by one from the
`selected` Ext.util.Collection - which is basically an helper class
around arrays and objects, most of it may have become obsolete with
modern browsers. The single remove resulted into further splicing of
the array, and all in all it resulted in a dramatically increased
complexity, ~ O(n^3).

The "remove one by one" logic comes highly probably from the fact
that users can register a `beforedeselection` listener which can
block a removal of a specific record. But, that's not used by us and
not really something one would often need in practice, but still its
a documented feature of ExtJS grids we want to keep; so go for an
alternative.
So, override `doDeselect` and change the old removal logic to one
that first record those entries which got blocked from removal and
remove them in one go from the "to-be-removed" collection.

Before/After this patch on my FF 86.0.1 with my i9-9900K and
deselecting ~10k records went from ~40s to about 33 ms total, so for
that case we went 1000x faster.

The remaining time is now mostly spend in the event fire/handling
logic, but even with 50k records we spent <<500ms in total, so not
too bad and thus kept as is for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-22 16:47:04 +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
Thomas Lamprecht
460306ebe9 bump version to 2.4-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-16 13:32:42 +01:00
Wolfgang Bumiller
8915422f90 add ACME domain editing
Same deal, however, here the PVE code is has a little bug
where changing the plugin type of a domain makes it
disappear, so this also contains some fixups.

Additionally, this now also adds the ability to change a
domain's "usage" (smtp, api or both), so similar to the
uploadButtons info in the Certificates panel, we now have a
domainUsages info. If it is set, the edit window will show a
multiselect combobox, and the panel will show a usage
column.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
658bfdff32 add ACME plugin editing
Like with the account panel, the 'acmeUrl' base needs to be
specified, otherwise this is copied from PVE

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
5df894de26 add ACME account panel
Copied from PVE with URLs now being based on the 'acmeUrl'
property which should point to the acme/ root containing
/tos, /directories, etc.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
60fead29a8 add certificate panel
Again, initially copied from PVE but adapted so it can be
used by both. (PVE side still needs to be tested though.)

The 'nodename' property is optional (since on PMG we
currently don't expose them via the UI directly). Instead,
the certificate info URL is required and the 'uploadButtons'
need to be passed, which just contains the certificate
"name", id (filename), url, and whether it is deletable and
whether a GUI reload is required after changing it. If only
1 entry is passed, the button stays a regular button (that
way PVE should still look the same), whereas in PMG we have
a menu to select between API and SMTP certificates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
63be5c590f add ACME forms
Mostly copied from PVE, but the user needs to set the URL
property so their stores can load the data, whereas in PVE
this was hardcoded.

API selector:
  needs its url to point to the challenge-schema url

Acme Account selector:
  needs its url to point to the acme account index

Acme Plugin selector:
  needs its url to point to the plugin index

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
c0acd78475 add ACME related data models
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +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
Dominik Csapak
8b38c9307b node/ServiceView: remove storeid
it's not needed anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-11 13:56:11 +01:00
Dominik Csapak
6732337cb9 data/*Store: drop storeid requirement
We never use that and it serves no purpose. It probably was meant to
be the upstream config 'storeId' which would add the store to the
Ext.StoreManager. This is unpractical though, since then the store
has to be explicitely destroyed, otherwise the StoreManager retains a
reference and the GC cannot remove the store.

Since donwstream users of the store can simply give the 'storeId'
property anyway if they need to be managed by the StoreManager, drop
the requirement here.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-11 13:56:11 +01:00
Thomas Lamprecht
3f81450686 bump version to 2.4-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 20:22:05 +01:00