Network section: IP address action updates

Prompt user to close details/refresh list view after these actions are
performed:

-Enable static NAT
-Disable static NAT

Always do a full refresh after releasing an IP.
This commit is contained in:
bfederle 2012-01-25 13:58:25 -08:00
parent 55b4cfc82a
commit 4efd42cac1
1 changed files with 20 additions and 6 deletions

View File

@ -1,4 +1,18 @@
(function(cloudStack, $, testData) {
var ipChangeNotice = function() {
cloudStack.dialog.confirm({
message: 'Your IP addresses may have changed; would you like to refresh the listing? Note that in this case the details pane will close.',
action: function() {
$('#browser .container').cloudBrowser('selectPanel', {
panel: $('#browser .panel:last').prev(),
complete: function() {
$(window).trigger('cloudStack.fullRefresh');
}
});
}
});
};
var actionFilters = {
ipAddress: function(args) {
var allowedActions = args.context.actions;
@ -1088,12 +1102,10 @@
args.complete({
data: {
isstaticnat: true
}
},
});
setTimeout(function() {
$(window).trigger('cloudStack.fullRefresh');
}, 500);
ipChangeNotice();
}
}
},
@ -1122,7 +1134,7 @@
return ['enableStaticNAT'];
};
},
fullRefreshAfterComplete: true
onComplete: ipChangeNotice
}
});
},
@ -1169,7 +1181,9 @@
state: 'Released'
};
},
fullRefreshAfterComplete: true
onComplete: function() {
$(window).trigger('cloudStack.fullRefresh');
}
}
});
},