1 /* Copyright 2016-2017, Huawei Technologies Co., Ltd.
\r
3 * Licensed under the Apache License, Version 2.0 (the "License");
\r
4 * you may not use this file except in compliance with the License.
\r
5 * You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software
\r
10 * distributed under the License is distributed on an "AS IS" BASIS,
\r
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 * See the License for the specific language governing permissions and
\r
13 * limitations under the License.
\r
17 $('.siteDeleteImg').click(
\r
19 var data = $(this).parent().parent().parent().find('td:last').find(
\r
22 var jsonObj = JSON.parse(data);
\r
23 for (var i = 0; i < jsonObj.length; i++) {
\r
24 var obj = jsonObj[i];
\r
25 var rowData = [obj.tpName, obj.peName, obj.vlanId,
\r
26 obj.siteCidr, obj.ip];
\r
27 $('#underlayTpDataTable').DataTable();
\r
28 $('#underlayTpDataTable').dataTable().fnAddData(rowData);
\r
32 function deleteController(objectId) {
\r
33 var requestUrl = "/openoapi/extsys/v1/sdncontrollers/" + objectId;
\r
37 contentType: "application/json",
\r
38 success: function (jsonobj) {
\r
39 $('#controller').bootstrapTable('remove', {
\r
40 field: 'sdnControllerId',
\r
43 alert("Delete Controller successfull !!!");
\r
45 error: function (xhr, ajaxOptions, thrownError) {
\r
46 alert("Error on deleting controller : " + xhr.responseText);
\r
51 function loadControllerData() {
\r
52 var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
\r
56 contentType: "application/json",
\r
57 success: function (jsonobj) {
\r
58 $('#controller').bootstrapTable({
\r
62 error: function (xhr, ajaxOptions, thrownError) {
\r
63 alert("Error on getting controller data : " + xhr.responseText);
\r
69 $('.creat-btn').click(function () {
\r
70 $('#vmAppDialog').addClass('in').css({
\r
75 $('.close,.button-previous').click(function () {
\r
76 $('#vmAppDialog').removeClass('in').css('display', 'none');
\r
78 $('.detail-top ul li').click(function () {
\r
79 $(this).addClass('current').siblings().removeClass('current');
\r
81 $('.para').click(function () {
\r
82 if ($('#serviceTemplateName').val() == '') {
\r
83 alert('Please choose the service templet!');
\r
84 $('#flavorTab').css('display', 'none');
\r
86 $('#flavorTab').css('display', 'block');
\r
88 $('#basicTab').css('display', 'block');
\r
90 $('.basic').click(function () {
\r
91 $('#flavorTab').css('display', 'none');
\r
94 $('.table tbody tr').click(
\r
96 $(this).addClass('openoTable_row_selected').siblings()
\r
97 .removeClass('openoTable_row_selected');
\r
99 $('.table tr:odd').addClass('active');
\r
100 $('#false').click(function () {
\r
101 $('#vmAppDialog').addClass('in').css({
\r
105 $('.close,.button-previous').click(function () {
\r
106 $('#vmAppDialog').removeClass('in').css('display', 'none');
\r
108 $('#filterTpLogicalType').click(
\r
110 $('#filterTpLogicalType_select_popupcontainer').toggleClass(
\r
112 $('#filterTpLogicalType').toggleClass('openo-focus');
\r
113 var oLeft = $('#open_base_tpL_td6').offset().left;
\r
114 var oTop = $('#open_base_tpL_td6').offset().top;
\r
115 var oHeight = $('#open_base_tpL_td6').height();
\r
116 $('#filterTpLogicalType_select_popupcontainer').css({
\r
118 'top': oTop + oHeight + 10
\r
121 $('div.openo-select-popup-container>div.openo-select-item>label').click(
\r
123 var Lvalue = $(this).html();
\r
124 $('#filterTpLogicalType_select_input').attr('value', Lvalue);
\r
125 $('#filterTpLogicalType_select_popupcontainer').addClass(
\r
127 $('#filterTpLogicalType').removeClass('openo-focus');
\r
129 $.fn.serializeObject = function () {
\r
131 var a = this.serializeArray();
\r
132 $.each(a, function () {
\r
133 if (o[this.name] !== undefined) {
\r
134 if (!o[this.name].push) {
\r
135 o[this.name] = [o[this.name]];
\r
137 o[this.name].push(this.value || '');
\r
139 o[this.name] = this.value || '';
\r
145 $('#createController').click(function () {
\r
146 var formData = JSON.stringify($("#controllerForm").serializeObject());
\r
147 var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
\r
151 contentType: "application/json",
\r
154 success: function (jsonResp) {
\r
155 alert("Controller saved successfully!!!");
\r
156 $('#controller').bootstrapTable("append", jsonResp);
\r
157 $('#vmAppDialog').removeClass('in').css('display', 'none');
\r
160 error: function (xhr, ajaxOptions, thrownError) {
\r
161 alert("Error on page : " + xhr.responseText);
\r