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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>