summaryrefslogtreecommitdiffstats
path: root/portal
diff options
context:
space:
mode:
Diffstat (limited to 'portal')
-rw-r--r--portal/src/main/webapp/extsys/ems/js/emsController.js4
-rw-r--r--portal/src/main/webapp/extsys/sdncontroller/js/sdncController.js113
-rw-r--r--portal/src/main/webapp/extsys/sdncontroller/sdncView.html25
-rw-r--r--portal/src/main/webapp/extsys/vim/js/vimController.js20
-rw-r--r--portal/src/main/webapp/extsys/vim/vimView.html10
5 files changed, 83 insertions, 89 deletions
diff --git a/portal/src/main/webapp/extsys/ems/js/emsController.js b/portal/src/main/webapp/extsys/ems/js/emsController.js
index 1e8ee2c..107131d 100644
--- a/portal/src/main/webapp/extsys/ems/js/emsController.js
+++ b/portal/src/main/webapp/extsys/ems/js/emsController.js
@@ -209,7 +209,7 @@ var vm = avalon.define({
commonUtil.showMessage($.i18n.prop("nfv-ems-iui-message-delete-fail"), "warning");
}
},
- error: function () {
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
commonUtil.showMessage($.i18n.prop("nfv-ems-iui-message-delete-fail"), "warning");
}
});
@@ -237,7 +237,6 @@ var vm = avalon.define({
},
postEMS: function () {
var emsSave = vm.getEMSSave();
- emsSave.emsId = Math.floor(Math.random() * 100000) / 100000;
var res = false;
$.ajax({
type: "POST",
@@ -249,6 +248,7 @@ var vm = avalon.define({
vm.server_rtn.info_block = false;
vm.server_rtn.warning_block = false;
if (jqXHR.status === 200) {
+ emsSave.emsId = data.id;
vm.emsInfo.push(emsSave);
vm.$emsList.push(emsSave);
res = true;
diff --git a/portal/src/main/webapp/extsys/sdncontroller/js/sdncController.js b/portal/src/main/webapp/extsys/sdncontroller/js/sdncController.js
index ef663b0..6c147ad 100644
--- a/portal/src/main/webapp/extsys/sdncontroller/js/sdncController.js
+++ b/portal/src/main/webapp/extsys/sdncontroller/js/sdncController.js
@@ -15,21 +15,20 @@
*/
var vm = avalon.define({
- $id: "emsController",
+ $id: "sdncController",
sdncList: [],
currentElement: {},
currentIndex: 0,
$sdncList: [],
$newElement: {
- "sdnControllerId":"a6c42529-cd6",
+ "thirdpartySdncId":"",
"name":"sdnc1",
- "status": "active",
"url":"",
+ "location":"edge",
"userName":"admin",
- "password":"admin",
+ "password":"",
"version":"v1.0",
"vendor":"ZTE",
- "description":"",
"protocol":"netconf",
"productName":"",
"type":"WAN"
@@ -56,12 +55,10 @@ var vm = avalon.define({
"url": /^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$/
},
$restUrl: {
- queryEmsInfoUrl: "/esrui/extsys/sdncontroller/mock-data/sdnc.json",//'/onapapi/aai/esr/v1/ems',
- addVnfmInfoUrl: '/onapapi/aai/esr/v1/ems',
- updateVnfmInfoUrl: '/onapapi/aai/esr/v1/ems/',
- delVnfmInfoUrl: '/onapapi/aai/esr/v1/ems/',
- queryMocUrl: '',
- queryVimUrl: '/onapapi/aai/esr/v1/vims'
+ queryEmsInfoUrl: "/api/aai-esr-server/v1/sdncontrollers",
+ addVnfmInfoUrl: '/api/aai-esr-server/v1/sdncontrollers',
+ updateVnfmInfoUrl: '/api/aai-esr-server/v1/sdncontrollers/{thirdpartySdncId}',
+ delVnfmInfoUrl: '/api/aai-esr-server/v1/sdncontrollers/{thirdpartySdncId}'
},
$htmlText: {
saveSuccess: $.i18n.prop("nfv-sdnc-iui-message-save-success"),
@@ -145,115 +142,115 @@ var vm = avalon.define({
delSDNC: function (id, index) {
bootbox.confirm($.i18n.prop("nfv-sdnc-iui-message-delete-confirm"), function (result) {
if (result) {
- vm.sdncList.splice(index, 1);
- vm.$sdncList.splice(index, 1);
- console.log(vm.sdncList[index]);
- /* $.ajax({
+ var sdncId = vm.sdncList[index]["thirdpartySdncId"];
+ var url = vm.$restUrl.delVnfmInfoUrl.replace("{thirdpartySdncId}", sdncId)
+ $.ajax({
type: "DELETE",
- url: vm.$restUrl.delVnfmInfoUrl + id,
+ url: url,
dataType: "json",
success: function (data, statusText, jqXHR) {
if (jqXHR.status == "204") {
-
+ vm.sdncList.splice(index, 1);
+ vm.$sdncList.splice(index, 1);
commonUtil.showMessage($.i18n.prop("nfv-sdnc-iui-message-delete-success"), "success");
} else {
commonUtil.showMessage($.i18n.prop("nfv-sdnc-iui-message-delete-fail"), "warning");
}
},
- error: function () {
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
commonUtil.showMessage($.i18n.prop("nfv-sdnc-iui-message-delete-fail"), "warning");
}
- });*/
+ });
}
});
},
postSDNC: function () {
- var emsSave = vm.getSDNCSave();
- emsSave.sdnControllerId = Math.floor(Math.random() * 100000) / 100000;
- vm.sdncList.push(emsSave);
- vm.$sdncList.push(emsSave);
- console.log(emsSave);
- return true;
- /*$.ajax({
+ var res = false;
+ var sdncSave = vm.getSDNCSave();
+ $.ajax({
type: "POST",
url: vm.$restUrl.addVnfmInfoUrl,
- data: JSON.stringify(vm.currentElement),
+ data: JSON.stringify(sdncSave),
dataType: "json",
contentType: "application/json",
- success: function (data) {
+ success: function (data, statusText, jqXHR) {
vm.server_rtn.info_block = false;
vm.server_rtn.warning_block = false;
- if (data) {
- vm.vnfmInfo = [];
- vm.$initTable();
-
+ if (jqXHR.status == "200") {
+ res = true;
+ sdncSave["thirdpartySdncId"] = data.id;
+ vm.sdncList.push(sdncSave);
+ vm.$sdncList.push(sdncSave);
$('#addEmsDlg').modal('hide');
commonUtil.showMessage(vm.$htmlText.saveSuccess, "success");
} else {
+ res = false;
vm.server_rtn.warning_block = true;
vm.server_rtn.rtn_info = vm.$htmlText.saveFail;
commonUtil.showMessage(vm.$htmlText.saveFail, "failed");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
+ res = false;
vm.server_rtn.warning_block = true;
vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
vm.server_rtn.info_block = false;
}
- });*/
+ });
+ return res;
},
putSDNC: function () {
- console.log(vm.getSDNCSave());
- vm.fillElement(vm.currentElement, vm.sdncList[vm.currentIndex]);
- return true;
- /* $.ajax({
+ var res = false;
+ var currentElement = vm.getSDNCSave();
+ var url = vm.$restUrl.updateVnfmInfoUrl.replace("{thirdpartySdncId}", currentElement["thirdpartySdncId"]);
+ $.ajax({
type: "PUT",
- url: vm.$restUrl.updateVnfmInfoUrl + vm.currentElement.emsId,
- data: JSON.stringify(vm.currentElement),
+ url: url,
+ data: JSON.stringify(currentElement),
dataType: "json",
contentType: "application/json",
- success: function (data) {
+ success: function (data, statusText, jqXHR) {
vm.server_rtn.info_block = false;
vm.server_rtn.warning_block = false;
- if (data) {
- for (var i = 0; i < vm.vnfmInfo.length; i++) {
- if (vm.vnfmInfo[i].vnfmId == vm.addVnfm.vnfmId) {
- vm.vnfmInfo[i].name = vm.addVnfm.name;
- vm.vnfmInfo[i].vimId = $("#vimId").val();
- vm.vnfmInfo[i].vendor = vm.addVnfm.vendor;
- vm.vnfmInfo[i].version = vm.addVnfm.version;
- vm.vnfmInfo[i].certificateUrl = vm.addVnfm.certificateUrl;
- vm.vnfmInfo[i].description = vm.addVnfm.description;
- vm.vnfmInfo[i].url = vm.addVnfm.url;
- vm.vnfmInfo[i].userName = vm.addVnfm.userName;
- vm.vnfmInfo[i].password = vm.addVnfm.password;
- }
- }
+ if (jqXHR.status == "200") {
+ res = true;
+ vm.fillElement(vm.currentElement, vm.sdncList[vm.currentIndex]);
$('#addEmsDlg').modal('hide');
commonUtil.showMessage(vm.$htmlText.updateSuccess, "success");
} else {
+ res = false;
vm.server_rtn.warning_block = true;
vm.server_rtn.rtn_info = vm.$htmlText.updateFail;
commonUtil.showMessage(vm.$htmlText.updateFail, "failed");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
+ res = false;
vm.server_rtn.warning_block = true;
vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
vm.server_rtn.info_block = false;
}
- });*/
+ });
+ return res;
+ },
+ sdncTypeChange: function (value) {
+ var $sdncLocation = $("#sdncLocation");
+ if("WAN" == value){
+ $sdncLocation.hide();
+ vm.currentElement.location = "";
+ } else {
+ $sdncLocation.show();
+ }
},
fillElement: function (sourceElement, targetElement) {
- targetElement["sdnControllerId"] = sourceElement["sdnControllerId"];
+ targetElement["thirdpartySdncId"] = sourceElement["thirdpartySdncId"];
targetElement["name"] = sourceElement["name"];
- targetElement["status"] = sourceElement["status"];
targetElement["url"] = sourceElement["url"];
+ targetElement["location"] = sourceElement["location"];
targetElement["userName"] = sourceElement["userName"];
targetElement["password"] = sourceElement["password"];
targetElement["version"] = sourceElement["version"];
targetElement["vendor"] = sourceElement["vendor"];
- targetElement["description"] = sourceElement["description"];
targetElement["protocol"] = sourceElement["protocol"];
targetElement["productName"] = sourceElement["productName"];
targetElement["type"] = sourceElement["type"];
diff --git a/portal/src/main/webapp/extsys/sdncontroller/sdncView.html b/portal/src/main/webapp/extsys/sdncontroller/sdncView.html
index 6bcb68f..f9f909d 100644
--- a/portal/src/main/webapp/extsys/sdncontroller/sdncView.html
+++ b/portal/src/main/webapp/extsys/sdncontroller/sdncView.html
@@ -29,7 +29,7 @@
<style> .ms-controller { visibility: hidden } </style>
</head>
<body>
-<div ms-controller="emsController" class="container-fluid ms-controller">
+<div ms-controller="sdncController" class="container-fluid ms-controller">
<div id="addEmsDlg" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
@@ -76,7 +76,7 @@
<span>Password</span>
</label>
<div class="col-sm-7">
- <input type="password" class="form-control" rows="3" ms-duplex="currentElement.password" name="password"/>
+ <input type="password" class="form-control" ms-duplex="currentElement.password" name="password"/>
<span class="help-block"></span>
</div>
</div>
@@ -85,7 +85,7 @@
<span>Version</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.version" name="version"/>
+ <input class="form-control" ms-duplex="currentElement.version" name="version"/>
<span class="help-block"></span>
</div>
</div>
@@ -94,7 +94,7 @@
<span>Vendor</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.vendor" name="vendor"/>
+ <input class="form-control" ms-duplex="currentElement.vendor" name="vendor"/>
<span class="help-block"></span>
</div>
</div>
@@ -103,7 +103,7 @@
<span>Protocol</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.protocol" name="protocol"/>
+ <input class="form-control" ms-duplex="currentElement.protocol" name="protocol"/>
<span class="help-block"></span>
</div>
</div>
@@ -112,7 +112,7 @@
<span>ProductName</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.productName" name="productName"/>
+ <input class="form-control" ms-duplex="currentElement.productName" name="productName"/>
<span class="help-block"></span>
</div>
</div>
@@ -121,17 +121,18 @@
<span>Type</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.type" name="type"/>
- <span class="help-block"></span>
+ <select class="form-control" ms-duplex="currentElement.type" name="type" ms-change="sdncTypeChange(this.value)">
+ <option value="WAN">WAN</option>
+ <option value="DC">DC</option>
+ </select>
</div>
</div>
- <div class="form-group">
+ <div class="form-group" ms-if="'DC' == currentElement.type" id="sdncLocation">
<label class="control-label col-sm-3">
- <span>Description</span>
+ <span>location</span>
</label>
<div class="col-sm-7">
- <input class="form-control" rows="3" ms-duplex="currentElement.description" name="description"/>
- <span class="help-block"></span>
+ <input class="form-control" ms-duplex="currentElement.location" name="location"/>
</div>
</div>
</form>
diff --git a/portal/src/main/webapp/extsys/vim/js/vimController.js b/portal/src/main/webapp/extsys/vim/js/vimController.js
index 2996e28..e9fd644 100644
--- a/portal/src/main/webapp/extsys/vim/js/vimController.js
+++ b/portal/src/main/webapp/extsys/vim/js/vimController.js
@@ -55,7 +55,7 @@ var vm = avalon
$queryVimInfoUrl: '/api/aai-esr-server/v1/vims',
$addVimInfoUrl: '/api/aai-esr-server/v1/vims',
$updateVimInfoUrl: '/api/aai-esr-server/v1/vims/{cloudOwner}/{cloudRegionId}',
- $delVimInfoUrl: '/api/aai-esr-server/v1/vims?cloudOwner={cloudOwner}&cloudRegionId={cloudRegionId}',
+ $delVimInfoUrl: '/api/aai-esr-server/v1/vims/{cloudOwner}/{cloudRegionId}',
$initTable: function () {
$.ajax({
"type": 'get',
@@ -192,19 +192,15 @@ var vm = avalon
delVim: function (index) {
bootbox.confirm($.i18n.prop('com_zte_ums_eco_roc_vim_confirm_delete_vim_record'), function (result) {
if (result) {
- var id = vm.vimInfo[index]["id"];
- vm.vimInfo.splice(index, 1);
- /* $.ajax({
+ var cloudOwner = vm.vimInfo[index]["cloudOwner"];
+ var cloudRegionId = vm.vimInfo[index]["cloudRegionId"];
+ var url = vm.$delVimInfoUrl.replace('{cloudOwner}', cloudOwner).replace('{cloudRegionId}', cloudRegionId);
+ $.ajax({
type: "DELETE",
- url: vm.$delVimInfoUrl.replace('{vim_id}', el.vimId),
+ url: url,
success: function (data, statusText, jqXHR) {
if (jqXHR.status == "204") {
- for (var i = 0; i < vm.vimInfo.length; i++) {
- if (el.vimId == vm.vimInfo[i].vimId) {
- vm.vimInfo.splice(i, 1);
- break;
- }
- }
+ vm.vimInfo.splice(index, 1);
resUtil.growl($.i18n.prop('com_zte_ums_eco_roc_vim_growl_msg_title') + $.i18n.prop('com_zte_ums_eco_roc_vim_growl_msg_remove_success'), "success");
}
else {
@@ -214,7 +210,7 @@ var vm = avalon
error: function (XMLHttpRequest, textStatus, errorThrown) {
resUtil.growl($.i18n.prop('com_zte_ums_eco_roc_vim_growl_msg_title') + errorThrown, "danger");
}
- });*/
+ });
}
});
},
diff --git a/portal/src/main/webapp/extsys/vim/vimView.html b/portal/src/main/webapp/extsys/vim/vimView.html
index 8be2a4a..923ddf7 100644
--- a/portal/src/main/webapp/extsys/vim/vimView.html
+++ b/portal/src/main/webapp/extsys/vim/vimView.html
@@ -230,15 +230,15 @@
<i class="fa fa-cloud fa-5x color_cloud"></i>
</div>
<div class="m-t-xl">
- <h3 class="md-text-overflow" ms-title="'cloudOwner:' + el['cloudOwner']" ms-text="'cloudOwner:' + el['cloudOwner']"></h3>
- <h3 class="md-text-overflow" ms-title="'cloudRegionId:' + el['cloudRegionId']" ms-text="'cloudRegionId:' + el['cloudRegionId']"></h3>
+ <h3 class="md-text-overflow" ms-attr-title="'cloudOwner:' + el['cloudOwner']" ms-text="'cloudOwner:' + el['cloudOwner']"></h3>
+ <h3 class="md-text-overflow" ms-attr-title="'cloudRegionId:' + el['cloudRegionId']" ms-text="'cloudRegionId:' + el['cloudRegionId']"></h3>
<div class="font">
<span id_i18n="com_zte_ums_eco_roc_vim_display_type"name_i18n="com_zte_conductor_ui_i18n"></span>
- <span class="md-text-overflow" ms-title="el['cloudType']" ms-text="el['cloudType']"></span>
+ <span class="md-text-overflow" ms-attr-title="el['cloudType']" ms-text="el['cloudType']"></span>
</div>
<div class="font">
<span id_i18n="com_zte_ums_eco_roc_vim_display_version"name_i18n="com_zte_conductor_ui_i18n"></span>
- <span class="md-text-overflow" ms-title="el['cloudRegionVersion']" ms-text="el['cloudRegionVersion']"></span>
+ <span class="md-text-overflow" ms-attr-title="el['cloudRegionVersion']" ms-text="el['cloudRegionVersion']"></span>
</div>
</div>
</div>
@@ -246,7 +246,7 @@
<div class="pull-right">
<a class="btn btn-default btn-sm" ms-click="$showVimTable($index, 'update')"><i
class="fa fa-pencil-square-o fa-lg"></i></a>
- <a class="btn btn-default btn-sm" disabled="disabled" ms-click="delVim($index)"><i class="fa fa-trash-o fa-lg"> </i></a>
+ <a class="btn btn-default btn-sm" ms-click="delVim($index)"><i class="fa fa-trash-o fa-lg"> </i></a>
<!--<a class="btn btn-default btn-sm" ms-click="gotoChartPage(el.oid,el.name,el.user)"><i class="fa fa-pie-chart fa-lg"> </i></a>-->
</div>
</div>