Commit Graph

69 Commits

Author SHA1 Message Date
Thomas Lamprecht
5a912de3f3 ui: storage content: support filtering by notes for backups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-02 15:26:21 +02: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
2b28954745 ui: backup views: disable remove button on protected backups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-16 13:57:22 +01:00
Thomas Lamprecht
528c24b569 ui: make protected column header use the icon only
to avoid using to much space, as the icon appears on hitting "change
protection" and the tooltip is set to "Protected" it should be still
quite clear.

Further UX improvement can be made by adding a context menu with can
use words for all actions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-16 13:57:03 +01:00
Dominik Csapak
bc54c47377 ui: render 'protected' column as icon and enable sorting
instead of 'Yes' and 'No', render the same icon as in pbs for protected
backups, and leave the column empty otherwise

this makes the difference much more visible and is more consistent with
how we present that flag in pbs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-16 13:57:03 +01:00
Lorenz Stechauner
f9f45aaca7 ui: refactor UploadToStorage.js
this also removes the "content" selector from the window.
as far as it seems, this selector was never able to select
more than one entry, so it was useless.

the check for FormData() is also removed, because this is
supported by all major browsers for a long time. therefore
doStandardSubmit() is also not necessary.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 09:21:44 +01:00
Lorenz Stechauner
26bfeca185 ui: move upload window into UploadToStorage.js
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 09:21:44 +01:00
Fabian Ebner
61cf265897 ui: backup views: add protected column
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-09 11:33:16 +01:00
Fabian Ebner
c0eadd5543 ui: storage content: avoid redundant options hasNotesColumn and hideColumns
Replace both by a showColumns option instead. As the current use of
hasNotesColumn already indicates, when new content-specific columns
are added, it is more natural for each derived class to specify the
columns it wants, rather than those it doesn't.

For hideColumns, there was no user. For hasNotesColumn, the only user
was the backup view.

Set the column information in the storage.BackupView class itself
rather than the instance (like hasNotesColumn was).

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-09 11:33:16 +01:00
Thomas Lamprecht
01366f9e8c ui: move download URL to storage window into own file
As 200 lines is a bit much for the content view, i.e., basically
growing it by 50% in size for a very specific feature is not ideal.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 00:45:09 +02:00
Lorenz Stechauner
af3c0a9287 fix #1710: ui: storage: add download from url button
uses the common function PVE::Tools::download_file_from_url to
download a iso image or container template.

note: Only users with permissions `Sys.Audit` and `Sys.Modify` on
`/` are permitted to use the api endpoints due to security reasons.
(it is possible to download files from internal networks which would
be not visible/accessible from outside)

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-07-03 00:36:26 +02:00
Thomas Lamprecht
ebea3f4507 ui: storage content: allow to specify extraColumns (again)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-24 23:34:25 +01:00
Dominik Csapak
ef402242d8 ui: change comment column to notes
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-24 13:47:07 +01:00
Thomas Lamprecht
c8a71b9e1f ui: storage content view: add clear trigger to search
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-16 10:09:05 +01:00
Thomas Lamprecht
1d8306e4ca ui: storage content view: eslint fixes and code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-16 09:58:04 +01:00
Thomas Lamprecht
6ecc74209f ui: reverse showColumns to hideColumns, default to hide comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-15 19:37:21 +01:00
Fabian Ebner
7ef0f4c36c content view: allow specifying which columns to show on init
depending on the content type, we might want to show different information, e.g.
parent for cloned VM/CT images, verification for backups, etc. Of course the
properties would have to be added to the model and the availableColumns first

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 19:02:21 +01:00
Fabian Ebner
f5e17f156a create ImageView and use it for VM and CT images
The enableFn's that were responsible for switching
between the image remove button and the standard remove button
are not needed anymore.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
1665b8402c create and use BackupView
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
13d7dfccee create and use TemplateView
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
8798c35bcd add upload button conditionally
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
dbeddeb322 turn {nodename, storage, sm} into object variables
so they can be used and specified in derived classes.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
9ce0c25857 content view: allow specifying title bar elements for init
in preparation to create derived classes.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
dc19fb838b remove the now unneccessary content type column
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
606b1d41ac remove the now unnecessary grouping by content type
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
e8b422bc77 use separate view for each content type
Organized as separate "if"s to allow changing properties easily later.

The StorageContentView now serves as a parent class, so the stateId
cannot be fixed there. Instead make each individual view stateful with a
unique stateId.

statusStore is not needed anymore, now there is a single fixed content type,
and the template and upload button are disabled depending on that type.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Fabian Ebner
c128543fd5 fix extension filter for upload window
so that it selects the correct filter for container templates

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-15 18:41:11 +01:00
Thomas Lamprecht
425e05d7ca ui: content/backup-view: move comment to second col, make flex
to make it more look like what we to in PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-12 18:34:38 +01:00
Dominik Csapak
957a53bd61 ui: add comment/verification columns to backup/content grid
verification column only shows in the backup grid and for
pbs storages

(renderer is mostly copied from proxmox-backup)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-12 18:14:53 +01:00
Fabian Ebner
8e262f397d ContentView: block removal of in-use container image
Since commit 5dae1a319b32ea3ebbb0b48a9f0b5e3abd1833c9 in pve-storage,
list_volumes correctly returns content type 'rootdir' for container images.
Adapt the relevant check here to make removal behave like it does
for VM images again.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-08-28 10:25:12 +02:00
Thomas Lamprecht
3bbce3b8cd drop jslint lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:11:47 +02:00
Dietmar Maurer
a4a86fe9b9 ui: ContentView: consider new ctime value
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-06 19:05:28 +01:00
Dietmar Maurer
3b8f599bca storage content GUI: improve detection of backup volumes
Include new proxmox backup server volumes.
2020-02-19 14:02:05 +01:00
Thomas Lamprecht
12d50fcd21 ui: add date column for backups in storage content view
main use case is to sort by date, e.g., I just re-created a cluster,
did some VM/CT backups on a NFS dump of mine which already had quite
some backups. Now, on restore I knew that only the backups made
yesterday were interesting, so a sort by date would allow me to find
them all easily, thus this patch was born.

Simple frontend extraction of information from the volid, for now
only for backups as there's the only case were we have the info at
all. Called the model entry "vdate" for "virtual date".

Mayb adding the creation date to all entries could be a nice addition
for the API someday.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-05 10:45:23 +01:00
Stefan Reiter
518a397487 Show supported file types in upload file selector
By default, all file types are shown, but the user now has the option of
filtering only by supported types in the file selector dialog.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Acked-by: Dominik Csapak <d.csapak@proxmox.com>
2019-09-03 07:08:47 +02:00
Dominic Jäger
4d23cdef16 Fix #582: Add default delay for backups
A default of 5 seems like a reasonable delay for removing backups from
the GUI.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2019-07-25 13:23:40 +02:00
Thomas Lamprecht
9cd612044a www: storage content view: fix typo in var name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 11:08:08 +02:00
Thomas Lamprecht
e7c0216d2e follouwp: reduce duplicate code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-07 13:30:50 +00:00
Tim Marx
abffa1a6dc ui: storage: handle empty response in case of file upload error
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-05-07 12:03:31 +00:00
Thomas Lamprecht
29acb9b58f fixup: s/Filter: /Search/ which is already translated
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 09:28:29 +01:00
Christian Ebner
f577bda029 Fix #1831: Add filter to CT template/appliances download window
This adds the posibility to filter CT template/appliances by package as well as
description in the CT template/appliances download window.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-01 09:03:00 +01:00
Thomas Lamprecht
9a25bf06b6 ui: storage/content: reference volid in confirm window and use new task description
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 13:27:34 +01:00
Thomas Lamprecht
f726b8da42 ui: storage/content: jslint and styling fixups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 13:26:56 +01:00
Wolfgang Link
4f19410bdd Add imageRemoveButton
If an image has a <vmid>  encoded in the image name
and the guest does not exist in the cluster
we can delete it on the GUI.

Also, if a config exists on another node and the storage is local
we can delete.

In all other cases, it is not allowed to delete it.

For safety reason the safe remove windows are used.
2018-11-22 11:57:19 +01:00
Wolfgang Link
c5e224fc73 Move removeButton in a variable
The move is necessary to hide the removeButton.
2018-11-22 08:50:32 +01:00
Thomas Lamprecht
56a353b9e7 use RestProxy from widget toolkit
Split PVE specific models, which where not moved to the general
widget toolkit, in a separate folder: data/models/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:38 +01:00
Thomas Lamprecht
9cb193cf8c use ObjectStore from widget toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:38 +01:00
Thomas Lamprecht
8cbc11a70c use TaskViewer & TaskProgress window from widget toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:38 +01:00
Dominik Csapak
e7ade592e3 use Proxmox.Utils instead of PVE.Utils
some function are now in Proxmox.Utils instead, so we have to use that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-25 13:36:38 +01:00
Dominik Csapak
5720fafabc use Button from widget toolkit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-25 13:36:37 +01:00