proxmox-widget-toolkit.git
3 months agobuildsys: enforce eslint for api-viewer
Thomas Lamprecht [Wed, 2 Jun 2021 14:10:31 +0000 (16:10 +0200)]
buildsys: enforce eslint for api-viewer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agoapi-viewer: eslint fixes, code cleanups
Thomas Lamprecht [Wed, 2 Jun 2021 14:08:32 +0000 (16:08 +0200)]
api-viewer: eslint fixes, code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agoapi-viewer: drop unused clicmdhash
Thomas Lamprecht [Wed, 2 Jun 2021 14:08:06 +0000 (16:08 +0200)]
api-viewer: drop unused clicmdhash

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agoapi viewer: rename gloabl schema variable and tell eslint about it
Thomas Lamprecht [Wed, 2 Jun 2021 12:46:32 +0000 (14:46 +0200)]
api viewer: rename gloabl schema variable and tell eslint about it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agoapi viewer: eslint (auto) fixes + slight cleanup
Thomas Lamprecht [Wed, 2 Jun 2021 12:43:51 +0000 (14:43 +0200)]
api viewer: eslint (auto) fixes + slight cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agodon't shout: s/APIVIEWER/APIViewer/
Thomas Lamprecht [Wed, 2 Jun 2021 12:43:13 +0000 (14:43 +0200)]
don't shout: s/APIVIEWER/APIViewer/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 months agoadd proxmox-widget-toolkit-dev package
Dominik Csapak [Fri, 28 May 2021 12:13:41 +0000 (14:13 +0200)]
add proxmox-widget-toolkit-dev package

used for various other packages to dev-depend on (e.g. pve-docs)
which only contains the Toolkit.js for now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoadd api-viewer source
Dominik Csapak [Fri, 28 May 2021 12:13:40 +0000 (14:13 +0200)]
add api-viewer source

so that we can reuse it across products
source was 'pbs' since that had the most features (http upgrade check)

a few changes to combine pve/pbs/pmg:
* use an optional 'cliusage' function it it exists to determine CLI usage
* check allowtoken for undefined to see if it is allowed or not
* use 'pmxapi' instead of pbs/pmg/pveapi
* rename all occurrences of 'pve' to 'pmx'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: move defaultDownloadServerUrl override to panel/RRDChart
Dominik Csapak [Fri, 28 May 2021 12:13:39 +0000 (14:13 +0200)]
Toolkit: move defaultDownloadServerUrl override to panel/RRDChart

not all users of Toolkit.js have the charts lib loaded, which means
the class does not exist then.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agodisk list: add wipe disk button
Fabian Ebner [Fri, 23 Apr 2021 10:14:59 +0000 (12:14 +0200)]
disk list: add wipe disk button

which shows a confirm dialog with the most relevant information before actually
issuing the API call.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 months agodisk list: move title bar initialization to initComponent
Fabian Ebner [Fri, 23 Apr 2021 10:14:58 +0000 (12:14 +0200)]
disk list: move title bar initialization to initComponent

to conditionally add more buttons later on.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 months 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>
3 months agopanel/RRDChart: fix animation settings for highlight/marker
Dominik Csapak [Thu, 27 May 2021 13:15:58 +0000 (15:15 +0200)]
panel/RRDChart: fix animation settings for highlight/marker

in extjs 7.0, the marker does not have the 'fx' property anymore,
but the now documented 'animation' property does not work as it seems.

instead set the animation settings directly on the chart. The only
downside is that this is now for *all* animations, not only the
fade in of the highlight. (the default duration is 500ms)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: remove Datepicker fix
Dominik Csapak [Wed, 26 May 2021 08:58:39 +0000 (10:58 +0200)]
Toolkit: remove Datepicker fix

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: remove textarea fix
Dominik Csapak [Wed, 26 May 2021 08:58:38 +0000 (10:58 +0200)]
Toolkit: remove textarea fix

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: remove pie chart fix
Dominik Csapak [Wed, 26 May 2021 08:58:37 +0000 (10:58 +0200)]
Toolkit: remove pie chart fix

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: remove firefox touchscreen override
Dominik Csapak [Wed, 26 May 2021 08:58:36 +0000 (10:58 +0200)]
Toolkit: remove firefox touchscreen override

seems to be fixed, at least i could not reproduce here.
If users report this again, we can still revert it if necessary.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: update focusJump override
Dominik Csapak [Wed, 26 May 2021 08:58:35 +0000 (10:58 +0200)]
Toolkit: update focusJump override

upstream code changed a bit, update to current version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: update overrides for scroll fixes
Dominik Csapak [Wed, 26 May 2021 08:58:34 +0000 (10:58 +0200)]
Toolkit: update overrides for scroll fixes

while some scrolling issues where fixed since 6.0.1, some where introduced,
namely:
* for firefox, the correct event to listen to is 'wheel' not 'mousewheel'
* the spinner scroll direction was incorrect
* the boxOverflow scroll direction was incorrect
* the boxOverflow scroll amount was too high

functions were copied from extjs source, eslintified, and adapted

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agopanel/RRDChart: fix legend/undoZoom
Dominik Csapak [Wed, 26 May 2021 08:58:33 +0000 (10:58 +0200)]
panel/RRDChart: fix legend/undoZoom

the legend is by default of type 'sprite', rever to 'dom'
but we now have to unset the '.legend', else on destruction
extjs tries to destroy it twice

also change the onAfterAnimation listener to 'redraw', since
the original event does not exist anymore, add a buffer to it
so that it is not that heavy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agocss: add css changes for treelist
Dominik Csapak [Wed, 26 May 2021 08:58:32 +0000 (10:58 +0200)]
css: add css changes for treelist

add a new class 'x-treelist-pve-nav' so that we can use
ui: 'pve-nav'
instead of
ui: 'nav'
which has some default styling we do not want

also overwrite the font to FontAwesome
(extjs 7.0 uses 'FontAwesome 5 Free' which we do not ship)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: set clearPropertiesOnDestroy to false by default
Dominik Csapak [Wed, 26 May 2021 08:58:31 +0000 (10:58 +0200)]
Toolkit: set clearPropertiesOnDestroy to false by default

instead of the upstream default of 'async'

we do this since it creates some problems with our callbacks which can
happen during component destruction. The upstream reasoning does not
really makes sense for us normally, since we do not keep any references
around for most things, and thus the garbage collector can claim it.

note that this is only for components, Ext.Base sets it to 'true' by
default and we do not change this since we normally do not extend
from non-components

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoToolkit: set download url for draw containers to '-'
Dominik Csapak [Wed, 26 May 2021 08:58:30 +0000 (10:58 +0200)]
Toolkit: set download url for draw containers to '-'

so that there can be no privacy leak, since the default points
to senchas server

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agodata/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest
Dominik Csapak [Wed, 26 May 2021 08:58:29 +0000 (10:58 +0200)]
data/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest

extjs 7.0 gives the responseType to the XMLHTTPRequest (which
is 'json' for a json reader), but that means that the response is
automatically decoded by the browser, with no means to get the original
return back

in our case, for successful api calls it would work, but some of our
errors are plain text, not json, so the decoded json object is 'null'
and we lose the error information

revert the type to 'undefined' which tells the browser not do do any
decoding

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months agobump version to 3.0-2
Thomas Lamprecht [Fri, 14 May 2021 08:35:03 +0000 (10:35 +0200)]
bump version to 3.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months 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>
4 months agobump version to 3.0-1
Thomas Lamprecht [Thu, 13 May 2021 17:46:57 +0000 (19:46 +0200)]
bump version to 3.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
4 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
5 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
6 months 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>
7 months 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>
7 months 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>