Commit Graph

1135 Commits

Author SHA1 Message Date
Maximiliano Sandoval
41c844b511 fix #6088: notification: matcher: use more descriptive strings
Add separate text for inverted and non-inverted cases, this should
reduce some confusion about how inversion works and allow for better
translations.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
 [TL: expand commit message.]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-01-28 15:21:02 +01:00
Fabian Grünbichler
82260afcdd changelog: s/UNRELEASED/bookworm
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-01-20 15:09:06 +01:00
Fabian Grünbichler
80b01f27bc bump version to 4.3.4
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-01-20 11:40:02 +01:00
Friedrich Weber
88d62e5386 acme: plugin: add htmlEncodes
to avoid interpreting html tags in the values.

When setting a tooltip via the `data-qtip` attribute, the contents
needs to be double-encoded. Ext.js internally uses `innerHTML` to
apply the generated HTML, which undoes one layer of encoding in case
of `data-qtip`.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2025-01-20 11:37:06 +01:00
Friedrich Weber
f26346a597 apt: add missing htmlEncode to qtip
to avoid interpreting html tags in the values.

When setting a tooltip via the `data-qtip` attribute, the contents
needs to be double-encoded. Ext.js internally uses `innerHTML` to
apply the generated HTML, which undoes one layer of encoding in case
of `data-qtip`.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2025-01-20 11:37:06 +01:00
Dominik Csapak
9d5d6a7815 task viewer: htmlEncode the status
so we don't accidentally interpret html tags from the task status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-20 11:37:01 +01:00
Dominik Csapak
7bb124c036 button: htmlEncode the name/id for the confirm message
so we don't accidentally interpret html tags

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-20 11:37:01 +01:00
Dominik Csapak
867bf7e6f5 utils: htmlEncode status text
so we don't accidentally interpret html tags in the output

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-20 11:37:01 +01:00
Maximiliano Sandoval
d710ceeeb6 webhook edit: do not split translatable strings
Splitting translatable strings deprives translators for context which
might be needed for getting the correct tenses or genders. See [1] for
example.

[1] https://wiki.gnome.org/TranslationProject(2f)DevGuidelines(2f)Never(20)split(20)sentences.html

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-01-15 17:19:59 +01:00
Gabriel Goller
d6d173f05d textarea field: add emptyText message to show markdown is supported
Just like in our `Notes` fields show a emptyText message that explains
that markdown can be used.

Reported-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-27 15:31:57 +01:00
Thomas Lamprecht
a5fb3afcf9 bump version to 4.3.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-27 12:25:47 +01:00
Fiona Ebner
ac10db95ef display-edit field: add emptyText getter and setter to support data-bind
To access the underlying fields a reference to them is now explicitly
saved after component initialisation.

First user is intended to be the path field for datastores where the
emptyText should dynamically be for a relative or absolute path.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
 [ TL: switch over from saving the xtype to query in the getter or
   setter to directly savign a reference to the underlying fields. ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-27 12:17:10 +01:00
Thomas Lamprecht
c806b73ff7 bump version to 4.3.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-25 18:32:26 +01:00
Gabriel Goller
1d07d61a18 form: add support for multiline textarea
This adds support for a editable multiline textarea in the ObjectGrid.
Now we can add a textarea row, which will open a textarea popup, and
encode the multi-line text into an base64 string (with utf8 support).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
 [ TL: various style, naming fixes and add fieldOps to allow passing,
   e.g., an empty text]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-25 18:16:12 +01:00
Gabriel Goller
70382e111a window: add consent modal
Add consentModal that gets displayed before the login. Simply shows the
text in a scrollable box and contains a single button "OK".

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-25 16:32:25 +01:00
Thomas Lamprecht
e79a20a8cc node: service state: restore original behavior
This reverts commit 461298d80a and
commit 4ca542b811 to get back to the
original state, which is already good enough here, as systemd unit
states are simply not translatable well, and are never translated by
systemd, so doing that will make most users life actually harder.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 15:39:41 +01:00
Christian Ebner
461298d80a utils: never translate systemd unit states
Translating unit states might be counter productive in case of
debugging, opt for not translating them and drop usage of the
translation helper.

This was spotted by several devs on doing translations in languages
they know, so it really seems not right to add.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
 [ TL: add last sentence to add some weight to not doing that ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 15:29:38 +01:00
Thomas Lamprecht
2686922392 bump version to 4.3.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 12:40:09 +01:00
Thomas Lamprecht
3375d11ea4 auth view/edit: make default-view checkbox opt-in
To avoid suggesting that a project has a feature that is not
implemented in the backend.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 12:37:26 +01:00
Thomas Lamprecht
0988db8ffc network view: pass generic editOptions config to edit window
Avoid the need to loop through every product specific feature
enablement, rather allow one to pass a generic object including them.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-16 16:37:15 +01:00
Thomas Lamprecht
358b98bf4f network edit: rename bridge_set_vids to enableBridgeVlanIds
we use camelCase in the JavaScript code and besides casing the old
name wasn't really telling and suggested that it was there to set a
specific VID not to enable setting them.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-16 16:35:51 +01:00
Thomas Lamprecht
2aa5d7e7ba network edit: shorten bridge VLAN ID label and tooltip
This is certainly a bit subjective, but IMO not much information is
lost, and the "space-separated" in the tooltip was never true (at
least for the backend), so might be even confusing; the example should
be enough to direct users in the right direction, real docs in the
documentation would be way better anyway than all those subtle UI
hints.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-16 16:33:15 +01:00
Thomas Lamprecht
ffe41ad5e3 network edit: shorten and improve bridge vlan ID validator
This does a few things, but all affecting the same validator and there
would not be much value with separate commits, so just use one.

Namely:
- reduce code by a lot, mostly by having a explicit ordered if-else
  chain that avoids the need for some extra checks as further branches
  can assume that former did not evaluate to true, thus we cans safe
  the closure that checked invalidity for a range-atom.
  While this allows entering "useless" ranges like "2-2" it's not
  clear why that should be a disallowed range, it's perfectly clear
  about what it represents.
- use Number.isNaN to avoid oddities from global isNaN that MDN warns
  against [0]
- give explicit error messages for different failure cases like
  out-of-range or not-a-number
- place error messages under gettext, our translators frequently ask
  to avoid untranslatable literals.
- support the same lists as the backend does, i.e. allow multiple
  whitespace and comma and semicolon as separators.

[0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-16 16:30:30 +01:00
Aaron Lauterer
b1a3eb7195 fix #3892: network: add bridge vids field for bridge_vids
The new optional bridge_vids field allows to set that property via the
GUI. Since the backend needs to support it, the field needs to be
explicitly enabled.

For now, Proxmox VE (PVE) is the use case.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2024-11-15 18:57:28 +01:00
Shannon Sterz
9d2fc36f61 dark theme: make icons in the permissions tree in pve dark
these icons are multiply style because they seem to be handled
differently across products. so this in essence "double inverts" them
in the context where that is needed

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-11-15 16:49:17 +01:00
Thomas Lamprecht
afb219dce0 add Bulgarian as available language
Got recently contributed to proxmox-i18n in commit 8ee24fd ("add
Bulgarian translations")

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-14 22:23:50 +01:00
Dominik Csapak
e84f80271d webhook edit: display validity for added key/value fields
by calling 'isValid()' once the widget is attached to the grid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 17:42:36 +01:00
Dominik Csapak
e872ed40f7 webhook edit: add emptytext to key-value fields
namely 'Key' and 'Value'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 17:42:36 +01:00
Dominik Csapak
b0eafb68a9 webhook edit: use type in add button text
so one can more easily see what gets added.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 17:42:36 +01:00
Dominik Csapak
3052c4dfc8 webhook edit: make items config not static
modifying static elements from the class, like done here with e.g.

 me.items[0][key] = value;

is dangerous, since it directly modifies the class definition of those
arrays/objects.

Instead move the definition in initComponent, which uses a fresh
declaration each time the component is initialized.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 17:42:36 +01:00
Dominik Csapak
20002254e6 webhook edit: improve layout and component hierarchy
* instead of manually setting margin/paddings and the fieldLabel, just
  use a FieldContainer instead of Container. That implements the
  Ext.form.Labelable mixin, which correctly positions the label. This
  also has the effect that the labels are now styled correctly.

* modify the margins to get a consistent spacing between fields

* reverse the order of grid/button, to be consistent with our other
  grids with this input pattern

* make the label of the textarea a proper fieldLabel with a
  FieldContainer, which gets rid of the ':' in the gettext and
  styles the label correctly.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 17:42:36 +01:00
Christoph Heiss
0f8d38b5de fix #5379: window: AuthEdit{LDAP, OpenId}: add 'Default realm' checkbox
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:58:34 +01:00
Christoph Heiss
6fe81f0cef fix #5379: panel: AuthView: add column displaying whether the realm is default
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:58:34 +01:00
Christoph Heiss
4b3850bf45 schema: make PAM realm editable using new AuthSimple panel
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:58:34 +01:00
Christoph Heiss
a285fec7e4 window: add panel for editing simple, built-in realms
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:58:34 +01:00
Christoph Heiss
b4b36ef29a panel: AuthView: use help link from schema if set
This can be used to set the `onlineHelp` identifier in the schema as
opposed to in the panel directly. Needed e.g. to share a panel between
PAM and PBS realm.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:57:46 +01:00
Christoph Heiss
be8cb1efb4 panel: AuthView: make useTypeInUrl property per-realm
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:57:46 +01:00
Christoph Heiss
3822a031dd window: AuthEditBase: include more information in thrown errors
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-11 23:57:46 +01:00
Thomas Lamprecht
5156cd1164 bump version to 4.3.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-11 21:58:01 +01:00
Timothy Nicholson
8f2c09235c fix #5831: ui: right-align s.m.a.r.t numerical table data
Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
2024-11-11 21:39:49 +01:00
Shannon Sterz
96fb6cfb72 password edit: add a minimum length parameter
so products can independently specify the minimum length of new
passwords

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-11-11 21:38:34 +01:00
Timothy Nicholson
4ca542b811 fix #5836: ui: translate systemd states in ServiceView
Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
2024-11-11 21:34:54 +01:00
Daniel Herzig
a351d3d36d fix #5611: node service view: hide non-installed services
This patch adds a filter to identify services, which are reported as
'not-found' by the api. By default they will not be shown in the UI
anymore, but visibility can still be toggled using a new checkbox.

Signed-off-by: Daniel Herzig <d.herzig@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-11 21:28:34 +01:00
Lukas Wagner
0ad5712ac7 notification: add UI for adding/updating webhook targets
The widgets for editing the headers/secrets were adapted from
the 'Tag Edit' dialog from PVE's datacenter options.

Apart from that, the new dialog is rather standard. I've decided
to put the http method and url in a single row, mostly to
save space and also to make it analogous to how an actual http request
is structured (VERB URL, followed by headers, followed by the body).

The secrets are a mechanism to store tokens/passwords in the
protected notification config. Secrets are accessible via
templating in the URL, headers and body via {{ secrets.NAME }}.
Secrets can only be set/updated, but not retrieved/displayed.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-By: Stefan Hanreich <s.hanreich@proxmox.com>
2024-11-10 18:03:15 +01:00
Gabriel Goller
ffeb8004fb utils: add base64 conversion helper
Add helper functions to convert from a utf8 string to a base64 string
and vice-versa. Using the TextEncoder/TextDecoder we can support unicode
such as emojis as well [0].

[0]: https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-10 18:01:44 +01:00
Dominik Csapak
f18c0d3636 css: add some conditions to the tag classes for the tag view
in the tag view, we have a custom 'full' style in a place where we
can have another tagstyle class above. to compensate for that, we have
to add another condition to those styles, namely that there is not the
'proxmox-tags-full' in between.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-10 11:30:00 +01:00
Thomas Lamprecht
6af66f9626 bump version to 4.2.4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-16 18:55:24 +02:00
Dominik Csapak
9e69d726e0 fix external linking to products by setting cookie SameSite attribute to lax
We introduced the 'strict' setting when browsers warned about our
cookies not having any SameSite setting [0]. While this works in
general, it had an unforeseen side effect:

When opening a link to the web UI of Proxmox projects, any existing
cookie does not get sent on the initial page load due to coming from
another origin. This then leads to the username and CSRF prevention
token not being set in the index response.
The UI code interprets this as the user being logged out (e.g. because
the ticket is not valid) and clears the cookie, displaying the login
window, even if the cookie's ticket value was still valid.

The MDN reference[1] says that setting it to 'lax' is similar to
'strict', but sends the cookie when navigating *to* our origin even
from other sites, which is what we want when linking from elsewhere.
(This would have also been the default if we wouldn't have set any
attribute).

[0]: https://lore.proxmox.com/pve-devel/20230315162630.289768-1-m.carrara@proxmox.com/
[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_attribute

Fixes: aec7e8d ("toolkit/utils: set SameSite attr of auth cookie to 'strict'")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-10-15 15:25:14 +02:00
Dominik Csapak
51e64f26ec css: dark theme: fix panel borders for pmg eol theme
since the header markup is different than what we use in pve, the
'spacer' elements in the pmg header get a (different colored) border by
default.

We already overwrite it for the first spacer, but when we show an EOL
notice, we have two of them, so add the second one to the rule too.
This also uses the 'css next sibling selector', just for the sibling of
the div with the 'eol-notice' class instead of the 'versioninfo' one.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-09-26 11:14:28 +02:00
Lukas Wagner
f420a35cb7 notification: matcher: move match-severity fields to panel
Also introduce a local viewModel that is linked to a parent viewModel,
allowing us to move the formulas to the panel.
This should make the code more cohesive and easier to follow.

No functional changes.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
2024-09-23 17:09:32 +02:00