[pve-devel] [PATCH manager v2 2/3] ui: add ability to show and edit comments for backups
Dominik Csapak
d.csapak at proxmox.com
Tue Nov 24 10:09:35 CET 2020
for now we filter out pbs storages
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/grid/BackupView.js | 51 ++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js
index 191b2e3f..d43f5a3f 100644
--- a/www/manager6/grid/BackupView.js
+++ b/www/manager6/grid/BackupView.js
@@ -227,7 +227,56 @@ Ext.define('PVE.grid.BackupView', {
selModel: sm,
tbar: {
overflowHandler: 'scroller',
- items: [ backup_btn, restore_btn, delete_btn,config_btn, '->', storagesel, '-', vmidfilterCB, storagefilter ],
+ items: [
+ backup_btn,
+ restore_btn,
+ delete_btn,
+ config_btn,
+ {
+ xtype: 'proxmoxButton',
+ text: gettext('Edit Notes'),
+ disabled: true,
+ enableFn: function() {
+ let storageVal = storagesel.getValue();
+ let storage = storagesel.getStore().findRecord('storage', storageVal);
+ if (storage) {
+ return storage.data.type !== 'pbs';
+ }
+ return true;
+ },
+ handler: function() {
+ let volid = sm.getSelection()[0].data.volid;
+ var storage = storagesel.getValue();
+ Ext.create('Proxmox.window.Edit', {
+ autoLoad: true,
+ width: 600,
+ height: 400,
+ resizable: true,
+ title: gettext('Comment'),
+ url: `/api2/extjs/nodes/${nodename}/storage/${storage}/content/${volid}`,
+ layout: 'fit',
+ items: [
+ {
+ xtype: 'textarea',
+ layout: 'fit',
+ name: 'notes',
+ height: '100%',
+ },
+ ],
+ listeners: {
+ destroy: function() {
+ reload();
+ },
+ },
+ }).show();
+ },
+ },
+ '->',
+ storagesel,
+ '-',
+ vmidfilterCB,
+ storagefilter
+ ],
},
columns: [
{
--
2.20.1
More information about the pve-devel
mailing list