mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - remove region action - removing the region that you are currently in is not allowed.
This commit is contained in:
parent
ae7e5b025e
commit
75a6e009b9
@ -70,7 +70,7 @@
|
|||||||
success: function(json) {
|
success: function(json) {
|
||||||
var item = json.addregionresponse.region;
|
var item = json.addregionresponse.region;
|
||||||
args.response.success({data: item});
|
args.response.success({data: item});
|
||||||
//$(window).trigger('cloudStack.refreshRegions');
|
$(window).trigger('cloudStack.refreshRegions');
|
||||||
},
|
},
|
||||||
error: function(json) {
|
error: function(json) {
|
||||||
args.response.error(parseXMLHttpResponse(json));
|
args.response.error(parseXMLHttpResponse(json));
|
||||||
@ -123,6 +123,14 @@
|
|||||||
messages: {
|
messages: {
|
||||||
notification: function() { return 'label.remove.region'; },
|
notification: function() { return 'label.remove.region'; },
|
||||||
confirm: function() { return 'message.remove.region'; }
|
confirm: function() { return 'message.remove.region'; }
|
||||||
|
},
|
||||||
|
preAction: function(args) {
|
||||||
|
var region = args.context.regions[0];
|
||||||
|
if(region.endpoint == document.location.href) {
|
||||||
|
cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var region = args.context.regions[0];
|
var region = args.context.regions[0];
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
$li.data('region-data', region);
|
$li.data('region-data', region);
|
||||||
|
|
||||||
if(document.location.href == region.endpoint) {
|
if(region.endpoint == document.location.href) {
|
||||||
currentRegion = region;
|
currentRegion = region;
|
||||||
$li.addClass('active');
|
$li.addClass('active');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user