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'
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)
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
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
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
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
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:
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>
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>
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>
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>
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>
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>
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>
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)
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.
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>
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.
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>
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.
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>
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>
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>