]> git.proxmox.com Git - proxmox-widget-toolkit.git/log
proxmox-widget-toolkit.git
3 weeks agorealm edit: don't send 'delete' parameter when creating new entry
Dominik Csapak [Thu, 25 Apr 2024 09:32:34 +0000 (11:32 +0200)]
realm edit: don't send 'delete' parameter when creating new entry

since tha api does not expect a 'delete' parameter here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 weeks agorealm edit: don't send type as extra parameter when 'useTypeInUrl' is set
Dominik Csapak [Thu, 25 Apr 2024 09:32:33 +0000 (11:32 +0200)]
realm edit: don't send type as extra parameter when 'useTypeInUrl' is set

in that case, the type is already part of the url and we must not send
it additionally as an parameter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 weeks agobump version to 4.2.2
Thomas Lamprecht [Wed, 24 Apr 2024 19:44:17 +0000 (21:44 +0200)]
bump version to 4.2.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agoform: include vlan field widget from PVE
Stefan Lendl [Thu, 4 Apr 2024 10:00:28 +0000 (12:00 +0200)]
form: include vlan field widget from PVE

Copied from PVE to use in PBS network configuration.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
3 weeks agobump version to 4.2.1
Thomas Lamprecht [Tue, 23 Apr 2024 17:25:09 +0000 (19:25 +0200)]
bump version to 4.2.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agosendmail: smtp: allow one to override the default mail author
Lukas Wagner [Tue, 23 Apr 2024 11:51:52 +0000 (13:51 +0200)]
sendmail: smtp: allow one to override the default mail author

In PBS, we obviously don't have "Proxmox VE" as a default sender, so
we need a mechanism to change the default author.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agofix #5251: tfa: set autocomplete on tfa input form
Maximiliano Sandoval [Mon, 19 Feb 2024 10:37:04 +0000 (11:37 +0100)]
fix #5251: tfa: set autocomplete on tfa input form

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
3 weeks agobump version to 4.2.0
Thomas Lamprecht [Sun, 21 Apr 2024 10:31:34 +0000 (12:31 +0200)]
bump version to 4.2.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agonetwork edit: allow bridges to have any valid interface name
Stefan Hanreich [Fri, 12 Apr 2024 08:07:37 +0000 (10:07 +0200)]
network edit: allow bridges to have any valid interface name

Allow the web UI to accept bridge interfaces with any valid interface
name, rather than being limited to the arbitrary "vmbr" prefix.

Limiting to at most 10 characters, since SDN possibly adds a .XXXX
prefix for Vlans. Since the hard limit for network interface names is
15 characters, limiting it to 10 characters here enables SDN to append
the VLAN prefix in any case.

Originally-by: Jillian Morgan <jillian.morgan@primordial.ca>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
 [ TL: avoid far away intermediate variable ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agogitignore: add more build artefacts to ignore list
Thomas Lamprecht [Sun, 21 Apr 2024 07:55:45 +0000 (09:55 +0200)]
gitignore: add more build artefacts to ignore list

ignore the assembled widget toolkit, the CSS generated from SCSS and
some more packaging related files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agoedit window: fixup syntax mis-hap
Thomas Lamprecht [Sat, 20 Apr 2024 18:43:19 +0000 (20:43 +0200)]
edit window: fixup syntax mis-hap

argh, it's was a bit to late for the previous clean-up and I forgot to
drop a closing parenthesis after reworking the if expression (and did
test again...).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 weeks agowindow: edit: simplify setting submit button
Thomas Lamprecht [Sat, 20 Apr 2024 18:41:09 +0000 (20:41 +0200)]
window: edit: simplify setting submit button

Since the reset-form functionality got moved into the header tools in
commit 046ec35 ("fix #5277: move reset button into window header
toolbar") we can unconditionally set the initial buttons, as those
will always just contain the submit one now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agonotes view: make opening the editor on double-click opt-in
Thomas Lamprecht [Sat, 20 Apr 2024 15:22:05 +0000 (17:22 +0200)]
notes view: make opening the editor on double-click opt-in

One can get some smart-selection behavior when double clicking text in
browsers, e.g., whole-word selection, and the notes view is generally
for having some text that is often copied, like hostnames or IP
addresses.

Opening the notes editor on double click is interfering with that
select+copy workflow, so instead of hard-coding that make it opt-in,
controlled by a setting from the browser-local storage.

Add some handling to cope with live-changes to that setting, as having
to re-open a panel to make it take effect is annoying and might make
people believe that this is buggy.

This new setting has (currently) to be handled by the per-product UI.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agonotes view: use pencil-square-o icon for opening the editor
Thomas Lamprecht [Sat, 20 Apr 2024 15:19:12 +0000 (17:19 +0200)]
notes view: use pencil-square-o icon for opening the editor

The gears one from the native tool with the same name is not really
telling and is normally rather used for options, not editing a
specific (notes) field.

So go for the edit pencil that indicates editing some field and use
that for both the edit button in the top bar and the tool one in the
title header bar.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agonotes view: place collapse tool on the right
Thomas Lamprecht [Sat, 20 Apr 2024 15:18:11 +0000 (17:18 +0200)]
notes view: place collapse tool on the right

so it's always at the end for both the collapsed and expanded state

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agofix #5277: move reset button into window header toolbar
Thomas Lamprecht [Sat, 20 Apr 2024 13:17:07 +0000 (15:17 +0200)]
fix #5277: move reset button into window header toolbar

The 'Reset' button, which can be used to reset the form to its
original values when editing an existing resource or property, was
located at the right to the submit button since its initial addition
(before the git epoch started at Proxmox).

As it had the exact same form and color as the 'OK' submit button, it
is easy to press by accident, which then resets the pending changes
one wanted to submit – while not catastrophic it's just needlessly bad
UX.

As this UX-mishap is something one gets used too relatively fast,
especially as developer due to frequently opening such dialogues to
test changes, its something that mostly newer users will run into.
Luckily one took the effort to actually open an enhancement request,
providing ample resources to underline their point.

While there where quite a few proposals to improve this, most of them
had some (smaller) disadvantage (e.g., potentially jumping location,
confusion with other buttons like the help one).

Moving the reset functionality as as icon-only + tooltip button into
the window header title bar was the proposal that had no real
disadvantage and solved the underlying UX issue by cleanly separating
submit from reset. Having reset near the close-window tool has no
negative implications, as both have a similar effect, the discard the
current pending changes that the user did not yet submit, so if one
mistakenly hits close instead of reset, or vice-versa, nothing is
lost.
A nice side-benefit of that option is that the change is really small
code wise.

Closes: #5277
Reported-by: Tristan Harward <trisweb@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agocss: correctly mask disabled elements inside headers
Thomas Lamprecht [Sat, 20 Apr 2024 12:51:45 +0000 (14:51 +0200)]
css: correctly mask disabled elements inside headers

The mask ExtJS uses to add a disabled look is using the general
default background color of panels as base color, i.e. white for light
mode and almost black for the dark mode.

But as the top header of windows uses a darker variant, having a mask
applied on some icons that is rendered directly in the header, without
any (button) element that provides its own background color, will make
that element show off.

This mostly happens for Tools, which we do not have many besides the
"Close" on, which is almost never disabled.

This was noticed when trying out to move the reset button inside the
window header tool bar, when that was disabled (e.g., form was not
dirty) it stuck out quite a bit in an odd way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agowindow: whitespace indentation fix
Thomas Lamprecht [Sat, 20 Apr 2024 12:50:48 +0000 (14:50 +0200)]
window: whitespace indentation fix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agobuildsys: also clean proxmox-dark folder in src clean target
Thomas Lamprecht [Sat, 20 Apr 2024 10:11:23 +0000 (12:11 +0200)]
buildsys: also clean proxmox-dark folder in src clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agosafe destroy window: rework top-level comment
Thomas Lamprecht [Sat, 20 Apr 2024 09:20:33 +0000 (11:20 +0200)]
safe destroy window: rework top-level comment

avoid odd wrap, this isn't a poem, and add some more context.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoeol notice: escalate to warning only shortly before EOL
Thomas Lamprecht [Tue, 16 Apr 2024 10:47:14 +0000 (12:47 +0200)]
eol notice: escalate to warning only shortly before EOL

The EOL message is positioned quite noticeable already in all our
products, being always visible. So use a notice-style for the icon
and its color until three weeks before EOL, when we switch to a
critical warning.

As it can be OK to run a, e.g., PVE 7 setup shortly before its EOL,
if, for example, one plans to replace it completely and decommission
the old one (so upgrade before EOL would be just extra work).

Using three weeks for the cut-off has no in-depth, heavily thought
out Good Reason™, but was rather chosen as it's likely to be noticed
before the actual EOL in somewhat actively maintained setups (e.g.,
admin checking in every week or two) and can give admins further
means to escalate things with higher ups. Also weeks are always 7
days, while months aren't uniform, so the former is easier to
communicate.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoeol notice: surpress highlighting if link was visited
Thomas Lamprecht [Tue, 16 Apr 2024 10:43:14 +0000 (12:43 +0200)]
eol notice: surpress highlighting if link was visited

add a class to the whole outer div to manage the CSS rules for the
EOL widget and use this to keep the original color for links even if
they got visited already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agonotify: shorten text to "reset" for built-in targets
Thomas Lamprecht [Wed, 10 Apr 2024 10:18:56 +0000 (12:18 +0200)]
notify: shorten text to "reset" for built-in targets

While the difference between Reset and Remove is a bit more subtle
this also leads to less jumping around of UI elements on the right to
it (we normally avoid such size-changes that cause layout changes
completely).

Also, the confirmation message is quite telling, so this is not too
bad.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agonotify: change 'Remove' button to 'Reset to default' for built-ins
Lukas Wagner [Thu, 14 Dec 2023 09:48:44 +0000 (10:48 +0100)]
notify: change 'Remove' button to 'Reset to default' for built-ins

A HTTP DELETE for a built-in target/matcher acts as a reset to its
defaults. This patch changes the 'Remove' button text based on the
selected target/matcher. If it is a built-in, the button text is
changed to 'Reset to default'. Also, if the built-in is not actually
modified, the button is disabled.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 weeks agoremove button: allow to set custom confirmation message
Lukas Wagner [Thu, 14 Dec 2023 09:48:43 +0000 (10:48 +0100)]
remove button: allow to set custom confirmation message

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 weeks agoi18n: mark strings as translatable
Maximiliano Sandoval [Thu, 7 Dec 2023 08:18:15 +0000 (09:18 +0100)]
i18n: mark strings as translatable

Note that N/A is already translatable in other places.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
5 weeks agowindow: edit: avoid sharing custom config objects between subclasses
Friedrich Weber [Tue, 9 Apr 2024 08:16:11 +0000 (10:16 +0200)]
window: edit: avoid sharing custom config objects between subclasses

Currently, `Proxmox.window.Edit` initializes `extraRequestParams` and
`submitOptions` to two objects that, if not overwritten, are shared
between all instances of subclasses. This bears the danger of
modifying the shared object in a subclass instead of overwriting it,
which affects all edit windows of the current session and can cause
hard-to-catch GUI bugs.

One such bug is the following: Currently, the `PVE.pool.AddStorage`
component inadvertently adds `poolid` to an `extraRequestParams`
object that is shared between all instances of `Proxmox.window.Edit`.
As a result, after adding a storage to a pool, opening any edit window
will send a GET request with a superfluous `poolid` parameter and
cause an error in the GUI:

> Parameter verification failed. (400)
> poolid: property is not defined in schema and the schema does not
> allow additional properties

This breaks all edit windows of the current session. A workaround is
to reload the current browser session.

To avoid this class of bugs in the future, implement a constructor
that makes copies of `extraRequestParams` and `submitOptions`. This
ensures that any subclass instance modifies only its own copies, and
modifications do not leak to other subclass instances.

Suggested-by: Stefan Sterz <s.sterz@proxmox.com>
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Tested-by: Stefan Sterz <s.sterz@proxmox>
5 weeks agodark-mode: set intentionally black icons to `$icon-color`
Stefan Sterz [Mon, 16 Oct 2023 16:28:49 +0000 (18:28 +0200)]
dark-mode: set intentionally black icons to `$icon-color`

some icons intentionally use black as their color in the light theme.
this includes the little pencil and check mark icon in the acme
overview. change their color to the regular dark-mode icon-color. for
this to work the filter inversion needed for some other icons needs to
be removed too.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
6 weeks agoupdate IFrame class to ExtJS 7.0 implantation
Thomas Lamprecht [Mon, 1 Apr 2024 13:46:10 +0000 (15:46 +0200)]
update IFrame class to ExtJS 7.0 implantation

To get rid of some outdated event handlers like `beforeunload` which
Chromium based browsers are deprecating this year [0].

For those wondering about why we do not use ExtJS implementation
directly here it might be worth adding that the `Ext.ux` name space is
build to a separate file that has a (minified!) size of almost 160
KiB, and we only use a handful of those, so copying is a lot cheaper.

[0]: https://developer.chrome.com/docs/web-platform/deprecating-unload

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agowindow: ldap: add tooltips for firstname, lastname and email attributes
Christoph Heiss [Fri, 12 Jan 2024 16:16:08 +0000 (17:16 +0100)]
window: ldap: add tooltips for firstname, lastname and email attributes

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
7 weeks agowindow: add Active Directory auth panel
Christoph Heiss [Fri, 12 Jan 2024 16:16:07 +0000 (17:16 +0100)]
window: add Active Directory auth panel

As AD realms are mostly just LDAP, reuse the LDAP panel and just
show/hide some elements based on the type.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 weeks agobump version to 4.1.5
Thomas Lamprecht [Thu, 21 Mar 2024 16:40:57 +0000 (17:40 +0100)]
bump version to 4.1.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agowindow: password edit: clarify labels
Thomas Lamprecht [Thu, 21 Mar 2024 16:33:24 +0000 (17:33 +0100)]
window: password edit: clarify labels

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agowindow: password edit: add opt-in confirmation-password field
Wolfgang Bumiller [Fri, 15 Mar 2024 11:55:09 +0000 (12:55 +0100)]
window: password edit: add opt-in confirmation-password field

For when the product UI using this component wants to show an extra
confirmation field where the user that executes the password change,
have to confirm their own password.

Reported-by: Wouter Arts <security@wth-security.nl>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: use already included CBind mixin instead of constructor ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agoutils: api request: defer masking after layout
Dominik Csapak [Tue, 19 Mar 2024 08:51:38 +0000 (09:51 +0100)]
utils: api request: defer masking after layout

Since recently (not sure when exactly), the 'load()' method of the
edit window did not correctly mask the window anymore

The reason seems to be that the API2Request tries to mask the
component before it's rendered, and that did never work correctly.

Instead of simply calling `setLoading`, test if the component is
rendered, and if not, mask it after it has finished it's layout.

Since we cannot guarantee that there is only one API2Request with the
waitMsgTarget set to it, nor that the 'afterlayout' and api call
responses come in a specific order, we count the loads, and only
ever unmask the component when the counter reaches zero again.

Since we're strictly in non-async code here and JavaScript is
single-threaded, this should not result in a data race.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agocertificates: removal prompt: don't display name if there is no name
Maximiliano Sandoval [Thu, 18 Jan 2024 14:14:10 +0000 (15:14 +0100)]
certificates: removal prompt: don't display name if there is no name

The default certificate does not have a name, which caused this to
display an undefined text in the prompt.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
 [ TL: drop useless instance of calling format, keep arrow-fn ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agogitignore: sort gitignore
Stefan Lendl [Fri, 12 Jan 2024 10:14:54 +0000 (11:14 +0100)]
gitignore: sort gitignore

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2 months agogitignore: build outputs
Stefan Lendl [Fri, 12 Jan 2024 10:14:52 +0000 (11:14 +0100)]
gitignore: build outputs

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2 months agoedit window: add optional custom submit options
Dominik Csapak [Wed, 6 Mar 2024 14:04:24 +0000 (15:04 +0100)]
edit window: add optional custom submit options

sometimes it's necessary or handy to add custom options to the submit
api call (e.g. timeout). So just expose a `submitOptions` where users
of the edit window can put their custom options.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agodns: update comment to avoid coupling to downstream dependency
Thomas Lamprecht [Fri, 1 Mar 2024 11:38:47 +0000 (12:38 +0100)]
dns: update comment to avoid coupling to downstream dependency

Not much of use, better comment why this exist, other products could
change or new ones get added with new semantic used there too, so the
previous comment would be guaranteed to become outdated rather sooner
than later.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agodns: optionally send delete for optional values
Dominik Csapak [Fri, 1 Mar 2024 09:03:40 +0000 (10:03 +0100)]
dns: optionally send delete for optional values

pbs only deletes the optional values here when they are sent with the
'delete' parameter, in contrast to pve/pmg that don't have a delete
parameter currently and always use the parameters as source of truth.

So to handle that, optionally set deleteEmpty if set from outside

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agobump version to 4.1.4
Thomas Lamprecht [Wed, 28 Feb 2024 10:46:43 +0000 (11:46 +0100)]
bump version to 4.1.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoutils: add extendable, translatable notification event descriptions
Lukas Wagner [Wed, 28 Feb 2024 10:00:59 +0000 (11:00 +0100)]
utils: add extendable, translatable notification event descriptions

Add a similar mechanism like we have for adding and overriding task
description per product UI.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoform: combo grid: clarify that showClearTrigger cannot actively hide them
Thomas Lamprecht [Wed, 28 Feb 2024 10:34:42 +0000 (11:34 +0100)]
form: combo grid: clarify that showClearTrigger cannot actively hide them

As getting a good setting name is a bit hard here, the current one
might me interpreted such that setting it to false will always hide
the trigger, but that's not the case, this is mostly a "force show
trigger even if allowBlank is set to false", and that's a bit of a
long name ;-)
So just add a comment and reevaluate if this really causes confusion.

While at it simplify the boolean expression to make it shorter and
easier to read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agocombogrid: add 'showClearTrigger' config
Lukas Wagner [Wed, 28 Feb 2024 10:00:58 +0000 (11:00 +0100)]
combogrid: add 'showClearTrigger' config

This allows one configure the clear trigger to be shown, even if
'allowBlank' is set false. This can be useful if one has a
non-editable combogrid where the value is set to something not
present in the store. Example: Match rule editing, one selects
a backup job to be match. If the backup job is removed and the match
rule edit window is opened again, then the old, deleted value cannot
be removed from the combogrid if there is no clear trigger.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agodatetimefield: fix changing date to end of month from short months
Dominik Csapak [Tue, 27 Feb 2024 13:23:24 +0000 (14:23 +0100)]
datetimefield: fix changing date to end of month from short months

When selecting a new date, we get a date object from the currently
selected date before the change. If that month has less days than what
was selected for the new month, `setDate` will wrap that to the
following month since the old month is still selected there.

For example:

select any date in april (has 30 days)
then select the 31th of january

this will actually select the 1st of january since we first get

setDate: 20xx-04-XX -> 20xx-04-31 (wrap) -> 20xx-05-01
setMonth: 20xx-05-01 -> 20xx-01-01

To fix this, use the additional parameters of setFullYear[0] to set
all of them simultaneously

0: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agod/changelog: drop duplicate 'for'
Thomas Lamprecht [Thu, 18 Jan 2024 11:59:54 +0000 (12:59 +0100)]
d/changelog: drop duplicate 'for'

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoi18n: use correct ISO 639-1 code for Korean with backward compat
Thomas Lamprecht [Mon, 15 Jan 2024 17:15:06 +0000 (18:15 +0100)]
i18n: use correct ISO 639-1 code for Korean with backward compat

recently the proxmox-i18n repo got a fix where we moved the files for
Korean to the correct language code, i.e., from previously wrong used
kr (Kanuri) to the correct ko (Korean).

This loads the correct ExtJS locale and is less confusing for our
Korean speakers, but we still want a clean transition for those that
have still the 'kr' value set in their language cookie.
Note that this transition only happens when the user opens the
language selector, as otherwise we do not have the product-specific
cookie name available, so a better transition would need to happen in
the per-product UIs.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofix #5074: notify: sendmail: smtp: fix mailto/mailto-user parameter deletion
Fiona Ebner [Thu, 4 Jan 2024 12:29:34 +0000 (13:29 +0100)]
fix #5074: notify: sendmail: smtp: fix mailto/mailto-user parameter deletion

by doing a cbind of isCreate to the top-level widget so that cbind in
the nested widgets for deleteEmpty works.

In the GUI, when a sendmail/smtp target is edited and either
'Additional Recipients' or 'Recipients' is completely removed (only
possible if the other field contains a value), parameter deletion did
not work properly. After applying the changes, the old value would
still be in place.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agobump version to 4.1.3
Thomas Lamprecht [Thu, 23 Nov 2023 10:16:28 +0000 (11:16 +0100)]
bump version to 4.1.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agonotification ui: display yellow warning triangle instead of red icon
Lukas Wagner [Thu, 23 Nov 2023 08:57:56 +0000 (09:57 +0100)]
notification ui: display yellow warning triangle instead of red icon

Instead of coloring the entire icon red, show a yellow warning
triangle containing an exclamation mark in case of validation errors.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agonotification ui: change icon for for match-field tree nodes
Lukas Wagner [Thu, 23 Nov 2023 08:57:55 +0000 (09:57 +0100)]
notification ui: change icon for for match-field tree nodes

The old icon was slightly ambiguous since we also use it for LXC
containers.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agoschema: do not translate SMTP
Thomas Lamprecht [Thu, 23 Nov 2023 08:09:59 +0000 (09:09 +0100)]
schema: do not translate SMTP

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 4.1.2
Thomas Lamprecht [Tue, 21 Nov 2023 20:36:07 +0000 (21:36 +0100)]
bump version to 4.1.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agonotification ui: add 'unknown' to match-severity dropdown
Lukas Wagner [Tue, 21 Nov 2023 16:01:45 +0000 (17:01 +0100)]
notification ui: add 'unknown' to match-severity dropdown

This is the severity used for forwarded mails, since we cannot
reasonably infer a priority here.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agonotification ui: add appropriate onlineHelp anchors
Lukas Wagner [Tue, 21 Nov 2023 14:47:58 +0000 (15:47 +0100)]
notification ui: add appropriate onlineHelp anchors

This links the dialog windows to the correct help section (different
target types, matchers).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agonotification matcher: fix inverted match modes
Fiona Ebner [Mon, 20 Nov 2023 14:53:56 +0000 (15:53 +0100)]
notification matcher: fix inverted match modes

The 'not' prefix is already stripped in the set() method of the view
model's 'rootMode' and not present anymore when updating the store.
The information about whether the mode is inverted or not is present
in the 'invert' data member.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
6 months agobump version to 4.1.1
Thomas Lamprecht [Fri, 17 Nov 2023 15:56:10 +0000 (16:56 +0100)]
bump version to 4.1.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agonotification matcher: improve wording for mode
Dominik Csapak [Thu, 16 Nov 2023 11:57:53 +0000 (12:57 +0100)]
notification matcher: improve wording for mode

by removing the 'invert' checkbox and instead show the 4 modes possible,
we still assemble/parse the invert for the backend

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agonotification matcher: improve handling empty and invalid values
Dominik Csapak [Thu, 16 Nov 2023 11:57:52 +0000 (12:57 +0100)]
notification matcher: improve handling empty and invalid values

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agonotification ui: add column for 'origin'
Lukas Wagner [Tue, 14 Nov 2023 12:59:53 +0000 (13:59 +0100)]
notification ui: add column for 'origin'

This column shows whether a matcher/target was provided as a built-in
default config or if it was created by the user. For built-ins, it
also shows whether the built-in settings have been changed.

To reset a built-in entry to its defaults, one can simply delete it.
For best UX, the 'delete' button should change its text to 'reset
defaults' when a built-in target/matcher is selected. This will be
added in another patch.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: add enable checkbox for targets/matchers
Lukas Wagner [Tue, 14 Nov 2023 12:59:52 +0000 (13:59 +0100)]
notification ui: add enable checkbox for targets/matchers

Add a 'enable' checkbox for targets and matchers in their edit
windows. Also show a new 'enable' column in the overview panel.
The parameter in the config is actually called 'disable', so
the UI needs to invert the setting in the appropriate
on{Get,Set}Values hooks.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agopanel: notification: add gui for SMTP endpoints
Lukas Wagner [Tue, 14 Nov 2023 12:59:51 +0000 (13:59 +0100)]
panel: notification: add gui for SMTP endpoints

This new endpoint configuration panel is embedded in the existing
EndpointEditBase dialog window. This commit also factors out some of
the non-trivial common form elements that are shared between the new
panel and the already existing SendmailEditPanel into a separate panel
EmailRecipientPanel.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonoficiation: matcher edit: make 'field' an editable combobox
Lukas Wagner [Tue, 14 Nov 2023 12:59:50 +0000 (13:59 +0100)]
noficiation: matcher edit: make 'field' an editable combobox

For now with fixed options that are shared between most notification
events - later, once we have a notification registry, this should be
filled dynamically.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: unprotected mailto-root target
Lukas Wagner [Tue, 14 Nov 2023 12:59:49 +0000 (13:59 +0100)]
notification ui: unprotected mailto-root target

A default notification config will now be created in pve-manager's
postinst hook - which is not magic in any way and can be modified
and deleted as desired.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification: matcher: add UI for matcher editing
Lukas Wagner [Tue, 14 Nov 2023 12:59:48 +0000 (13:59 +0100)]
notification: matcher: add UI for matcher editing

This modifies the old filter edit window in the following ways:
  - Split content into multiple panels
    - Name and comment in the first tab
    - Match rules in a tree-structure in the second tab
    - Targets to notify in the third tab

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: rename filter to matcher
Lukas Wagner [Tue, 14 Nov 2023 12:59:47 +0000 (13:59 +0100)]
notification ui: rename filter to matcher

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: remove notification groups
Lukas Wagner [Tue, 14 Nov 2023 12:59:46 +0000 (13:59 +0100)]
notification ui: remove notification groups

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: remove filter setting for targets
Lukas Wagner [Tue, 14 Nov 2023 12:59:45 +0000 (13:59 +0100)]
notification ui: remove filter setting for targets

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonotification ui: add target selector for matcher
Lukas Wagner [Tue, 14 Nov 2023 12:59:44 +0000 (13:59 +0100)]
notification ui: add target selector for matcher

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agoform: displaye-edit: add one of the two missing returns
Thomas Lamprecht [Fri, 17 Nov 2023 14:00:30 +0000 (15:00 +0100)]
form: displaye-edit: add one of the two missing returns

the other one _should_ not be problematic, as field-container itself
isn't picked up as a "real" field itself, but we might bind to that
somewhere, where enabling could break this.

The editable one seems to not be used yet, according to Dominik, so
fix that now already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoapi-viewer: implement basic oneOf support
Dominik Csapak [Thu, 16 Nov 2023 15:21:52 +0000 (16:21 +0100)]
api-viewer: implement basic oneOf support

for parameters only for now, also only implement the basic use case we
want to have currently: use in section config apis where we have more
than one type.

we could improve upon that, e.g. by properly grouping the type relevant
options, and also implementing that for return types.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agobump version to 4.1.0
Thomas Lamprecht [Tue, 14 Nov 2023 08:11:27 +0000 (09:11 +0100)]
bump version to 4.1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agocombogrid: initialze value with [] by default
Dominik Csapak [Wed, 19 Jul 2023 12:11:09 +0000 (14:11 +0200)]
combogrid: initialze value with [] by default

we have to initialize the value of a combogrid to something (else extjs
does not initialize everything in the object *sometimes* for yet unknown
reasons), but the empty string is wrong.

we already have at least two places where we set the default value to []
(namely NodeSelector and ha GroupSelector) with the comment:

 // set default value to empty array, else it inits it with
 // null and after the store load it is an empty array,
 // triggering dirtychange

so it makes sense to always set it to that by default. This only ever is
relevant when the combogrid has `allowBlank: true`, since if it does not
it's either invalid (and thus "dirty") or it has a selected value anyway

this should make the manual setting of

 value: [],

unnecessary in the child classes. We can even remove it direcly in the
NetworkSelector.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoapt: drop ChangeLogUrl
Fabian Grünbichler [Tue, 4 Jul 2023 09:45:06 +0000 (11:45 +0200)]
apt: drop ChangeLogUrl

it's not returned anymore by the corresponding backends, since fetching
changelogs is now fully delegated to `apt`.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 months agowindow/FileBrowser: enable tar button by default
Dominik Csapak [Thu, 19 Oct 2023 09:13:55 +0000 (11:13 +0200)]
window/FileBrowser: enable tar button by default

all endpoints now can handle the 'tar' parameter, so add it for all

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoDiskList: render osdid-list if present
Aaron Lauterer [Tue, 22 Aug 2023 09:04:56 +0000 (11:04 +0200)]
DiskList: render osdid-list if present

Render all OSD IDs in 'osdid-list' if the parameter is present.

It is possible to have multiple OSD daemons on a disk. We want to list
them all in the UI.
Fall back to the 'osdid' parameter if 'osdid-list' is not available.

We check rec.data['osdid-list'] against its general truthiness as it
might not be present at all or null.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
6 months agofix #4442: Extend LogView for firewall datetime filtering
Christian Ebner [Wed, 9 Aug 2023 10:55:27 +0000 (12:55 +0200)]
fix #4442: Extend LogView for firewall datetime filtering

Extends the current panels date filtering capability to date-time
based filtering, and adds a config option to switch between livemode
and filter mode, analogous to the JournalView panel.

The `submitFormat` config is introduced to adapt the formatting of
params values for their corresponding api calls.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
6 months agofix #4442: adapt DateTimeField to be more declarative
Christian Ebner [Wed, 9 Aug 2023 10:55:26 +0000 (12:55 +0200)]
fix #4442: adapt DateTimeField to be more declarative

Reworks the current implementation of the DateTimeField to be more
declarative by using a ViewModel and data bindings as well as formulas,
in order to reduce code and unwanted complexity.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
6 months agopanel: sendmail edit: don't translate 'Proxmox VE' in author field
Lukas Wagner [Mon, 9 Oct 2023 14:15:16 +0000 (16:15 +0200)]
panel: sendmail edit: don't translate 'Proxmox VE' in author field

The default value is determined by the backend and is never
translated (which does not make sense any way for a product name).
This was likely just a copy/paste mistake from other from fields.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agoschema: endpoint types: don't translate endpoint type names
Lukas Wagner [Mon, 9 Oct 2023 14:38:29 +0000 (16:38 +0200)]
schema: endpoint types: don't translate endpoint type names

... that are not really translatable.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agoutils: fix trailing comma
Thomas Lamprecht [Tue, 31 Oct 2023 20:47:12 +0000 (21:47 +0100)]
utils: fix trailing comma

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotext field: add trimValue config
Thomas Lamprecht [Tue, 24 Oct 2023 11:58:04 +0000 (13:58 +0200)]
text field: add trimValue config

Inspired by a recent bug detected in the subscription key field, where
a trailing white space caused verification issues.

We might even enable the trimming by default, after checking call
sites that is – most often one wants to trim the text to be submitted

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoutils: code style cleanup/reduction
Thomas Lamprecht [Tue, 24 Oct 2023 11:57:39 +0000 (13:57 +0200)]
utils: code style cleanup/reduction

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agobump version to 4.0.9
Thomas Lamprecht [Tue, 3 Oct 2023 08:40:11 +0000 (10:40 +0200)]
bump version to 4.0.9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoparser: split checking IMG and A tags, make the latter more strict
Thomas Lamprecht [Tue, 3 Oct 2023 07:43:47 +0000 (09:43 +0200)]
parser: split checking IMG and A tags, make the latter more strict

Split the logic so that each tag is handled explicitly on it's own
if-else branch, which is now safer to do as we default to
allow-only-http-like.

Also address a recently introduced regression from the implementation
of the #4756 where any user that could edit notes could use
javascript: script-urls for XSS purpose to prepare a link that could
leak private user information when another user clicked on it, at
least if they omitted basic sanity checks by looking at the URL
displayed by the browser before.

We have to override a false-positive triggered by a eslint heuristic,
a simple string compression should be always safe.

Fixes: 5cbbb9c ("fix #4756: markdown notes: allow any valid URL for a tags")
Reported-by: Hieu Dang Cong <HieuDC5@fpt.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoparser: make it clearer that we mark HTTP-like URLs always as safe
Thomas Lamprecht [Tue, 3 Oct 2023 06:44:02 +0000 (08:44 +0200)]
parser: make it clearer that we mark HTTP-like URLs always as safe

we should make this controllable by the user for images, while modern
browser are quite safe w.r.t. not transmitting to much info on cross
origin requests, it still might be nicer if they have some control
over this.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoparser: use safer mechanism for allowing URLs
Thomas Lamprecht [Tue, 3 Oct 2023 06:37:34 +0000 (08:37 +0200)]
parser: use safer mechanism for allowing URLs

Having a default-remove boolean flag is making it easier to get this
right and decouple the if-branches that check if something is OK
(which may get more complex in the future) from the actual handling of
the result by always removing the href attribute if not explicitly
told otherwise.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoparser: factor out getting lower-case canonical tag name
Thomas Lamprecht [Tue, 3 Oct 2023 06:27:22 +0000 (08:27 +0200)]
parser: factor out getting lower-case canonical tag name

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agonotification config view: add missing parameter for Ext.String.format
Lukas Wagner [Mon, 18 Sep 2023 09:49:43 +0000 (11:49 +0200)]
notification config view: add missing parameter for Ext.String.format

Fixes: 7e4b51 ("notification config view: fix using gettext with parameter")
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agosendmail edit panel: fix using gettext with parameter
Thomas Lamprecht [Thu, 14 Sep 2023 06:14:25 +0000 (08:14 +0200)]
sendmail edit panel: fix using gettext with parameter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agonotification config view: fix using gettext with parameter
Thomas Lamprecht [Wed, 13 Sep 2023 16:17:07 +0000 (18:17 +0200)]
notification config view: fix using gettext with parameter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agonotification config view: fix using gettext with parameter
Thomas Lamprecht [Wed, 13 Sep 2023 16:15:09 +0000 (18:15 +0200)]
notification config view: fix using gettext with parameter

One must use a parameter {0} replacement string as otherwise this
cannot be translated at all.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 4.0.8
Thomas Lamprecht [Wed, 13 Sep 2023 15:16:06 +0000 (17:16 +0200)]
bump version to 4.0.8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoutils: language map: add entry for Croatian translation
Thomas Lamprecht [Wed, 13 Sep 2023 15:05:03 +0000 (17:05 +0200)]
utils: language map: add entry for Croatian translation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoauth: ldap: openid: use proxmoxtextfield for comment
Lukas Wagner [Tue, 18 Jul 2023 11:57:07 +0000 (13:57 +0200)]
auth: ldap: openid: use proxmoxtextfield for comment

The regular `textfield` does not support the `deleteEmpty`
setting. Thus, if no comment was entered the configuration
would still end up with an empty `comment` key:

ldap: foo
    server ....
    bind-dn ...
    comment

Fixed by switching over to `proxmoxtextfield`, which properly
deletes empty keys.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agofix #4951: accept undefined as value for the MultiDiskSelector
Dominik Csapak [Thu, 7 Sep 2023 12:18:05 +0000 (14:18 +0200)]
fix #4951: accept undefined as value for the MultiDiskSelector

otherwise it tries to string split it and throws an exception

This can happen when there was no initial value and the form is reset.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agofix #4531: acme plugins: correct change detection of dirty form fields
Filip Schauer [Wed, 30 Aug 2023 11:57:44 +0000 (13:57 +0200)]
fix #4531: acme plugins: correct change detection of dirty form fields

Fix the ACME plugin edit form only detecting dirtychanges once the
value of a textfield was dirtied and then changed back to the
original.

This behaviour is caused as we cannot reuse the field's
resetOriginalValue method, due to that cause breakage here, e.g., if
the value was edited, then another plugin (without a schema) gets
selected, and then one would switch back again to the previous plugin,
it would cause the (actually still dirty) value to get registered as
new original one by mistake.

So the fix here is to keep the manual originalValue tracking, but add
the missing call to checkDirty after setting the originalValue to
refresh the dirty flag.

Fixes: 45708891 ("ui: add ACMEPluginEdit window") from pve-manager
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
 [TL: record reason for originalValue handling & sligthly reword ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoutils: Remove outdated url in comment
Christian Ebner [Fri, 11 Aug 2023 10:43:54 +0000 (12:43 +0200)]
utils: Remove outdated url in comment

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
9 months agobump version to 4.0.7
Wolfgang Bumiller [Wed, 16 Aug 2023 08:43:13 +0000 (10:43 +0200)]
bump version to 4.0.7

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>