diff options
Diffstat (limited to 'openo-portal/portal-monitor')
12 files changed, 2278 insertions, 0 deletions
diff --git a/openo-portal/portal-monitor/pom.xml b/openo-portal/portal-monitor/pom.xml new file mode 100644 index 00000000..ad5d900b --- /dev/null +++ b/openo-portal/portal-monitor/pom.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2016, CMCC Technologies Co., Ltd. + + 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. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <groupId>org.openo.gso.gui</groupId> + <artifactId>openo-portal</artifactId> + <version>1.1.0-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <artifactId>portal-monitor</artifactId> + <version>1.1.0-SNAPSHOT</version> + <packaging>war</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/css/dac.css b/openo-portal/portal-monitor/src/main/webapp/monitor/css/dac.css new file mode 100644 index 00000000..64e1f67d --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/css/dac.css @@ -0,0 +1,220 @@ +/** + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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. + */ +body { + color: #333; + font-size: 14px; + font-family: "Microsoft yahei", arial; + background-color: #ffffff !important; +} + + +a { + + text-decoration: none !important; +} + + + +.titlefont { + font-size: 16px; +} + + + +.container-fluid { + background-color: #fff; +} + + +div.separator div { + text-align: center; + line-height: 0; +} + +.row{ + margin-left: 0px; + margin-right: 0px; + margin-bottom: 10px; + margin-top: 10px; +} + + +p[tooltip], div[tooltip], td[tooltip], span[tooltip]{ + overflow: hidden; + text-overflow: ellipsis; + white-space:nowrap; +} + +.control-label .required { + color: #e02222; + font-size: 12px; + padding-left: 2px; +} + +.stats_box { + display: inline-block; + list-style: none outside none; + margin-left: 0; + margin-top: 10px; + padding: 0; + float: left; +} + + + +.stats_box .policyDiv{ + background: #eee; + box-shadow: 0 0 0 1px #f8f8f8 inset,0 0 0 1px #ccc; + display: inline-block; + line-height: 18px; + margin: 0 10px 10px; + padding: 0 10px; + float: left; + height: 105px; +} + + + +.sparkline { + min-width: 60px; + /* border-right: 1px solid #dcdcdc; */ + /* box-shadow: 1px 0 0 0 #fff; */ + float: left; + /* margin-right: 9pt; */ + padding: 0px 24px 0 34px; + height: 90px; +} + +.sparkline i{ +color:#5bc0de; +} + + + + + + + +.animated-panel { + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +/* +.panel-footer { + padding: 6px 15px; +}*/ + + +/*卡片面板样式*/ +.animated-panel { + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.hpanel { + background-color: none; + border: none; + box-shadow: none; + margin-bottom: 35px; + +} + +.hpanel .panel-body { + border: 1px solid #e4e5e7; + border-radius: 2px; + padding: 20px; + position: relative; +} +.h-200 { + min-height: 220px; +} +.m-t-xl { + margin-top: 20px; +} +.text-success { + color: #0d638f; +} + +.hpanel_div_list{ + height:30px; +} + +.hpanel > .panel-footer { + color: inherit; + border: 1px solid #e4e5e7; + border-top: none; + font-size: 90%; + background: #f7f9fa; + height:40px; + padding: 5px 15px; +} + +.color_cloud{ + color:#BAB9B9; +} +.stats-title{ + +} + +h3{ + margin-top: 10px; + margin-bottom: 40px; + font-weight: 200; + color: #357ebd +} + +.blue-font{ + color:#428bca; +} + +.hpanel > .panel-footer .pull-right a{ + margin-left: 5px; +} + +.font-bold { + font-weight: 600; + margin-bottom: 15px; +} + +.hpanel_show{ + cursor: pointer; + background-color: #f7f9fa; +} + +.hpanel > .panel-footer .pull-right .btn { + min-width: 30px !important; +} + + +div[data-name="cond_zone"] div { + background-color: #fff; + margin-bottom: 15px; +} + +span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: left; + margin-top: 50px; +}
\ No newline at end of file diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/css/monitorSetting.css b/openo-portal/portal-monitor/src/main/webapp/monitor/css/monitorSetting.css new file mode 100644 index 00000000..576dc18e --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/css/monitorSetting.css @@ -0,0 +1,167 @@ +/** + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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. + */ +body { + color: #333; + font-family: "Microsoft yahei", Verdana, Arial, Helvetica, sans-serif !important; + padding: 0px !important; + margin: 0px !important; + direction: ltr; + background-color: #ffffff !important; +} + +a { + text-decoration: none !important; + cursor: pointer; +} + +.label{ + font-size: 80%; +} + +.row{ + margin-left: 0px; + margin-right: 0px; + padding-left: 0px; + padding-right: 0px; +} + +.chart_row{ + + padding-left:5px; + padding-right: 5px; +} + +.titlefont { + font-size: 16px; +} + +.container-fluid { + background-color: #fff; +} + +.blue-font { + color: #428bca; +} + + + +.separator-line { + height: 1px; + width: 100%; + background: #ddd; + overflow: hidden; + margin-bottom: 15px; + margin-top: 6px; + opacity: 0.6; +} + + + + + +.main { + + overflow: hidden; + margin-bottom: 10px; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + padding-top: 10px; + padding-right: 10px; +} + +.panel-tools { + display: inline-block; + float: right; + margin-top: 0; + padding: 0; + position: relative; +} + +.panel-tools a { + margin-left: 5px; + color: #9d9fa2; + cursor: pointer; +} + +.panel-tools a:hover{ + color: #34495e; + text-decoration: none; +} + + +.timeline-badge { + width: 100px; + height: 100px; + border-radius: 50% 50% 50% 50%; + text-align: center; + font-size: 50px; + line-height: 100px; + color: #fff; + background-color: #999999; +} +.timeline-badge.info { + background-color: #378AE8 !important; +} + +.collapseContent ul { + padding-left: 0; + list-style: none; +} + +.collapseContent ul li{ + height:40px; + font-size: 15px; +} + +#MonitorContent{ + padding-top: 30px; + padding-bottom: 20px; +} + +.border-right { + border-right: 1px solid #e4e5e7; +} + +.tipArea { + border-bottom: 1px solid #d4d4d4; + width: 85%; + text-align: center; + margin-bottom: 15px; + margin-left: 30px; + font-weight: bold; +} +.monitor-icon{ + + width:180px; + float:left; + padding-left:40px + +} + +.proxy_div{ + float:left; + padding-left:20px + +} + +#MonitorContent b{ + margin-right: 5px; +}
\ No newline at end of file diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/dacList.html b/openo-portal/portal-monitor/src/main/webapp/monitor/dacList.html new file mode 100644 index 00000000..c0115c47 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/dacList.html @@ -0,0 +1,250 @@ +<!-- + Copyright 2016, CMCC Technologies Co., Ltd. + + 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. +--> +<!DOCTYPE html> +<html> +<head lang="en"> + <meta charset="UTF-8"> + <title></title> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/font-awesome/css/font-awesome.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/bootstrap/css/bootstrap.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ngict-component.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ZteIctIcons/style.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/animate.css"/> + <link rel="stylesheet" type="text/css" href="css/dac.css"/> + <style> + .ms-controller { + visibility: hidden + } + </style> +</head> +<body> +<div class="ms-controller container-fluid" ms-controller="dacController"> + +<div class="row" style=" margin-top: 15px;"> + <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6"> + <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorList_dac_manage" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC Manage </span> + </div> + <div class="pull-right"> + <a href="#" ms-click="gotoMonitorPage()" ><i class="fa fa-reply "></i> + <span id="com_zte_openo_umc_monitor_return" name_i18n="com_zte_openo_umc_monitor_ui_i18n">return</span></a> + + </div> + + </div> + <div class="separator-line"></div> + + + <div id="dacDlg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 id="myModalLabel" ms-text="dacDlgInfo.titleName"></h4> + </div> + <div class="modal-body"> + <div class="alert alert-info" ms-visible="server_rtn.info_block" ms-html="server_rtn.rtn_info"></div> + <div class="alert alert-danger " ms-visible="server_rtn.warning_block" ms-text="server_rtn.rtn_info"></div> + <form class="form-horizontal" id="dac_form" role="form"> + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Node Label</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" ms-duplex="dacInfo.nodeLabel" name="nodeLabel" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_dac_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="ipAddress" ms-duplex="dacInfo.ipAddress" class="form-control" ms-attr-disabled="dacDlgInfo.saveType=='update'"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_dac_note" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Note</span> + + </label> + <div class="col-sm-7"> + <textarea class="form-control" name="note" ms-duplex="dacInfo.note" rows="3"></textarea> + + </div> + </div> + + </form> + </div> + <div class="modal-footer"> + <!--button class="btn btn-success" type="submit" ms-click="testDAC()">Access Test</button--> + <button class="btn btn-primary" type="submit" ms-click="saveDAC()" id="com_zte_openo_umc_monitor_btn_save" name_i18n="com_zte_openo_umc_monitor_ui_i18n" ms-attr-disabled="vm.dacChecking==true">Save</button> + <button class="btn" data-dismiss="modal" aria-hidden="true" id="com_zte_openo_umc_monitor_btn_cancel" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Cancel</button> + </div> + </div> + + </div> + </div> + </div> + + <div class="row-fluid" data-name="cond_zone"> + <div class="col-sm-12"> + <button class="btn white radius_l" id="app-new-btn" ms-click="addDAC()" > + <i class=" ict-new"></i> <span id="com_zte_openo_umc_monitor_dac_register" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Register DAC</span> + </button> + </div> + </div> + + <span class="response_throbber" ms-visible="vm.dacLoading"></span> + + <div ms-visible="!vm.dacLoading"> + <div class="row" ms-each-dac="dacInfoArray"> + <div class="col-sm-4 col-md-4 animated-panel zoomIn" style="-webkit-animation-delay: 0.1s;" > + <div class="hpanel stats" > + + <div class="panel-body h-200" > + <div class="stats-icon pull-right"> + <i class="ict-it-net fa-5x color_cloud"></i> + </div> + <div class="m-t-xl"> + <h3>{{dac.nodeLabel}}</h3> + <div class="hpanel_div_list"><span class="font-bold" id="com_zte_openo_umc_monitor_dac_panel_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address:</span><span>{{dac.ipAddress}}</span></div> + <div class="hpanel_div_list"><span class="font-bold" id="com_zte_openo_umc_monitor_dac_panel_note" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Note:</span><span>{{dac.note}}</span> </div> + </div> + </div> + + <div class="panel-footer"> + <div class="pull-right"> + <a class="btn btn-default btn-sm" ms-click="updateDAC(dac)"><i class="fa fa-pencil-square-o fa-lg"></i></a> + <a class="btn btn-default btn-sm" ms-click="delDAC(dac.oid)"><i class="fa fa-trash-o fa-lg"> </i></a> + </div> + </div> + </div> + </div> + + + + </div> + + + <div class="row-fluid"> + <div class="col-md-12" style="padding-left:0px;"> + <div class="pull-left"> + <small><span id="com_zte_openo_umc_monitor_monitorList_total" name_i18n="com_zte_openo_umc_monitor_ui_i18n">total</span> + <span ms-text="dacInfoArray.size()"></span> + <span id="com_zte_openo_umc_monitor_monitorList_records" name_i18n="com_zte_openo_umc_monitor_ui_i18n">records</span> + </small> + </div> + </div> + </div> + </div> + +</div> + +<script type="text/javascript" src="/openoui/common/thirdparty/jquery/jquery-1.10.2.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap/js/bootstrap.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery-validation/js/jquery.validate.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootbox/bootbox.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap-growl/bootstrap-growl.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/avalon/avalon.js"></script> +<script type="text/javascript" src="/openoui/common/js/tools.js"></script> +<script type="text/javascript" src="/openoui/common/js/core/hk.min.js" ></script> +<script type="text/javascript" src="js/monitorSettingUtil.js"></script> +<script type="text/javascript" src="js/dacController.js"></script> +<script type="text/javascript" src="js/loadi18nApp_ngict-umc-monitor.js"></script> +<script> + var lang= getLanguage(); + loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/'); + + jQuery.validator.addMethod("ip", function(value, element) { + return this.optional(element) || /^(([-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.)(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.){2}([1-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))$/.test(value); + }, $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo')); + + var form = $('#dac_form'); + var error = $('.alert-danger', form); + var success = $('.alert-success', form); + + form.validate({ + doNotHideMessage: true, //this option enables to show the error/success messages on tab switch. + errorElement: 'span', //default input error message container + errorClass: 'help-block', // default input error message class + focusInvalid: false, // do not focus the last invalid input + rules: { + + nodeLabel:{ + required: true, + maxlength:50 + }, + ipAddress:{ + required: true, + ip:true, + maxlength:20 + } + }, + messages: { + nodeLabel:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_dac_label_empty_errInfo') + }, + ipAddress:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_dac_ipaddress_empty_errInfo') + + }, + + }, + errorPlacement: function (error, element) { // render error placement for each input type + error.insertAfter(element); // for other inputs, just perform default behavior + }, + + invalidHandler: function (event, validator) { //display error alert on form submit + success.hide(); + error.show(); + //ZteFrameWork.scrollTo(error, -200); + }, + + highlight: function (element) { // hightlight error inputs + $(element) + .closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group + }, + + unhighlight: function (element) { // revert the change done by hightlight + $(element) + .closest('.form-group').removeClass('has-error'); // set error class to the control group + }, + + success: function (label) { + label + .addClass('valid') // mark the current input as valid and display OK icon + .closest('.form-group').removeClass('has-error'); // set success class to the control group + }, + submitHandler: function (form) { + success.show(); + error.hide(); + //add here some ajax code to submit your form or just call form.submit() if you want to submit the form without ajax + } + + }); + + +</script> + +</body> +</html>
\ No newline at end of file diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/i18n/umc-monitor-iui-i18n-en-US.properties b/openo-portal/portal-monitor/src/main/webapp/monitor/i18n/umc-monitor-iui-i18n-en-US.properties new file mode 100644 index 00000000..c8607f41 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/i18n/umc-monitor-iui-i18n-en-US.properties @@ -0,0 +1,102 @@ +# +# Copyright 2016, CMCC Technologies Co., Ltd. +# +# 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. +# +com_zte_openo_umc_monitor_monitorList_titeName=Monitor Para List +com_zte_openo_umc_monitor_monitorList_dac_manage= DAC Manage +com_zte_openo_umc_monitor_monitorList_monitor_sn=SN +com_zte_openo_umc_monitor_monitorList_monitor_name=Display Name +com_zte_openo_umc_monitor_monitorList_monitor_ipaddress=IP Address +com_zte_openo_umc_monitor_monitorList_monitor_type=Type +com_zte_openo_umc_monitor_monitorList_total=total +com_zte_openo_umc_monitor_monitorList_records=records +com_zte_openo_umc_monitor_monitorList_monitor_dacip=DAC +com_zte_openo_umc_monitor_monitorList_monitor_opr=Operation + + +com_zte_openo_umc_monitor_return=return +com_zte_openo_umc_monitor_dac_label=Node Label +com_zte_openo_umc_monitor_dac_ipaddress=IP Address +com_zte_openo_umc_monitor_dac_note=Note +com_zte_openo_umc_monitor_btn_save=Save +com_zte_openo_umc_monitor_btn_cancel=Cancel +com_zte_openo_umc_monitor_dac_register=Register DAC +com_zte_openo_umc_monitor_dac_edit=Edit DAC +com_zte_openo_umc_monitor_dac_panel_ipaddress=IP Address: +com_zte_openo_umc_monitor_dac_panel_note=Note: + +com_zte_openo_umc_monitor_dac_register_repeat_errInfo=DAC IP: {0} has been registerd +com_zte_openo_umc_monitor_dac_register_check_Info=check IPAddress and save DAC ,please wait +com_zte_openo_umc_monitor_dac_register_successInfo=DAC save success +com_zte_openo_umc_monitor_dac_update_successInfo=DAC update success +com_zte_openo_umc_monitor_dac_delete_sureInfo=Are you sure delete this DAC? +com_zte_openo_umc_monitor_dac_delete_successInfo=DAC delete success +com_zte_openo_umc_monitor_dac_query_failInfo=query DAC Info fail: +com_zte_openo_umc_monitor_dac_save_failInfo=DAC save fail: +com_zte_openo_umc_monitor_dac_delete_failInfo=DAC delete fail: +com_zte_openo_umc_monitor_tip=Tip: +com_zte_openo_umc_monitor_dac_label_empty_errInfo=please input Node Label +com_zte_openo_umc_monitor_dac_ipaddress_empty_errInfo=please input IP address + +com_zte_openo_umc_monitor_monitorsetting_delete=Delete +com_zte_openo_umc_monitor_monitorsetting_ipaddress=IP Address +com_zte_openo_umc_monitor_monitorsetting_dac=DAC +com_zte_openo_umc_monitor_monitorsetting_user=User +com_zte_openo_umc_monitor_monitorsetting_password=Password +com_zte_openo_umc_monitor_monitorsetting_protocol=Protocol +com_zte_openo_umc_monitor_monitorsetting_port=Port +com_zte_openo_umc_monitor_monitorsetting_version=Version +com_zte_openo_umc_monitor_monitorsetting_snmpport=SNMP Port +com_zte_openo_umc_monitor_monitorsetting_snmpversion=SNMP Version +com_zte_openo_umc_monitor_monitorsetting_snmpcommunity=SNMP Community + +com_zte_openo_umc_monitor_monitorsetting_titlename=Monitor Para Setting +com_zte_openo_umc_monitor_btn_monitorset=Monitor Set +com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo=Please input the correct IP address +com_zte_openo_umc_monitor_monitorsetting_user_empty_errInfo=please input Login User +com_zte_openo_umc_monitor_monitorsetting_password_empty_errInfo=please input Login Password +com_zte_openo_umc_monitor_monitorsetting_dac_empty_errInfo=please select DAC IP +com_zte_openo_umc_monitor_monitorsetting_protocol_empty_errInfo=please select Login Protocol +com_zte_openo_umc_monitor_monitorsetting_ipaddress_empty_errInfo=please input IP address +com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo=please input Login Port +com_zte_openo_umc_monitor_monitorsetting_name_empty_errInfo=please input Node Label + +com_zte_openo_umc_monitor_monitorsetting_query_list_errInfo=query monitor List fail +com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo=query monitor Instance fail +com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo=Monitor Set saveing...,please wait +com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo=Monitor Set save fail +com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo=Monitor Set save success +com_zte_openo_umc_monitor_monitorsetting_dac_query_failInfo=query DAC Info fail: +com_zte_openo_umc_monitor_monitorsetting_task_checkInfo=Monitor Task updating...,please wait +com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo=Monitor Task update fail: + + +openo-umc-monitor-iui-table-sLengthMenu=View _MENU_ records +openo-umc-monitor-iui-table-sZeroRecords=No matching records found +openo-umc-monitor-iui-table-sInfo= | Found total _TOTAL_ records +openo-umc-monitor-iui-table-sInfoEmpty=No records found to show +openo-umc-monitor-iui-table-sGroupActions=_TOTAL_ records selected: +openo-umc-monitor-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection. +openo-umc-monitor-iui-table-sEmptyTable=No data available in table +openo-umc-monitor-iui-table-sPrevious=Prev +openo-umc-monitor-iui-table-sNext=Next +openo-umc-monitor-iui-table-sPage=Page +openo-umc-monitor-iui-table-sPageOf=of +com_zte_openo_umc_monitor_monitorsetting_agentIP=Agent Ip +com_zte_openo_umc_monitor_monitorsetting_agentUsername=Agent Username +com_zte_openo_umc_monitor_monitorsetting_agentPassword=Agent Password +com_zte_openo_umc_monitor_monitorsetting_agentProtocol=Agent Protocol +com_zte_openo_umc_monitor_monitorsetting_agentPort=Agent Port +com_zte_openo_umc_monitor_monitorsetting_ppMaxCount=PP MaxCount + diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/images/throbber.gif b/openo-portal/portal-monitor/src/main/webapp/monitor/images/throbber.gif Binary files differnew file mode 100644 index 00000000..06393889 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/images/throbber.gif diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/js/dacController.js b/openo-portal/portal-monitor/src/main/webapp/monitor/js/dacController.js new file mode 100644 index 00000000..872be4d2 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/js/dacController.js @@ -0,0 +1,275 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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 vm = avalon + .define({ + $id : "dacController", + $queryDACsRestUrl : '/openoapi/umc/v1/monitor/dacs', + server_rtn:{ + info_block:false, + warning_block:false, + rtn_info:"" + }, + dacLoading:false, + dacChecking:false, + dacInfoArray : [], + dacInfo:{ + oid:"", + moc:"", + nodeLabel : '', + ipAddress : '', + note : '' + }, + dacDlgInfo:{ + titleName:"", + saveType:"" + }, + initDAC:function(){ + vm.dacLoading=true; + + $.ajax({ + "type": 'get', + "url": vm.$queryDACsRestUrl, + "dataType": "json", + success: function (resp) { + vm.dacInfoArray = (resp==null)?[]:resp; + vm.dacInfoArray.sort(function(a,b){return a.nodeLabel>b.nodeLabel?1:-1}); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + // bootbox.alert("query DAC Info fail:"+":"+errorThrown); + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_query_failInfo')+errorThrown,"danger"); + return; + }, + complete:function(){ + vm.dacLoading=false; + } + }); + }, + testDAC:function(){ + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info="DAC Access Test Pass"; + }, + addDAC:function(){ + + vm.dacInfo.oid=""; + vm.dacInfo.moc="it.dac"; + vm.dacInfo.nodeLabel=""; + vm.dacInfo.ipAddress=""; + vm.dacInfo.note=""; + + vm.dacDlgInfo.saveType = "add"; + vm.dacDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_dac_register'); + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=false; + + + $(".form-group").each(function () { + $(this).removeClass('has-success'); + $(this).removeClass('has-error'); + $(this).find(".help-block[id]").remove(); + }); + $("#dacDlg").modal("show"); + }, + saveDAC : function() { + success.hide(); + error.hide(); + if (form.valid() == false) { + return false; + } + + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info='<i class="fa fa-spinner fa-spin fa-lg"></i> '+$.i18n.prop('com_zte_openo_umc_monitor_dac_register_check_Info'); + + + var data= JSON.stringify({ + "oid":vm.dacInfo.oid, + "moc": vm.dacInfo.moc, + "nodeLabel":vm.dacInfo.nodeLabel, + "ipAddress":vm.dacInfo.ipAddress, + "note":vm.dacInfo.note + }); + + if(vm.dacDlgInfo.saveType=="add") + { + vm.dacChecking=true; + for(var i=0;i<vm.dacInfoArray.length;i++){ + + if(vm.dacInfoArray[i].ipAddress==vm.dacInfo.ipAddress) + { + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_register_repeat_errInfo',[vm.dacInfo.ipAddress]); + vm.dacChecking=false; + return; + } + + } + + $.ajax({ + "type": 'POST', + "url": vm.$queryDACsRestUrl, + "data" : data, + "dataType": "json", + "contentType":"application/json", + success: function (resp) { + if(resp.result=="SUCCESS"){ + var newDac=JSON.parse(data); + newDac.oid=resp.info; + + vm.dacInfoArray.push(newDac); + // vm.dacInfoArray.sort(function(a,b){return a.nodeLabel>b.nodeLabel?1:-1}); + $('#dacDlg').modal('hide'); + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_register_successInfo'),"success"); + vm.dacChecking=false; + } + else{ + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= resp.info; + vm.dacChecking=false; + } + + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_save_failInfo')+errorThrown; + vm.dacChecking=false; + + } + }); + } + else{ + + $.ajax({ + "type": 'PUT', + "url": vm.$queryDACsRestUrl, + "data" :data, + "dataType": "json", + "contentType":"application/json", + success: function (resp) { + if(resp.result=="SUCCESS"){ + for(var i=0;i<vm.dacInfoArray.length;i++){ + if(vm.dacInfoArray[i].oid == vm.dacInfo.oid) + { + vm.dacInfoArray[i].nodeLabel=vm.dacInfo.nodeLabel; + vm.dacInfoArray[i].ipAddress=vm.dacInfo.ipAddress; + vm.dacInfoArray[i].note=vm.dacInfo.note; + + + break; + } + } + + + + $('#dacDlg').modal('hide'); + + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_update_successInfo'),"success"); + + } + else{ + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= resp.info; + } + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_save_failInfo')+errorThrown; + + } + }); + + + } + + + }, + updateDAC:function(dacInfo){ + + vm.dacInfo.oid=dacInfo.oid; + vm.dacInfo.moc=dacInfo.moc; + vm.dacInfo.nodeLabel=dacInfo.nodeLabel; + vm.dacInfo.ipAddress=dacInfo.ipAddress; + vm.dacInfo.note=dacInfo.note; + + + vm.dacDlgInfo.saveType = "update"; + vm.dacDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_dac_edit'); + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=false; + + + $(".form-group").each(function () { + $(this).removeClass('has-success'); + $(this).removeClass('has-error'); + $(this).find(".help-block[id]").remove(); + }); + + $("#dacDlg").modal("show"); + }, + delDAC:function(oid){ + bootbox.confirm($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_sureInfo'),function(result){ + if(result){ + $.ajax({ + "type": 'DELETE', + "url": vm.$queryDACsRestUrl+"/"+oid, + "dataType": "json", + success: function (resp) { + + if(resp.result=="SUCCESS"){ + for(var i=0;i<vm.dacInfoArray.length;i++){ + if(vm.dacInfoArray[i].oid == oid){ + vm.dacInfoArray.splice(i, 1); + break; + } + } + + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_successInfo'),"success"); + } + else{ + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_failInfo')+resp.info,"danger"); + } + + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_failInfo')+errorThrown,"danger"); + + } + }); + } + + + }); + + }, + gotoMonitorPage:function(){ + window.location.href="monitorSettingList.html"; + } + + + }); +avalon.scan(); +vm.initDAC(); diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/js/loadi18nApp_ngict-umc-monitor.js b/openo-portal/portal-monitor/src/main/webapp/monitor/js/loadi18nApp_ngict-umc-monitor.js new file mode 100644 index 00000000..590f13a4 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/js/loadi18nApp_ngict-umc-monitor.js @@ -0,0 +1,43 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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. + */ +function loadPropertiesSideMenu(lang, propertiesFileNamePrefix, propertiesFilePath){ + jQuery.i18n.properties({ + language:lang, + name:propertiesFileNamePrefix, + path:propertiesFilePath, + mode:'map', + callback: function() { + var i18nItems = $('[name_i18n=com_zte_openo_umc_monitor_ui_i18n]'); + for(var i=0;i<i18nItems.length;i++){ + var $item = $(i18nItems.eq(i)); + var itemId = $item.attr('id'); + var itemTitle = $item.attr('title'); + + if(typeof($item.attr("title")) == "string"){ + $item.attr("title", ($.i18n.prop(itemTitle))); + } + + if(undefined != itemId && typeof($item.attr("placeholder"))=="undefined"){ + $item.text($.i18n.prop(itemId)); + }else if(undefined != itemId && typeof($item.attr("placeholder"))!="undefined"){ + $item.attr("placeholder", $.i18n.prop(itemId)); + } + } + } + }); +} + + diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingController.js b/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingController.js new file mode 100644 index 00000000..6eb0c4f2 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingController.js @@ -0,0 +1,429 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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 vm = avalon + .define({ + $id : "monitorController", + server_rtn:{ + info_block:false, + warning_block:false, + rtn_info:"" + }, + resource:{ + monitorList:[] + }, + ifPROXYIPChange:"", + monitorUrl:"", + oldmonitorInfo:{ + ipAddress:"", + label:"", + customPara:{ + + } + }, + monitorInfo:{ + oid:"", + origin:"", + neTypeId:"", + label:"", + ipAddress:"", + extendPara:"", + customPara:{ + + } + }, + dataTableLanguage: { + "sProcessing": "<img src='/openoui/common/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span> Loadding...</span>", + "sLengthMenu": $.i18n.prop("openo-umc-monitor-iui-table-sLengthMenu"), + "sZeroRecords": $.i18n.prop("openo-umc-monitor-iui-table-sZeroRecords"), + "sInfo": "<span class='seperator'></span>" + $.i18n.prop("openo-umc-monitor-iui-table-sInfo"), + "sInfoEmpty": $.i18n.prop("openo-umc-monitor-iui-table-sInfoEmpty"), + "sGroupActions": $.i18n.prop("openo-umc-monitor-iui-table-sGroupActions"), + "sAjaxRequestGeneralError": $.i18n.prop("openo-umc-monitor-iui-table-sAjaxRequestGeneralError"), + "sEmptyTable": $.i18n.prop("openo-umc-monitor-iui-table-sEmptyTable"), + "oPaginate": { + "sPrevious": $.i18n.prop("openo-umc-monitor-iui-table-sPrevious"), + "sNext": $.i18n.prop("openo-umc-monitor-iui-table-sNext"), + "sPage": $.i18n.prop("openo-umc-monitor-iui-table-sPage"), + "sPageOf": $.i18n.prop("openo-umc-monitor-iui-table-sPageOf") + } + }, + + $monitorListRestUrl :'/openoapi/umc/v1/monitor/monitorinfos', + $monitorInstanceRestUrl :'/openoapi/umc/v1/monitor/monitorinfo/', + $queryDacsRestUrl : '/openoapi/umc/v1/monitor/dacs', + $updateMonitorTaskRestUrl : '/openoapi/umc/v1/monitor/monitortask/', + + $loginProtocol: { + selectItems : [ + { + cond_value : 'SSH', + name :"SSH" + }, + { + cond_value : 'TELNET', + name : "TELNET" + } + + ] + }, + dac: { + selectItems : [] + }, + + monitorSettingDlgInfo:{ + titleName:"", + saveType:"" + }, + queryMonitorList : function() { + + $.ajax({ + "type": 'get', + "url": vm.$monitorListRestUrl, + "dataType": "json", + "success": function (resp) { + for(index in resp) + { + var monitorInfo=resp[index] + var customPara={}; + if(monitorInfo.customPara!=""){ + customPara=JSON.parse(monitorInfo.customPara); + if(typeof(customPara.PROXYIP) == "undefined") + { + customPara.PROXYIP="127.0.0.1"; + } + } + else{ + customPara={PROXYIP:"127.0.0.1"}; + } + monitorInfo.customPara=customPara; + } + + vm.resource.monitorList = resp; + + $('#monitorManagerTable').DataTable({ + "oLanguage": vm.dataTableLanguage, + "sDom": '<"top"rt><"bottom"lip>', + "sPaginationType": "bootstrap_extended", + "bSort": false + }); + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_list_errInfo')+errorThrown,"danger"); + } + + }); + + + }, + queryMonitorInstance : function(oid){ + + vm.monitorInfo.oid=oid; + vm.monitorUrl=vm.$monitorInstanceRestUrl+oid; + + $.ajax({ + "type": 'GET', + "url": vm.monitorUrl, + "dataType": "json", + "success": function (resp) { + + var monitorInfo=resp; + var customPara={}; + if(monitorInfo.customPara!=""){ + customPara=JSON.parse(monitorInfo.customPara); + if(typeof(customPara.PROXYIP) == "undefined") + { + customPara.PROXYIP="127.0.0.1"; + } + } + else{ + customPara={PROXYIP:"127.0.0.1"}; + } + monitorInfo.customPara=customPara; + vm.monitorInfo=monitorInfo; + + vm.oldmonitorInfo.ipAddress=monitorInfo.ipAddress; + vm.oldmonitorInfo.label=monitorInfo.label; + vm.oldmonitorInfo.customPara=customPara; + + + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo')+errorThrown,"danger"); + } + + + }); + + }, + + deleteMonitorInfo : function(oid){ + vm.monitorInfo.oid=oid; + vm.monitorUrl=vm.$monitorInstanceRestUrl+oid; + + $.ajax({ + "type": 'DELETE', + "url": vm.monitorUrl, + "dataType": "json", + "success": function (resp) { + vm.gotoMonitorListPage(); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo')+errorThrown,"danger"); + } + + + }); + + }, + updateMonitorSet:function(){ + + + vm.monitorSettingDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_btn_monitorset'); + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=false; + + $(".form-group").each(function () { + $(this).removeClass('has-success'); + $(this).removeClass('has-error'); + $(this).find(".help-block[id]").remove(); + }); + + if(vm.monitorInfo.customPara.PROXYIP=="" && vm.dac.selectItems.length>0){ + vm.monitorInfo.customPara.PROXYIP=vm.dac.selectItems[0].ipAddress; + } + + if(vm.monitorInfo.customPara.PROTOCOL==""){ + vm.monitorInfo.customPara.PROTOCOL="SSH"; + vm.monitorInfo.customPara.PORT="22"; + } + + $("#monitorSettingDlg").modal("show"); + }, + testMonitorSet:function(){ + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info="Monitor Set Access Test Pass"; + }, + saveMonitorSet : function() { + success.hide(); + error.hide(); + if (form.valid() == false) { + return false; + } + var propertyNames=vm.monitorInfo.customPara.$propertyNames.split("­"); + var isPropertyUnEqual=false; + for(index in propertyNames) + { + var name=propertyNames[index] + if(vm.oldmonitorInfo.customPara[name]!=vm.monitorInfo.customPara[name]) + { + isPropertyUnEqual=true; + break; + } + } + // judge monitorInfo whether change + if( vm.oldmonitorInfo.ipAddress!=vm.monitorInfo.ipAddress || + isPropertyUnEqual){ + + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo'); + var customPara=JSON.stringify(vm.monitorInfo.customPara.$model); + $.ajax({ + "type": 'POST', + "url": vm.monitorUrl, + "data": JSON.stringify({ + "ipAddress": vm.monitorInfo.ipAddress, + "oid": vm.monitorInfo.oid, + "neTypeId": vm.monitorInfo.neTypeId, + "label": vm.monitorInfo.label, + "origin": vm.monitorInfo.origin, + "extendPara": vm.monitorInfo.extendPara, + "customPara": customPara + }), + "dataType": "json", + "contentType" : "application/json", + success: function (resp) { + // judge PROXYIP whether change + + if(vm.oldmonitorInfo.customPara.PROXYIP!=vm.monitorInfo.customPara.PROXYIP){ + vm.ifPROXYIPChange=1; + } + else{ + vm.ifPROXYIPChange=0; + } + + vm.updateMonitorTask(); + + vm.oldmonitorInfo.ipAddress=vm.monitorInfo.ipAddress; + vm.oldmonitorInfo.label=vm.monitorInfo.label; + var customPara=vm.monitorInfo.customPara.$model; + vm.oldmonitorInfo.customPara=customPara; + + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo')+errorThrown; + } + }); + + } + else if(vm.oldmonitorInfo.label!=vm.monitorInfo.label){ + //only change label label + + //save new monitorInfo + + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo'); + var customPara=JSON.stringify(vm.monitorInfo.customPara.$model); + + $.ajax({ + "type": 'POST', + "url": vm.monitorUrl, + "data": JSON.stringify({ + "ipAddress": vm.monitorInfo.ipAddress, + "oid": vm.monitorInfo.oid, + "neTypeId": vm.monitorInfo.neTypeId, + "label": vm.monitorInfo.label, + "origin": vm.monitorInfo.origin, + "extendPara": vm.monitorInfo.extendPara, + "customPara": customPara + }), + "dataType": "json", + "contentType" : "application/json", + success: function (resp) { + if(resp.result=="SUCCESS"){ + + vm.oldmonitorInfo.label=vm.monitorInfo.label; + $('#monitorSettingDlg').modal('hide'); + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success"); + + + } + else{ + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo'); + } + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo')+errorThrown; + } + }); + + } + else{ + //no change + $('#monitorSettingDlg').modal('hide'); + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success"); + } + + + + + + }, + cancelMonitorSet: function() { + + vm.monitorInfo.ipAddress=vm.oldmonitorInfo.ipAddress; + vm.monitorInfo.name=vm.oldmonitorInfo.name; + vm.monitorInfo.customPara=vm.oldmonitorInfo.customPara; + $('#monitorSettingDlg').modal('hide'); + + }, + queryDACs:function(){ + + + $.ajax({ + "type": 'get', + "url": vm.$queryDacsRestUrl, + "dataType": "json", + success: function (resp) { + vm.dac.selectItems = (resp==null)?[]:resp; + // vm.proxy.selectItems.sort(function(a,b){return a.ipAddress>b.ipAddress?1:-1}); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_dac_query_failInfo')+errorThrown,"danger"); + } + }); + }, + updateMonitorTask:function(){ + vm.server_rtn.warning_block=false; + vm.server_rtn.info_block=true; + vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_task_checkInfo'); + + + var data= JSON.stringify({ + oid:vm.monitorInfo.oid, + moc:vm.monitorInfo.neTypeId, + proxyIp:vm.monitorInfo.customPara.PROXYIP + }); + + $.ajax({ + "type": 'PUT', + "url": vm.$updateMonitorTaskRestUrl+vm.ifPROXYIPChange, + "data" :data, + "dataType": "json", + "contentType":"application/json", + success: function (resp) { + if(resp.result=="SUCCESS"){ + + $('#monitorSettingDlg').modal('hide'); + monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success"); + + } + else + { + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo')+resp.info; + } + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + + vm.server_rtn.warning_block=true; + vm.server_rtn.info_block=false; + vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo')+errorThrown; + + } + }); + + }, + gotoDACPage:function(){ + window.location.href="dacList.html"; + }, + gotoMonitorSettingPage:function(oid){ + window.location.href="monitorSetting.html?"+oid; + }, + gotoMonitorListPage:function(){ + window.location.href="monitorSettingList.html"; + } + }); + +avalon.scan(); + + diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingUtil.js b/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingUtil.js new file mode 100644 index 00000000..b1792afe --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/js/monitorSettingUtil.js @@ -0,0 +1,169 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * 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 monitorUtil = {}; + +monitorUtil.growl=function(message,type){ + var delay; + if(type=="success"){ + delay=3000; + } + else{ + delay=0; + } + + $.growl({ + icon: "fa fa-envelope-o fa-lg", + title: " "+$.i18n.prop('com_zte_openo_umc_monitor_tip')+" ", + message: message+" " + },{ + type: type, + delay:delay + }); +} + + +$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) { + return { + "iEnd": oSettings.fnDisplayEnd(), + "iLength": oSettings._iDisplayLength, + "iTotal": oSettings.fnRecordsTotal(), + "iFilteredTotal": oSettings.fnRecordsDisplay(), + "iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength), + "iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength) + }; +}; + +$.extend($.fn.dataTableExt.oPagination, { + "bootstrap_extended": { + "fnInit": function (oSettings, nPaging, fnDraw) { + var oLang = oSettings.oLanguage.oPaginate; + var oPaging = oSettings.oInstance.fnPagingInfo(); + + var fnClickHandler = function (e) { + e.preventDefault(); + if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) { + fnDraw(oSettings); + } + }; + + $(nPaging).append( + '<div class="pagination-panel"> ' + oLang.sPage + ' ' + + '<a href="#" class="btn btn-sm default prev disabled" title="' + oLang.sPrevious + '"><i class="fa fa-angle-left"></i></a>' + + '<input type="text" class="pagination-panel-input input-mini input-inline input-sm" maxlenght="5" style="text-align:center; margin: 0 4px; border: 1px solid rgb(169, 169, 169);height: 28px;">' + + '<a href="#" class="btn btn-sm default next disabled" title="' + oLang.sNext + '"><i class="fa fa-angle-right"></i></a> ' + + oLang.sPageOf + ' <span class="pagination-panel-total"></span>' + + '</div>' + ); + + var els = $('a', nPaging); + + $(els[0]).bind('click.DT', {action: "previous"}, fnClickHandler); + $(els[1]).bind('click.DT', {action: "next"}, fnClickHandler); + + $('.pagination-panel-input', nPaging).bind('change.DT', function (e) { + var oPaging = oSettings.oInstance.fnPagingInfo(); + e.preventDefault(); + var page = parseInt($(this).val()); + if (page > 0 && page < oPaging.iTotalPages) { + if (oSettings.oApi._fnPageChange(oSettings, page - 1)) { + fnDraw(oSettings); + } + } else { + $(this).val(oPaging.iPage + 1); + } + }); + + $('.pagination-panel-input', nPaging).bind('keypress.DT', function (e) { + var oPaging = oSettings.oInstance.fnPagingInfo(); + if (e.which == 13) { + var page = parseInt($(this).val()); + if (page > 0 && page < oSettings.oInstance.fnPagingInfo().iTotalPages) { + if (oSettings.oApi._fnPageChange(oSettings, page - 1)) { + fnDraw(oSettings); + } + } else { + $(this).val(oPaging.iPage + 1); + } + e.preventDefault(); + } + }); + }, + + "fnUpdate": function (oSettings, fnDraw) { + var iListLength = 5; + var oPaging = oSettings.oInstance.fnPagingInfo(); + var an = oSettings.aanFeatures.p; + var i, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2); + + if (oPaging.iTotalPages < iListLength) { + iStart = 1; + iEnd = oPaging.iTotalPages; + } + else if (oPaging.iPage <= iHalf) { + iStart = 1; + iEnd = iListLength; + } else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) { + iStart = oPaging.iTotalPages - iListLength + 1; + iEnd = oPaging.iTotalPages; + } else { + iStart = oPaging.iPage - iHalf + 1; + iEnd = iStart + iListLength - 1; + } + + + for (i = 0, iLen = an.length; i < iLen; i++) { + var wrapper = $(an[i]).parents(".dataTables_wrapper"); + + if (oPaging.iTotalPages <= 0) { + $('.pagination-panel, .dataTables_length', wrapper).hide(); + } else { + $('.pagination-panel, .dataTables_length', wrapper).show(); + } + + $('.pagination-panel-total', an[i]).html(oPaging.iTotalPages); + $('.pagination-panel-input', an[i]).val(oPaging.iPage + 1); + + // Remove the middle elements + $('li:gt(1)', an[i]).filter(':not(.next)').remove(); + + // Add the new list items and their event handlers + for (j = iStart; j <= iEnd; j++) { + sClass = (j == oPaging.iPage + 1) ? 'class="active"' : ''; + $('<li ' + sClass + '><a href="#">' + j + '</a></li>') + .insertBefore($('li.next:first', an[i])[0]) + .bind('click', function (e) { + e.preventDefault(); + oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength; + fnDraw(oSettings); + }); + } + + // Add / remove disabled classes from the static elements + if (oPaging.iPage === 0) { + $('a.prev', an[i]).addClass('disabled'); + } else { + $('a.prev', an[i]).removeClass('disabled'); + } + + if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) { + $('a.next', an[i]).addClass('disabled'); + } else { + $('a.next', an[i]).removeClass('disabled'); + } + } + } + } +}); diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSetting.html b/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSetting.html new file mode 100644 index 00000000..92a97baa --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSetting.html @@ -0,0 +1,480 @@ +<!-- + Copyright 2016, CMCC Technologies Co., Ltd. + + 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. +--> +<!DOCTYPE html> +<html> +<head lang="en"> +<meta charset="UTF-8"> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/font-awesome/css/font-awesome.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/bootstrap/css/bootstrap.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ngict-component.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ZteIctIcons/style.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/animate/animate.min.css"/> + <link rel="stylesheet" type="text/css" href="css/monitorSetting.css"/> + <style> + .ms-controller { + visibility: hidden + } + </style> +</head> +<body> +<div> + <div class="container-fluid" class="ms-controller" ms-controller="monitorController"> + + <div id="monitorSettingDlg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="content"> + <div class="modal-header"> + <button type="button" class="close" ms-click="cancelMonitorSet()">×</button> + <h4 id="myModalLabel" ms-text="monitorSettingDlgInfo.titleName"></h4> + </div> + <div class="modal-body"> + <div class="alert alert-info" ms-visible="server_rtn.info_block" ms-text="server_rtn.rtn_info"></div> + <div class="alert alert-danger " ms-visible="server_rtn.warning_block" ms-text="server_rtn.rtn_info"></div> + <form class="form-horizontal" id="monitorSetting_form" role="form"> + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="name" ms-duplex="monitorInfo.label" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="ipAddress" ms-duplex="monitorInfo.ipAddress" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_dac" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <select ms-each="dac.selectItems" name="PROXYIP" ms-duplex="monitorInfo.customPara.PROXYIP" class="form-control" style="width:150px"> + <option ms-attr-value='el.ipAddress'>{{el.ipAddress}}</option> + </select> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.VERSION!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_version" name_i18n="com_zte_openo_umc_monitor_ui_i18n">version</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="VERSION" ms-duplex="monitorInfo.customPara.VERSION" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.USERNAME!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_user" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login User</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="USERNAME" ms-duplex="monitorInfo.customPara.USERNAME" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group" ms-if="monitorInfo.customPara.PASSWORD!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_password" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Password</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="password" name="PASSWORD" ms-duplex="monitorInfo.customPara.PASSWORD" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group" ms-if="monitorInfo.customPara.PROTOCOL!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_protocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Protocol</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <select ms-each="$loginProtocol.selectItems" ms-duplex="monitorInfo.customPara.PROTOCOL" class="form-control" style="width:150px" name="ROTOCOL" id="select_protocol"> + <option ms-attr-value='el.cond_value'>{{el.name}}</option> + </select> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group" ms-if="monitorInfo.customPara.PORT!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Port</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="PORT" ms-duplex="monitorInfo.customPara.PORT" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group" ms-if="monitorInfo.customPara.DBPORT!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Port</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="DBPORT" ms-duplex="monitorInfo.customPara.DBPORT" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + + <div class="form-group" ms-if="monitorInfo.customPara.SNMPPORT!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_snmpport" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Port</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="SNMPPORT" ms-duplex="monitorInfo.customPara.SNMPPORT" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.SNMPVERSION!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_snmpversion" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Version</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="SNMPVERSION" ms-duplex="monitorInfo.customPara.SNMPVERSION" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.SNMPCOMMUNITY!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_snmpcommunity" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Community</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="SNMPCOMMUNITY" ms-duplex="monitorInfo.customPara.SNMPCOMMUNITY" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.IPADDRESS2!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_agentIP" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent IP</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="IPADDRESS2" ms-duplex="monitorInfo.customPara.IPADDRESS2" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.USERNAME2!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_agentUsername" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Username</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="USERNAME2" ms-duplex="monitorInfo.customPara.USERNAME2" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.PASSWORD2!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_agentPassword" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Password</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="PASSWORD2" ms-duplex="monitorInfo.customPara.PASSWORD2" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.PROTOCOL2!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_agentProtocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Protocol</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="PROTOCOL2" ms-duplex="monitorInfo.customPara.PROTOCOL2" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.PORT2!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_agentPort" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent port</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="PORT2" ms-duplex="monitorInfo.customPara.PORT2" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + <div class="form-group" ms-if="monitorInfo.customPara.PPMAXCOUNT!=null"> + <label class="control-label col-sm-3"> + <span id="com_zte_openo_umc_monitor_monitorsetting_ppMaxCount" name_i18n="com_zte_openo_umc_monitor_ui_i18n">PP Max Count</span> + <span class="required" aria-required="true">*</span> + </label> + <div class="col-sm-7"> + <input type="text" name="PPMAXCOUNT" ms-duplex="monitorInfo.customPara.PPMAXCOUNT" class="form-control"/> + <span class="help-block"></span> + </div> + </div> + </form> + </div> + <div class="modal-footer"> + <button class="btn btn-primary" type="submit" ms-click="saveMonitorSet()" id="com_zte_openo_umc_monitor_btn_save" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Save</button> + <button class="btn" ms-click="cancelMonitorSet()" id="com_zte_openo_umc_monitor_btn_cancel" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Cancel</button> + </div> + </div> + </div> + </div> + </div> + + <div class="row" style=" margin-top: 15px;"> + <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6"> + <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorsetting_titlename" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Para Setting </span> + + </div> + <div class="pull-right"> + <a href="#" ms-click="gotoMonitorListPage()" ><i class="fa fa-reply "></i> <span id="com_zte_openo_umc_monitor_return" name_i18n="com_zte_openo_umc_monitor_ui_i18n">return</span></a> + + </div> + + </div> + <div class="separator-line"></div> + + <div class="row row-fluid"> + + <button class="btn white radius_l" id="app-new-btn" style=" margin-bottom: 10px;" + ms-click="updateMonitorSet()"> + <i class="ict-gear"></i> <span id="com_zte_openo_umc_monitor_btn_monitorset" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Set</span> + </button> + + + <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 row" > + + <div class="form-body"> + + <div style="width:100%;" id="MonitorContent" class="collapse in main collapseContent"> + <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 border-right" > + <div class="monitor-icon"> + <div class="timeline-badge info"> + <i class="ict-VDU"></i> + </div> + </div> + <div style="float:left"> + <ul> + <li><b><span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.label"></span></li> + <li><b><span id="com_zte_openo_umc_monitor_monitorsetting_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.ipAddress"></span></li> + <li><b><span id="com_zte_openo_umc_monitor_monitorsetting_dac" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROXYIP"></span></li> + + </ul> + </div> + </div> + + <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6" > + + <div class="proxy_div"> + <ul> + <li ms-if="monitorInfo.customPara.VERSION!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_version" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.VERSION"></span></li> + <li ms-if="monitorInfo.customPara.USERNAME!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_user" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.USERNAME"></span></li> + <li ms-if="monitorInfo.customPara.PROTOCOL!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_protocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROTOCOL"></span></li> + <li ms-if="monitorInfo.customPara.PORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PORT"></span></li> + <li ms-if="monitorInfo.customPara.DBPORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.DBPORT"></span></li> + <li ms-if="monitorInfo.customPara.SNMPPORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpport" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPPORT"></span></li> + <li ms-if="monitorInfo.customPara.SNMPVERSION!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpversion" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPVERSION"></span></li> + <li ms-if="monitorInfo.customPara.SNMPCOMMUNITY!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpcommunity" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPCOMMUNITY"></span></li> + <li ms-if="monitorInfo.customPara.IPADDRESS2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentIP" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.IPADDRESS2"></span></li> + <li ms-if="monitorInfo.customPara.USERNAME2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentUsername" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.USERNAME2"></span></li> + <li ms-if="monitorInfo.customPara.PASSWORD2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentPassword" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PASSWORD2"></span></li> + <li ms-if="monitorInfo.customPara.PROTOCOL2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentProtocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROTOCOL2"></span></li> + <li ms-if="monitorInfo.customPara.PORT2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentPort" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PORT2"></span></li> + <li ms-if="monitorInfo.customPara.PPMAXCOUNT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_ppMaxCount" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PPMAXCOUNT"></span></li> + </ul> + </div> + </div> + + </div> + </div> + </div> + + + + </div> + + +</div> + +<script type="text/javascript" src="/openoui/common/thirdparty/jquery/jquery-1.10.2.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap/js/bootstrap.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery-validation/js/jquery.validate.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap-growl/bootstrap-growl.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/avalon/avalon.js"></script> +<script type="text/javascript" src="/openoui/common/js/tools.js"></script> +<script type="text/javascript" src="/openoui/common/js/core/hk.min.js" ></script> +<script type="text/javascript" src="js/monitorSettingUtil.js"></script> +<script type="text/javascript" src="js/monitorSettingController.js"></script> +<script type="text/javascript" src="js/loadi18nApp_ngict-umc-monitor.js"></script> + +<script> + + + + var lang= getLanguage(); + loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/'); + + + var monitorUrlParm = window.location.search.split(":"); + if (monitorUrlParm && monitorUrlParm.length > 0) { + var oid = decodeURIComponent(monitorUrlParm[0]).replace("?",""); + + } + + vm.queryMonitorInstance(oid); + vm.queryDACs(); + + + + + jQuery.validator.addMethod("ip", function(value, element) { + return this.optional(element) || /^(([-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.)(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.){2}([1-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))$/.test(value); + }, $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo')); + + var form = $('#monitorSetting_form'); + var error = $('.alert-danger', form); + var success = $('.alert-success', form); + + form.validate({ + doNotHideMessage: true, //this option enables to show the error/success messages on tab switch. + errorElement: 'span', //default input error message container + errorClass: 'help-block', // default input error message class + focusInvalid: false, // do not focus the last invalid input + rules: { + + USERNAME:{ + required: true, + maxlength:30 + }, + PASSWORD:{ + required: true, + maxlength:30 + }, + PORT:{ + required: true, + digits:true, + maxlength:5 + }, + DBPORT:{ + required: true, + digits:true, + maxlength:5 + }, + PROXYIP:{ + required: true, + }, + PROTOCOL:{ + required: true + }, + ipAddress:{ + required: true, + ip:true, + maxlength:20 + }, + name:{ + required: true, + maxlength:30 + } + }, + messages: { + USERNAME:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_user_empty_errInfo') + + }, + PASSWORD:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_password_empty_errInfo') + }, + PORT:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo') + }, + DBPORT:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo') + }, + PROXYIP:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_dac_empty_errInfo') + }, + PROTOCOL:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_protocol_empty_errInfo') + }, + ipAddress:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_empty_errInfo') + }, + name:{ + required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_name_empty_errInfo') + } + + }, + errorPlacement: function (error, element) { // render error placement for each input type + error.insertAfter(element); // for other inputs, just perform default behavior + }, + + invalidHandler: function (event, validator) { //display error alert on form submit + success.hide(); + error.show(); + //ZteFrameWork.scrollTo(error, -200); + }, + + highlight: function (element) { // hightlight error inputs + $(element) + .closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group + }, + + unhighlight: function (element) { // revert the change done by hightlight + $(element) + .closest('.form-group').removeClass('has-error'); // set error class to the control group + }, + + success: function (label) { + label + .addClass('valid') // mark the current input as valid and display OK icon + .closest('.form-group').removeClass('has-error'); // set success class to the control group + }, + submitHandler: function (form) { + success.show(); + error.hide(); + //add here some ajax code to submit your form or just call form.submit() if you want to submit the form without ajax + } + + }); + + $("#select_protocol").change(function(){ + var checkValue=$("#select_protocol").val(); + if(checkValue=="SSH"){ + vm.monitorInfo.customPara.LOGINPORT="22"; + } + else if(checkValue=="TELNET"){ + vm.monitorInfo.customPara.LOGINPORT="23"; + } + }); + +</script> + +</body> +</html>
\ No newline at end of file diff --git a/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSettingList.html b/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSettingList.html new file mode 100644 index 00000000..ec8dbfe7 --- /dev/null +++ b/openo-portal/portal-monitor/src/main/webapp/monitor/monitorSettingList.html @@ -0,0 +1,103 @@ +<!-- + Copyright 2016, CMCC Technologies Co., Ltd. + + 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. +--> +<!DOCTYPE html> +<html> +<head lang="en"> +<meta charset="UTF-8"> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/font-awesome/css/font-awesome.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/bootstrap/css/bootstrap.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/animate/animate.min.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/thirdparty/data-tables/dataTables.bootstrap.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ngict-component.css"/> + <link rel="stylesheet" type="text/css" href="/openoui/common/css/ZteIctIcons/style.css"/> + <link rel="stylesheet" type="text/css" href="css/monitorSetting.css"/> + <style> + .ms-controller { + visibility: hidden + } + </style> +</head> +<body> + + <div class="container-fluid" class="ms-controller" ms-controller="monitorController"> + + + + <div class="row" style=" margin-top: 15px;"> + <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6"> + <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorList_titeName" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Para List </span> + </div> + + </div> + <div class="separator-line"></div> + <button class="btn white radius_l" id="app-new-btn" style=" margin-bottom: 10px;" ms-click="gotoDACPage()"> + <i class="ict-it-net"></i> + <span id="com_zte_openo_umc_monitor_monitorList_dac_manage" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span> + </button> + + + <div class="row row-fluid"> + <table class="table table-striped table-bordered table-hover dataTable " id="monitorManagerTable"> + <thead> + <tr class="heading"> + <th style="width: 80px;" id="com_zte_openo_umc_monitor_monitorList_monitor_sn" name_i18n="com_zte_openo_umc_monitor_ui_i18n">SN</th> + <th id="com_zte_openo_umc_monitor_monitorList_monitor_name" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Display Name</th> + <th id="com_zte_openo_umc_monitor_monitorList_monitor_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</th> + <th id="com_zte_openo_umc_monitor_monitorList_monitor_dacip" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC IP Address</th> + <th id="com_zte_openo_umc_monitor_monitorList_monitor_type" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Type</th> + <th id="com_zte_openo_umc_monitor_monitorList_monitor_opr" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Opr</th> + + </tr> + </thead> + <tbody ms-each-monitor="resource.monitorList"> + <tr> + <td>{{$index+1}}</td> + <td><a href="#" ms-click="gotoMonitorSettingPage(monitor.oid)">{{monitor.label}}</a></td> + <td ms-text="monitor.ipAddress"></td> + <td ms-text="monitor.customPara.PROXYIP"></td> + <td>{{monitor.neTypeId}}</td> + <td> + <a href="#" ms-click="deleteMonitorInfo(monitor.oid)"> + <span id="com_zte_openo_umc_monitor_monitorsetting_delete" name_i18n="com_zte_openo_umc_monitor_ui_i18n">delete</span> + </a> + </td> + </tr> + </tbody> + </table> + </div> + </div> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery/jquery-1.10.2.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap/js/bootstrap.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script> +<script type="text/javascript" src="js/loadi18nApp_ngict-umc-monitor.js"></script> +<script type="text/javascript" src="/openoui/common/js/tools.js"></script> +<script type="text/javascript" src="/openoui/common/js/core/hk.min.js" ></script> +<script type="text/javascript"> + var lang= getLanguage(); + loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/'); +</script> +<script type="text/javascript" src="/openoui/common/thirdparty/data-tables/jquery.dataTables.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/bootstrap-growl/bootstrap-growl.min.js"></script> +<script type="text/javascript" src="/openoui/common/thirdparty/avalon/avalon.js"></script> +<script type="text/javascript" src="js/monitorSettingUtil.js"></script> +<script type="text/javascript" src="js/monitorSettingController.js"></script> +<script> + $(function(){ + vm.queryMonitorList(); + }); +</script> +</body> +</html> |