]> git.proxmox.com Git - proxmox-widget-toolkit.git/log
proxmox-widget-toolkit.git
2 years agobump version to 2.6-2 stable-6
Thomas Lamprecht [Tue, 15 Mar 2022 16:29:32 +0000 (17:29 +0100)]
bump version to 2.6-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoadd EOL notice component
Thomas Lamprecht [Tue, 15 Mar 2022 16:05:16 +0000 (17:05 +0100)]
add EOL notice component

to avoid copying the same thing to three different product's GUIs
this year..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.6-1
Thomas Lamprecht [Fri, 25 Jun 2021 07:34:40 +0000 (09:34 +0200)]
bump version to 2.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: touch incremental-lint in check target to avoid triggering twice
Thomas Lamprecht [Fri, 28 May 2021 08:40:19 +0000 (10:40 +0200)]
buildsys: touch incremental-lint in check target to avoid triggering twice

Without this the check and the, through the 'install' target
triggered, incremental lint target triggered a full eslint run.

Makes it similar to what PBS did from the beginning of eslint
inclusion..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 557c45056c62edaa480341c262b0286eecb6a56a)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocbind mixin: also descend in elements with an cbind property
Thomas Lamprecht [Fri, 25 Jun 2021 06:42:39 +0000 (08:42 +0200)]
cbind mixin: also descend in elements with an cbind property

Not only into those with an xtype one, as we can either have a
implicit default xtype (e.g., in tbars for buttons, or set explicitly
via the `defaults` mechanism) or want to apply cbinds to stores or
other objects.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 5995eddcc48ddb63d235905cd0a948f38c5e9164)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocombo grid: load: rework auto-selection and validity logic
Thomas Lamprecht [Mon, 7 Jun 2021 16:03:25 +0000 (18:03 +0200)]
combo grid: load: rework auto-selection and validity logic

We do not want to trigger an autoSelect if there's a value set, even
if it isn't found in the store, as that hides the fact that an (now)
invalid valid is configured from the user, which can be confusing if
something is not working, as when editing an object it seems like a
valid value is selected.

Further, if a value is set we mark the field as invalid from the
start, at least if it's neither disabled nor allowed to have a
value which is does not exists in the backing store.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocombo grid: reformat/place comment
Thomas Lamprecht [Mon, 7 Jun 2021 16:02:08 +0000 (18:02 +0200)]
combo grid: reformat/place comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoobject grid: line-wrap cleanup
Thomas Lamprecht [Sun, 23 May 2021 14:23:17 +0000 (16:23 +0200)]
object grid: line-wrap cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.5-6
Thomas Lamprecht [Fri, 21 May 2021 15:40:26 +0000 (17:40 +0200)]
bump version to 2.5-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoobject grid: improve/add to documentation
Thomas Lamprecht [Fri, 21 May 2021 15:15:21 +0000 (17:15 +0200)]
object grid: improve/add to documentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoobject grid: allow one to declaratively specify rows
Thomas Lamprecht [Fri, 21 May 2021 14:39:23 +0000 (16:39 +0200)]
object grid: allow one to declaratively specify rows

So that users of this component do not necesacrrily need to add an
initComponent override and make the `me.add_XYZ_row()` there, but
instead can use something like:

  gridRows: [
    {
      xtype: 'text',
      name: 'http-proxy',
      text: gettext('HTTP proxy'),
      defaultValue: Proxmox.Utils.noneText,
      vtype: 'HttpProxy',
      deleteEmpty: true,
    },
  ],

I avoid using `rows` as config key as that is internally used for
quite a few things, and potentially some existing users (did not
checked all). We can still switch to that easily if it is deemed to
be better...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoobject grid: code cleanup
Thomas Lamprecht [Fri, 21 May 2021 14:38:37 +0000 (16:38 +0200)]
object grid: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.5-5
Thomas Lamprecht [Fri, 14 May 2021 08:30:43 +0000 (10:30 +0200)]
bump version to 2.5-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodisk smart: fix non working smart value window
Lorenz Stechauner [Fri, 14 May 2021 07:16:10 +0000 (09:16 +0200)]
disk smart: fix non working smart value window

fix regression in refactor from commit 7eb1fb18ad6a243953c

Reported in forum:
https://forum.proxmox.com/threads/gui-disks-tab-cant-showup-smart-values.89180/
https://forum.proxmox.com/threads/smart-values-bug-in-6-4-6.89179/

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodebian: various trivial updates
Thomas Lamprecht [Thu, 13 May 2021 17:45:05 +0000 (19:45 +0200)]
debian: various trivial updates

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump debhelper compat level to 12
Thomas Lamprecht [Thu, 13 May 2021 17:44:45 +0000 (19:44 +0200)]
d/control: bump debhelper compat level to 12

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.5-4
Thomas Lamprecht [Fri, 7 May 2021 16:02:04 +0000 (18:02 +0200)]
bump version to 2.5-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodisk list: factor out renderers for type and usage
Fabian Ebner [Fri, 23 Apr 2021 10:14:57 +0000 (12:14 +0200)]
disk list: factor out renderers for type and usage

to be re-used later.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agodisk list: fix minor usage renderer issue
Fabian Ebner [Fri, 23 Apr 2021 10:14:56 +0000 (12:14 +0200)]
disk list: fix minor usage renderer issue

If there is extended information, the variable is overwritten anyways.
Avoid appending an extra space if there is no extended information.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoformat/render size: allow one to specifiy if base 2 or 10 is desired
Thomas Lamprecht [Tue, 4 May 2021 08:33:28 +0000 (10:33 +0200)]
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>
2 years agoutils: code cleanup/refactoring
Thomas Lamprecht [Tue, 4 May 2021 08:27:17 +0000 (10:27 +0200)]
utils: code cleanup/refactoring

no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodisk smart: fix layout, enable autoscroll
Thomas Lamprecht [Mon, 3 May 2021 07:38:29 +0000 (09:38 +0200)]
disk smart: fix layout, enable autoscroll

`layout: fit` does not much on a leaf item node, it's for children
after all. So use it at top and enable autoscroll on the text
component.

Reported in the forum:
https://forum.proxmox.com/threads/gui-smart-details-cannot-be-scrolled-down.88566/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodisk smart: code/indentation cleanup
Thomas Lamprecht [Mon, 3 May 2021 07:31:59 +0000 (09:31 +0200)]
disk smart: code/indentation cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoinfo widget: set default warning threshold to 75%
Thomas Lamprecht [Mon, 3 May 2021 07:33:24 +0000 (09:33 +0200)]
info widget: set default warning threshold to 75%

60% is just way to low, this probably could be 80% or even 85% too,
in huge setups that normally means that there's still a lot of
resources left, but be conservative for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoinfo widget: code cleanup
Thomas Lamprecht [Mon, 3 May 2021 07:33:08 +0000 (09:33 +0200)]
info widget: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoutils: add comment note for task descriptions
Thomas Lamprecht [Fri, 30 Apr 2021 12:10:55 +0000 (14:10 +0200)]
utils: add comment note for task descriptions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.5-3
Thomas Lamprecht [Sat, 24 Apr 2021 17:30:14 +0000 (19:30 +0200)]
bump version to 2.5-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoformat task status: improve replace() usage
Fabian Ebner [Fri, 9 Apr 2021 08:44:32 +0000 (10:44 +0200)]
format task status: improve replace() usage

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoformat task status: rename variable
Fabian Ebner [Fri, 9 Apr 2021 08:44:31 +0000 (10:44 +0200)]
format task status: rename variable

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agotask status: create helper for formatting
Fabian Ebner [Fri, 9 Apr 2021 08:44:30 +0000 (10:44 +0200)]
task status: create helper for formatting

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agotoolkit: update email regex for acme account
Lorenz Stechauner [Fri, 23 Apr 2021 08:15:13 +0000 (10:15 +0200)]
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>
3 years agobump version to 2.5-2
Thomas Lamprecht [Thu, 22 Apr 2021 18:34:45 +0000 (20:34 +0200)]
bump version to 2.5-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agostatus view: query and update pveInfoWidget too for now
Thomas Lamprecht [Thu, 22 Apr 2021 18:30:28 +0000 (20:30 +0200)]
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>
3 years agoacme: separate flag to disable the 'domains=' array
Wolfgang Bumiller [Fri, 16 Apr 2021 13:35:17 +0000 (15:35 +0200)]
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>
3 years agoFileBrowser: show errors in messagebox and allow expand 'all'
Stefan Reiter [Thu, 22 Apr 2021 15:34:57 +0000 (17:34 +0200)]
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>
3 years agoFileBrowser: support 'virtual'/'v' file type
Stefan Reiter [Thu, 22 Apr 2021 15:34:56 +0000 (17:34 +0200)]
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>
3 years agoUtils: add errorCallback to monStoreErrors
Stefan Reiter [Thu, 22 Apr 2021 15:34:55 +0000 (17:34 +0200)]
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>
3 years agoutils: render_cpu: fix theoretical bug
Thomas Lamprecht [Thu, 22 Apr 2021 15:48:38 +0000 (17:48 +0200)]
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>
3 years agoutils: code cleanup and refactoring
Thomas Lamprecht [Thu, 22 Apr 2021 15:46:18 +0000 (17:46 +0200)]
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>
3 years agonode status view: code cleanup
Thomas Lamprecht [Thu, 22 Apr 2021 13:32:27 +0000 (15:32 +0200)]
node status view: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopanel: add StatusView from PVE
Dominik Csapak [Mon, 19 Apr 2021 11:00:44 +0000 (13:00 +0200)]
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>
3 years agoUtils: refactor updateColumns from pve-manager
Dominik Csapak [Mon, 19 Apr 2021 11:00:43 +0000 (13:00 +0200)]
Utils: refactor updateColumns from pve-manager

we want to reuse this in pbs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobring over some icons from PVE
Dominik Csapak [Mon, 19 Apr 2021 11:00:42 +0000 (13:00 +0200)]
bring over some icons from PVE

we want to reuse them in PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoUtils: add several render functions from PVE
Dominik Csapak [Mon, 19 Apr 2021 11:00:41 +0000 (13:00 +0200)]
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>
3 years agosafe destroy: fix class alias
Thomas Lamprecht [Thu, 22 Apr 2021 11:22:05 +0000 (13:22 +0200)]
safe destroy: fix class alias

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosafe destroy: code/readability cleanup
Thomas Lamprecht [Thu, 22 Apr 2021 10:47:54 +0000 (12:47 +0200)]
safe destroy: code/readability cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosafe destroy: allow specifing additional items
Fabian Ebner [Mon, 19 Apr 2021 13:14:36 +0000 (15:14 +0200)]
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>
3 years agosafe destroy: remove purge checkbox
Fabian Ebner [Mon, 19 Apr 2021 13:14:35 +0000 (15:14 +0200)]
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>
3 years agorrd chart: fix y-axis segmentation when using powerOfTwo
Thomas Lamprecht [Fri, 16 Apr 2021 19:53:45 +0000 (21:53 +0200)]
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>
3 years agorrd chart: add option to render values as power of two base
Thomas Lamprecht [Thu, 15 Apr 2021 17:02:33 +0000 (19:02 +0200)]
rrd chart: add option to render values as power of two base

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.5-1
Thomas Lamprecht [Tue, 13 Apr 2021 07:11:54 +0000 (09:11 +0200)]
bump version to 2.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotoolkit: override email VType validation
Stoiko Ivanov [Thu, 8 Apr 2021 12:41:18 +0000 (14:41 +0200)]
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>
3 years agowindow/edit: add option to disable reset button
Aaron Lauterer [Mon, 15 Feb 2021 15:26:45 +0000 (16:26 +0100)]
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>
3 years agofile browser: add config and comments for params, uper case URL
Thomas Lamprecht [Tue, 13 Apr 2021 07:01:28 +0000 (09:01 +0200)]
file browser: add config and comments for params, uper case URL

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoFileBrowser: allow downloading root folder and simplify code
Stefan Reiter [Mon, 12 Apr 2021 15:32:51 +0000 (17:32 +0200)]
FileBrowser: allow downloading root folder and simplify code

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoFileBrowser: remove PBS dependencies
Stefan Reiter [Thu, 1 Apr 2021 15:34:43 +0000 (17:34 +0200)]
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>
3 years agowindow: add FileBrowser
Stefan Reiter [Thu, 1 Apr 2021 15:34:42 +0000 (17:34 +0200)]
window: add FileBrowser

from proxmox-backup, only names changed

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoacme domains: fix ui-reload gettext + code cleanup
Thomas Lamprecht [Sun, 28 Mar 2021 14:54:51 +0000 (16:54 +0200)]
acme domains: fix ui-reload gettext + code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocerts: ui-reload: code cleanup and better gettext
Thomas Lamprecht [Sun, 28 Mar 2021 12:31:11 +0000 (14:31 +0200)]
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>
3 years agotasks: add warningsText
Fabian Ebner [Fri, 12 Mar 2021 12:53:24 +0000 (13:53 +0100)]
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>
3 years agopanel/acme-domains: fix cyclic dependency in view model
Thomas Lamprecht [Tue, 23 Mar 2021 16:24:09 +0000 (17:24 +0100)]
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>
3 years agobump version to 2.4-9
Thomas Lamprecht [Tue, 23 Mar 2021 10:28:28 +0000 (11:28 +0100)]
bump version to 2.4-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: async api: reject with whole failure response and add helper to alert it
Thomas Lamprecht [Tue, 23 Mar 2021 10:26:17 +0000 (11:26 +0100)]
utils: async api: reject with whole failure response and add helper to alert it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocheckbox model: optimize ranged de/selections
Thomas Lamprecht [Tue, 23 Mar 2021 10:03:56 +0000 (11:03 +0100)]
checkbox model: optimize ranged de/selections

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.4-8
Thomas Lamprecht [Mon, 22 Mar 2021 15:55:22 +0000 (16:55 +0100)]
bump version to 2.4-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agooverride deselection in CheckboxModel to improve performance
Thomas Lamprecht [Mon, 22 Mar 2021 06:08:11 +0000 (07:08 +0100)]
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>
3 years agoutils: copy over async helpers
Thomas Lamprecht [Mon, 22 Mar 2021 15:17:56 +0000 (16:17 +0100)]
utils: copy over async helpers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.4-7
Thomas Lamprecht [Tue, 16 Mar 2021 12:32:42 +0000 (13:32 +0100)]
bump version to 2.4-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd ACME domain editing
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:23 +0000 (11:24 +0100)]
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>
3 years agoadd ACME plugin editing
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:22 +0000 (11:24 +0100)]
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>
3 years agoadd ACME account panel
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:21 +0000 (11:24 +0100)]
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>
3 years agoadd certificate panel
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:20 +0000 (11:24 +0100)]
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>
3 years agoadd ACME forms
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:19 +0000 (11:24 +0100)]
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>
3 years agoadd ACME related data models
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:18 +0000 (11:24 +0100)]
add ACME related data models

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoUtils: add ACME related utilities
Wolfgang Bumiller [Tue, 16 Mar 2021 10:24:17 +0000 (11:24 +0100)]
Utils: add ACME related utilities

copied from PVE with linter fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agonode/ServiceView: remove storeid
Dominik Csapak [Thu, 11 Mar 2021 09:14:33 +0000 (10:14 +0100)]
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>
3 years agodata/*Store: drop storeid requirement
Dominik Csapak [Thu, 11 Mar 2021 09:14:32 +0000 (10:14 +0100)]
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>
3 years agobump version to 2.4-6
Thomas Lamprecht [Fri, 5 Mar 2021 19:22:05 +0000 (20:22 +0100)]
bump version to 2.4-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoedit window: advanced: only show advanced fields on invalid temporary
Thomas Lamprecht [Fri, 5 Mar 2021 19:18:02 +0000 (20:18 +0100)]
edit window: advanced: only show advanced fields on invalid temporary

makes no sense to permanently enable them, that makes for weird
experience.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopanel/DiskList: return empty text for status on partitions
Dominik Csapak [Fri, 5 Mar 2021 11:03:54 +0000 (12:03 +0100)]
panel/DiskList: return empty text for status on partitions

instead of returning 'unknown'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotask viewer: increase height
Thomas Lamprecht [Fri, 5 Mar 2021 16:13:31 +0000 (17:13 +0100)]
task viewer: increase height

500 px still fit nicely in our minimum requirements of "HD ready"
(1280 x 720 px) and for any slightly longer running task the extra
pixel are really nice, I frequently find myself resizing the height
immediately after a task window opens so lets up the default a bit...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.4-5
Thomas Lamprecht [Tue, 9 Feb 2021 13:33:12 +0000 (14:33 +0100)]
bump version to 2.4-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agovlan edit: Match explicit values to name field
Dominic Jäger [Mon, 8 Feb 2021 12:41:37 +0000 (13:41 +0100)]
vlan edit: Match explicit values to name field

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agovlan edit: Set valid default name
Dominic Jäger [Mon, 8 Feb 2021 12:41:36 +0000 (13:41 +0100)]
vlan edit: Set valid default name

Using find_next_iface_id we get a valid VLAN name.
This way, inserting a vlan raw device is still required (but everything that is
inserted so far is valid).

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agovlan edit: Move example from default value to tooltip
Dominic Jäger [Mon, 8 Feb 2021 12:41:35 +0000 (13:41 +0100)]
vlan edit: Move example from default value to tooltip

We usually choose default values that are valid input for the field.
interfaceX.1 is rejected by the API.

Instead, use a tooltip to demonstrate possible valid inputs for the field.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agovlan edit: Forbid blank vlan raw device
Dominic Jäger [Mon, 8 Feb 2021 12:41:34 +0000 (13:41 +0100)]
vlan edit: Forbid blank vlan raw device

Users certainly have to insert a vlan raw device when the textfield is enabled.
Currently, they only see `invalid network interface name "` when submitting.
Forbidding the blank field shows the problem earlier.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agovlan edit: Fix automatic field disabling
Dominic Jäger [Mon, 8 Feb 2021 12:41:33 +0000 (13:41 +0100)]
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>
3 years agomove DiskList.js from grid/ to panel/
Fabian Ebner [Mon, 8 Feb 2021 14:23:28 +0000 (15:23 +0100)]
move DiskList.js from grid/ to panel/

because it's a treepanel now.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoconvert disk list to disk tree and conditionally include partitions
Fabian Ebner [Mon, 8 Feb 2021 14:23:27 +0000 (15:23 +0100)]
convert disk list to disk tree and conditionally include partitions

Assigning the store directly to the treepanel doesn't work, more manual
handling is needed. This is mostly based on what we do for PBS's datastore
content view. The store monitoring also needs to be changed slightly.

The buttons are restricted to work on disks only, based on the parent
attribute, that only partitions have.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoprune panel: make keep-last label text like the others
Fabian Ebner [Fri, 27 Nov 2020 10:08:28 +0000 (11:08 +0100)]
prune panel: make keep-last label text like the others

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoinput panel: Add drawing of layout
Dominic Jäger [Fri, 27 Nov 2020 11:08:12 +0000 (12:08 +0100)]
input panel: Add drawing of layout

The drawing makes clear in a few seconds:
 - what columnT and columnB stand for
 - what additional containers and panels are created
 - to which of those the elements of column1, column2... go to

When you're in the JS debugger and lost overview of where in this
element hierarchy you are, you can quickly check xtype + layout. Then
consulting this drawing solves the mistery.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agofix usage of findRecord
Dominik Csapak [Thu, 26 Nov 2020 08:23:39 +0000 (09:23 +0100)]
fix usage of findRecord

findRecord does not match exactly, but only at the beginning and
case insensitive, by default. Change all calls to be case sensiti
and an exactmatch (we never want the default behaviour afaics).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agogrid/DiskList: restore info about ceph
Dominik Csapak [Wed, 25 Nov 2020 15:37:07 +0000 (16:37 +0100)]
grid/DiskList: restore info about ceph

previously we printed this ceph info, but it got lost during
refactoring to widget-toolkit, restore a slightly modified
version of the code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobump version to 2.4-4
Thomas Lamprecht [Fri, 15 Jan 2021 15:24:12 +0000 (16:24 +0100)]
bump version to 2.4-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreader: JsonObject: cope with empty (null) return value
Thomas Lamprecht [Fri, 15 Jan 2021 15:18:04 +0000 (16:18 +0100)]
reader: JsonObject: cope with empty (null) return value

there may be cases where the backend serialization plumping code
makes it easier to return null instead of a emtpy object if a
(sub)property or whole config is not configured, as it's closer to
the truth (not configured == null, configured but empty would be {})

For objects this resulted in a exception, as the null value was tried
to be dereferenced, avoid that by defaulting to an empty object in
that case.
For arrays we already coped with that by luck, make that more
explicit to avoid future breakage.

Both result to a empty array being returned as values, which means
empty store and is deemed to be OK in that case.

The rowdef.required still applies and adds empty values though, this
could be argued to not be really fitting - for now lets keep it that
way, we could make this opt-in though if it shows that it is not
always correct.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreader: JsonObject: whitespace fixes
Thomas Lamprecht [Fri, 15 Jan 2021 15:17:35 +0000 (16:17 +0100)]
reader: JsonObject: whitespace fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: network: Remove bond-primary gettext
Dominic Jäger [Thu, 7 Jan 2021 08:32:14 +0000 (09:32 +0100)]
ui: network: Remove bond-primary gettext

The corresponding option  in /etc/network/interfaces is exactly "bond-primary".
Translating this might easily make unclear what is meant.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
3 years agobump version to 2.4-3
Thomas Lamprecht [Mon, 23 Nov 2020 17:46:09 +0000 (18:46 +0100)]
bump version to 2.4-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune panel: allow to pass emptyText for keep-last
Thomas Lamprecht [Mon, 23 Nov 2020 17:17:53 +0000 (18:17 +0100)]
prune panel: allow to pass emptyText for keep-last

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune field: use dirtychange event to hide/show clear-trigger
Thomas Lamprecht [Mon, 23 Nov 2020 17:17:23 +0000 (18:17 +0100)]
prune field: use dirtychange event to hide/show clear-trigger

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>