ui: datastore: show comment, allow to edit notes
the "comment" is the first line of the "notes" field from a manifest, show it in the grid and allow editing the full notes. Hack the click event listener a bit together for the right aligned edit action button, but it works out well and is efficient (only one event listener is much cheaper than per-buttons ones). Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
38
www/window/NotesEdit.js
Normal file
38
www/window/NotesEdit.js
Normal file
@ -0,0 +1,38 @@
|
||||
Ext.define('PBS.window.NotesEdit', {
|
||||
extend: 'Proxmox.window.Edit',
|
||||
mixins: ['Proxmox.Mixin.CBind'],
|
||||
|
||||
title: gettext('Notes'),
|
||||
|
||||
width: 600,
|
||||
height: '400px',
|
||||
resizable: true,
|
||||
layout: 'fit',
|
||||
|
||||
autoLoad: true,
|
||||
|
||||
defaultButton: undefined,
|
||||
|
||||
notesFieldName: 'notes',
|
||||
|
||||
setValues: function(values) {
|
||||
let me = this;
|
||||
if (typeof values === "string") {
|
||||
let v = values;
|
||||
values = {};
|
||||
values[me.notesFieldName] = v;
|
||||
}
|
||||
me.callParent([values]);
|
||||
},
|
||||
|
||||
items: {
|
||||
xtype: 'textarea',
|
||||
name: 'notes',
|
||||
cbind: {
|
||||
name: '{notesFieldName}',
|
||||
},
|
||||
height: '100%',
|
||||
value: '',
|
||||
hideLabel: true,
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user