Commit Graph

1056 Commits

Author SHA1 Message Date
Thomas Lamprecht
f372d3c087 node apt: make changelog window taller for 4:3 ratio
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:15:36 +01:00
Thomas Lamprecht
261f558105 node apt: cleanup and modernize code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-01 12:14:22 +01:00
Thomas Lamprecht
7f14a081af bump version to 3.5.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 17:31:31 +01:00
Thomas Lamprecht
6b70ca845d form: display-edit: add safe default renderer for display field
Due to the value binding on can get interesting effects when the
displayEdit field is in write (input) mode, as then the values still
get relayed to the display field, which itself is wanted as the field
supports live-switching, but even though the display field is
disabled and hidden, the value will be still rendered and a user can
XSS themselves inserting things like:
<img src="a" onerror="alert('cookie:'+document.cookie);"></token

And even though it's harmless (your browser knows your own cookie
already), it is rather odd and simply to cheap to harden against (per
default) to not do so.

Reported-by: Marcel Fromkorth <marcel.fromkorth@8com.de>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 17:21:13 +01:00
Thomas Lamprecht
319d450bec api request: add wide spread alert-error logic as smart-on option
The "smartness" is mostly "enable it automatically if the caller did
not specify an explicit override and there's neither a failure nor
callback function define", but that should cover most cases.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 15:56:27 +01:00
Thomas Lamprecht
cf93d1da50 utils: always html-encode response message
while this is something that only the user that made the request will
see, and for most people the possibility of "hacking" themselves is
rather redundant, it is still not nice to have this possible in
general; as even if it's highly unlikely that there ever can be an
error triggered to another user via API2 request handling, hardening
against it is simply to cheap to not do it.

Reported-by: Marcel Fromkorth <marcel.fromkorth@8com.de>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 15:41:42 +01:00
Thomas Lamprecht
d53046d66b utils: code cleanup for extractRequestError
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 15:34:31 +01:00
Dominik Csapak
4a819c891e combobox grid: avoid needing two clicks after re-selecting an item
'picker.hide()' hides the picker, but does not do everything to
properly keep track of the picker state in the combobox class.

This lead to a bug when we reselected an entry, we had to click the
picker again twice to open it again.

Use the 'collapse' method of the combobox instead, which does the
necessary book-keeping.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-01-31 10:34:47 +01:00
Dominik Csapak
c071b0c302 ComboGrid: make height for the error configurable
by introducing a errorHeight config property. This is necessary when
the ComboGrid has e.g. a toolbar and we show the error in the grid body
only, 100 pixels is not enough then. To solve that without hardcoding
different heights, let the subclass/caller configure that

also set this when the store load fails completely (was not done until now)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-01-18 15:13:37 +01:00
Dominik Csapak
aa157deb47 ComboGrid: use the grids view for the error message
for most of the combogrids, this does not make a difference, but we
want to have a node selection in some of their toolbars. There
having the error over the whole grid makes it impossible to select a
different node (which might be necessary to get rid of the error), so
we show the error on the view (which is the grids content body only).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-01-18 15:13:37 +01:00
Thomas Lamprecht
49dd139a34 bump version to 3.5.4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 16:09:56 +01:00
Thomas Lamprecht
f6efb0d487 node network view: move add-menu generation to common helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 16:03:45 +01:00
Thomas Lamprecht
bcd21f899e node network view: rework finding free interface ID
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 15:18:10 +01:00
Thomas Lamprecht
13220ad1f5 node network view: code style modernization
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 15:13:33 +01:00
Thomas Lamprecht
8407542364 role selector: make slightly more wide and resizeable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 15:09:25 +01:00
Thomas Lamprecht
7b8eff314a task viewer: modernize code style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 14:43:33 +01:00
Thomas Lamprecht
ba4ab7663d code style: use arrow fn for some api request failure paths
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-11 14:42:33 +01:00
Dominik Csapak
9e12fc0203 privilege role selector: fix renderer for Proxmox VE
In PBS we get an array here, so the renderer is fine, but in pve it's
just a long string, so add a space after commas to achieve the same
effect.

Without this, the second column is not visible in pve because of an
error in the renderer (no 'join' function on a string)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: squash in code-reduction to make it a one-liner again ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-09 14:23:38 +01:00
Christoph Heiss
c8bae5b130 node/ServiceView: Show unit-state column in PBS too
The PBS api now reports `unit-state` for services as well, thus enable
the column for it.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-01-05 10:16:19 +01:00
Daniel Tschlatscher
45110c1630 add task log download button in TaskViewer
Adds a download button in the TaskViewer. Uses the newly created
downloadAsFile() method in the Utils class.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Tested-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Stefan Sterz <s.sterz@proxmox.com>
2023-01-04 14:33:09 +01:00
Daniel Tschlatscher
8189ce639c Source file download in new Utils function
Adds a function for downloading a file from a remote URL in the Utils
class and uses it to revise one similar usage in FileBrowser.js

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Tested-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Stefan Sterz <s.sterz@proxmox.com>
2023-01-04 14:32:59 +01:00
Aaron Lauterer
a95dbf6dea parameter and return grid: allow text selection
Making it easier for people to copy & paste parameter and retrun value
names.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2023-01-02 17:44:24 +01:00
Thomas Lamprecht
ddf7a65deb css: whitespace fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-28 08:34:29 +01:00
Thomas Lamprecht
0bba4fc63f bump version to 3.5.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 11:14:39 +01:00
Dominik Csapak
ed6721d0ff log, journal view: fix access to me after destroying
it can happen that the view is destroyed during an api call, so we
should check if it's destroyed as the first thing in the callback

if the view is destroyed, there is nothing we can do here, so simply
return

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-21 10:27:50 +01:00
Dominik Csapak
d13f97d6e3 css: don't make full tags inline-block in the tree
when showing full tags in the tree as inline-block, the height is
increased, leading to unwanted 'wobble' when tags are added/removed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-21 10:27:43 +01:00
Thomas Lamprecht
a35c612297 bump version to 3.5.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 08:37:29 +01:00
Matthias Heiserer
28a000898f api-viewer: show min/max for values without any other format
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-11-16 20:35:22 +01:00
Matthias Heiserer
7148e22691 fix #4271: api-viewer: display nested formats instead of [object Object]
I tried to keep the format as close to the HTML docs as possible, but
there are a few discrepancies between HTML docs and how this patch
displays parameters, instead of:
- <enum>,the enum variants are displayed. [1]
- <0|1>, <boolean> is displayed.

[1] The HTML docs explain parameters after the initial format string,
which the GUI doesn't (and there's no space for that). Showing the
variants inline is the easiest way to not loose information here.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-11-16 20:35:22 +01:00
Matthias Heiserer
18afb0491c RDD: don't display power-of-two suffix 'i' for values without unit suffix
So instead of showing "0 i" (meaning e.g. 0 Gi), just display "0".

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-11-16 20:35:01 +01:00
Dominik Csapak
64e7c5371b Toolkit: add override for Ext.dd.DragDropManager
to fix selection behavior for Ext.dd.DragZone.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-16 14:48:44 +01:00
Dominik Csapak
2396874180 add tag related helpers
helpers to
* generate a color from a string consistently
* generate a html tag for a tag
* related css classes

contrast is calculated according to SAPC draft:
https://github.com/Myndex/SAPC-APCA

which is likely to become a w3c guideline in the future and seems
to be a better algorithm for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-16 14:48:44 +01:00
Thomas Lamprecht
121bbf57bf input panel: add onSetValues hook
As counter-part to `onGetValue`, which is for form assembly, add the
`onSetValues` helper that allows to hook into setting the values on
the fields, for example if one needs to transform a `disabled` to
`enable`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-15 15:16:43 +01:00
Wolfgang Bumiller
54fc2533c8 simplify cpuset regex
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-10 10:56:03 +01:00
Wolfgang Bumiller
5ef8d10da6 cpuset: test only the regex
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-10 10:51:56 +01:00
Daniel Bowder
9109c39202 fix #3593: add CpuSet type to js
Regex parses a cpuset via 2 matches. Find number(s) or range(s) folowed
by a comma, then, find a single number or a single range not followed
by a comma. E.g., 0-1,4-5,6,7,10,11,14-15
CpuSet function first checks regex, then ensures left num <= right num

Signed-off-by: Daniel Bowder <daniel@bowdernet.com>
2022-11-10 09:40:00 +01:00
Aaron Lauterer
d17aa32eb4 TaskProgress: show text instead of percentage
The text needs to be defined in the wait() call as otherwise the
Ext.Progressbar will show a percentage that is not correct anyway but
just reflects where the animated progress bar itself is.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2022-11-07 14:57:16 +01:00
Thomas Lamprecht
8df4bd63d7 form: integer field: code cleanup in getSubmitData
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-07 14:56:49 +01:00
Alexandre Derumier
60ed17bf96 fix #2703: networkedit: limit custom interface name field to 15 characters.
Linux kernel don't allow interfaces name with more than 15 characters

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2022-10-14 15:20:45 +02:00
Matthias Heiserer
34edc91701 CSS: import action column fix from pbs, pmg
So it is in one location and available to pve as well.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-10-10 10:01:16 +02:00
Stefan Sterz
eaa8d084e8 fix: toolkit: make email regex pattern match pve-common
`proxmoxMail` used its own regex pattern to validate emails. that
meant certain email addresses were rejected by the front-end that
were accepted by the backend that uses the functionality from
`pve-common`. examples include the following:

- "user@host.test-tld"
- "user-@host.testtld"
- "user@host"

reported on the forum: https://forum.proxmox.com/threads/gui-bugulance-using-the-user-add-gui-interface.114743/

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2022-09-12 17:14:45 +02:00
Daniel Tschlatscher
94d84581c2 fix: gui: up/down arrow keys increment/decrement twice in Number field
When the up or down arrow key on the keyboard was pressed while a
number text field (or any one descending from Ext.form.field.Spinner)
was selected, the up and down callbacks for that text fields KeyNav
were called twice. Therefore, the value in the text field would always
incorrectly increment/decrement by step * 2.

The problem was an overwrite for the onRender() method of the Spinner
class, which caused the callbacks for pressing an arrow key to be
registered for a second time. Simply not doing that in the overwritten
onRender() method fixes the problem.

The redundant declarations for spinUpEl and spinDownEl were removed as
well. Additionally, the 'mousewheel' event handler, registered in the
overwritten (but still executed) parent function, is unregistered now,
as it could lead to unintended side effects in browsers which still
implement this event.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
2022-07-29 09:20:44 +02:00
Hannes Laimer
59551419b5 ui: DiskLisk: handle partition data from PBS backend
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2022-06-15 10:58:39 +02:00
Hannes Laimer
b7e91380ca ui: disks: add 'mounted' column
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2022-06-15 10:27:18 +02:00
Thomas Lamprecht
3e83971bca bump version to 3.5.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-16 18:04:07 +02:00
Thomas Lamprecht
3271d12f24 file browser: disable item # size rendering
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-16 18:03:07 +02:00
Thomas Lamprecht
267c536516 edit window: comment text width/rewording
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-16 16:13:12 +02:00
Thomas Lamprecht
5dc3b0fa00 window: task viewer: code refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-16 16:13:12 +02:00
Thomas Lamprecht
53dc88d409 pxarFileTypes: fix over-eager s/text/label/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-16 14:56:03 +02:00
Thomas Lamprecht
141d2ec303 bump version to 3.5.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-15 11:59:14 +02:00