Commit Graph

303 Commits

Author SHA1 Message Date
Dominik Csapak
6f2940c7b1 ui: fix not opening 'bulk action' windows
we previously removed the 'filters' property from the store, but this
has the effect that the filter array is only ever initialized when
we try to access them via the specified api of extjs

so instead of adding them manually to their array, use the 'addFilter'
method of extjs

also use 'getStore()' instead of directly accessing the store to be
consistent with the extjs api use

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-03-14 11:37:47 +01:00
Dominik Csapak
7a5ca76aa1 fix #4239: ui: show selected but non-existing vmids in backup edit
by adding records manually when using 'setValue' on a vmselector.
It'll show up normally but have an 'unknown' nodename, and no type/status/etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:47:34 +01:00
Dominik Csapak
fc8138ec20 ui: guest selector: correctly change invalid class on en/disable
since the invalid class is manually handled, validity needs to be
checked explicitly too on setDisabled

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:47:34 +01:00
Dominik Csapak
11fc6d7fb5 ui: guest selector: switch from post-filter to query param for API call
So that we can modify any filters without always having to consider
filtering for the type too. Note that the 'vm' tyoe here is slightly
confusing and should actually be 'guest', as this also returns
containers. Reduces transmission size a bit as nice side effect.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:47:34 +01:00
Dominik Csapak
d3086ce752 ui: guest selector: improve set/getValue handling during store load
When one calls setValue or getValue during a store load, the store
might be empty or incomplete, so defer the selection after the load
and cache the value for getValue invocations until the store is
loaded

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:47:34 +01:00
Dominik Csapak
66a38a6afa ui: guest selector: make the shown picker columns customizable
We will reuse this component in other place, which might not always
want to show all columns

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:47:34 +01:00
Dominik Csapak
731436ee86 ui: refactor ui option related methods into UIOptions
a new singleton like Utils/Parser, intended for holding stuff for
ui options, such as the tag settings/overrides

no behavioural change intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-02-22 09:12:36 +01:00
Dominik Csapak
f5dd10dc3e ui: remove unused booleanfield
it's not used anymore, does not belong into pve-manager (rather in
proxmox-widget-toolkit), does not have a proper alias.

it's simple enough to recreate should we ever need it again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-02-22 09:12:36 +01:00
Dominik Csapak
b497c4c731 ui: remove 'Storage View'
it is basically the 'Server View' but with less content, and has often
times lead to confusion when uses accidentally selected it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-02-22 09:12:36 +01:00
Thomas Lamprecht
7b668b16bb ui: local storage selector: avoid cut-off for node field
The top bar normally doesn't hosts form fields, so the height was a
bit off and the lower border of the node selector overflowed and got
hidden, making the whole picker look slightly off.

So set a minimum height of 40 px to ensure the field can be fully
shown, including margins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 17:59:58 +01:00
Thomas Lamprecht
ab4ea492b6 ui: form store node selector: improve variable name clarity slightly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-31 17:58:01 +01:00
Dominik Csapak
7528c2572e ui: ComboBoxSetStoreNode: don't hide the picker when clicking the toolbar
When clicking the toolbar of the ComboGrid, the combobox loses focus,
and instantly hides the picker.

To prevent that, we keep track of the mousedown event on the toolbar
(which happily comes before the focusLeave event), and prevent the
focusLeave propagation in that case.

Then on mouseup, we focus the combobox again, so that the nexct
focusLeave can trigger again.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-01-31 10:38:11 +01:00
Dominik Csapak
d420b29ae3 ui: storage: move node scan selector inside combobox
by converting the relevant selection boxes to combogrids.
This is done to reduce confusion for how/why to select a node, and
doing it this way it is moved closer to the selection of the actual
value we want. It still restricts the nodes when selecting a specific one.

Show it only when there is more than one node according to the
in-memory PVE.data.ResourceStore info, as for single-node setups
there isn't any other node one could scan anyway.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-18 16:01:08 +01:00
Dominik Csapak
d7610df0c7 ui: storage: use null as empty value for scanned-node selector
otherwise it can happen that there as additional change event from
null to '', even though the value did not change

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-18 16:01:08 +01:00
Stefan Hrdlicka
14d9ecc416 fix #2822: add iscsi, lvm, lvmthin & zfs storage for all cluster nodes
This adds a dropdown box for iSCSI, LVM, LVMThin & ZFS storage options where a
cluster node needs to be chosen. As default the current node is
selected. It restricts the the storage to be only availabe on the
selected node.

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
2022-12-21 16:24:04 +01:00
Dominik Csapak
2da3166e58 ui: tags: highlight finish inline editing button
by making it a 'regular' blue button instead of a toolbar button

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 16:37:46 +01:00
Dominik Csapak
66dace4b3c ui: tags: implement dirty tracking for inline editing
similar to how regular forms are tracked

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 16:37:46 +01:00
Dominik Csapak
e83ea30e4a ui: tags: shortcut accept&cancel with keypresses
pressing 'Enter' accepts the current tags and
'Escape' cancels editing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 16:37:46 +01:00
Dominik Csapak
1b48b8b7a1 ui: hide 'no tags' field and edit icon without VM.Config.Options
they cannot edit them anyway, so no point in showing them that
there is no tag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 16:37:46 +01:00
Dominik Csapak
56dee217bc ui: fix datacenter tags options inputs
* dont allow blank for tree shape
* allow completely removing registered tags and user-tag-access properties
* correctly check validity for the listfield
* use correct gettexts
* don't inject empty field in the listfield when setting an empty string

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 12:56:18 +01:00
Thomas Lamprecht
09b65afff9 ui: tags: reduce opacity of "No Tags" hint
make it less stand out, it's just a hint not primary information

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 18:36:54 +01:00
Thomas Lamprecht
13a0c8bf11 ui: eslint auto-fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 18:21:48 +01:00
Dominik Csapak
432aec5641 ui: change style of ListField
and make it more like the 'traffic control' time grid in pbs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:48 +01:00
Dominik Csapak
38f4e6e43b ui: tags: hide already set tags in dropdown
on every change, collect all tags and update the filter of all tag
fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:48 +01:00
Dominik Csapak
871953db9f ui: tags: make sorting more natural
by sorting the lower cased variants, and only if they are identical
sort the original values with 'localeCompare'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:48 +01:00
Dominik Csapak
59e71a0881 ui: rework inline tag editing
things that changed:
* removed 'add Tag' inline button with proper button that adds
  empty tag
* don't require to confirm each tag, simply update the color "live"
* set a minimum width for the editing box, so that it's easier to click
* replace cancel/finish icons with proper buttons
* fix tagCharRegex for multichar text (necessary for paste)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:48 +01:00
Dominik Csapak
8d8ba23da9 ui: implement tag ordering as configured in datacenter config
datacenter.cfg returns an 'ordering' option. parse that and
use it to order the tags when viewing. default is alphabetical.

With alphabetical ordering, drag & drop when editing is disabled and the
tags will be inserted at the right place. When saving, the sorted
order will be written into the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:23 +01:00
Dominik Csapak
ad4a19f652 ui: add tags to ResourceGrid and GlobalSearchField
also allows to search for tags in the GlobalSearchField where each tag is
treated like a seperate field, so it weighs more if the user searches for
the exact string of a single tag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>

ui: ResourceGrid: render tags

with the 'full' styling

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:23 +01:00
Dominik Csapak
1b42bb8657 ui: add form for editing tags
This is a wrapper container for holding a list of (editable) tags
intended to be used in the lxc/qemu status toolbar

To add a new tag, we reuse the 'pveTag' class, but overwrite some of
its behaviour and css classes so that it properly adds tags

Also handles the drag/drop feature for the tags in the list

When done with editing (by clicking the checkmark), sends a 'change'
event with the new tags

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:20:53 +01:00
Dominik Csapak
b6f9fc78c0 ui: add form/Tag
displays a single tag, with the ability to edit inline on click (when
the mode is set to editable). This brings up a list of globally available tags
for simple selection.

this is a basic ext component, with 'i' tags for the icons (handle and
add/remove button) and a span (for the tag text)

shows the tag by default, and if put in editable mode, makes the
span editable. when actually starting the edit, shows a picker
with available tags to select from

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:20:53 +01:00
Dominik Csapak
4f43785ac9 ui: add PVE.form.ListField
a field which contains just a list of textfields, e.g. useful for a list
of simple tags

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:20:53 +01:00
Dominik Csapak
7381265da2 ui: add grid form for mapping tags to foreground/background colors
This provides a basic grid to edit a list of tag color overrides.
We'll use this for editing the datacenter.cfg overrides and the
browser storage overrides.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:20:12 +01:00
Stefan Sterz
eba38fa4b2 ui: only allow rbd pools to be added as rbd storage
previously the ui would allow adding all pools (even the default
ceph-mon pools) as storage. this could lead to issues when users did
use these pools as storage (e.g.: vms missing their disks after a
migration). hence, restrict the pool selector to rbd pools.

fails gracefully by reverting to the previous behavior if a pool has
no application assigned to it.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Tested-By:  Aaron Lauterer <a.lauterer@proxmox.com>
2022-11-16 20:24:12 +01:00
Stefan Hrdlicka
1a3e2e9f5d cleanup: style fix
Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
2022-10-24 13:38:23 +02:00
Stefan Hrdlicka
1eb7b17f3a fix #1981: get next free disk id on change of bus/device
Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
2022-10-24 13:38:23 +02:00
Thomas Lamprecht
2831d8061b ui: mdev selector: avoid separate gettext for "Avail"
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-10-04 13:54:10 +02:00
Dominik Csapak
9c020707a0 ui: improve form/MDevSelector
by
* showing the (optional) name in front of the type
* making the 'availble' column a bit narrower
* enabling 'cellWrap' for the description
* making the dropdown a bit wider (so all the information can fit)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-08-12 14:04:49 +02:00
Thomas Lamprecht
56148f253e ui: utils: drop some useles _array helpers, just use Object.entries
if we need to enforce ordering it may help to reintroduce them
though.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-26 09:07:14 +02:00
Fabian Ebner
db8aa0f468 ui: disk storage selector: support storage with multiple formats without qcow2
For future or external storages where the assumption "multiple formats implies
qcow2 is supported" doesn't hold.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-20 15:01:28 +02:00
Fabian Ebner
faef846c22 ui: disk storage selector: never send format when hideFormat is true
The backend will pick an appropriate format when nothing is specified. The
comment made it sound like 'raw' would be sent, but that didn't actually happen
on file-based storages, and now no format is sent, so adapt the comment too.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-20 15:01:28 +02:00
Aaron Lauterer
48eb9401a4 ui: BusTypeSelector: change noVirtIO to withVirtIO
Double negated properties make it harder than necessary to parse
conditions.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-07 15:35:17 +02:00
Thomas Lamprecht
f703ea43e3 ui: form/calendar event: add monthly and yearly examples
like PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-18 05:51:59 +01:00
Thomas Lamprecht
5d51f148cc ui: form/calendar event: enable first-day-of-month example again
the rust based implementation form PBS we recently switched too
supports that

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-13 17:52:27 +01:00
Fabian Ebner
392e3cf11d 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 all affected sorters anyways.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-12-16 10:11:48 +01:00
Thomas Lamprecht
ec23a5cb32 ui: calendar event: add once daily example and clarify workday one
Using 00:00 with relying on the implied default is sub optimal as its
a bit of a magic example that new users may not understand as easily.
So spell it out explicitly, even if there'd be a shorter version
possible.

We also had some request for the once-daily every day, and its a
sensible example to have in general, could help getting the
difference between an hour list and a single one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-07 18:51:32 +01:00
Aaron Lauterer
7b14d77a7a ui: qm: disk selection: add optional selection of unused
With this optional setting, it is possible to allow the user to also
select 'unused' as a disk bus type.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-12 18:30:10 +01:00
Dominik Csapak
786e7d8328 ui: storage/cephfs: make ceph fs selectable
by adding a CephFSSelector and using it in the CephFSEdit window
(similar to the poolselector/textfield)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-11 17:52:08 +01:00
Thomas Lamprecht
82536c370d ui: form/CalendarEvent: remove 'first saturday each month' example
Originally-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 17:50:47 +01:00
Wolfgang Bumiller
69c33cffe8 www: use UserSelector from wtk
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-11 14:38:23 +01:00
Fabian Ebner
358d3efd1d ui: calendar event: fix descriptions for examples
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 10:09:47 +01:00