NetworkView: conditionally view pending changes

This commit is contained in:
Dietmar Maurer 2017-03-07 17:29:12 +01:00
parent ab29b73d6b
commit 89f5745205

View File

@ -45,6 +45,7 @@ Ext.define('Proxmox.node.NetworkView', {
failure: function(response, opts) { failure: function(response, opts) {
changeitem.update(gettext('Error') + ': ' + response.htmlStatus); changeitem.update(gettext('Error') + ': ' + response.htmlStatus);
store.loadData({}); store.loadData({});
changeitem.setHidden(true);
}, },
success: function(response, opts) { success: function(response, opts) {
var result = Ext.decode(response.responseText); var result = Ext.decode(response.responseText);
@ -52,8 +53,11 @@ Ext.define('Proxmox.node.NetworkView', {
var changes = result.changes; var changes = result.changes;
if (changes === undefined || changes === '') { if (changes === undefined || changes === '') {
changes = gettext("No changes"); changes = gettext("No changes");
changeitem.setHidden(true);
} else {
changeitem.update("<pre>" + Ext.htmlEncode(changes) + "</pre>");
changeitem.setHidden(false);
} }
changeitem.update("<pre>" + Ext.htmlEncode(changes) + "</pre>");
} }
}); });
}; };
@ -326,6 +330,7 @@ Ext.define('Proxmox.node.NetworkView', {
border: false, border: false,
region: 'south', region: 'south',
autoScroll: true, autoScroll: true,
hidden: true,
itemId: 'changes', itemId: 'changes',
tbar: [ tbar: [
gettext('Pending changes') + ' (' + gettext('Pending changes') + ' (' +