proxmox-backup/www/window/NotesEdit.js
Thomas Lamprecht c9725bb829 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>
2020-10-28 18:36:12 +01:00

39 lines
649 B
JavaScript

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,
},
});