Stefan Sterz [Wed, 7 Sep 2022 09:37:40 +0000 (11:37 +0200)]
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:
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>
Thomas Lamprecht [Sun, 15 May 2022 08:37:43 +0000 (10:37 +0200)]
file browser: only disable button if not downloadable and add hint in tooltip
To avoid to much layout jumping if the whole button disappears
(changes height of footer bar too), rather explain to the user the
why and what they can do instead.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Sterz [Thu, 5 May 2022 13:52:48 +0000 (15:52 +0200)]
fix #4001: FileBrowser: add menu to button and selected entry label
this commit adds a label showing the currently selected entry in the
file browser and merges the "Download .tar.zst" and "Download .zip"
button into one menu button.
Thomas Lamprecht [Sat, 14 May 2022 12:07:06 +0000 (14:07 +0200)]
ui: acl role selector: make wider and wrap priv column
as UX was pretty poort, one could only see one and a half privileges
of the role, the rest overflowed and was hidden. While the column
could be resized, doing so would make the role name column shrink
automatically, and it really shouldn't be required in the first
place.
This is a very important selector and all privs of a role must be
visible when opening without any manual user interaction required.
So increase the width to 500px, make the priv colum take more
relative space and enable cellWrap to avoid hidden overflow.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
window/FileBrowser: try reload again when getting a 503 error
for the file restore, we return a 503 error when we were not finished
mounting a disk in the restore vm, so ignore that error and try again
(up to 10 times) so a file listing now has a "real" timeout of
up to 300 seconds (30s pveproxy timeout * 10) instead of only 30,
which should be enough for most situations.
we also increase the proxy timeout to 60 seconds, since if one has many
disks, all of them will try to load at the same time, but the browser
has a maximum request limit and will stall+queue the remaining ones. so
those will not run into the extjs timeout when we increase it here.
for older backends without the new 503 returning feature, the calls
will still run into a pveproxy timeout anyway.
we also have to reimplement the 'monStoreErrors' functionality to
get a slightly different behaviour:
we disable the default extj loadMask of the treepanel and set it
ourselves. then on 503 we leave it up, and only remove it on success
or error (for non initial loads)
Dominik Csapak [Thu, 10 Mar 2022 14:31:37 +0000 (15:31 +0100)]
StatusView: fix usage calculation for fields without valid values
Sometimes, total can be zero (e.g. for swap when it's not used), which
leads to the usage being NaN. This led to the progressbar not being
updated for InfoWidgets, leaving a spurious '0%' as text.
Stefan Sterz [Tue, 12 Apr 2022 10:34:21 +0000 (12:34 +0200)]
toolkit: refactor markdown based NotesView and NotesEdit
refactor them to make them more flexible and, thus, usable in pbs.
adds parameters for enabling the TBar, setting the help section in the
editing dialog and cleans up the code in some places
Stefan Sterz [Tue, 12 Apr 2022 10:34:20 +0000 (12:34 +0200)]
toolkit: add NotesView panel and NotesEdit window
move them here from pve so we can maintain them across several
products
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
[ T: also rename class/xtypes to avoid temporary breakage ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 13 Apr 2022 09:09:07 +0000 (11:09 +0200)]
css: fix tab icon/text baseline
the baseline for the text was seriously off, the text had
(relatively) much more space below than above, which looks off for
buttons with an actual background
Instead of centering with margin/padding explicitly, do so with the
flex layout model.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 12 Apr 2022 14:36:50 +0000 (16:36 +0200)]
object grid: call rendere with our scope
having window as this scope has zero benefits and while one could
already try to get the local scope via some Ext.ComponentQuery query
its just nicer to have it easily available.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 28 Mar 2022 13:53:45 +0000 (15:53 +0200)]
form: combo grid: fix selection after filtering
firing 'refresh' in 'clearLocalFilter' was wrong, since that triggers
too often, for example when selecting an entry (since the field lost
focus). This lead to the picker refreshing and not registering the
click and thus not selecting the desired entry.
Instead refresh the view when we really need it: when the picker is shown.
The filter is already gone, but the picker grid does not know this yet,
so we fire the event then.
Dominik Csapak [Tue, 29 Mar 2022 14:04:10 +0000 (16:04 +0200)]
node/Tasks: don't count 'preFilters' as normal filters
they can not be removed nor are they visible, so don't count them.
When having a prefilter, we now don't show anymore that there is an
active filter, and don't enable the button anymore.
This is the case for vms for example (vmid is a prefilter).
Dominik Csapak [Fri, 18 Mar 2022 10:00:11 +0000 (11:00 +0100)]
utils: clear cookies with secure flag set
otherwise firefox complains with a deprecation warning that the secure-flag
is not set but SameSite to 'None'. Since we cannot know how firefox will
behave once that behaviour is no longer supported, add the secure flag
now.
Note: ExtJS also clears by setting the cookie with an empty value,
there's no browser supported clear api.
Dominik Csapak [Thu, 3 Mar 2022 14:11:45 +0000 (15:11 +0100)]
fix #3919: log view: show first task output line correctly
if a task did not produce output yet, we always get a single line
with "no output". our heuristic in the gui counts the total lines +
the current position. so to update the first output correctly, we
have to update every time in case we only have one line.
Otherwise, we only update on the second line, which is bad
in case the only line we ever get is the result.
Dominik Csapak [Wed, 23 Feb 2022 11:05:06 +0000 (12:05 +0100)]
fix drag&drop for pointerType 'pen'
some devices (e.g. vms via novnc, and some laptops) get the pointerType
'pen' under chromium.
the DragZone handler tries to ignore touch input for that by
checking for "=== 'mouse'" which does not include 'pen'
so override that to handle it when the pointerType !== 'touch'
Fabian Ebner [Tue, 7 Dec 2021 11:53:30 +0000 (12:53 +0100)]
sorters: use correct property 'direction' and keep default 'ASC'
Ext.util.Sorter does not have an 'order' property, so 'order: DESC'
didn't have an effect. The default is 'ASC' and it is arguably the
preferred direction for realm anyways.
If there are mirrors and log/special vdevs it just feels too small.
It also doesn't help if there are errors in the upper part taking up
space. Make it 600, which was used in PVE before.
improve error handling when adding webauthn entries
There are cases where we directly throw a string error
(particularly, when navigator.credentials.create() fails,
for example when trying to register the same WA device to
the same user twice), which would end up with the WA window
simply not closing before.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Wed, 24 Nov 2021 17:23:35 +0000 (18:23 +0100)]
log viewer: add heuristic for scroll-direction dependent ratio distribution
if the user scrolls down make 2/3 of the buffer load the downward
(newer) buffer and only 1/3 the upward (older), and vice versa, if
the user scrolls up load 2/3 of the older messages vs. 1/3 of newer
ones.
If the user scrolls around frantically we're roughly as good as
previously and in all other cases we're better now.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Tue, 23 Nov 2021 12:02:29 +0000 (13:02 +0100)]
ui: logpanel: catch up to very fast task logs with api calls
by updating the start to 'total-limit' if we follow the task log live.
to do that, we decouple the 'scroll' event from updating the 'start'
parameter and call that directly after we scrolled down.
to not trigger the scroll event multiple times, suspend the scroll event
while doing that.
while we're touching those lines, remove the 'setTimeout' workaround
for touchscreens, since it seems to work fine since extjs 7.0
this also fixes the issue that the scroll event is not called sometimes
Dominik Csapak [Tue, 23 Nov 2021 09:49:35 +0000 (10:49 +0100)]
ui: journalview: fix wrong first load with timespan
calling updateParams here lead to making an api call with the default
timespan (last 3 days) on pbs/pmg when going to the 'administration'
panel, even though it would never be shown since on tab activate we would
show the 'live mode' which does not use the timespan
on pve this did not happen since the journalview is on its own page and
the change to livemode triggered too fast..
Thomas Lamprecht [Tue, 23 Nov 2021 08:34:41 +0000 (09:34 +0100)]
utils: format_duration_human: calculate years too
Add years and skip showing minute scale once we got over a year,
that's just not relevant anymore at that scale..
Months are just not an ideal thing to show, as they have different
lengths too (leap years have similar issue, but they differ 0.27%
from a normal year, while shortest to longest month is 10.7%
difference!)
Weeks could be done though, they're fixed at 7 days, but for now I
want to avoid unwieldy day numbers like 2634 d as that's just hard to
frame correctly. Also adding years now does not makes adding weeks in
the future impossible anyway..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Thu, 18 Nov 2021 09:50:10 +0000 (10:50 +0100)]
data: diffstore: fix autoDestroyRstore option
the change from extjs 6.0.1 to 7.0.0 removed 'onDestroy' but brought
us 'doDestroy' for stores
we did not notice since 'onDestroy' was a private method and thus
the changelog did not mention this (doDestroy is a public method meant
exactly for our use case)