summaryrefslogtreecommitdiffstats
path: root/esr/src
diff options
context:
space:
mode:
authorqin.liang(10184303) <qin.liang13@zte.com.cn>2017-08-17 19:17:52 +0800
committerqin.liang(10184303) <qin.liang13@zte.com.cn>2017-08-17 19:24:57 +0800
commit88c9e674d224e7f3ab4a01ab3d812e9e0137b074 (patch)
treed28da2953e65f172a43e7c7f56424774b132e34f /esr/src
parent3f57340962a164496d1c6611dc179c813299fb12 (diff)
AAI-65 Realize the EMS register portal
Change-Id: I8e7e7db97f46ee99ec05832882a90701f2f02551 Issue-ID: AAI-65 Signed-off-by: qin.liang(10184303) <qin.liang13@zte.com.cn>
Diffstat (limited to 'esr/src')
-rw-r--r--esr/src/main/webapp/extsys/ems/css/ems.css81
-rw-r--r--esr/src/main/webapp/extsys/ems/emsView.html390
-rw-r--r--esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-en-US.properties74
-rw-r--r--esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-zh-CN.properties75
-rw-r--r--esr/src/main/webapp/extsys/ems/js/ems-validate.js12
-rw-r--r--esr/src/main/webapp/extsys/ems/js/emsController.js424
-rw-r--r--esr/src/main/webapp/extsys/ems/js/emsUtil.js78
-rw-r--r--esr/src/main/webapp/extsys/ems/js/loadi18n_nsoc.js2
-rw-r--r--esr/src/main/webapp/extsys/ems/mock-data/ems.json66
9 files changed, 721 insertions, 481 deletions
diff --git a/esr/src/main/webapp/extsys/ems/css/ems.css b/esr/src/main/webapp/extsys/ems/css/ems.css
index 9dd1e5f..6838e7e 100644
--- a/esr/src/main/webapp/extsys/ems/css/ems.css
+++ b/esr/src/main/webapp/extsys/ems/css/ems.css
@@ -311,12 +311,10 @@ input[name="daterange"] {
}
td.details-control {
- background: url('../images/details_open.png') no-repeat center center;
cursor: pointer;
}
tr.shown td.details-control {
- background: url('../images/details_close.png') no-repeat center center;
}
.details table td {
@@ -403,10 +401,10 @@ input.pagination-panel-input {
animation-duration: .5s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
+ -webkit-animation-delay: 0.1s;
}
.hpanel {
- background-color: none;
border: none;
box-shadow: none;
margin-bottom: 25px;
@@ -421,13 +419,15 @@ input.pagination-panel-input {
}
.h-200 {
- min-height: 220px;
+ min-height: 120px;
}
.m-t-xl {
margin-top: 40px;
}
-
+.card-name{
+ text-align: center;
+}
.m-t-xl div {
margin-bottom: 15px;
}
@@ -476,11 +476,78 @@ h3 {
font-weight: 600;
margin-bottom: 15px;
}
-
.hpanel_show {
background-color: #f7f9fa;
}
-
.vnfm-padding {
padding-left: 0;
+}
+.step-content{
+ margin-top: 20px;
+}
+.px-ui-steps{
+ height: 36px;
+}
+.px-ui-horizon-ul-horizon{
+ display: flex;
+ box-orient: horizontal;
+ margin: 0;
+ padding: 0;
+}
+.px-ui-steps-li{
+ list-style: none;
+ position: relative;
+ width: 386px;
+ height: 24px;
+ line-height: 24px;
+ float: left;
+ margin-right: 0;
+}
+.px-ui-menuitem-div-passive{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ min-width: 120px;
+ -webkit-transform: translate(-50%,-50%);
+ -moz-transform: translate(-50%,-50%);
+ -ms-transform: translate(-50%,-50%);
+ -o-transform: translate(-50%,-50%);
+ transform: translate(-50%,-50%);
+}
+.step-active div:first-child span:last-child{
+ color: #4d5761;
+}
+.step-active div:last-child, .step-active div:first-child span:first-child{
+ background: #33bcff;
+}
+.px-ui-steps-number-passive{
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ display: inline-block;
+ margin-right: 10px;
+ float: left;
+ color: #fff;
+ text-align: center;
+ background: #ddd;
+}
+.px-ui-steps-title-passive{
+ white-space: nowrap;
+}
+.px-ui-steps-title-active{
+ color: #4d5761;
+}
+.px-ui-steps-title-passive{
+ color: #7c868d;
+}
+
+.px-ui-underline-passive{
+ width: 100%;
+ height: 2px;
+ margin-top: 35px;
+ position: absolute;
+ background: #ddd;
+}
+#btnPreStep, #btnSave{
+ display: none;
} \ No newline at end of file
diff --git a/esr/src/main/webapp/extsys/ems/emsView.html b/esr/src/main/webapp/extsys/ems/emsView.html
index 3e5216a..56a364e 100644
--- a/esr/src/main/webapp/extsys/ems/emsView.html
+++ b/esr/src/main/webapp/extsys/ems/emsView.html
@@ -23,145 +23,256 @@
<link href="../../thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link href="../../thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<link href="../../thirdparty/uniform/css/uniform.default.min.css" rel="stylesheet"/>
- <link href="../../thirdparty/css/ZteIctIcons/style.css" rel="stylesheet"/>
<link href="../../thirdparty/css/ngict-component.css" rel="stylesheet"/>
<link href="css/animate.min.css" rel="stylesheet"/>
<link href="css/ems.css" rel="stylesheet"/>
- <style>
- .ms-controller {
- visibility: hidden
- }
- </style>
-
+ <style> .ms-controller { visibility: hidden } </style>
</head>
<body>
<div ms-controller="emsController" class="container-fluid ms-controller">
- <div id="addEmsDlg" class="modal fade" tabindex="-1" role="dialog"
- aria-labelledby="myModalLabel" aria-hidden="true">
+ <div id="addEmsDlg" class="modal fade" tabindex="-1" role="dialog"
+ aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content Changepasswd">
<div class="content">
<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"
- aria-hidden="true">×
- </button>
- <h4 id="myModalLabel">{{addEms.title}}</h4>
+ <h4 id="myModalLabel">{{modalTitle}}</h4>
</div>
<div class="modal-body">
- <form class="form-horizontal" id="ems_form" role="form">
- <input type="hidden" ms-duplex="addEms.emsId" name="emsId" class="form-control"/>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-name" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.name" name="name" class="form-control" ms-readonly="addEms.nameReadonly"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-type" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.type" name="type" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-vendor" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.vendor" name="vendor" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-version" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.version" name="version" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span>URL</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.url" name="url" class="form-control"
- ms-attr-placeholder="addEms.urlTip"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label">VIM
- <span></span>
- </label>
- <div class="col-sm-7">
- <select class="form-control" id="vimId" name="vimId">
- <option ms-repeat-vim="vimSelectItems" ms-attr-value="vim.vimId"
- data-repeat-rendered="vimRendered">{{vim.name}}
- </option>
+ <div class="px-ui-steps">
+ <ul class="px-ui-horizon-ul-horizon" role="tablist">
+ <li class="px-ui-steps-li step-active" id="step-resource">
+ <div class="px-ui-menuitem-div-passive">
+ <span class="px-ui-steps-number-passive">1</span>
+ <span class="px-ui-steps-title-passive">Resource</span>
+ </div>
+ <div class="px-ui-underline-passive"></div>
+ </li>
+ <li class="px-ui-steps-li" id="step-performance">
+ <div class="px-ui-menuitem-div-passive">
+ <span class="px-ui-steps-number-passive">2</span>
+ <span class="px-ui-steps-title-passive">Performance</span>
+ </div>
+ <div class="px-ui-underline-passive"></div>
+ </li>
+ <li class="px-ui-steps-li" id="step-alarm">
+ <div class="px-ui-menuitem-div-passive">
+ <span class="px-ui-steps-number-passive">3</span>
+ <span class="px-ui-steps-title-passive">Alarm</span>
+ </div>
+ <div class="px-ui-underline-passive"></div>
+ </li>
+ </ul>
+ </div>
+ <div class="step-content">
+ <form class="form-horizontal" id="form_resource" role="form">
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Name</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.emsName" name="emsName" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Ftptype</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <select ms-duplex="currentElement.resource.ftptype" name="ftptype" class="form-control">
+ <option value="ftp">ftp</option>
+ <option value="sftp">sftp</option>
+ </select>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>IP</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.resource.ip" name="ip" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Port</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.resource.port" name="port" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>User</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.resource.user" name="user" class="form-control" ms-attr-placeholder="urlTip"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Password</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="password" class="form-control" rows="3" ms-duplex="currentElement.resource.password" name="password"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Remotepath</span>
+ </label>
+ <div class="col-sm-7">
+ <input class="form-control" rows="3" ms-duplex="currentElement.resource.remotepath" name="remotepath"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Passive</span>
+ </label>
+ <div class="col-sm-7">
+ <select class="form-control" rows="3" ms-duplex="currentElement.resource.passive" name="passive">
+ <option value="true">true</option>
+ <option value="false">false</option>
</select>
+ <span class="help-block"></span>
+ </div>
</div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-certificateUrl"
- name_i18n="com_zte_nfv_nsoc_i18n"></span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.certificateUrl" name="certificateUrl"
- class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-userName" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="addEms.userName" name="userName"
- class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text-password" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- </label>
- <div class="col-sm-7">
- <input type="password" ms-duplex="addEms.password" name="password"
- class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="nfv-ems-iui-text_description" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- </label>
- <div class="col-sm-7">
- <textarea class="form-control" rows="3" ms-duplex="addEms.description"
- name="description"></textarea>
- <span class="help-block"></span>
- </div>
- </div>
- </form>
-
+ </form>
+ <form class="form-horizontal" id="form_performance" role="form" hidden>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Ftptype</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <select ms-duplex="currentElement.performance.ftptype" name="type" class="form-control">
+ <option value="ftp">ftp</option>
+ <option value="sftp">sftp</option>
+ </select>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>IP</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.performance.ip" name="ip" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Port</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.performance.port" name="port" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>User</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.performance.user" name="user" class="form-control" ms-attr-placeholder="urlTip"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Password</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="password" class="form-control" rows="3" ms-duplex="currentElement.performance.password" name="password"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Remotepath</span>
+ </label>
+ <div class="col-sm-7">
+ <input class="form-control" rows="3" ms-duplex="currentElement.performance.remotepath" name="remotepath"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Passive</span>
+ </label>
+ <div class="col-sm-7">
+ <select class="form-control" rows="3" ms-duplex="currentElement.performance.passive" name="passive">
+ <option value="true">true</option>
+ <option value="false">false</option>
+ </select>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ </form>
+ <form class="form-horizontal" id="form_alarm" role="form" hidden>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>IP</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.alarm.ip" name="ip" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Port</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.alarm.port" name="port" class="form-control"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>User</span>
+ <span class="required" aria-required="true">*</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="text" ms-duplex="currentElement.alarm.user" name="user" class="form-control" ms-attr-placeholder="urlTip"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ <span>Password</span>
+ </label>
+ <div class="col-sm-7">
+ <input type="password" class="form-control" rows="3" ms-duplex="currentElement.alarm.password" name="password"/>
+ <span class="help-block"></span>
+ </div>
+ </div>
+ </form>
+ </div>
</div>
<div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true" id="nfv-ems-iui-text-cancelBtn"
- name_i18n="com_zte_nfv_nsoc_i18n"></button>
- <button class="btn btn-primary" type="submit" ms-click="$saveEms"
- id="nfv-ems-iui-text-saveBtn" name_i18n="com_zte_nfv_nsoc_i18n"></button>
+ <button class="btn" id="btnPreStep" ms-click="$preStep">Back</button>
+ <button class="btn btn-primary" id="btnNextStep" ms-click="$nextStep">Next</button>
+ <button class="btn btn-primary" id="btnSave" ms-click="$saveEMS" id_i18n="nfv-ems-iui-text-saveBtn" name_i18n="com_zte_nfv_nsoc_i18n"></button>
+ <button class="btn" id="btnCancel" ms-click="dismiss" aria-hidden="true" id_i18n="nfv-ems-iui-text-cancelBtn" name_i18n="com_zte_nfv_nsoc_i18n"></button>
</div>
</div>
</div>
@@ -169,40 +280,33 @@
</div>
<div class="row-fluid" data-name="cond_zone">
<div class="col-md-12">
- <button class="btn white radius_l" id="app-new-btn" ms-click="$showEmsTable">
- <i class="ict-new"></i> <span id="nfv-ems-iui-text-registerBtn"
- name_i18n="com_zte_nfv_nsoc_i18n"></span>
+ <button class="btn white radius_l" id="app-new-btn" ms-click="$registerEMS">
+ <i class="ict-new"></i> <span id_i18n="nfv-ems-iui-text-registerBtn" name_i18n="com_zte_nfv_nsoc_i18n"></span>
</button>
</div>
</div>
- <div class="col-sm-12 ems-padding" ms-each-el="emsInfo">
- <div class="col-sm-4 animated-panel zoomIn" style="-webkit-animation-delay: 0.1s;">
+ <div class="col-sm-12 vnfm-padding" ms-each-el="emsInfo">
+ <div class="col-sm-3 animated-panel zoomIn">
<div class="hpanel stats">
<div class="panel-body h-200" ms-hover="hpanel_show">
<div class="pull-left">
- <span class="label label-success" ms-if="el.status === $Status.success"
- id="nfv-ems-iui-text-status-normal" name_i18n="com_zte_nfv_nsoc_i18n"></span>
- <span class="label label-danger" ms-attr-title="el.errorInfo" data-toggle="tooltip"
- ms-if="el.status === $Status.failed" id="nfv-ems-iui-text-status-fail"
- name_i18n="com_zte_nfv_nsoc_i18n"></span>
+ <span class="label label-success" ms-if="el.status == status.success" id_i18n="nfv-ems-iui-text-status-normal" name_i18n="com_zte_nfv_nsoc_i18n"></span>
+ <span class="label label-danger" ms-if="el.status == status.failed" ms-attr-title="el.errorInfo" data-toggle="tooltip" id_i18n="nfv-ems-iui-text-status-fail" name_i18n="com_zte_nfv_nsoc_i18n"></span>
</div>
<div class="stats-icon pull-right">
<i class="fa fa-server fa-5x color_cloud"></i>
</div>
<div class="m-t-xl">
- <h3 ms-text="el.name"></h3>
- <div><span id="nfv-ems-iui-text-type" name_i18n="com_zte_nfv_nsoc_i18n"></span>:<span
- ms-text="el.type"></span></div>
- <div>URL:<span ms-text="el.url"></span></div>
+ <h3 ms-text="el.emsName"></h3>
+ <!--<div class="card-name"><span ms-text="el.emsName"></span></div>-->
</div>
</div>
<div class="panel-footer">
<div class="pull-right">
- <a class="btn btn-default btn-sm" ms-click="emsUtil.updateEms(el.$model)"><i
+ <a class="btn btn-default btn-sm" ms-click="updateEMS($index)"><i
class="fa fa-pencil-square-o fa-lg"></i></a>
- <a class="btn btn-default btn-sm" ms-click="emsUtil.delEms(el.emsId)"><i
- class="fa fa-trash-o fa-lg"> </i></a>
+ <a class="btn btn-default btn-sm" ms-click="delEMS(el.emsId, $index)"><i class="fa fa-trash-o fa-lg"></i></a>
</div>
</div>
</div>
@@ -210,9 +314,8 @@
</div>
<div class="col-sm-12">
<div class="pull-left text-muted">
- <small><span id="nfv-ems-iui-text-total" name_i18n="com_zte_nfv_nsoc_i18n"></span> <span class="blue-font"
- ms-text="emsInfo.size()"></span>
- <span id="nfv-ems-iui-text-total-ems" name_i18n="com_zte_nfv_nsoc_i18n"></span></small>
+ <small><span id_i18n="nfv-ems-iui-text-total" name_i18n="com_zte_nfv_nsoc_i18n"></span> <span class="blue-font" ms-text="emsInfo.size()"></span>
+ <span id_i18n="nfv-ems-iui-text-total-ems" name_i18n="com_zte_nfv_nsoc_i18n"></span></small>
</div>
</div>
</div>
@@ -234,7 +337,6 @@
<script type="text/javascript" src="js/loadi18n_nsoc.js"></script>
<script type="text/javascript" src="js/ems-validate.js"></script>
-<script type="text/javascript" src="js/emsUtil.js"></script>
<script type="text/javascript" src="js/emsController.js"></script>
</body>
</html> \ No newline at end of file
diff --git a/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-en-US.properties b/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-en-US.properties
index 6d10a1d..f39749a 100644
--- a/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-en-US.properties
+++ b/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-en-US.properties
@@ -14,42 +14,42 @@
# limitations under the License.
#
-//vnfm
-nfv-vnfm-iui-title=VNFM Manage
-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?
-nfv-vnfm-iui-message-delete-success=Vnfm deleted successfully.
-nfv-vnfm-iui-message-delete-fail=Vnfm deleted failed.
+//ems
+nfv-ems-iui-title=EMS Manage
+nfv-ems-iui-message-title=Ems info
+nfv-ems-iui-message-query-fail=Query ems failed.
+nfv-ems-iui-message-save-success=Save successfully.
+nfv-ems-iui-message-save-fail=Save failed.
+nfv-ems-iui-message-ems-already-exists=Ems already exists.
+nfv-ems-iui-message-update-success=Update successfully.
+nfv-ems-iui-message-update-fail=Update failed.
+nfv-ems-iui-message-delete-confirm=Do you want to delete the current ems?
+nfv-ems-iui-message-delete-success=Ems deleted successfully.
+nfv-ems-iui-message-delete-fail=Ems deleted failed.
-nfv-vnfm-iui-test-update=Modify vnfm info
-nfv-vnfm-iui-text-register=Register vnfm info
-nfv-vnfm-iui-text-name=Name
-nfv-vnfm-iui-text-type=type
-nfv-vnfm-iui-text-version=version
-nfv-vnfm-iui-text-certificateUrl=certificate URL
-nfv-vnfm-iui-text-vendor=Vendor
-nfv-vnfm-iui-text-userName=Username
-nfv-vnfm-iui-text-password=Password
-nfv-vnfm-iui-text_description=Description
-nfv-vnfm-iui-text-cancelBtn=cancel
-nfv-vnfm-iui-text-saveBtn=save
-nfv-vnfm-iui-text-registerBtn=Register
-nfv-vnfm-iui-text-status-normal=Normal
-nfv-vnfm-iui-text-status-fail=Alarm
-nfv-vnfm-iui-text-total=Total
-nfv-vnfm-iui-text-total-vnfm= of vnfm
+nfv-ems-iui-text-update=Modify ems info
+nfv-ems-iui-text-register=Register ems info
+nfv-ems-iui-text-name=Name
+nfv-ems-iui-text-type=type
+nfv-ems-iui-text-version=version
+nfv-ems-iui-text-certificateUrl=certificate URL
+nfv-ems-iui-text-vendor=Vendor
+nfv-ems-iui-text-userName=Username
+nfv-ems-iui-text-password=Password
+nfv-ems-iui-text_description=Description
+nfv-ems-iui-text-cancelBtn=cancel
+nfv-ems-iui-text-saveBtn=save
+nfv-ems-iui-text-registerBtn=Register
+nfv-ems-iui-text-status-normal=Normal
+nfv-ems-iui-text-status-fail=Abnormal
+nfv-ems-iui-text-total=Total
+nfv-ems-iui-text-total-ems= of ems
-nfv-vnfm-iui-validate-name=Please enter a name
-nfv-vnfm-iui-validate-type=Please enter the vnfm type
-nfv-vnfm-iui-validate-version=Please enter version
-nfv-vnfm-iui-validate-vendor=Please enter vendor
-nfv-vnfm-iui-validate-vim=Please select a VIM
-nfv-vnfm-iui-validate-url-required=Please enter the URL
-nfv-vnfm-iui-validate-url=Please enter the right URL
-nfv-vnfm-iui-text-url-tip=Example: http://10.0.0.1 \ No newline at end of file
+nfv-ems-iui-validate-name=Please enter a name
+nfv-ems-iui-validate-type=Please enter the ems type
+nfv-ems-iui-validate-version=Please enter version
+nfv-ems-iui-validate-vendor=Please enter vendor
+nfv-ems-iui-validate-ems=Please select a EMS
+nfv-ems-iui-validate-url-required=Please enter the URL
+nfv-ems-iui-validate-url=Please enter the right URL
+nfv-ems-iui-text-url-tip=Example: http://10.0.0.1
diff --git a/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-zh-CN.properties b/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-zh-CN.properties
index 6adad99..e6bdacd 100644
--- a/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-zh-CN.properties
+++ b/esr/src/main/webapp/extsys/ems/i18n/nfv-nso-iui-i18n-zh-CN.properties
@@ -14,42 +14,41 @@
# limitations under the License.
#
-//vnfm
-nfv-vnfm-iui-title=VNFM管理
-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信息?
-nfv-vnfm-iui-message-delete-success=删除成功
-nfv-vnfm-iui-message-delete-fail=删除失败
+//ems
+nfv-ems-iui-title=EMS管理
+nfv-ems-iui-message-title=EMS信息
+nfv-ems-iui-message-query-fail=查询EMS失败。
+nfv-ems-iui-message-save-success=保存成功。
+nfv-ems-iui-message-save-fail=保存失败。
+nfv-ems-iui-message-ems-already-exists=EMS已经存在
+nfv-ems-iui-message-update-success=修改成功。
+nfv-ems-iui-message-update-fail=修改失败。
+nfv-ems-iui-message-delete-confirm=确定删除所选ems信息?
+nfv-ems-iui-message-delete-success=删除成功
+nfv-ems-iui-message-delete-fail=删除失败
+nfv-ems-iui-text-update=修改EMS信息
+nfv-ems-iui-text-register=注册EMS信息
+nfv-ems-iui-text-name=名称
+nfv-ems-iui-text-type=类型
+nfv-ems-iui-text-version=版本
+nfv-ems-iui-text-certificateUrl=认证url
+nfv-ems-iui-text_description=描述
+nfv-ems-iui-text-vendor=厂商
+nfv-ems-iui-text-userName=接入用户
+nfv-ems-iui-text-password=接入密码
+nfv-ems-iui-text-cancelBtn=取消
+nfv-ems-iui-text-saveBtn=保存
+nfv-ems-iui-text-registerBtn=注册EMS
+nfv-ems-iui-text-status-normal=正常
+nfv-ems-iui-text-status-fail=报警
+nfv-ems-iui-text-total=共
+nfv-ems-iui-text-total-ems=EMS
-nfv-vnfm-iui-test-update=修改vnfm信息
-nfv-vnfm-iui-text-register=注册vnfm信息
-nfv-vnfm-iui-text-name=名称
-nfv-vnfm-iui-text-type=类型
-nfv-vnfm-iui-text-version=版本
-nfv-vnfm-iui-text-certificateUrl=认证url
-nfv-vnfm-iui-text_description=描述
-nfv-vnfm-iui-text-vendor=厂商
-nfv-vnfm-iui-text-userName=接入用户
-nfv-vnfm-iui-text-password=接入密码
-nfv-vnfm-iui-text-cancelBtn=取消
-nfv-vnfm-iui-text-saveBtn=保存
-nfv-vnfm-iui-text-registerBtn=注册vnfm
-nfv-vnfm-iui-text-status-normal=正常
-nfv-vnfm-iui-text-status-fail=报警
-nfv-vnfm-iui-text-total=共
-nfv-vnfm-iui-text-total-vnfm= vnfm
-
-nfv-vnfm-iui-validate-name=请输入名称
-nfv-vnfm-iui-validate-type=请输入vnfm类型
-nfv-vnfm-iui-validate-version=请输入版本号
-nfv-vnfm-iui-validate-vendor=请输入厂商
-nfv-vnfm-iui-validate-vim=请选择VIM
-nfv-vnfm-iui-validate-url-required=请输入URL
-nfv-vnfm-iui-validate-url=请输入正确的URL
-nfv-vnfm-iui-text-url-tip=例如:http://10.0.0.1 \ No newline at end of file
+nfv-ems-iui-validate-name=请输入名称
+nfv-ems-iui-validate-type=请输入EMS类型
+nfv-ems-iui-validate-version=请输入版本号
+nfv-ems-iui-validate-vendor=请输入厂商
+nfv-ems-iui-validate-vim=请选择EMS
+nfv-ems-iui-validate-url-required=请输入URL
+nfv-ems-iui-validate-url=请输入正确的URL
+nfv-ems-iui-text-url-tip=例如:http://10.0.0.1 \ No newline at end of file
diff --git a/esr/src/main/webapp/extsys/ems/js/ems-validate.js b/esr/src/main/webapp/extsys/ems/js/ems-validate.js
index 627d6d5..7cca638 100644
--- a/esr/src/main/webapp/extsys/ems/js/ems-validate.js
+++ b/esr/src/main/webapp/extsys/ems/js/ems-validate.js
@@ -47,20 +47,20 @@ $(function () {
},
messages: {
name: {
- required: $.i18n.prop("nfv-vnfm-iui-validate-name")
+ required: $.i18n.prop("nfv-ems-iui-validate-name")
},
type: {
- required: $.i18n.prop("nfv-vnfm-iui-validate-type")
+ required: $.i18n.prop("nfv-ems-iui-validate-type")
},
version: {
- required: $.i18n.prop("nfv-vnfm-iui-validate-version")
+ required: $.i18n.prop("nfv-ems-iui-validate-version")
},
vendor: {
- required: $.i18n.prop("nfv-vnfm-iui-validate-vendor")
+ required: $.i18n.prop("nfv-ems-iui-validate-vendor")
},
url: {
- required: $.i18n.prop("nfv-vnfm-iui-validate-url-required"),
- url: $.i18n.prop("nfv-vnfm-iui-validate-url")
+ required: $.i18n.prop("nfv-ems-iui-validate-url-required"),
+ url: $.i18n.prop("nfv-ems-iui-validate-url")
}
},
errorPlacement: function (error, element) { // render error placement for each input type
diff --git a/esr/src/main/webapp/extsys/ems/js/emsController.js b/esr/src/main/webapp/extsys/ems/js/emsController.js
index 567af53..b615b62 100644
--- a/esr/src/main/webapp/extsys/ems/js/emsController.js
+++ b/esr/src/main/webapp/extsys/ems/js/emsController.js
@@ -14,12 +14,45 @@
* limitations under the License.
*/
-var vm = avalon
- .define({
+var vm = avalon.define({
$id: "emsController",
emsInfo: [],
- //mocSelectItems : [],
+ currentElement: {},
+ $emsList: [],
+ $newElement: {
+ "emsId": "",
+ "status": "active",
+ "emsName": "",
+ "version": "v1.0",
+ "vendor": "ZTE",
+ "description": "ems description",
+ "resource": {
+ "ftptype": "ftp",
+ "ip": "",
+ "port": "",
+ "user": "root",
+ "password": "",
+ "remotepath": "/opt/Gcp/data/",
+ "passive": true
+ },
+ "performance": {
+ "ftptype": "ftp",
+ "ip": "",
+ "port": "",
+ "user": "root",
+ "password": "",
+ "remotepath": "",
+ "passive": true
+ },
+ "alarm": {
+ "ip": "",
+ "port": 2000,
+ "user": "root",
+ "password": ""
+ }
+ },
vimSelectItems: [],
+ saveType: "add",
server_rtn: {
info_block: false,
warning_block: false,
@@ -27,15 +60,23 @@ var vm = avalon
$RTN_SUCCESS: "RTN_SUCCESS",
$RTN_FAILED: "RTN_FAILED"
},
- $Status: {
+ modalTitle: $.i18n.prop("nfv-ems-iui-text-register"),
+ urlTip: "",
+ currentStep: 1,
+ status: {
success: "active",
failed: "inactive"
},
+ $format: {
+ "ipv4": /^((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))$/,
+ "port": /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
+ "url": /^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$/
+ },
$restUrl: {
- queryEmsInfoUrl: '/onapapi/aai/esr/v1/emss',
- addEmsInfoUrl: '/onapapi/aai/esr/v1/emss',
- updateEmsInfoUrl: '/onapapi/aai/esr/v1/emss/',
- delEmsInfoUrl: '/onapapi/aai/esr/v1/emss/',
+ queryEmsInfoUrl: "/esrui/extsys/ems/mock-data/ems.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'
},
@@ -50,196 +91,239 @@ var vm = avalon
$.ajax({
"type": 'GET',
"url": vm.$restUrl.queryEmsInfoUrl,
- //"dataType": "json",
+ "dataType": "json",
"success": function (resp) {
- for (var i = 0; i < resp.length; i++) {
- resp[i].status = vm.$Status.success;
- }
vm.emsInfo = resp;
+ vm.$emsList = $.extend(true, [], resp) ;
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
bootbox.alert($.i18n.prop("nfv-ems-iui-message-query-fail") + ":" + textStatus + ":" + errorThrown);
return;
},
complete: function () {
- emsUtil.tooltipEmsStatus();
+ $("[data-toggle='tooltip']").tooltip();
}
});
},
-
- $initVim: function () {
- $.ajax({
- type: 'get',
- url: vm.$restUrl.queryVimUrl,
- dataType: 'json',
- success: function (resp) {
- if (resp) {
- vm.vimSelectItems = resp;
- }
- vm.vimSelectItems.push({"vimId": "", "name": ""});
- }
- });
+ $nextStep: function () {
+ if(vm.currentStep == 1 && !vm.validate("resource")){
+ return false;
+ } else if(vm.currentStep == 2 && !vm.validate("performance")){
+ return false;
+ }
+ vm.currentStep ++;
+ vm.showStep();
},
- addEms: {
- title: $.i18n.prop("nfv-ems-iui-text-register"),
- emsId: "",
- name: "",
- type: "",
- //moc : "",
- nameReadonly : false,
- vimId: "",
- //vimVisiable : false,
- vendor: "",
- version: "",
- description: "",
- certificateUrl: "",
- url: "",
- urlTip: $.i18n.prop("nfv-ems-iui-text-url-tip"),
- userName: "",
- password: "",
- saveType: "add",
- status: ""
- },
- $showEmsTable: function () {
- vm.addEms.title = $.i18n.prop("nfv-ems-iui-text-register"),
- vm.addEms.emsId = "";
- vm.addEms.name = "";
- vm.addEms.type = "";
- vm.addEms.nameReadonly = false;
- vm.addEms.vimId = "";
- vm.addEms.vendor = "";
- vm.addEms.version = "";
- vm.addEms.description = "";
- vm.addEms.certificateUrl = "";
- vm.addEms.url = "";
- vm.addEms.userName = "";
- vm.addEms.password = "";
- vm.addEms.saveType = "add";
- vm.server_rtn.warning_block = false;
- vm.server_rtn.info_block = false;
- vm.$initVim();
- $(".form-group").each(function () {
- $(this).removeClass('has-success');
- $(this).removeClass('has-error');
- $(this).find(".help-block[id]").remove();
- });
+ $preStep: function () {
+ if(vm.currentStep == 2 && !vm.validate("resource")){
+ return false;
+ } else if(vm.currentStep == 3 && !vm.validate("alarm")){
+ return false;
+ }
+ vm.currentStep --;
+ vm.showStep();
+ },
+ showStep: function () {
+ var show = function (filter) {
+ $(".px-ui-steps ul li.step-active").removeClass("step-active");
+ $("#step-" + filter).addClass("step-active");
+ $(".step-content form").hide();
+ $("#form_" + filter).show();
+ };
+ switch (vm.currentStep){
+ case 1:
+ show("resource");
+ $("#btnSave, #btnPreStep").hide();
+ $("#btnNextStep").show();
+ break;
+ case 2:
+ show("performance");
+ $("#btnSave").hide();
+ $("#btnNextStep, #btnPreStep").show();
+ break;
+ case 3:
+ show("alarm");
+ $("#btnNextStep").hide();
+ $("#btnSave, #btnPreStep").show();
+ break;
+ }
+ },
+ $registerEMS: function () {
+ vm.currentElement = $.extend(true, {}, vm.$newElement);
+ vm.currentIndex = -1;
+ vm.saveType = "add";
+ vm.modalTitle = $.i18n.prop("nfv-ems-iui-text-register");
+ vm.$showTable();
+ },
+ $showTable: function () {
+ vm.currentStep = 1;
+ vm.showStep();
+ $(".form-group").removeClass('has-success').removeClass('has-error');
$("#addEmsDlg").modal("show");
},
- // $getMocName : function(mocId) {
- // var items = vm.mocSelectItems;
- // for(var i=0;i<items.length;i++) {
- // if(items[i].id == mocId) {
- // return items[i].name;
- // }
- // }
- // return "";
- // },
- $saveEms: function () {
- var form = $('#ems_form');
- if (form.valid() == false) {
- return false;
+ dismiss: function () {
+ if(vm.currentIndex !== -1){
+ vm.currentElement.emsName = vm.$emsList[vm.currentIndex].emsName;
}
+ $("#addEmsDlg").modal("hide");
+ },
+ $saveEMS: function () {
+ var form = $('#vnfm_form');
+ //TODO valiate
vm.server_rtn.info_block = true;
vm.server_rtn.warning_block = false;
- vm.addEms.status = vm.$Status.success;
- var param = {
- name: vm.addEms.name,
- vimId: $("#vimId").val(),
- vendor: vm.addEms.vendor,
- version: vm.addEms.version,
- type: vm.addEms.type,
- description: vm.addEms.description,
- certificateUrl: vm.addEms.certificateUrl,
- url: vm.addEms.url,
- userName: vm.addEms.userName,
- password: vm.addEms.password
- }
//save VIM info
- if (vm.addEms.saveType == "add") {
- $.ajax({
- type: "POST",
- url: vm.$restUrl.addEmsInfoUrl,
- data: JSON.stringify(param),
- dataType: "json",
- contentType: "application/json",
- success: function (data) {
- vm.server_rtn.info_block = false;
- vm.server_rtn.warning_block = false;
- if (data) {
- vm.emsInfo = [];
- vm.$initTable();
-
- $('#addEmsDlg').modal('hide');
- commonUtil.showMessage(vm.$htmlText.saveSuccess, "success");
- } else {
- 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) {
- vm.server_rtn.warning_block = true;
- vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
- vm.server_rtn.info_block = false;
- }
- });
+ var res = false;
+ if (vm.saveType == "add") {
+ res = vm.postEMS();
} else {
- $.ajax({
- type: "PUT",
- url: vm.$restUrl.updateEmsInfoUrl + vm.addEms.emsId,
- data: JSON.stringify(param),
- dataType: "json",
- contentType: "application/json",
- success: function (data) {
- vm.server_rtn.info_block = false;
- vm.server_rtn.warning_block = false;
- if (data) {
- for (var i = 0; i < vm.emsInfo.length; i++) {
- if (vm.emsInfo[i].emsId == vm.addEms.emsId) {
- vm.emsInfo[i].name = vm.addEms.name;
- vm.emsInfo[i].vimId = $("#vimId").val();
- vm.emsInfo[i].vendor = vm.addEms.vendor;
- vm.emsInfo[i].version = vm.addEms.version;
- vm.emsInfo[i].certificateUrl = vm.addEms.certificateUrl;
- vm.emsInfo[i].description = vm.addEms.description;
- vm.emsInfo[i].url = vm.addEms.url;
- vm.emsInfo[i].userName = vm.addEms.userName;
- vm.emsInfo[i].password = vm.addEms.password;
- }
+ res = vm.putEMS();
+ }
+ if(res){
+ $("#addEmsDlg").modal("hide");
+ }
+ },
+ updateEMS: function (index) {
+ vm.saveType = "update";
+ vm.currentIndex = index;
+ vm.currentElement = vm.emsInfo[index];
+ vm.$showTable();
+ },
+ delEMS: function (id, index) {
+ bootbox.confirm($.i18n.prop("nfv-ems-iui-message-delete-confirm"), function (result) {
+ if (result) {
+ vm.emsInfo.splice(index, 1);
+ vm.$emsList.splice(index, 1);
+ console.log(vm.emsInfo[index]);
+ /* $.ajax({
+ type: "DELETE",
+ url: vm.$restUrl.delVnfmInfoUrl + id,
+ dataType: "json",
+ success: function (data, statusText, jqXHR) {
+ if (jqXHR.status == "204") {
+
+ commonUtil.showMessage($.i18n.prop("nfv-ems-iui-message-delete-success"), "success");
+ } else {
+ commonUtil.showMessage($.i18n.prop("nfv-ems-iui-message-delete-fail"), "warning");
}
- $('#addEmsDlg').modal('hide');
- commonUtil.showMessage(vm.$htmlText.updateSuccess, "success");
- } else {
- vm.server_rtn.warning_block = true;
- vm.server_rtn.rtn_info = vm.$htmlText.updateFail;
- commonUtil.showMessage(vm.$htmlText.updateFail, "failed");
+ },
+ error: function () {
+ commonUtil.showMessage($.i18n.prop("nfv-ems-iui-message-delete-fail"), "warning");
}
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.warning_block = true;
- vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
- vm.server_rtn.info_block = false;
- }
- });
+ });*/
+ }
+ });
+ },
+ validate: function (formId) {
+ var res = true;
+ var emsSave = vm.getEMSSave();
+ var ip = emsSave[formId].ip;
+ var port = emsSave[formId].port;
+ if(!vm.$format.ipv4.test(ip)){
+ $("#form_" + formId + " input[name='ip']").next().html("The IP format is incorrect");
+ res = res && false;
+ } else {
+ $("#form_" + formId + " input[name='ip']").next().html("");
}
+ if(!vm.$format.port.test(port)){
+ $("#form_" + formId + " input[name='port']").next().html("The port format is incorrect");
+ res = res && false;
+ } else {
+ $("#form_" + formId + " input[name='port']").next().html("");
+ }
+ return res;
},
+ postEMS: function () {
+ var emsSave = vm.getEMSSave();
+ if(!vm.validate("alarm")){
+ return false;
+ }
+ emsSave.emsId = Math.floor(Math.random() * 100000) / 100000;
+ vm.emsInfo.push(emsSave);
+ vm.$emsList.push(emsSave);
+ console.log(emsSave);
+ return true;
+ /*$.ajax({
+ type: "POST",
+ url: vm.$restUrl.addVnfmInfoUrl,
+ data: JSON.stringify(vm.currentElement),
+ dataType: "json",
+ contentType: "application/json",
+ success: function (data) {
+ vm.server_rtn.info_block = false;
+ vm.server_rtn.warning_block = false;
+ if (data) {
+ vm.vnfmInfo = [];
+ vm.$initTable();
- vimRendered: function (action) {
- var items = vm.vimSelectItems;
- if (vm.addEms.saveType === "update") {
- for (var i = 0; i < items.length; i++) {
- if (items[i].vimId == vm.addEms.vimId) {
- $("#vimId")[0].selectedIndex = i;
- break;
+ $('#addEmsDlg').modal('hide');
+ commonUtil.showMessage(vm.$htmlText.saveSuccess, "success");
+ } else {
+ 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) {
+ vm.server_rtn.warning_block = true;
+ vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
+ vm.server_rtn.info_block = false;
}
- } else {
- $("#vimId")[0].selectedIndex = items.length - 1;
+ });*/
+ },
+ putEMS: function () {
+ console.log(vm.getEMSSave());
+ if(!vm.validate("alarm")){
+ return false;
}
+ return true;
+ /* $.ajax({
+ type: "PUT",
+ url: vm.$restUrl.updateVnfmInfoUrl + vm.currentElement.emsId,
+ data: JSON.stringify(vm.currentElement),
+ dataType: "json",
+ contentType: "application/json",
+ success: function (data) {
+ 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;
+ }
+ }
+ $('#addEmsDlg').modal('hide');
+ commonUtil.showMessage(vm.$htmlText.updateSuccess, "success");
+ } else {
+ 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) {
+ vm.server_rtn.warning_block = true;
+ vm.server_rtn.rtn_info = textStatus + ":" + errorThrown;
+ vm.server_rtn.info_block = false;
+ }
+ });*/
},
-
+ getEMSSave: function () {
+ var emsSave = $.extend(true, {}, vm.currentElement.$model);
+ emsSave.alarm = vm.currentElement.alarm.$model;
+ emsSave.resource = vm.currentElement.resource.$model;
+ emsSave.performance = vm.currentElement.performance.$model;
+ return emsSave;
+ }
});
+vm.currentElement = $.extend(true, {}, vm.$newElement);
avalon.scan();
-vm.$initTable();
-//vm.$initMoc(); \ No newline at end of file
+vm.$initTable(); \ No newline at end of file
diff --git a/esr/src/main/webapp/extsys/ems/js/emsUtil.js b/esr/src/main/webapp/extsys/ems/js/emsUtil.js
deleted file mode 100644
index 21038da..0000000
--- a/esr/src/main/webapp/extsys/ems/js/emsUtil.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2016-2017 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var vnfmUtil = {};
-
-vnfmUtil.delVnfm = function (vnfmId) {
- bootbox.confirm($.i18n.prop("nfv-vnfm-iui-message-delete-confirm"), function (result) {
- if (result) {
- $.ajax({
- type: "DELETE",
- url: vm.$restUrl.delVnfmInfoUrl + vnfmId,
- dataType: "json",
- success: function (data, statusText, jqXHR) {
- if (jqXHR.status == "204") {
- for (var i = 0; i < vm.vnfmInfo.length; i++) {
- if (vnfmId == vm.vnfmInfo[i].vnfmId) {
- //delete the vnfm object from vnfm array
- vm.vnfmInfo.splice(i, 1);
- break;
- }
- }
- commonUtil.showMessage($.i18n.prop("nfv-vnfm-iui-message-delete-success"), "success");
- } else {
- commonUtil.showMessage($.i18n.prop("nfv-vnfm-iui-message-delete-fail"), "warning");
- }
- },
- error: function () {
- commonUtil.showMessage($.i18n.prop("nfv-vnfm-iui-message-delete-fail"), "warning");
- }
- });
- }
- });
-}
-
-vnfmUtil.updateVnfm = function (data) {
- vm.addVnfm.vnfmId = data.vnfmId;
- vm.addVnfm.name = data.name;
- //vm.addVnfm.moc = data.moc;
- //vm.addVnfm.mocDisabled = true;
- vm.addVnfm.vendor = data.vendor;
- vm.addVnfm.version = data.version;
- vm.addVnfm.description = data.description;
- 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";
- vm.addVnfm.title = $.i18n.prop("nfv-vnfm-iui-test-update");
- vm.server_rtn.info_block = false;
- vm.server_rtn.warning_block = false;
- //vm.$initMoc();
- vm.$initVim();
-
- $(".form-group").each(function () {
- $(this).removeClass('has-success');
- $(this).removeClass('has-error');
- $(this).find(".help-block[id]").remove();
- });
- $("#addVnfmDlg").modal("show");
-}
-
-vnfmUtil.tooltipVnfmStatus = function () {
- $("[data-toggle='tooltip']").tooltip();
-} \ No newline at end of file
diff --git a/esr/src/main/webapp/extsys/ems/js/loadi18n_nsoc.js b/esr/src/main/webapp/extsys/ems/js/loadi18n_nsoc.js
index a543a20..45224af 100644
--- a/esr/src/main/webapp/extsys/ems/js/loadi18n_nsoc.js
+++ b/esr/src/main/webapp/extsys/ems/js/loadi18n_nsoc.js
@@ -23,7 +23,7 @@ function loadPropertiesSideMenu(lang, fileNamePrefix, filePath) {
var i18nItems = $("[name_i18n=com_zte_nfv_nsoc_i18n]");
for (var i = 0; i < i18nItems.length; i++) {
var $item = $(i18nItems.eq(i));
- var itemId = $item.attr("id");
+ var itemId = $item.attr("id_i18n");
var itemTitle = $item.attr("title");
if (typeof(itemTitle) != "undefined") {
$item.attr("title", $.i18n.prop(itemId));
diff --git a/esr/src/main/webapp/extsys/ems/mock-data/ems.json b/esr/src/main/webapp/extsys/ems/mock-data/ems.json
new file mode 100644
index 0000000..d02e57e
--- /dev/null
+++ b/esr/src/main/webapp/extsys/ems/mock-data/ems.json
@@ -0,0 +1,66 @@
+[
+ {
+ "emsId": "123098765",
+ "status": "active",
+ "emsName": "EMS_TEST",
+ "version": "v1.0",
+ "vendor": "ZTE",
+ "description": "ems description",
+ "resource": {
+ "ftptype": "ftp",
+ "ip": "10.44.55.145",
+ "port": "2000",
+ "user": "root",
+ "password": "test",
+ "remotepath": "/opt/Gcp/data/",
+ "passive": true
+ },
+ "performance": {
+ "ftptype": "ftp",
+ "ip": "10.44.55.145",
+ "port": "2000",
+ "user": "root",
+ "password": "test",
+ "remotepath": "/opt/Gcp/data/",
+ "passive": true
+ },
+ "alarm": {
+ "ip": "10.44.55.145",
+ "port": 2000,
+ "user": "root",
+ "password": "test"
+ }
+ },
+ {
+ "emsId": "12309876566",
+ "status": "inactive",
+ "emsName": "EMS_TEST_FAILED",
+ "version": "v1.0",
+ "vendor": "ZTE",
+ "description": "ems description",
+ "resouce": {
+ "ftptype": "sftp",
+ "ip": "10.44.55.15",
+ "port": "2100",
+ "user": "root",
+ "password": "test",
+ "remotepath": "/opt/Gcp/data/",
+ "passive": true
+ },
+ "performance": {
+ "ftptype": "sftp",
+ "ip": "10.44.55.15",
+ "port": "2100",
+ "user": "root",
+ "password": "test",
+ "remotepath": "/opt/Gcp/data/",
+ "passive": true
+ },
+ "alarm": {
+ "ip": "10.44.55.15",
+ "port": 2100,
+ "user": "root",
+ "password": "test"
+ }
+ }
+] \ No newline at end of file