mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-22 08:14:23 +00:00
node network: disable revert button if there are no changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
1cf31d6bac
commit
03e93db5d5
@ -48,6 +48,7 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
var reload = function() {
|
var reload = function() {
|
||||||
var changeitem = me.down('#changes');
|
var changeitem = me.down('#changes');
|
||||||
var apply_btn = me.down('#apply');
|
var apply_btn = me.down('#apply');
|
||||||
|
var revert_btn = me.down('#revert');
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: baseUrl,
|
url: baseUrl,
|
||||||
failure: function(response, opts) {
|
failure: function(response, opts) {
|
||||||
@ -64,10 +65,12 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
changes = gettext("No changes");
|
changes = gettext("No changes");
|
||||||
changeitem.setHidden(true);
|
changeitem.setHidden(true);
|
||||||
apply_btn.setDisabled(true);
|
apply_btn.setDisabled(true);
|
||||||
|
revert_btn.setDisabled(true);
|
||||||
} else {
|
} else {
|
||||||
changeitem.update("<pre>" + Ext.htmlEncode(changes) + "</pre>");
|
changeitem.update("<pre>" + Ext.htmlEncode(changes) + "</pre>");
|
||||||
changeitem.setHidden(false);
|
changeitem.setHidden(false);
|
||||||
apply_btn.setDisabled(false);
|
apply_btn.setDisabled(false);
|
||||||
|
revert_btn.setDisabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -282,6 +285,7 @@ Ext.define('Proxmox.node.NetworkView', {
|
|||||||
}, '-',
|
}, '-',
|
||||||
{
|
{
|
||||||
text: gettext('Revert'),
|
text: gettext('Revert'),
|
||||||
|
itemId: 'revert',
|
||||||
handler: function() {
|
handler: function() {
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: baseUrl,
|
url: baseUrl,
|
||||||
|
Loading…
Reference in New Issue
Block a user