mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 13099: global settings page - when name is xennetworklabel/kvmnetworklabel/vmwarenetworklabel and value is null, show "Use default gateway" instead of null.
This commit is contained in:
parent
fad3c7eab4
commit
463d0f9ebb
@ -1,4 +1,11 @@
|
|||||||
(function(cloudStack) {
|
(function(cloudStack) {
|
||||||
|
|
||||||
|
var replaceNullValueWith = {
|
||||||
|
'xennetworklabel': 'Use default gateway',
|
||||||
|
'xennetworklabel': 'Use default gateway',
|
||||||
|
'xennetworklabel': 'Use default gateway'
|
||||||
|
};
|
||||||
|
|
||||||
cloudStack.sections['global-settings'] = {
|
cloudStack.sections['global-settings'] = {
|
||||||
title: 'Global Settings',
|
title: 'Global Settings',
|
||||||
id: 'global-settings',
|
id: 'global-settings',
|
||||||
@ -8,24 +15,29 @@
|
|||||||
edit: {
|
edit: {
|
||||||
label: 'Change value',
|
label: 'Change value',
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var name = args.data.jsonObj.name;
|
var name = args.context["global-settings"].name;
|
||||||
var value = args.data.value;
|
var value = args.data.value;
|
||||||
|
|
||||||
$.ajax({
|
if((name in replaceNullValueWith) && (value == replaceNullValueWith[name])) {
|
||||||
url: createURL(
|
args.response.success({data: args.context["global-settings"]});
|
||||||
'updateConfiguration&name=' + name + '&value=' + value
|
}
|
||||||
),
|
else {
|
||||||
dataType: 'json',
|
$.ajax({
|
||||||
async: true,
|
url: createURL(
|
||||||
success: function(json) {
|
'updateConfiguration&name=' + todb(name) + '&value=' + todb(value)
|
||||||
var item = json.updateconfigurationresponse.configuration;
|
),
|
||||||
cloudStack.dialog.notice({ message: 'Please restart your management server for your change to take effect.' });
|
dataType: 'json',
|
||||||
args.response.success({data: item});
|
async: true,
|
||||||
},
|
success: function(json) {
|
||||||
error: function(json) {
|
var item = json.updateconfigurationresponse.configuration;
|
||||||
args.response.error(parseXMLHttpResponse(json));
|
cloudStack.dialog.notice({ message: 'Please restart your management server for your change to take effect.' });
|
||||||
}
|
args.response.success({data: item});
|
||||||
});
|
},
|
||||||
|
error: function(json) {
|
||||||
|
args.response.error(parseXMLHttpResponse(json));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -50,7 +62,16 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var items = json.listconfigurationsresponse.configuration;
|
var configurationObjs = json.listconfigurationsresponse.configuration;
|
||||||
|
|
||||||
|
var items = [];
|
||||||
|
$(configurationObjs).each(function(){
|
||||||
|
if((this.name in replaceNullValueWith) && (this.value == null)) {
|
||||||
|
this.value = replaceNullValueWith[this.name];
|
||||||
|
}
|
||||||
|
items.push(this);
|
||||||
|
});
|
||||||
|
|
||||||
args.response.success({ data: items });
|
args.response.success({ data: items });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user