mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-03 18:36:15 +00:00
ui: support create removable datastore through directory creation
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
42e3b2f12a
commit
c8835f5882
@ -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,
|
||||
|
@ -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',
|
||||
|
@ -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'),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user