ui: support create removable datastore through directory creation

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer 2024-11-25 17:22:11 +01:00 committed by Thomas Lamprecht
parent 42e3b2f12a
commit c8835f5882
3 changed files with 29 additions and 0 deletions

View File

@ -150,6 +150,8 @@ pub fn list_datastore_mounts() -> Result<Vec<DatastoreMountInfo>, Error> {
"removable-datastore": {
description: "The added datastore is removable.",
type: bool,
optional: true,
default: false,
},
filesystem: {
type: FileSystemType,

View File

@ -121,6 +121,19 @@ Ext.define('PBS.admin.Directorylist', {
],
columns: [
{
text: '<span class="fa fa-plug"/>',
flex: 0,
width: 35,
dataIndex: 'removable',
renderer: function(_text, _, row) {
if (row.data.removable) {
return `<i class="fa fa-check"/>`;
} else {
return '';
}
},
},
{
text: gettext('Path'),
dataIndex: 'path',

View File

@ -43,6 +43,20 @@ Ext.define('PBS.window.CreateDirectory', {
name: 'add-datastore',
fieldLabel: gettext('Add as Datastore'),
value: '1',
listeners: {
change(field, newValue, _oldValue) {
let form = field.up('form');
let rmBox = form.down('[name=removable-datastore]');
rmBox.setDisabled(!newValue);
rmBox.setValue(false);
},
},
},
{
xtype: 'proxmoxcheckbox',
name: 'removable-datastore',
fieldLabel: gettext('is removable'),
},
],
});