mirror of https://github.com/apache/cloudstack.git
BUG-ID: CLOUDSTACK-6162: UI > zone > physical network > service provider > add OVS.
Reviewed-by: Brian
This commit is contained in:
parent
94257c0fc8
commit
82121a2149
|
|
@ -192,6 +192,16 @@
|
|||
return allowedActions;
|
||||
};
|
||||
|
||||
function ovsProviderActionFilter(args) {
|
||||
var allowedActions = [];
|
||||
var jsonObj = args.context.item; //args.context.item == nspMap["virtualRouter"]
|
||||
if (jsonObj.state == "Enabled")
|
||||
allowedActions.push("disable");
|
||||
else if (jsonObj.state == "Disabled")
|
||||
allowedActions.push("enable");
|
||||
return allowedActions;
|
||||
};
|
||||
|
||||
cloudStack.sections.system = {
|
||||
title: 'label.menu.infrastructure',
|
||||
id: 'system',
|
||||
|
|
@ -3858,6 +3868,120 @@
|
|||
}
|
||||
},
|
||||
|
||||
OVS: {
|
||||
id: "OVS",
|
||||
label: "OVS",
|
||||
isMaximized: true,
|
||||
type: 'detailView',
|
||||
fields: {
|
||||
name: {
|
||||
label: 'label.name'
|
||||
},
|
||||
state: {
|
||||
label: 'label.status',
|
||||
indicator: {
|
||||
'Enabled': 'on'
|
||||
}
|
||||
}
|
||||
},
|
||||
tabs: {
|
||||
network: {
|
||||
title: 'label.network',
|
||||
fields: [{
|
||||
name: {
|
||||
label: 'label.name'
|
||||
}
|
||||
}, {
|
||||
state: {
|
||||
label: 'label.state'
|
||||
},
|
||||
supportedServices: {
|
||||
label: 'label.supported.services'
|
||||
},
|
||||
id: {
|
||||
label: 'label.id'
|
||||
},
|
||||
physicalnetworkid: {
|
||||
label: 'label.physical.network.ID'
|
||||
}
|
||||
}],
|
||||
dataProvider: function(args) {
|
||||
refreshNspData("OVS");
|
||||
args.response.success({
|
||||
actionFilter: ovsProviderActionFilter,
|
||||
data: $.extend(nspMap["OVS"], {
|
||||
supportedServices: nspMap["OVS"] == undefined? "": nspMap["OVS"].servicelist.join(', ')
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
enable: {
|
||||
label: 'label.enable.provider',
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Enabled"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
return 'message.confirm.enable.provider';
|
||||
},
|
||||
notification: function() {
|
||||
return 'label.enable.provider';
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
disable: {
|
||||
label: 'label.disable.provider',
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Disabled"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
return 'message.confirm.disable.provider';
|
||||
},
|
||||
notification: function() {
|
||||
return 'label.disable.provider';
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// NetScaler provider detail view
|
||||
netscaler: {
|
||||
type: 'detailView',
|
||||
|
|
@ -17999,6 +18123,9 @@
|
|||
case "VpcVirtualRouter":
|
||||
nspMap["vpcVirtualRouter"] = items[i];
|
||||
break;
|
||||
case "OVS":
|
||||
nspMap["OVS"] = items[i];
|
||||
break;
|
||||
case "Netscaler":
|
||||
nspMap["netscaler"] = items[i];
|
||||
break;
|
||||
|
|
@ -18107,6 +18234,12 @@
|
|||
state: nspMap.pa ? nspMap.pa.state : 'Disabled'
|
||||
});
|
||||
}
|
||||
|
||||
nspHardcodingArray.push({
|
||||
id: 'OVS',
|
||||
name: 'OVS',
|
||||
state: nspMap.OVS ? nspMap.OVS.state : 'Disabled'
|
||||
});
|
||||
};
|
||||
|
||||
cloudStack.actionFilter.physicalNetwork = function(args) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue