From 4f51d21908a17d6b46ea0dfd1a3d5fa344a14dec Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 1 Aug 2013 15:35:33 -0700 Subject: [PATCH] CLOUDSTACK-3753: UI > Infrastructure > zone detail > physical network > guest > (1) remove Delete VLAN Range action. (2) change Add VLAN Range action to pass new VLAN range + exisitng VLAN range(s) to API. This is corresponding UI change to updatePhysicalNetwork API change that removevlan property has been removed and definition of vlan property has been changed. --- ui/scripts/system.js | 80 ++++---------------------------------------- 1 file changed, 6 insertions(+), 74 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 15352f32d0b..6453dacdbb4 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1151,11 +1151,13 @@ }, action: function(args) { - - var array1 = []; + var array1 = []; if (args.data.startvlan != "" && args.data.endvlan != "") { - array1.push("&vlan=" + todb(args.data.startvlan) + "-" + todb(args.data.endvlan)); - + var newVlanRange = todb(args.data.startvlan) + "-" + todb(args.data.endvlan); + if(selectedPhysicalNetworkObj.vlan == "") + array1.push("&vlan=" + newVlanRange); + else + array1.push("&vlan=" + selectedPhysicalNetworkObj.vlan + "," + newVlanRange); } $.ajax({ url: createURL("updatePhysicalNetwork&id=" + selectedPhysicalNetworkObj.id + array1.join("")), @@ -1168,85 +1170,15 @@ } }); }, - error: function(json) { args.response.error(parseXMLHttpResponse(json)); - } - }); - - }, notification: { poll: pollAsyncJobResult } - - - }, - - removeVlanRange: { - label: 'Remove VLAN Range', - messages: { - confirm: function(args) { - return 'Are you sure you want to remove an existing VLAN Range from this guest network?'; - }, - notification: function(args) { - return 'VLAN Range removed'; - } - }, - - createForm: { - title: 'Remove VLAN Range', - fields: { - startvlan: { - label: 'Vlan Start', - validation: { - required: true - } - }, - endvlan: { - label: 'Vlan End', - validation: { - required: true - } - } - } - - }, - - action: function(args) { - - var array1 = []; - if (args.data.startvlan != "" && args.data.endvlan != "") { - array1.push("&removevlan=" + args.data.startvlan + "-" + args.data.endvlan); - } - $.ajax({ - url: createURL("updatePhysicalNetwork&id=" + selectedPhysicalNetworkObj.id + array1.join("")), - dataType: "json", - success: function(json) { - var jobId = json.updatephysicalnetworkresponse.jobid; - args.response.success({ - _custom: { - jobId: jobId - } - }); - }, - - error: function(json) { - args.response.error(parseXMLHttpResponse(json)); - - } - - }); - - }, - notification: { - poll: pollAsyncJobResult - } - } - }, tabFilter: function(args) {