Commit Graph

593 Commits

Author SHA1 Message Date
Thomas Lamprecht
f869d73e50 css: markdown: add some nicer blockquote styling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 18:08:06 +02:00
Thomas Lamprecht
a610dd9e32 parser: sanitize HTML: allow 'disabled', 'start', 'type' and 'checked' attributes
This makes check box lists like the following snipped work:

- [X] Done
- [ ] not done

Further allow the start attr, sometimes generated for ordered lists.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 17:37:38 +02:00
Thomas Lamprecht
d1c4a7389f css: markdown: add some nicer table styling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 16:24:27 +02:00
Thomas Lamprecht
59754b7bf8 bump version to 3.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 15:32:31 +02:00
Thomas Lamprecht
51a2f11c6b integrate marked as markdown parser
Define our own, rather minimal interface so that we change the parser
under the hood if ever needed, I already did so once during
evaluating this, as first I checked out Snarkdown[0], which is really
nice for the few lines of code it needs, but is a bit to limited for
the use case.

Currently marked[1] is used, provided by the libjs-marked Debian
package.

For now statically link the marked parser in on built time to avoid
the need to add new directories to serve in our pve/pmg/pbs proxies.
This is a bit ugly but can be cleaned up afterwards transparently
too.

We sanitize the produced HTML ourselves (most MD JS parser/renderer
don't do that) by creating a real, but not active, DOM tree and
recursively prune bad nodes/attrs from it and let it spit out HTML
again at the end. While a tad inefficient it really won't matter for
our use case, as the notes/comments we render are only a few KiB of
text and it's done on the client side anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 15:19:29 +02:00
Thomas Lamprecht
00cbb47e09 d/copyright: mark license explicitly and indent like machine readable format
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 15:18:11 +02:00
Aaron Lauterer
3d886f9422 ui: network: add columns for vlan-id and vlan-raw-device
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-06-15 14:43:58 +02:00
Thomas Lamprecht
580ccacf1a buildsys: change upload dist to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 09:46:54 +02:00
Thomas Lamprecht
142d5d2cdf 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>
2021-06-07 18:10:15 +02:00
Thomas Lamprecht
674895d354 combo grid: reformat/place comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-07 18:10:15 +02:00
Thomas Lamprecht
e8c1bffbcb bump version to 3.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:26:54 +02:00
Thomas Lamprecht
4957686b0d panel: disks: more static task window creation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:26:54 +02:00
Thomas Lamprecht
94791efabb buildsys: cleanup variable names/grouping
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:10:58 +02:00
Thomas Lamprecht
b0e33a3e2a buildsys: enforce eslint for api-viewer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:10:31 +02:00
Thomas Lamprecht
ac4fa7fee8 api-viewer: eslint fixes, code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:32 +02:00
Thomas Lamprecht
5eb59676c3 api-viewer: drop unused clicmdhash
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:06 +02:00
Thomas Lamprecht
8556628c93 api viewer: rename gloabl schema variable and tell eslint about it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:46:32 +02:00
Thomas Lamprecht
52428d6055 api viewer: eslint (auto) fixes + slight cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:51 +02:00
Thomas Lamprecht
2f80505306 don't shout: s/APIVIEWER/APIViewer/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:13 +02:00
Dominik Csapak
ed9ae47edd 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>
2021-06-02 13:44:37 +02:00
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