aboutsummaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-extsys
diff options
context:
space:
mode:
authorsunqi310 <sun.qi310@zte.com.cn>2016-09-30 10:56:25 +0800
committersunqi310 <sun.qi310@zte.com.cn>2016-09-30 10:56:25 +0800
commitf914a52cb02c45313099672a090a748dde6eceed (patch)
treed29b7816e4fb3511daac402b93ed670d9d1c83dc /openo-portal/portal-extsys
parente9aa067594c8cd91c11da2a18a6a2bd7c0f464db (diff)
Modify the UI of Vim and vnfm manager
Change-Id: I80ba1645a45775e10bb62840b532eea988904cee Signed-off-by: sunqi310 <sun.qi310@zte.com.cn>
Diffstat (limited to 'openo-portal/portal-extsys')
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vim/js/vimController.js37
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vim/vimView.html34
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-en-US.properties1
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-zh-CN.properties1
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmController.js15
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmUtil.js1
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/vnfmView.html2
7 files changed, 60 insertions, 31 deletions
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vim/js/vimController.js b/openo-portal/portal-extsys/src/main/webapp/extsys/vim/js/vimController.js
index 06479d49..96e23a0d 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vim/js/vimController.js
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vim/js/vimController.js
@@ -87,6 +87,8 @@ var vm = avalon
vimId: "",
vimName: "",
domain: '',
+ domainVisable:true,
+ vimNameModify:false,
userName: "",
tenant: "",
password: "",
@@ -102,10 +104,12 @@ var vm = avalon
if (vm.action.ADD == action) {
vm.addVim.vimId = "";
vm.addVim.vimName = "";
+ vm.addVim.vimNameModify=false;
vm.addVim.userName = "";
vm.addVim.password = "";
vm.addVim.url = "";
vm.addVim.domain = "";
+ vm.addVim.domainVisable = true;
vm.addVim.description = "";
vm.addVim.tenant = "";
vm.addVim.vendor = "";
@@ -116,12 +120,14 @@ var vm = avalon
} else {
vm.addVim.vimId = el.vimId;
vm.addVim.vimName = el.name;
+ vm.addVim.vimNameModify=true;
vm.addVim.url = el.url;
vm.addVim.description = el.description;
vm.addVim.userName = el.userName;
vm.addVim.password = el.password;
vm.addVim.tenant = el.tenant;
vm.addVim.domain = el.domain;
+ vm.addVim.domainVisable=vm.$getdomainVisable(el.type);
vm.addVim.saveType = "update";
vm.addVim.titleName = $.i18n.prop('com_zte_ums_eco_roc_vim_modify_info');
vm.addVim.vimType = el.type;
@@ -148,16 +154,14 @@ var vm = avalon
}
vm.executeWait.visible = true;
vm.executeError.visible = false;
- if (vm.addVim.saveType == "add") {
- /*
- for( var i = 0; i < vm.vimInfo.length; i ++ ){
- if(vm.addVim.url == vm.vimInfo[i].url){
- resUtil.growl($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_title") + 'already exists',"info");
- $('#addVimDlg').modal('hide');
- return;
- }
- }
- */
+ if (vm.addVim.saveType == "add") {
+ for( var i = 0; i < vm.vimInfo.length; i ++ ){
+ if(vm.addVim.name == vm.vimInfo[i].name){
+ resUtil.growl($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_title") + ' already exists',"info");
+ $('#addVimDlg').modal('hide');
+ return;
+ }
+ }
vm.persistVim();
} else if (vm.addVim.saveType == "update") {
vm.updateVim();
@@ -292,7 +296,20 @@ var vm = avalon
},
gotoChartPage: function (oid, name, tenant) {
window.location.href = "vimChart.html?" + oid + "&" + name + "&" + tenant;
+ },
+ $getdomainVisable:function(vimType){
+ if ("openstack"==vimType){
+ return true;
+ }else{
+ return false;
+ }
+
+ },
+ vimTypeRendered:function(){
+ vm.addVim.domainVisable=vm.$getdomainVisable(vm.addVim.vimType);
}
+
+
});
avalon.scan();
vm.$initTable();
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vim/vimView.html b/openo-portal/portal-extsys/src/main/webapp/extsys/vim/vimView.html
index 726883ff..28518381 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vim/vimView.html
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vim/vimView.html
@@ -63,7 +63,21 @@
<span class="required" aria-required="true">*</span>
</label>
<div class="col-sm-7">
- <input type="text" ms-duplex="addVim.vimName" name="vimName" class="form-control"/>
+ <input type="text" ms-duplex="addVim.vimName" name="vimName" class="form-control" ms-readonly="addVim.vimNameReadonly"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span id_i18n="com_zte_ums_eco_roc_vim_type"
+ name_i18n="com_zte_conductor_ui_i18n"></span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <select id="vimTypeSelect" ms-each="$vimType.selectItems"
+ ms-duplex="addVim.vimType" data-duplex-changed="vimTypeRendered">
+ <option ms-attr-value='el.cond_value'>{{el.name}}</option>
+ </select>
<span class="help-block"></span>
</div>
</div>
@@ -138,7 +152,7 @@
<span class="help-block"></span>
</div>
</div>
- <div class="form-group">
+ <div class="form-group" ms-visible="addVim.domainVisable">
<label class="control-label col-sm-3">
<span id_i18n="com_zte_ums_eco_roc_vim_domain"
name_i18n="com_zte_conductor_ui_i18n"></span>
@@ -147,21 +161,7 @@
<input type="text" ms-duplex="addVim.domain" name="domain" class="form-control"/>
<span class="help-block"></span>
</div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id_i18n="com_zte_ums_eco_roc_vim_type"
- name_i18n="com_zte_conductor_ui_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vimTypeSelect" ms-each="$vimType.selectItems"
- ms-duplex="addVim.vimType">
- <option ms-attr-value='el.cond_value'>{{el.name}}</option>
- </select>
- <span class="help-block"></span>
- </div>
- </div>
+ </div>
<div class="form-group">
<label class="control-label col-sm-3">
<span id_i18n="com_zte_ums_eco_roc_vim_description"
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-en-US.properties b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-en-US.properties
index 4690e7c3..a53d1bd9 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-en-US.properties
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-en-US.properties
@@ -20,6 +20,7 @@ nfv-vnfm-iui-message-title=vnfm info
nfv-vnfm-iui-message-query-fail=Query vnfm failed.
nfv-vnfm-iui-message-save-success=Save successfully.
nfv-vnfm-iui-message-save-fail=Save failed.
+nfv-vnfm-iui-message-vnfm-already-exists=vnfm already exists.
nfv-vnfm-iui-message-update-success=Update successfully.
nfv-vnfm-iui-message-update-fail=Update failed.
nfv-vnfm-iui-message-delete-confirm=Do you want to delete the current vnfm?
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-zh-CN.properties b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-zh-CN.properties
index 29bfa7f8..8384a0b3 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-zh-CN.properties
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/i18n/nfv-nso-iui-i18n-zh-CN.properties
@@ -20,6 +20,7 @@ nfv-vnfm-iui-message-title=vnfm信息
nfv-vnfm-iui-message-query-fail=查询vnfm失败。
nfv-vnfm-iui-message-save-success=保存成功。
nfv-vnfm-iui-message-save-fail=保存失败。
+nfv-vnfm-iui-message-vnfm-already-exists=vnfm 已经存在
nfv-vnfm-iui-message-update-success=修改成功。
nfv-vnfm-iui-message-update-fail=修改失败。
nfv-vnfm-iui-message-delete-confirm=确定删除所选vnfm信息?
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmController.js b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmController.js
index 0fc15bf3..ed5d74f8 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmController.js
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmController.js
@@ -42,6 +42,7 @@ var vm = avalon
$htmlText: {
saveSuccess: $.i18n.prop("nfv-vnfm-iui-message-save-success"),
saveFail: $.i18n.prop("nfv-vnfm-iui-message-save-fail"),
+ alreadyExist: $.i18n.prop("nfv-vnfm-iui-message-vnfm-already-exists"),
updateSuccess: $.i18n.prop("nfv-vnfm-iui-message-update-success"),
updateFail: $.i18n.prop("nfv-vnfm-iui-message-update-fail")
},
@@ -99,7 +100,7 @@ var vm = avalon
name: "",
type: "",
//moc : "",
- //mocDisabled : false,
+ nameReadonly : false,
vimId: "",
//vimVisiable : false,
vendor: "",
@@ -119,7 +120,7 @@ var vm = avalon
vm.addVnfm.name = "";
vm.addVnfm.type = "";
//vm.addVnfm.moc = "";
- //vm.addVnfm.mocDisabled = false;
+ vm.addVnfm.nameReadonly = false;
vm.addVnfm.vimId = "";
//vm.addVnfm.vimVisiable = false;
vm.addVnfm.vendor = "";
@@ -177,7 +178,15 @@ var vm = avalon
password: vm.addVnfm.password
}
//save VIM info
- if (vm.addVnfm.saveType == "add") {
+ if (vm.addVnfm.saveType == "add") {
+ // for( var i = 0; i < vm.vnfmInfo.length; i ++ ){
+ // if(vm.addVnfm.name == vm.vnfmInfo[i].name){
+ // vm.server_rtn.warning_block = true;
+ // vm.server_rtn.rtn_info = vm.$htmlText.alreadyExist;
+ // commonUtil.showMessage(vm.$htmlText.alreadyExist, "failed");
+ // return;
+ // }
+ // }
$.ajax({
type: "POST",
url: vm.$restUrl.addVnfmInfoUrl,
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmUtil.js b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmUtil.js
index 2e5b5c6f..3438717b 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmUtil.js
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/js/vnfmUtil.js
@@ -55,6 +55,7 @@ vnfmUtil.updateVnfm = function (data) {
vm.addVnfm.type = data.type;
vm.addVnfm.vimId = data.vimId;
vm.addVnfm.url = data.url;
+ vm.addVnfm.nameReadonly=true;
vm.addVnfm.userName = data.userName;
vm.addVnfm.password = data.password;
vm.addVnfm.saveType = "update";
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/vnfmView.html b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/vnfmView.html
index a4bd1d7e..0f034d78 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/vnfmView.html
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/vnfm/vnfmView.html
@@ -56,7 +56,7 @@
<span class="required" aria-required="true">*</span>
</label>
<div class="col-sm-7">
- <input type="text" ms-duplex="addVnfm.name" name="name" class="form-control"/>
+ <input type="text" ms-duplex="addVnfm.name" name="name" class="form-control" ms-readonly="addVnfm.nameReadonly"/>
<span class="help-block"></span>
</div>
</div>