As reported in the community forum[0], as opposed to VM/LXC creation,
there is no validation for the name in the clone dialog. Use the same
validation as the guest creation wizards do to catch errors early,
before sending the API request.
ui: utils: monitor_ceph_installed: avoid setting nodename to localhost
If a user is accessing the Ceph panel via Datacenter -> Ceph, then the
install & config wizard might be shown. The nodename that is passed to
the wizard will decide the ID of the initial MON and MGR services.
Therefore, don't fall back to 'localhost' but the actual name of the
node to which we are connected to. The result will be that the first MON
and MGR will have the expected ID instead of 'localhost'.
Thomas Lamprecht [Sat, 22 Apr 2023 07:47:29 +0000 (09:47 +0200)]
proxy: cleanup getting index method
- improve variable definition/use locality
- avoid some if's for some (mostly boolean) assignments, just use an
expression
As long as we don't go overboard with code golfing it to extremely
terse, shorter code is always more readable, especially if
definition/use happens not dozens of lines apart.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Fri, 31 Mar 2023 10:03:08 +0000 (12:03 +0200)]
fix #4627: ui: backup edit: don't deselect all guests on load
'selectPoolMembers' will be called when the poolid field changes.
(That can even happen when the mode is not even 'pool') Due to how
the fields are set, there is a race condition that this will be
called after the remaining fields were set up, including the VM list
that might have entries selected.
Since the first thing we do here is to deselect all, this wiped the
virtual guest selection sometimes.
To fix it, check if we're actually in the correct mode before doing
anything.
The pve_verify_cidr{,v4,v6} functions were originally intended for
the /etc/network/interfaces API endpoints and thus are a bit
restrictive. For example, as reported in the community forum[0],
pve_verify_cidr() does not consider '0::/0' and '0::/1' to be valid.
The error message in this scenario being
> value does not look like a valid CIDR network
is also confusing, as the first thought of users will be that it comes
from the passed-in monitor address.
The public networks are not written here and read from the Ceph config
and via a RADOS mon command, so no need to try and verify them. If
something really would go wrong during parsing, the
get_local_ip_from_cidr() call would complain afterwards.
[0]: https://forum.proxmox.com/threads/125226/
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Lukas Wagner [Thu, 23 Feb 2023 15:25:59 +0000 (16:25 +0100)]
pvereport: add `date -R` to general system info section
Sometimes it can be quite useful to know when exactly a system report
was generated. Adds the following output quite prominently in the
general system info section:
Thomas Lamprecht [Tue, 21 Mar 2023 15:22:23 +0000 (16:22 +0100)]
ui: rename "Theme" selector to "Color Theme"
Having "Color" added makes it easier to translate (i.e. Farbschema,
配色) and at least as understandable as Theme, so change it,
Suggested-by: Markus Frank <m.frank@proxmox.com>
[ T: while Markus suggested Color Scheme, the hive-mind opted for
this ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Tue, 21 Mar 2023 09:16:10 +0000 (10:16 +0100)]
ui: lvm-thin: fix not being able to edit the storage
The change handler of the edit config from a displayEditField still
triggers, even if hidden and disabled. This then enables another
editConfig part of a displayEditField, which triggers an error in the
API.
To fix that, simply check if this field is disabled before setting
the other fields value
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Aaron Lauterer [Mon, 20 Mar 2023 10:50:54 +0000 (11:50 +0100)]
api: ceph: add ceph/cfg path, deprecate ceph/config and ceph/configdb
Consolidating the different config paths lets us add more as needed
without polluting our API with too many 'configxxx' endpoints.
The config and configdb paths are renamed under the ceph/cfg path:
* config -> raw (returns the ceph.conf file as is)
* configdb -> db (returns the ceph config db contents)
The old paths are still available and need to be dropped at some point.
Aaron Lauterer [Mon, 20 Mar 2023 10:32:31 +0000 (11:32 +0100)]
ui: ceph: adapt urls to new ceph/pool endpoint
ceph/pools (plural) is deprecated, use the new one.
Since the details / status of a pool has been moved from previously
ceph/pools/{name} to now ceph/pool/{name}/status, we need to pass the
'loadUrl' to the edit window.
Aaron Lauterer [Mon, 20 Mar 2023 10:32:30 +0000 (11:32 +0100)]
api: ceph: deprecate pools in favor of pool
/nodes/{node}/ceph/pools/{pool} returns the pool details right away on a
GET. This makes it bad practice to add additional sub API endpoints.
By deprecating it and replacing it with /nodes/{node}/ceph/pool/{pool}
(singular instead of plural) we can turn that into an index GET
response, making it possible to expand it more in the future.
The GET call returning the pool details is moved into
/nodes/{node}/ceph/pool/{pool}/status
The code in the new Pool.pm is basically a copy of Pools.pm to avoid
a close coupling with the old code as it is possible that it will divert
until we can entirely remove the old code.
Thomas Lamprecht [Fri, 17 Mar 2023 10:22:07 +0000 (11:22 +0100)]
fix #4571: ui: ceph: allow adding extra-ID for multiple MDS per node
One MDS can only serve a single CephFS at a time and for redundancy
one wants to have standby's on other nodes.
But with multiple CephFS instances a single MDS per node might not be
enough, e.g., with three FS on a three-node cluster a failure of one
node would mean that on CephFS won't work anymore.
While the API and CLI allowed to set up multiple CephFS per node
already, the UI didn't. Address this by adding an `Extra ID` field
that will be suffixed to the base ID, which always contains the node
as that makes sorting and also associating services to their node
easier.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Lukas Wagner [Thu, 26 Jan 2023 10:47:11 +0000 (11:47 +0100)]
ui: backup: replication: replace non-clickable checkbox with icons
From a usability view, having a checkbox that is not clickable is pretty
misleading, especially if the visual style is exactly the same as in
other places in the UI where the checkbox is functional.
Max Carrara [Tue, 14 Mar 2023 15:08:39 +0000 (16:08 +0100)]
ui: cert upload: fix private key field sending empty string
The private key's field is now excluded from the upload form's
JSON data if it's left empty.
Prior to this change, the form still used an empty string for the
private key's field, even if no key was provided by the user.
Because the key's field is marked as optional in the upload cert
API endpoint, JSONSchema validation would therefore fail.
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Max Carrara [Tue, 14 Mar 2023 15:08:38 +0000 (16:08 +0100)]
ui: cert upload: use inputpanel for certificate upload
This change replaces the the certificate upload form's items with
a single inputpanel widget. The components for the key and cert fields
are preserved as-is. Hardcoded values are now explicitly set in
`onGetValues` instead of using hidden widgets.
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Aaron Lauterer [Mon, 12 Dec 2022 12:14:51 +0000 (13:14 +0100)]
ui: osd: add details window
This new windows provides more detailes about an OSD such as:
* PID
* Memory usage
* various metadata that could be of interest
* list of phyiscal disks used for the main disk, db and wal with
additional infos about the volumes for each
A new 'Details' button is added to the OSD overview and a double click
on an OSD will also open this new window.
The componend defines the items in the initComponent instead of
following a fully declarative approach. This is because we need to pass
the same store to multiple Proxmox.ObjectGrids.
Aaron Lauterer [Mon, 12 Dec 2022 12:14:49 +0000 (13:14 +0100)]
api ceph osd: add OSD index, metadata and lv-info
To get more details for a single OSD, we add two new endpoints:
* nodes/{node}/ceph/osd/{osdid}/metadata
* nodes/{node}/ceph/osd/{osdid}/lv-info
The {osdid} endpoint itself gets a new GET handler to return the index.
The metadata one provides various metadata regarding the OSD.
Such as
* process id
* memory usage
* info about devices used (bdev/block, db, wal)
* size
* disks used (sdX)
...
* network addresses and ports used
...
Memory usage and PID are retrieved from systemd while the rest can be
retrieved from the metadata provided by Ceph.
The second one (lv-info) returns the following infos for a logical
volume:
* creation time
* lv name
* lv path
* lv size
* lv uuid
* vg name
Possible volumes are:
* block (default value if not provided)
* db
* wal
'ceph-volume' is used to gather the infos, except for the creation time
of the LV which is retrieved via 'lvs'.
Dominik Csapak [Tue, 14 Mar 2023 10:20:36 +0000 (11:20 +0100)]
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
Thomas Lamprecht [Tue, 14 Mar 2023 10:21:27 +0000 (11:21 +0100)]
revert "fix #4333: redirect API handler output to STDERR"
Redirecting stdout is not a feasible approach, as that also affects
all run_commands and other command executions/forks done by the API
handler, and thus breaks parsing outputs of such command executions
in the API handlers.
We plan to add a `--result-fd` option instead, allowing users to pass
their own file, open FD or named pipe to the pvesh, so that they can
process the output in streaming or in full afterward afterwards.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 6 Mar 2023 14:23:35 +0000 (15:23 +0100)]
ui: BackupEdit: refactor edit window into declarative style
simplifies some things, e.g. en/disabling the grid and pool selector
while refactoring, cleanup up some smaller things like nested if/else
paths, unnecessary splitting of the deprecated 'dow' parameter, etc.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
by replacing the manual vm grid implementation and reusing the
VMSelector we already have. Since this is a full-fledged form field, we
can drop the complicated selection tracking / reselecting that we did
by saving into a hidden field.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Mon, 6 Mar 2023 14:23:31 +0000 (15:23 +0100)]
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>
Dominik Csapak [Mon, 6 Mar 2023 14:23:30 +0000 (15:23 +0100)]
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>
Dominik Csapak [Fri, 10 Mar 2023 13:08:12 +0000 (14:08 +0100)]
api: return missing 'hardware' entry in node endpoint index
The 'hardware' entry was missing there. While interfacing with it
works, it will not show up during CLI auto completion and in the HTML
debug view (/api2/html/) if not listed here in the API directory
index.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Sterz [Fri, 10 Mar 2023 13:08:37 +0000 (14:08 +0100)]
ui: make tree settings button like regular buttons
the "proxmox-inline-button" class is redundant in the crisp theme as
it only sets the buttons text to black. we mainly use that class for
"help" buttons. this is useful in the dark theme, because we want help
buttons to stand out a bit so (possibly confused) users are drawn to
them more easily. removing the class here doesn't change anything for
"crisp", but makes the dark theme appear more consistent. also fixes
up an unnecessary space.
Since the rule selector is not allowed to be empty, but the loading
of the rules is not instant, the validity change will trigger before
the load was finished. Since it is in the advanced section, it will
be opened every time instead of only when there is an invalid value.
This patch fixes that by temporarily setting 'allowBlank' to true
until the store is loaded, and then it revalidates the field.
Thomas Lamprecht [Fri, 10 Mar 2023 14:38:17 +0000 (15:38 +0100)]
ui: fire config change: always pass required parameters
As otherwise the listeners might choke on the missing records.
For our usage it was only a problem when one changed the tree UI
options while having the Datacenter -> Summary panel open, as that
listens to the UI changes to adapt the shown gauges for e.g., memory,
storage, or CPUs, and thus actually uses the current result (unlike
we do in the store load listener).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Sterz [Wed, 8 Mar 2023 16:40:08 +0000 (17:40 +0100)]
subscription/summary/backup: stop setting the background color
setting the background color in js code adds that property as a style
attribute to the element. that makes it hard to alter later via css
and makes it hard to dynamically change the color e.g. if we want to
add different themes. the background color for these elements are
white already anyway, so just remove them here.
ui: ceph status: avoid messing with internal state of warning grid
inline the transformation for the health store and also avoid setting
raw data from the outside
and drop some bogus comments along the way, first one should mostly
use "why?" not "what happens?" comments and second, commenting
straight forward things always makes one pause and recheck everything
far to often, as a comment indicates there something non-obvious
happening.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Wed, 22 Feb 2023 07:51:52 +0000 (08:51 +0100)]
fix #1408: ui: ResourceTree: sort the tree according to tree-sorting options
Considers the newly added options from browser local storage. We have to
save the last sorting mechanism there, so we can detect if it changes
and trigger the movement/text changes (otherwise the tree nodes won't
be updated/moved)
Aaron Lauterer [Tue, 21 Feb 2023 10:23:32 +0000 (11:23 +0100)]
report: add ceph health detail
This gives us more detailed infos about the problems Ceph currently has.
It is the last command because if PGs have issues, the list can be quite
long. Therefore, we want it at the end of the report.
Aaron Lauterer [Thu, 17 Nov 2022 09:29:13 +0000 (10:29 +0100)]
ui: ceph: osd: set default icon for other crush types
Some users have a more complicated CRUSH hierarchy, for example with a
stretched cluster. The additional hierarchy steps (datacenter, rack,
room, ...) are shown in the OSD panel. Showing a generic icon for any
CRUSH types that have not a specific icon configured will make it easier
to navigate the tree as it will not look somewhat broken and empty.
Aaron Lauterer [Tue, 14 Feb 2023 08:13:47 +0000 (09:13 +0100)]
ceph osd: return PGs per OSD and show in UI
By switching from 'ceph osd tree' to the 'ceph osd df tree' mon API
equivalent , we get the same data structure with more information per
OSD. One of them is the number of PGs stored on that OSD.
The number of PGs per OSD is an important number, for example when
trying to figure out why the performance is not as good as expected.
Therefore, adding it to the OSD overview visible by default should
reduce the number of times, one needs to access the CLI.
Comparing runtime cost on a 3 node ceph cluster with 4 OSDs each doing 50k
iterations gives:
So, while definitively a bit slower, but it's still in the µs range,
and as such below HTTP in TLS in TCP connection setup for most users,
so worth the extra useful information.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
[ TL: slight rewording of subject and add benchmark data ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Lukas Wagner [Tue, 14 Feb 2023 13:35:08 +0000 (14:35 +0100)]
ui: ldap: fix `Parameter verification error`
...when editing LDAP realm sync settings and only a single property is
empty and thus to be deleted (e.g. values.delete = "filter").
If `delete` is a simple string and not an array,
`PVE.Utils.delete_if_default` simply creates a comma-separated list,
(e.g. value.delete = "filter,sync-attributes").
When the properties from the other panel are evaluated and added to the
the `delete` property, comma-separated list format is not considered,
leading to a final value for `delete` that could look like this:
value.delete = {
"server2",
"comment",
"filter,sync-attributes"
}
This commit fixes this by splitting `delete` in case it is a string.
Reported-by: Friedrich Weber <f.weber@proxmox.com> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com> Tested-by: Friedrich Weber <f.weber@proxmox.com>
Stefan Sterz [Thu, 9 Feb 2023 11:43:14 +0000 (12:43 +0100)]
fix #4521: api/tasks: replace upid as filename for task log downloads
previously the upid would just be used without a file extension when
downloading a task log. this lead to rather strange filenames that
appeared unfamiliar to users as the upid is not very prevalent in the
gui. set a proper file name based on the node name, worker type and a
time stamp instead. also add the ".log" file extension to indicate
that these files contain logs.