Commit Graph

723 Commits

Author SHA1 Message Date
Dominik Csapak
4ae75df35d 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>
2021-06-02 13:44:37 +02:00
Dominik Csapak
53758e164a 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>
2021-06-02 13:44:37 +02:00
Fabian Ebner
d453438aa0 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>
2021-06-02 13:19:42 +02:00
Fabian Ebner
e3a5040c55 disk list: move title bar initialization to initComponent
to conditionally add more buttons later on.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 13:19:42 +02:00
Thomas Lamprecht
557c45056c 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>
2021-05-28 10:40:21 +02:00
Dominik Csapak
fe3a919417 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>
2021-05-28 07:56:23 +02:00
Dominik Csapak
a78ec00494 Toolkit: remove Datepicker fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
65ed0bf8b8 Toolkit: remove textarea fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
97b71d24a5 Toolkit: remove pie chart fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
10a6a6d5ef 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
9c1296e503 Toolkit: update focusJump override
upstream code changed a bit, update to current version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
d78eb5ec99 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
fef7d02477 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
ee4801472d 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
322de5629f 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
518dd0b6d9 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>
2021-05-27 13:37:36 +02:00
Dominik Csapak
fba354621f 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>
2021-05-27 13:37:36 +02:00
Thomas Lamprecht
d00e8b940a object grid: line-wrap cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-23 16:24:51 +02:00
Thomas Lamprecht
52d3f3b019 object grid: improve/add to documentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-21 17:15:21 +02:00
Thomas Lamprecht
bc9ae6029f 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>
2021-05-21 17:15:03 +02:00
Thomas Lamprecht
f0f898d2dd object grid: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-21 16:38:37 +02:00
Thomas Lamprecht
a2f0234d48 bump version to 3.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-14 10:35:03 +02:00
Lorenz Stechauner
32bb96f4c7 disk smart: fix non working smart value window
fix regression in refactor from commit 7eb1fb18ad

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>
2021-05-14 10:34:28 +02:00
Thomas Lamprecht
c60c729250 bump version to 3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-13 19:46:57 +02:00
Thomas Lamprecht
c42e4596e5 debian: various trivial updates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-13 19:46:22 +02:00
Thomas Lamprecht
b2c52530fb d/control: bump debhelper compat level to 12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-13 19:46:22 +02:00
Thomas Lamprecht
ff7b048364 bump version to 2.5-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-07 18:02:04 +02:00
Fabian Ebner
e2ecec942f disk list: factor out renderers for type and usage
to be re-used later.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-07 17:58:21 +02:00
Fabian Ebner
f38bbed7bf 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>
2021-05-07 17:58:21 +02:00
Thomas Lamprecht
b46ad78c2d format/render size: allow one to specifiy if base 2 or 10 is desired
Storage capacity and usage seems to prefer the base ten (SI unit) use
(makes the capacity a bigger number) while memory (RAM) is normally
preferred to use base 2.

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

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

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 10:27:19 +02:00
Thomas Lamprecht
ff7ee78453 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>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
7eb1fb18ad disk smart: code/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
18b79e39cf 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>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
713a7f9379 info widget: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
fc0a18e6c2 utils: add comment note for task descriptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-30 14:10:55 +02:00
Thomas Lamprecht
33d34da8a7 bump version to 2.5-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-24 19:30:14 +02:00
Fabian Ebner
9b4b243aa1 format task status: improve replace() usage
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
9865b73e56 format task status: rename variable
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
4294143f92 task status: create helper for formatting
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
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