Commit Graph

21 Commits

Author SHA1 Message Date
Maximiliano Sandoval
419e473456 ui: do not split translatable strings
Splitting the strings adds extra work to translators as they now have
less context to work with.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250228102342.163467-1-m.sandoval@proxmox.com
2025-04-07 15:16:15 +02:00
Dominik Csapak
4ecd28022c ui: qemu pci edit: select correct radiobutton when editing
This panel uses a view model for changing between mapping and raw for
disabling fields. Since the view model bindings take effect after
setVMConfig is called, the default value for 'isMapped' of true
overwrote the mode chosen from the config.

To fix that, set the value in the view model there too.

Additionally, check the 'mapped' radiobutton by default instead of
'raw', so that it is the same as the view model.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250407095029.2950635-1-d.csapak@proxmox.com
2025-04-07 11:52:45 +02:00
Thomas Lamprecht
67bad2bed6 ui: mdev selector: clarify that config accepts a named PCI mapping now too
The backend and this component accept both, a specific PCI id or a
named mapping since commit 8b33297c6 ("api/ui: improve mdev listing
for pci mappings"), so clarify that by updating the config property
from `pciid` to `pciIdOrMapping`, including the setter method.

Only the setter was used once by our single caller, so update that
there to use the new name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 11:15:28 +01:00
Dominik Csapak
8b33297c6e api/ui: improve mdev listing for pci mappings
Currently, when we have a PCI resource mapping, we manually check only
the available models for the first PCI entry. This often works, but not
always, since one could have completely different devices in one
mapping, or with the new NVIDIA sysfs api we don't get the generally
available models.

To improve this, extend the parameter for the PCI ID to accept both,
PCI IDs or named mappings, and for the latter mappings, iterate over
all local PCI devices in it and extract the mdev types.

Rename also the parameter to better reflect what it accepts. While the
this is changing a API parameter, it's not a breaking change in this
specific case because the parameter is derived from the URL path, and
any attempt to include the parameter with a name manually is not
possible and  will result in an error:

  duplicate parameter (already defined in URI) with conflicting values!

Since we cannot reach the API handler without giving the parameter
already via the URL, there is no way to give it via name.

Accepting named mappings directly in this API endpoint also vastly
simplifies the UI code, since we now only have to give the mapping to
the selector instead of an (arbitrarily selected) PCI id from that
mapping.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: also split pciid into pci-id for readability and reword message
   slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 10:38:46 +01:00
Maximiliano Sandoval
d76c2b0f9e fix typos in comments
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-22 18:28:18 +02:00
Dominik Csapak
b1d42186d1 ui: qemu/PCIEdit: rework panel to add a mapped configuration
reworks the panel to use a controller, so that we can easily
add the selector for mapped pci devices

shows now a selection between 'raw' and 'mapped' devices, where
'raw' ones work like before, and 'mapped' ones take the values
form the hardware map config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-16 16:25:42 +02:00
Dominik Csapak
dd8b3252af ui: fix adding hostpci > 5
by using the limits from PVE.Utils

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-04-25 18:22:24 +02:00
Thomas Lamprecht
d20113ef7e ui: pci passthrough: fix labels of new id/vendor overrides
We do not use 'Set XYZ' anywhere else and it should be clear enough
from the PCI selector in the non-advanced section that the actual
device to get passed-through is chosen else where, but we still can
use the emptyText to avoid confusion where the (sub) vendor/id will
come from if a field is left empty.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-01-27 15:16:50 +01:00
Nicholas Sherlock
9a9be673d1 ui: pci passthrough: editor for pci-id overrides
Signed-off-by: Nicholas Sherlock <n.sherlock@gmail.com>
2022-01-25 11:17:05 +01:00
Dominik Csapak
4f0d4294cf ui: qemu/PCIEdit: change onlineHelp link to vm config section
link the user directly to the vm config section of the pci
passthrough docs, since that is whats happening on that panel.

It still is on the same page as the whole passthrough docs, so
the remaining info is still there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-30 14:49:14 +02:00
Thomas Lamprecht
a7ec3666b1 ui: qemu/PCI Edit: code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 12:29:29 +02:00
Dominic Jäger
61e0576823 ui: qemu: eslint fixes
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-05-19 12:12:36 +02:00
Thomas Lamprecht
d2021707e3 ui: eslint: enforce "no-extra-boolean-cast" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:43:40 +01:00
Thomas Lamprecht
8058410f40 ui: eslint: fix various spacing related issues
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:39:15 +01:00
Thomas Lamprecht
f6710aac38 ui: eslint: fix trailing comma and comma related whitespaces errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:31:03 +01:00
Dominik Csapak
d3b3b4ad2a ui: fix 'no iommu found' message for setups
sometimes, the first device in the pci api call is not in a separate
iommu group (see e.g. [0]), but it is active and should work

instead of testing the first, test all, and only show the message
if no device has a set iommu group

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-20 15:34:27 +01:00
Stefan Reiter
5b23d68382 gui: pci passthrough: fix 'Add PCI' dialog for new devices
Commit f36240c507 (gui: pci passthrough: consider domain in PCISelector)
used 'values.host' without checking if it's set, resulting in an error
when the dialog was opened for a new device (where values.host is
undefined).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-02-17 15:34:38 +01:00
Dominik Csapak
f36240c507 gui: pci passthrough: consider domain in PCISelector
but remove the default domain '0000' before sending to the backend,
and add it if no domain is given in the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-20 19:43:31 +01:00
Stoiko Ivanov
f71b7c28ff change .pve-hint to .pmx-hint css-class
With introducing pmx-hint to pmg as well, by adding a 'pmx-hint' css-class
to proxmox-widget-toolkit, it makes sense to use the definition everywhere.
this patch drops the .pve-hint class from pve's css and replaces all occurences
in the GUI-source.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-10-09 09:11:04 +02:00
Dominik Csapak
2b25a905ad do not send 'undefined' as romfile
when adding a pcidevice, we added 'romfile=undefined' by accident

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-05 14:25:24 +01:00
Dominik Csapak
c59fb4eef5 gui: add qemu/PCIEdit
this patch adds the PCIEdit window and InputPanel uses PCISelector
and MDevSelector

when we detect an iommugroup of -1, we put a warning on top to inform
the user that IOMMU is not activated (but let him add the devices
regardless, so that he can use it after IOMMU is activated)

also puts a warning if he selects a device that shares an iommugroup
with a different device (but not the same device with different
function). that detection is not perfect, but we cannot do really
better

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-22 13:31:31 +01:00