From 33796336d546fa61a3906500ea56d77c960ab222 Mon Sep 17 00:00:00 2001 From: “shentao” Date: Fri, 21 Oct 2016 15:05:13 +0800 Subject: GSO-35 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3ad00c3c9265a1b3818decedca1d77995864ba29 Signed-off-by: “shentao” --- openo-portal/portal-performance/pom.xml | 40 + .../src/main/webapp/performance/alarm_view.html | 324 ++++++ .../main/webapp/performance/css/alarmsQuery.css | 737 +++++++++++++ .../webapp/performance/css/performanceChart.css | 45 + .../webapp/performance/css/performanceQuery.css | 828 ++++++++++++++ .../src/main/webapp/performance/css/pmQueryBox.css | 299 +++++ .../i18n/web-alarm-i18n-en-US.properties | 108 ++ .../i18n/web-performance-i18n-en-US.properties | 130 +++ .../main/webapp/performance/image/aos_view-fm.gif | Bin 0 -> 205 bytes .../src/main/webapp/performance/image/arrow.png | Bin 0 -> 5680 bytes .../main/webapp/performance/image/chart_icon.png | Bin 0 -> 1727 bytes .../src/main/webapp/performance/image/delete.png | Bin 0 -> 3029 bytes .../webapp/performance/image/details_close.png | Bin 0 -> 3300 bytes .../main/webapp/performance/image/details_open.png | Bin 0 -> 3304 bytes .../src/main/webapp/performance/image/down.png | Bin 0 -> 2938 bytes .../src/main/webapp/performance/image/filter.png | Bin 0 -> 7780 bytes .../main/webapp/performance/image/statistics.png | Bin 0 -> 25116 bytes .../main/webapp/performance/image/table_icon.png | Bin 0 -> 1668 bytes .../src/main/webapp/performance/image/up.png | Bin 0 -> 2926 bytes .../src/main/webapp/performance/js/alarmConds.js | 261 +++++ .../webapp/performance/js/alarmsServerPageTable.js | 514 +++++++++ .../src/main/webapp/performance/js/alarmsUtil.js | 1154 ++++++++++++++++++++ .../src/main/webapp/performance/js/commonUtil.js | 60 + .../webapp/performance/js/curAlarmsController.js | 430 ++++++++ .../main/webapp/performance/js/performanceChart.js | 181 +++ .../performance/js/performanceQueryController.js | 843 ++++++++++++++ .../src/main/webapp/performance/js/pmUtil.js | 458 ++++++++ .../main/webapp/performance/js/serverPageTable.js | 217 ++++ .../webapp/performance/performance_query_rule.html | 141 +++ .../main/webapp/performance/performance_view.html | 110 ++ 30 files changed, 6880 insertions(+) create mode 100644 openo-portal/portal-performance/pom.xml create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/alarm_view.html create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/css/alarmsQuery.css create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/css/performanceChart.css create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/css/performanceQuery.css create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/css/pmQueryBox.css create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/i18n/web-alarm-i18n-en-US.properties create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/i18n/web-performance-i18n-en-US.properties create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/aos_view-fm.gif create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/arrow.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/chart_icon.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/delete.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/details_close.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/details_open.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/down.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/filter.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/statistics.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/table_icon.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/image/up.png create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/alarmConds.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/alarmsServerPageTable.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/alarmsUtil.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/commonUtil.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/curAlarmsController.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/performanceChart.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/performanceQueryController.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/pmUtil.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/js/serverPageTable.js create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/performance_query_rule.html create mode 100644 openo-portal/portal-performance/src/main/webapp/performance/performance_view.html (limited to 'openo-portal/portal-performance') diff --git a/openo-portal/portal-performance/pom.xml b/openo-portal/portal-performance/pom.xml new file mode 100644 index 00000000..83128301 --- /dev/null +++ b/openo-portal/portal-performance/pom.xml @@ -0,0 +1,40 @@ + + + + + org.openo.gso.gui + openo-portal + 1.1.0-SNAPSHOT + + + 4.0.0 + portal-performance + 1.1.0-SNAPSHOT + war + + + + + org.apache.maven.plugins + maven-war-plugin + + false + + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/alarm_view.html b/openo-portal/portal-performance/src/main/webapp/performance/alarm_view.html new file mode 100644 index 00000000..a210d658 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/alarm_view.html @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ + + +
+
+
+ +
+
+
+
+ + +
+ +
+
+ + +
+
+
+
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/css/alarmsQuery.css b/openo-portal/portal-performance/src/main/webapp/performance/css/alarmsQuery.css new file mode 100644 index 00000000..1ad72971 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/css/alarmsQuery.css @@ -0,0 +1,737 @@ +body { + overflow: auto !important; + background-color: #fff; +} + +.ms-controller{ + visibility: hidden +} + +.container-fluid{ + background-color: #fff; +} + +.page-content-body { + margin-top: 10px; +} +.page-content-body .row{ + margin-left:0; +} +#ict_fm_alarmCount_div_left{ + margin-bottom:10px; +} +.page-content-body .separator-line{ + height:1px; + border-bottom:1px dashed #ccc; + background:transparent; +} +.circleBtn:first-child { + border-top-left-radius: 3px !important; + border-bottom-left-radius: 3px !important; +} + +.circleBtn:last-child { + + border-top-right-radius: 3px !important; + border-bottom-right-radius: 3px !important; +} + +.sideBtn:first-child { + border-top-left-radius: 20px !important; + border-bottom-left-radius: 20px !important; + min-width: 50px; +} + +.sideBtn:last-child { + border-top-right-radius: 20px !important; + border-bottom-right-radius: 20px !important; + min-width: 50px; +} + +.btnRiusCircle { + border-radius: 20px !important; +} + +button:last-child { + margin-left: 15px; +} +.btn-groupBlue { + padding-left: 20px; +} + +.btn-groupBlue .btn:hover { + color: #333; + background-color: #ebebeb ; + +} +.btnWhite { + font-size: 14px; + font-family: "微软雅黑"; + line-height: 20px; + /*background-image: linear-gradient(to bottom, #ffffff, #ffffff);*/ + background-color: #ffffff; + + border: 1px solid #cccccc; +} +.btnWhite:hover{ +background-color:#ebebeb; +color:#333; +} +.btn_group1 .btn:hover { + color: #ffffff; + background-color:#ebebeb; + background-position: 0 0px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} + +.blueactive { + color: #ffffff !important; + background-color: #5b9bd1; +} + +.blueactive:hover { + color: #ffffff !important; + background-color: #4d85b4 !important; +} + +.cond_zone { + background-color: #fff; + padding-left: 20px; + padding-right: 50px; +} + +.cond_zone_time { + background-color: #fff; + margin-top: 20px; + margin-bottom: 10px; +} + +.condSelect { + /* width: 100%; */ + border: 1px solid #CCC; + height: 34px !important; +} + +.cond_selected{ + padding-left: 10px; +} + +button.btn.btn-default { + color: #aaa; +} + +.filtergroup button.btn { + min-width: 68px; +} +.adCondition button.btn { + min-width: 80px; +} +.btn-default { + color: #5b9bd1; + background-color: #fff; + border-color: #ccc; +} + +.daySelect { + width: 42px; + height: 26px !important; + font-size: 14px; + margin-bottom: 0px; + border-width: 1px; + padding: 0px 0px; + border-radius: 4px; +} + +.calendar-date { + color: #5b9bd1; +} + +.daterangepicker .ranges { + width: 205px; +} + +.daterangepicker .ranges input { + width: 95px !important; +} + +/* .daterangepicker { + left: 20% !important; +} */ +.daterangepicker .ranges input[type="text"] { + width: 85px !important; +} + +.dataRange { + width: 195px; + line-height: 0; + height: 26px; + vertical-align: top; + margin-left: 5px; + padding: 0px 0px; +} + +div.dataTables_paginate { + display: inline; + float: right !important; +} + +div.dataTables_length, div.dataTables_info { + display: inline; +} + +div.pagination-panel { + margin-right: 10px; +} + +input.pagination-panel-input { + width: 50px; +} + +.input-sm { + padding: 4px 10px; +} + +td.details-control { + text-align: center; + cursor: pointer; +} + + +.details table td { + word-wrap: break-word; + word-break: normal; + border-top: 1px solid #dddddd; +} + +td.title { + width: 10%; +} + +.detailTitleStyle{ + background-color: #EEE !important; +} + +.close-statistic{ + float:right; + margin-top:5px; + margin-right:25px; + vertical-align:bottom; + padding:3px; + border:2px solid #fff ; + border-radius:20px; + color:#9b9b9b; +} +.close-statistic:hover{ +border:2px solid #e74c3c ; +color:#e74c3c; +text-decoration:none; +} +.detailCellStyle{ + background-color: #FFF !important; +} + +table.dataTable tbody th, table.dataTable tbody td { + padding: 8px 10px; + vertical-align:middle; +} + +.echart_height{ + height: 400px; +} + + + +button.serveractive { + color: #ffffff !important; + background-position: 0 0px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; + background-image: linear-gradient(to bottom, #E6971A, #E6971A) !important; +} + +.rule_title { + padding: 8px; + margin-bottom: 25px; + border-left: 2px solid #5b9bd1; + color: #1A78CA; + font-size: 16px; +} + +.iconPosition > div { + margin: 20px 0px 0px 0px; +} +.iconPosition{ + margin-top: 90px; +} +.iconPosition div { + color: #757575; + cursor: pointer; +} + +.iconPosition div:hover { + color: #333; +} + +#defaulInfo, #selectAralmCodes { + border: 1px solid #e0e0e0; +} + +.right_assign_box { + height: 370px; + overflow-y: auto; + overflow-x: auto; + border: 1px solid #e0e0e0; +} + +.right-assign-checked-box{ + /*height: 312px;*/ + height: 370px; + overflow-y: auto; + overflow-x: auto; + border: 1px solid #e0e0e0; +} + +.fmZtree { + z-index: 3000; + position: absolute; + background: #fff; + outline: none; +} + +.filtergroup { + text-align: center; + margin-top: 15px; +} + +.fliterline { + margin-top: 20px; + height:1px; + border-bottom:1px dashed #c4cde8; + margin-bottom:15px; + overflow:hidden; + width:100%; +} + +.adCondition { + float: right; +} + +.btn .caret { + margin-right: 5px; +} + +.tablebtn { + float: right; +} + +#ict_alarms_table_div { + padding-right: 0; + margin-top: 10px; +} + +div.alarmsTree { + width: 580px; +} + +div.alarmsTree-small{ + width: 280px; +} +.alarm-serious { + background-color: #de4040; + color: #ffffff !important; +} +.alarm-serious:hover { + background-color: #c23737 !important; +} +.alarm-important { + background-color: #e37c29; + color: #ffffff !important; +} +.alarm-important:hover { + background-color: #c86e25 !important; +} +.alarm-secondary { + background-color: #e9d426; + color: #ffffff !important; +} +.alarm-secondary:hover { + background-color: #d3c023 !important; +} +.alarm-slightly { + background-color: #86bcdb; + color: #ffffff !important; +} +.alarm-slightly:hover { + background-color: #77a7c2 !important; +} +.flRight { + float: right; + margin-right: 1px; +} + +/* #alLocation { + margin-top: 40px; +} */ + +.borderBottom { + border-bottom: 4px solid !important; + border-top: 0px solid !important; +} + +.borderTop { + border-top: 4px solid !important; + border-bottom: 0px solid !important; +} + +.spinnerSmall { + width: 34px !important; + margin-right: 24px; +} + +.icheckbox_square-aero{ + margin-right: 5px; +} +.alarmsSave { + font-size: 16px; + color: #555; + vertical-align: middle; + cursor: pointer; +} + +.alarmsSave:hover { + color: #5b9bd1; +} +.margin-space{ + margin-bottom: 15px; + margin-top: 5px; +} + +.defaultHideTopLink{ + display: none; + position: absolute; + display: none; + background: #000; + opacity: 0.8; + border: 1px solid #ddd !important; + font-size: 0.8em; + box-shadow: 2px 3px 5px #C8C8C8; + border-radius: 8px; + padding: 0px 10px; + z-index: 999; + height: 30px; + color: #fff; + line-height: 25px; +} + +.defaultHideTopLink:after { + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #000; + border-left: 6px solid transparent; + content: ''; +} + +.tooltip-inner { + max-width: 300px !important; +} + +.calendar-time select { + color: #555 !important; +} + +#affirmTrip{ + margin-top: 3%; + margin-left: 1%; +} + + +#unAffirmTrip{ + margin-top: 3%; + margin-left: 4%; +} + +#alLocationTree,#alCodeTree,#alTypeTree{ + border: 1px solid rgba(0,0,0,.2); + margin-top: 5px; + background-clip: padding-box; + border-radius: 6px; + outline: 0; + margin-left: -5px; + box-shadow: 0 5px 15px rgba(0,0,0,.5); +} + +#right-menu { + position: fixed; + top: 0; + right: 0; + width: 400px; + height: 100%; + border-left: 4px solid rgb(58,174,218); + background-color: rgba(255,255,255,.95); + padding-left: 19px; + padding-right: 13px; + padding-top: 20px; + z-index: 9999; + overflow-y: auto; +} + +.btn-right-detail { + color: #5b9bd1; + background-color: #fff; + border-color: #ccc; +} + + +.right { + float: right; +} + + +.default-display-none{ + display: none; +} + +.nodesDetail { + margin-top: 15px; +} + +#ict_table_general_div td{ + min-width: 115px; +} + + +#moreCond label{ + margin-bottom: 0px; +} + +.alarm-date-form-control{ + padding: 0px 4px; +} + +.titlefont { + font-size: 16px; +} + +.subtitlefont { + font-size: 14px; +} + + +.ackState a:hover{ + color: #fff; + text-decoration:none; +} + + +.label-danger:hover{ + background-color: #C9302C; +} + +.right-button-pointer { + display: inline-block; + cursor: pointer; +} + +.tree-right-table td{ + white-space: nowrap; + cursor: pointer; +} + +.tree-right-table td:hover{ + background: #FFEDE4; + border-bottom: 1px solid #f8dddd; + border-top: 1px solid #f8dddd; +} + +.tallCellSelected{ + background: #f8dddd; + border-bottom: 1px solid #f8dddd; + border-top: 1px solid #f8dddd; +} + +.tallCellSelected:hover{ + background: #f8dddd !important; +} + + +.margin-top-space{ + margin-top: 15px; +} + + +.tree-left-table td{ + white-space: nowrap; + cursor: pointer; +} + +.tree-left-table td:hover{ + background: #FFEDE4; + border-bottom: 1px solid #f8dddd; + border-top: 1px solid #f8dddd; +} + +#saveModalCancle{ + color:#333; +} + +.radioLabel{ + margin-left: -10px; + margin-right: 10px; +} + +.alarmbtn, #ict_alarms_table_div{ +padding-left:0; +} + +.advanced-selection{ + margin-top:40px; +} + +#moreCond{ + border: 1px dashed rgb(196, 205, 232); + margin-top: 10px; + margin-bottom: 10px; + margin-left: 0px; + margin-right: 0px; + padding-left: 15px; + padding-right: 15px; +} + +.bodyTop{ + margin-top: 10px; +} + +.confirmTime{ + margin-left: 5px; +} + +.condSaveTip{ + margin-top: 15px; +} + +/*修改树组件默认样式*/ +.ztree li a { + border: 0px; +} + +.ict-Magnifier:hover{ + color:#555555 +} + +.ict-save:hover{ + color:#555555 +} + +.dataTables_scrollHeadInner table.dataTable tbody td { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.dataTables_scrollHeadInner table.dataTable { + margin-bottom: 0px !important; + border-bottom: 0px !important; +} + +.dataTables_scrollBody table { + border-top: 0px !important; + border-bottom: 1px solid #ddd !important; + /* margin-top: -5px; */ +} + +.dataTables_scrollBody { + margin-top: -2px; +} + +#ict_alarms_table_wrapper .bottom{ + margin-top: 10px; +} + +table .DataTables_sort_wrapper { + padding-left: 2px !important; +} + +.detailTable { + border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888; +} + +.detailTable td{border:1px solid #ddd !important;} + +.detailTitleStyle .label{ + color:#333333; + background-color: rgba(66, 139, 202, 0); + float:right; +} + +.label{ + font-size: 100%; + font-weight: 100; +} + +input[name="daterange"] { + width: 220px; + line-height: 0; + height: 31px; + /* vertical-align: top; */ + margin-top: 2px; +} +.acknow-purple{ +background-color:#bf74d5; +color:#fff; +} +.acknow-purple:hover{ +background-color:#b36bc8; +} +.ict-table{ + color:#549bb6; +} +.dataTables_length select[size]{ + height:28px; +} +/*1024下展开左边菜单*/ +@media screen and (max-width: 770px) and (min-width: 750px) { + .btn-groupBlue { + padding-left: 5px; + } +} + +/*1024下,左边菜单收起来*/ + +@media screen and (max-width: 1000px) and (min-width: 810px) { + .tree-padd { + padding-left: 7%; + } + + .daterange-cond-padd { + padding-left: 10%; + } +} + +@media screen and (max-width: 1100px) and (min-width: 1000px) { + + .tree-padd { + padding-left: 10%; + } + + .tree-daterange-cond-padd { + padding-left: 10%; + } +} + +@media screen and (min-width: 1100px) { + .tree-padd { + padding-left: 12%; + } + + .daterange-cond-padd { + padding-left: 10%; + } +} + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/css/performanceChart.css b/openo-portal/portal-performance/src/main/webapp/performance/css/performanceChart.css new file mode 100644 index 00000000..85da87d6 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/css/performanceChart.css @@ -0,0 +1,45 @@ +.reveal-modal-bg { + position: fixed; + height: 100%; + width: 100%; + background: #000; + background: rgba(0,0,0,.8); + z-index: 100; + display: none; + top: 0; + left: 0; +} + +.reveal-modal { + visibility: hidden; + top: 100px; + left: 200px; + width: 1200px; + background: #eee url(modal-gloss.png) no-repeat -200px -80px; + position: fixed; + z-index: 101; + padding: 30px 40px 34px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 0 0 10px rgba(0,0,0,.4); + -webkit-box-shadow: 0 0 10px rgba(0,0,0,.4); + -box-shadow: 0 0 10px rgba(0,0,0,.4); +} + +.reveal-modal.small {width: 200px; margin-left: -140px;} +.reveal-modal.medium {width: 400px; margin-left: -240px;} +.reveal-modal.large {width: 600px; margin-left: -340px;} +.reveal-modal.xlarge {width: 800px; margin-left: -440px;} + +.reveal-modal .close-reveal-modal { + font-size: 22px; + line-height: .5; + position: absolute; + top: 8px; + right: 11px; + color: #aaa; + text-shadow: 0 -1px 1px rbga(0,0,0,.6); + font-weight: bold; + cursor: pointer; +} diff --git a/openo-portal/portal-performance/src/main/webapp/performance/css/performanceQuery.css b/openo-portal/portal-performance/src/main/webapp/performance/css/performanceQuery.css new file mode 100644 index 00000000..f747a57d --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/css/performanceQuery.css @@ -0,0 +1,828 @@ +body{ + font-family: microsoft yahei !important; +} +body { + font-family: 'Open Sans', sans-serif; + background-color: #f1f3fa; + width: '100%'; + height: '100%'; + margin-top: 5px; +} + +a { + /* font-weight: bold;*/ + text-decoration: none !important; } + +p { + color: #444; + font-size: 14px; + font-weight: normal; + line-height: 21px; + margin: 0 0 12px 0; } + +p.credit { + border-top: 1px solid #ccc; + font-size: 14px; + line-height: 140%; + margin: 36px 0 12px 0; + padding: 8px 0 0 0; + text-align: center; } + +ul.column { + float: left; + list-style: none; + width: 675px; } +ul.column li { + background: #eee; + -webkit-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: inset 0 1px 1px 0 #c7c7c7; + box-shadow: inset 0 1px 1px 0 #c7c7c7; + float: left; + margin: 10px 0 0 10px; + display: block; + height: 150px; + text-align: center; + width: 215px; } + + +/* Clear Floated Elements +------------------------------------------------------------------------------*/ +.column:after, +.button-collection:after, +.clearfix:after, +div.project-info:after { + clear: both; + content: ' '; + display: block; + font-size: 0; + line-height: 0; + visibility: hidden; + width: 0; + height: 0; } + +.nav-tabs{ +border:0; +} +.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{ +border:0; +border-top:3px solid #F3565D; +} +.nav-tabs>li>a{ +border-radius:0; +} +.nav-tabs>li>a:hover{ +background-color:#f1f3fa; +border:1Px solid #f1f3fa; +} +.c3{ +margin-top:120px; +} +.skills-chart-breadcrumb{ + +} + +.blue:selected{ +border:0; +background-color: #5b9bd1; +} +.btn { + /* border-width: 0; */ + /* padding: 7px 14px; */ + /* font-size: 14px; */ + /* outline: none !important; */ + /* background-image: none !important; */ + /* filter: none; */ + /* -webkit-box-shadow: none; */ + -moz-box-shadow: none; + /* box-shadow: none; */ + /* text-shadow: none; */ +} + +.btn-default, select { +border-width: 1px; +padding: 4px 1px; +border-radius: 4px; +} + +.input-sm { + padding: 4px 10px; +} + +.btn-block { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; +} + +/* Bootstrap buttons */ +.btn-default { + color: #5b9bd1; + background-color: #fff; + border-color: #ccc; + +} +.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active { + color: #333; + background-color: #ededed; + border-color: #b3b3b3; +} +.open .btn-default.dropdown-toggle { + color: #333; + background-color: #ededed; + border-color: #b3b3b3; +} +.btn-default:active, .btn-default.active { + background-image: none; + background-color: #e0e0e0; + font-weight: bold; +} +.btn-default:active:hover, .btn-default.active:hover { + background-color: #e6e6e6; +} +.open .btn-default.dropdown-toggle { + background-image: none; +} +.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-default > i { + color: #aaa; +} +.btn-default > i[class^="icon-"], +.btn-default > i[class*="icon-"] { + color: #8c8c8c; +} + +div[data-name="tab_zone"] div{ + background-color:#f1f3fa; + padding:0px; +} + + +div[data-name="cond_zone"] div{ + background-color: #fff; + margin-top:15px; + margin-bottom:15px; +} + +div[data-name="log-otherConds-zone"]{ + display:inline; +} + +div[data-name="log-otherConds-zone"] select ,div[data-name="log-otherConds-zone"] span{ + /**height:33px;*/ + margin-left:15px; + color:#5b9bd1; + border-color:#ccc; + font-weight: bold; +} + +div.separator div{ + text-align: center; + line-height:0; +} +div.separator-sline{ + height:28px ; + width:3px; +} + +.dropdown-toggle{ +color:#5b9bd1; +} +.calendar-date{ +color:#5b9bd1; +} +.range_inputs{ +color:#5b9bd1; +} +.btn.dropdown-toggle, .btn-group .btn.dropdown-toggle, .btn:hover, .btn:disabled, .btn[disabled], .btn:focus, .btn:active, .btn.active { + outline: none !important; + background-image: none !important; + filter: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + text-shadow: none; +} + +#skills-chart-breadcrumb{ +margin-bottom:10px +} + + +/*增加daterangepicker的css*/ +input[name="daterange"]{ + width: 220px; + line-height:0; + height: 31px; + vertical-align: top; + margin-top: 2px; + +} + +.daterangepicker .ranges{ + width: 205px; +} +.daterangepicker .ranges input{ + width:95px !important; +} + +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{ + word-wrap: break-word; + word-break: normal; + border-top: 1px solid #dddddd; +} + +.details table tr:first-child td { + border-top: none; +} + +.details table{ + table-layout:fixed; + width:100%; +} + +td.title{ + width:10%; +} + +table.dataTable tbody th, table.dataTable tbody td { +padding: 8px 10px; +} + +div.dataTables_length ,div.dataTables_info{ + display: inline; +} + +div.dataTables_paginate{ + display: inline; + float: right; +} + +div.pagination-panel{ + margin-right:10px; +} + +input.pagination-panel-input{ + width:50px; +} + +#ict_log_table_div{ + margin-top:15px; +} + + +#ict_sm_table_div label{ + font-weight:100; +} + +.daterangepicker .daterangepicker_start_input label, .daterangepicker .daterangepicker_end_input label{ +color:#5b9bd1; + +} +.daterangepicker .ranges .input-mini{ + color:#5b9bd1; + } +.cancelBtn { + padding:5px 10px 5px 10px; +} +.btn:focus, .btn:active:focus, .btn.active:focus{ + outline:0; +} + +#ict_log_table_div table{ + +} + +.box0{ +display:none !important + +} +.box1{ +background-image:url(../images/userGroup.png); +background-repeat:no-repeat; +background-color:#578ebe !important; +height:3px !important; +background-position-y:100%; +} +.box2{ +background-image:url(../images/loginUser.png); +background-repeat:no-repeat; +background-color:#44b6ae !important; +height:3px !important; +background-position-y:100%; +} +.box3{ +background-image:url(../images/blackList.png); +background-repeat:no-repeat; +background-color:#c0af69 !important; +height:3px !important; +background-position-y:100%; +} +.box4{ +background-image:url(../images/lockUser.png); +background-repeat:no-repeat; +background-color:#e35b5a !important; +height:3px !important; +background-position-y:100%; +} +.box5{ +background-image:url(../images/userGroup.png); +background-repeat:no-repeat; +background-color:#578ebe !important; +height:3px !important; +background-position-y:100%; +} +.box6{ +background-image:url(../images/loginUser.png); +background-repeat:no-repeat; +background-color:#44b6ae !important; +height:3px !important; +background-position-y:100%; +} +.box7{ +background-image:url(../images/lockUser.png); +background-repeat:no-repeat; +background-color:#e35b5a !important; +height:3px !important; +background-position-y:100%; +} +.box8{ +background-image:url(../images/userGroup.png); +background-repeat:no-repeat; +background-color:#578ebe !important; +height:3px !important; +background-position-y:100%; +} +.box9{ +background-image:url(../images/loginUser.png); +background-repeat:no-repeat; +background-color:#44b6ae !important; +height:3px !important; +background-position-y:100%; +} +.boxPadding{ +padding-left:15px; +padding-right:0px; +} +.row1 .separator-line{ +margin-bottom:5px; +} +.row a{ +/*color:white;*/ +font-weight:normal; +font-size:14px; + +} +.btnBlue { + background-color: #5b9bd1; + border-radius: 20px; + color: white; + font-weight: normal; + text-align: center; + min-width: 80px; +} +.btnBlue:hover{ + background-color: #487ca9 !important; + color:#fff !important; +} +.btnBlue1 { + background-color: #5b9bd1; + border-radius: 20px; + color: white; + font-weight: normal; + text-align: center; + min-width: 80px; +} +.btnGrey { + background-color: #d3d1d1; + border-radius: 20px; + color: black !important; + font-weight: normal; + padding: 8px 0; + text-align: center; + width: 70px; +} +.smLianJie { +color:#5b9bd1 !important; +font-weight:normal; +display:inline-block; +margin-top:25px; +font-size:14px +} + +.smLianJie span{ +padding:2px; +} +.rightDiv{ +float:right; +color:#5b9bd1 !important; +} +.num{ +font-size:30px; +font-family:arial; +font-weight:bold; +} +.numdiv{ +margin-bottom:20px; +} +.ruleDiv{ +text-align:center; +} + +.ruleDiv1{ +padding-top:20px; +text-align:center; +} +.fmTypeDiv{ + padding: 20px; + text-align: center; + font-size: 16px; + background: white; + margin-top: 5px; + margin-left: 30px; + margin-right: 10px; + height: 105px; +} +.container-fluid{ +background-color:white !important; +/*margin-top:25px;*/ +min-height:500px; +} +.titlefont{ + font-size:16px; +} +.label{ + font-weight: 400; + /*font-size: 14px; */ +} +.v5h5{ + font-size: 16px; + color:#5b9bd1 !important; + font-weight:bold !important; +} +.v5label{ + padding-top: 5px !important; + font-size: 13px; + text-align:right; +} +.v5lineColor1{ + background-color:#578ebe !important; +} +.box1:hover{ + background-color:#487ca9 !important; +} + +.box2:hover{ + background-color: #329d96 !important; +} +.box3:hover{ + background-color:#ad9a4d !important; +} +.box4:hover{ + background-color:#d45150 !important; +} +.v5spinner{ + width:50px; + margin-left:10px; + margin-right:10px; +} +.ff{ + float:left;/*左漂浮*/ + width: 1px; + height: 25px;/*竖线高度*/ + background: #000;/*填充颜色*/ +} +.radio-list{ + padding-top:0px; +} +.row1{ + margin-right: 0px !important; +} + +#ict_sm_tableloginUser_wrapper .ict-legendshow, +#ict_sm_tablelockUser .ict-unlock +{ + margin-right:6px; +} +#ict_sm_tableallUser > thead > tr > th,#ict_sm_tableloginUser > thead > tr > th,#ict_sm_tablelockUser > thead > tr > th{ + background:white; + background-color:white !important; +} +#weakregularity{color:#468ECE;border-bottom: 1px #468ECE dotted;margin:0px !important;} +#weakregularity_tip{ + position:absolute; + display:none; + background:#000; + opacity:0.8; + border:1px solid #ddd !important; + font-size:0.8em; + margin-top:-1%; + margin-left:15%; + box-shadow:2px 3px 5px #C8C8C8; + border-radius:8px; + padding:20px 5px; + z-index:999; + width:530px; + height:270px; + color:#fff; + line-height:25px; +} +#weakregularity_tip > ul > li{margin-top:4px;list-style-type:disc;} +#weakregularity_tip > ul > li:first-child{margin-top:0px;} +#com_zte_ums_ict_sm_new_user_isPasswordChanged > span, +#com_zte_ums_ict_sm_new_user_passwordvaliddays > span +{ + margin:0px 6px; +} +#forceExit{ + /**padding:3px 18px 3px 10px; + cursor:pointer; + border:1px solid #ddd; + border-radius:12px; + text-shadow:0 1px 0 hsla(0,0%,100%,0.75); + //background-image:url("../images/forceOut.png"); + //background-repeat:no-repeat; + //background-size:20% 70%; + background-position:left 10% top 45%;**/ + margin-bottom:10px; +} + +/*#forceExit:hover{ + background-color:#F9F9F9; +}*/ +.smLianJie:hover{ + cursor:pointer; +} +div.checker,div.checker span{ + width:22px; + height:22px; + background:#fff; +} +.row1 .col-xs-10, .row1 .col-md-10, .row1 .col-sm-10, .row1 .col-lg-10{ +width:87% !important; +} +.row1 .col-xs-2, .row1 .col-md-2, .row1 .col-sm-2, .row1 .col-lg-2{ +width:13% !important; +} +.modify_user{ +padding-left:0px; +} +.btn-xs{ +color:#333; +font-size:14px; +} +.btn-xs:hover{ +color:#333 +} +ul.ztree {margin-top: 10px;border: 1px solid #E0E0E0;/*background: #f0f6e4;width:220px;height:360px;*/overflow-y:auto;overflow-x:auto;/*ict*/padding: 25px;} +#new_rule_body{ +padding-left:25px; +} +.rule_title{ +padding:8px; +margin-bottom:25px; +border-left: 2px solid #5b9bd1; +color:#1A78CA; +font-size:16px; +} +.group{ +margin-top:25px; +} + +h5.form-section, .checkbox-list, .panel-title{ + font-family: microsoft yahei !important; + color: #333; + +} +.right_assign_box{ +height:400px; +overflow-y:auto; +overflow-x:hidden; +border:1px solid #e0e0e0; +} +.right_assign_box ul.ztree{ +border:0; +} +.right_assign_box .table-bordered{ + border:0; + } +.right_assign_box .table-bordered>thead>tr>th, .right_assign_box .table-bordered>tbody>tr>th, .right_assign_box .table-bordered>tfoot>tr>th, .right_assign_box .table-bordered>thead>tr>td, .right_assign_box .table-bordered>tbody>tr>td, .right_assign_box .table-bordered>tfoot>tr>td{ + border-left:0; + padding:8px 18px; +} +.right_assign_box .table>thead>tr>th{ + border:0; +} +#com_zte_ums_ict_sm_new_user_maxlogin .form-control{ +width:30%; +display:inline; +margin-left:10px; +} + +.div_padding{ + padding-left:75px; +} +#lockThreshold{width:80%;} +#lockThreshold_select{width:100%;height:20px;font-size:0.8em;color:black;margin-top:10px;} +#lockThreshold_1{position:absolute;cursor:pointer;width:auto;} +#lockThreshold_2{position:absolute;cursor:pointer;width:auto;} +#lockThreshold_3{position:absolute;cursor:pointer;width:auto;} + +.delete-icon { + float: right; + /* padding: 5px; */ + cursor: pointer; + position: relative; + display: inline-block; + margin-right: 2%; +} +.delete-icon img { + position: absolute; + right: 0px; +} +.removeIcon { + width: 22px; + height: 22px; + float: right; + margin-right: -8px; + margin-top: -8px; + background: url(/ngict/iui/component/ict/ict-dashboard/images/delete.png) no-repeat 0px 0px; + cursor: pointer; +} +.deleteIconHidden{ + opacity:0; +} +.nam{ + font-size: 15px; +} +.queryLink{ + font-size: 15px; + margin-top: 10px; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 3% !important; + opacity: .5; + filter: alpha(opacity=50); + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0,0,0,.6); +} +.carousel-control .glyphicon-chevron-right { + right: 10%; +} +.item { + overflow: hidden; + display: block; + margin-bottom: 0px !important; +} +.page-info-bottom{ +margin-top:10px; +} + +.deleteIcon { + font-size:16px; + cursor: pointer; + margin-bottom: 10px; + float: left; + color:#a9c2d6; + border:1px solid #eef5fb; + border-radius:20px; + padding:3px; +} +.deleteIcon:hover { +border:1px solid #e74c3c; +color:#e74c3c; +} +.resourceObj { + margin-left: 30px; + margin-top:3px; +} + +.resourceList th { + background-color: #D3E7F8 !important; + border: 1px solid #CEE5F9 !important; +} +.resourceList td { + background-color: #EEF5FB !important; + padding-top: 20px !important; + border: 1px solid #CEE5F9 !important; +} +.filterDiv { + margin-bottom:0; + +} +.filterDiv input{ + border: 1px solid #ddd; + //border-radius:3px; + height:30px; + width:100%; + border-bottom:0; +} +.boxLabel { + background-color: #D3E7F8; + margin-left: 26%; + border: 1px solid #E2EFFA; + padding: 8px; +} +.blueactive { + color: #ffffff !important; + background-color: #5b9bd1; +} +.btnWhite { + font-size: 14px; + line-height: 15px; + border: 1px solid #cccccc; +} +#taskTimeDiv { + margin-top: 8px; +} +.daterangepicker .ranges input[type="text"] { + width: 76px !important; + font-size: 11px; + vertical-align: middle; +} +#queryTimeRange { + width: 275px; + padding: 6px; + border: 1px solid #ddd; +} +.selector-class{ + width: 200px; +} +.table{ + margin-bottom: 0px; +} +.ict-modify{ + font-size:16px; + float: right; + margin-bottom:-10px; + position:absolute; + right:5px; + bottom:30px; +} +.subbox{ + text-align:center; +} +.subbox .ict-modify{ + border:1px #fff solid; + padding:3px; + border-radius:5px; +} +.subbox .ict-modify:hover{ + background-color:#fff; + color:#709bce; +} +.subbox .textImageStyle span{ + padding:10px; + border-radius:30px; + background-color:#fff; + text-align:center; + margin:0 auto; + color:#b3c9e2; + font-size:16px; +} +.textImageStyle{ + margin-bottom:4px; +} +.carousel-control .glyphicon-chevron-left{ + margin-left:-30px; +} +.carousel-control .glyphicon-chevron-right{ + margin-right:-10px; +} +.carousel-control.left, .carousel-control.right { + background-image: none; +} +.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { + /* margin-left: 0; */ + font-size: 25px; + margin-top: -20px; +} +.resourceList .heading{ + font:12px normal "microsoft yahei"; +} +.ms-controller { + visibility: hidden +} diff --git a/openo-portal/portal-performance/src/main/webapp/performance/css/pmQueryBox.css b/openo-portal/portal-performance/src/main/webapp/performance/css/pmQueryBox.css new file mode 100644 index 00000000..aa930c6e --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/css/pmQueryBox.css @@ -0,0 +1,299 @@ +/*.row a { + font-size: 14px; +}*/ + +#addRule { + margin-bottom: 10px; +} +.btn.dropdown-toggle, +.btn-group .btn.dropdown-toggle, +.btn:hover, +.btn:disabled, +.btn[disabled], +.btn:focus, +.btn:active, +.btn.active { + outline: none !important; + background-image: none !important; + filter: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + text-shadow: none; +} +.btn-rank { + border-color: #ccc; +} +.alarm-serious { + background-color: #de4040; + color: #ffffff !important; +} +.alarm-serious:hover { + background-color: #c23737 !important; +} +.alarm-important { + background-color: #e37c29; + color: #ffffff !important; +} +.alarm-important:hover { + background-color: #c86e25 !important; +} +.alarm-secondary { + background-color: #e9d426; + color: #ffffff !important; +} +.alarm-secondary:hover { + background-color: #d3c023 !important; +} +.alarm-slightly { + background-color: #86bcdb; + color: #ffffff !important; +} +.alarm-slightly:hover { + background-color: #77a7c2 !important; +} +.btn-group.btn-group-circle > .btn:first-child { + border-radius: 3px 0px 0px 3px; +} +.btn-group.btn-group-circle > .btn:last-child { + border-radius: 0 3px 3px 0 !important; +} +.btn-group-circle { + padding-bottom: 5px; +} +.open .btn-default.dropdown-toggle { + color: #333; + background-color: #ededed; + border-color: #b3b3b3; +} +.btn-group .btn-default:active, +.btn-group .btn-default.active { + background-image: none; + background-color: #5b9bd1; + color: #fff; +} +.ruleBox { + height: 175px; +} +.filterRule { + background-image: url(../images/filter.png); + background-repeat: no-repeat; + background-position: center; + text-align: center; +} +/*.boxPadding { + padding-top: 60px; +}*/ +.ruleRow { + padding-left: 20px; + padding-right: 30px; + font-size: 15px; +} +.filterRuleRow { + padding-left: 30px; + padding-right: 20px; + font-size: 15px; +} +.fRule { + padding-left: 12%; + padding-right: 12%; +} +.ruleNav .ruleBox .rule { + margin-top: 5px; + padding-left: 0px; +} +.bigText { + height: 400px; +} +.bigText1 { + margin-bottom: 20px; + height: 320px; +} +.right_assign_box { + height: 412px; + overflow-y: auto; + overflow-x: hidden; + border: 1px solid #ccc; + border-radius: 4px; +} +.boxHeight { + height: 723px; +} +.right_assign_box1 { + height: 800px; + overflow-y: auto; + overflow-x: hidden; + border: 1px solid #e0e0e0; +} +.right_assign_box ul.ztree { + border: 0; +} +.right_assign_box .table-bordered { + border: 0; +} +.right_assign_box .table-bordered > thead > tr > th, +.right_assign_box .table-bordered > tbody > tr > th, +.right_assign_box .table-bordered > tfoot > tr > th, +.right_assign_box .table-bordered > thead > tr > td, +.right_assign_box .table-bordered > tbody > tr > td, +.right_assign_box .table-bordered > tfoot > tr > td { + border-left: 0; + padding: 8px 18px; +} +.right_assign_box .table > thead > tr > th { + border: 0; +} +ul.ztree { + border: 1px solid #E0E0E0; + /*background: #f0f6e4;width:220px;height:360px;*/ + + overflow-y: auto; + overflow-x: auto; +} +.rule_title { + padding-left: 5px; + margin-bottom: 15px; + border-left: 2px solid #5b9bd1; + color: #1A78CA; + font-size: 16px; +} +.row1 .separator-line { + margin-bottom: 5px; +} +.group { + margin-top: 25px; +} +.ztree li span.button.diy1_icon { + background: url(""); +} +.titlefont { + font-size: 16px; +} +#new_rule_body { + padding-left: 25px; +} +#defaulInfo, +#selectAralmCodes { + border: 1px solid #e0e0e0; +} +.iconPosition div { + color: #757575; + cursor: pointer; +} +.iconPosition div:hover { + color: #333; +} +#dataRange { + margin-left: 15px; +} +.dataRow { + margin-left: 15px; +} +.alarmLevel { + margin-left: 15px; +} +.ruleList { + background-color: #fff; + min-height: 460px; +} +.ruleNav { + // margin-bottom: 15px; + margin-left: 15px; + margin-right: 15px; +} +.right-assign-checked-box { + height: 412px; + overflow-y: auto; + overflow-x: auto; + border: 1px solid #e0e0e0; +} +.box { + color: white; + text-align: center; + height: 80px !important; + font-size: 14px; +} +.boxStyle1, +.ProcessingSuggestion { + background-repeat: no-repeat; + background-color: #48C79C !important; + background-position-y: 100%; +} +.boxStyle1:hover, +.ProcessingSuggestion:hover { + background-color: #64e2b8 !important; +} +.boxStyle2, +.notifyFilter { + background-repeat: no-repeat; + background-color: #709BCE !important; + background-position-y: 100%; +} +.boxStyle2:hover, +.notifyFilter:hover { + background-color: #87b2e4 !important; +} +.boxStyle3, +.alarmBox { + background-repeat: no-repeat; + background-color: #9699E0 !important; + background-position-y: 100%; +} +.boxStyle3:hover, +.alarmBox:hover { + background-color: #acaff1 !important; +} +.boxStyle4, +.codesetting { + background-repeat: no-repeat; + background-color: #5BC0DE !important; + background-position-y: 100%; +} +.boxStyle4:hover, +.codesetting:hover { + background-color: #8dd4eb !important; +} +.ruleNav .separator-line { + margin-bottom: 5px; + height: 3px; +} +.ruleNav .separator-line-visibilty { + visibility: hidden; +} +a { + text-decoration: none !important; +} +.subbox { + padding-left: 5px; + padding-right: 5px; +} +.textImageStyle { + font-size: 24px; + margin-right: 5px; + vertical-align: middle; + padding-left: 0; + padding-bottom: 1px; + padding-top: 14px; +} +#test1>div { + margin-bottom: 15px; +} +.rule-submit { + padding-left: 45px; +} +.sugg-box .form-control { + margin-bottom: 15px; +} +/*.dataTables_info{ + float:right; +}*/ + +@media screen and (max-width: 900px) and (min-width: 600px) { + .rule-pic { + display: none; + } + .ruleNav .col-xs-10 { + width: 100%; + } +} + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-alarm-i18n-en-US.properties b/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-alarm-i18n-en-US.properties new file mode 100644 index 00000000..975589d4 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-alarm-i18n-en-US.properties @@ -0,0 +1,108 @@ +//表格相关 +ngict-fm-iui-table-sLengthMenu=View _MENU_ records +ngict-fm-iui-table-sZeroRecords=No matching records found +ngict-fm-iui-table-sInfo= | Found total _TOTAL_ records +ngict-fm-iui-table-sInfoEmpty=No records found to show +ngict-fm-iui-table-sGroupActions=_TOTAL_ records selected: +ngict-fm-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection. +ngict-fm-iui-table-sEmptyTable=No data available in table +ngict-fm-iui-table-sPrevious=Prev +ngict-fm-iui-table-sNext=Next +ngict-fm-iui-table-sPage=Page +ngict-fm-iui-table-sPageOf=of + +//告警界面 +ngict_fm_iui_curalarm_currentAlarm=Active Alarms +ngict_fm_iui_curalarm_advance=Advance +ngict_fm_iui_curalarm_alarmPosition=Location +ngict_fm_iui_curalarm_choosed=Selected +ngict_fm_iui_curalarm_locationSelected=Selected +ngict_fm_iui_curalarm_alarmTypeSelected=Selected +ngict_fm_iui_curalarm_probableCauseSelected=Selected +ngict_fm_iui_curalarm_alarmType=Alarm Type +ngict_fm_iui_curalarm_probableCause=Alarm Code +ngict_fm_iui_curalarm_ackTimeTitle=ACK Time: +ngict_fm_iui_curalarm_recentOneDay=Last One Day +ngict_fm_iui_curalarm_recenttwoDays=Last Two Days +ngict_fm_iui_curalarm_recentOneWeek=Last One Week +ngict_fm_iui_curalarm_raisedTime=Raised Time: +ngict_fm_iui_curalarm_query=Query +ngict_fm_iui_curalarm_save=Save +ngict_fm_iui_curalarm_clean=Clear +ngict_fm_iui_curalarm_refreash=Refreash +ngict_fm_iui_curalarm_exportAll=Export All +ngict_fm_iui_curalarm_name=Name +ngict_fm_iui_curalarm_condSaveTip=Update conditions when conditions exist,otherwise create a new condition. +ngict_fm_iui_curalarm_cancel=Cancel +ngict_fm_iui_curalarm_ok=OK +ngict_fm_iui_curalarm_affirm=Acknowledge +ngict_fm_iui_curalarm_unaffirm=Unacknowledge +ngict_fm_iui_curalarm_custom=Custom + +ngict_fm_iui_curalarm_critical=Critical +ngict_fm_iui_curalarm_major=Major +ngict_fm_iui_curalarm_minor=Minor +ngict_fm_iui_curalarm_warning=Warning +ngict_fm_iui_curalarm_ackAlarm=Acknowledge +ngict_fm_iui_curalarm_unackAlarm=Unacknowledge +ngict_fm_iui_curalarm_visible=Visible +ngict_fm_iui_curalarm_invisible=Invisible + +ngict_fm_iui_curalarm_order=No. +ngict_fm_iui_curalarm_id=id +ngict_fm_iui_curalarm_ne=NE +ngict_fm_iui_curalarm_moc=NE Type +ngict_fm_iui_curalarm_probableCauseCode=Alarm Code +ngict_fm_iui_curalarm_alarmRaisedTime=Raised Time +ngict_fm_iui_curalarm_perceivedSeverity=Severity +ngict_fm_iui_curalarm_ackState=ACK State +ngict_fm_iui_curalarm_ackTime=(UN)ACK Time +ngict_fm_iui_curalarm_position1=Position1 +ngict_fm_iui_curalarm_alarmChangedTime=Changed Time +ngict_fm_iui_curalarm_ackUserId=(UN)ACK User ID +ngict_fm_iui_curalarm_ackSystemId=(UN)ACK System ID +ngict_fm_iui_curalarm_alarmClearedTime=Cleared Time +ngict_fm_iui_curalarm_additionalText=Additional Information +ngict_fm_iui_curalarm_ackSystem=(UN)ACK System +ngict_fm_iui_curalarm_clearUserId=Clear User ID +ngict_fm_iui_curalarm_clearSystemId=Clear System ID +ngict_fm_iui_curalarm_clearType=Clear Type +ngict_fm_iui_curalarm_specificProblem=Specific Problem +ngict_fm_iui_curalarm_neIp=NE IP + +//调用datarangepicker组件 +ngict_fm_iui_curalarm_from=from +ngict_fm_iui_curalarm_to=to +ngict_fm_iui_curalarm_Mon=Mon +ngict_fm_iui_curalarm_Tues=Tues +ngict_fm_iui_curalarm_Wed=Wed +ngict_fm_iui_curalarm_Thurs=Thurs +ngict_fm_iui_curalarm_Fri=Fri +ngict_fm_iui_curalarm_Sat=Sat +ngict_fm_iui_curalarm_Sun=Sun +ngict_fm_iui_curalarm_January=January +ngict_fm_iui_curalarm_February=February +ngict_fm_iui_curalarm_March=March +ngict_fm_iui_curalarm_April=April +ngict_fm_iui_curalarm_May=May +ngict_fm_iui_curalarm_June=June +ngict_fm_iui_curalarm_July=July +ngict_fm_iui_curalarm_August=August +ngict_fm_iui_curalarm_September=September +ngict_fm_iui_curalarm_October=October +ngict_fm_iui_curalarm_November=November +ngict_fm_iui_curalarm_December=December + + + + + + + + + + + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-performance-i18n-en-US.properties b/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-performance-i18n-en-US.properties new file mode 100644 index 00000000..6b257704 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/i18n/web-performance-i18n-en-US.properties @@ -0,0 +1,130 @@ +com_zte_ums_ict_pm_index_indexManagement=Index Management +com_zte_ums_ict_pm_index_indexName=Name +com_zte_ums_ict_pm_index_dataType=Data Type +com_zte_ums_ict_pm_index_moType=Mo Type +com_zte_ums_ict_pm_index_counter=Counter +com_zte_ums_ict_pm_index_resourceType=NE Type +com_zte_ums_ict_pm_index_strExpression=Formula +com_zte_ums_ict_pm_index_indexDes=Formula Expression +com_zte_ums_ict_pm_index_operate=Operate +com_zte_ums_ict_pm_index_selectCounter=Please select the Mo Type first +com_zte_ums_ict_sm_confirmToDeleteIndex=Are you sure to delete this index? +STRING=String +INT=Int +FLOAT=Float +LONG=Long +DATA=Date +PERCENT=Percent + +com_zte_ums_ict_pm_threshold=Threshold +com_zte_ums_ict_pm_threshold_title=Threshold Management +com_zte_ums_ict_pm_threshold_index=门限标示 +com_zte_ums_ict_pm_threshold_taskName=Task Name +com_zte_ums_ict_pm_index_direction=Direction +com_zte_ums_ict_pm_threshold_warning=Warning Threshold +com_zte_ums_ict_pm_threshold_minor=Minor Threshold +com_zte_ums_ict_pm_threshold_major=Major Threshold +com_zte_ums_ict_pm_threshold_critical=Critical Threshold +com_zte_ums_ict_pm_threshold_resource=Resource +com_zte_ums_ict_pm_threshold_resource_name=Resource Name +com_zte_ums_ict_pm_threshold_resource_value=Resource Value +com_zte_ums_ict_pm_threshold_resource_turbulence=Turbulence Value +com_zte_ums_ict_pm_threshold_up=Up +com_zte_ums_ict_pm_threshold_down=Down + + +com_zte_ums_ict_pm_index_dataType=数据类型 +com_zte_ums_ict_pm_index_activeStatus=状态 +com_zte_ums_ict_pm_index_activeStatus_true=激活 +com_zte_ums_ict_pm_index_activeStatus_false=挂起 +com_zte_ums_ict_pm_index_granularity=粒度 +com_zte_ums_ict_pm_index_beginTime=开始时间 +com_zte_ums_ict_pm_index_endTime=结束时间 + + +com_zte_ums_ict_pm_action_add=Create +com_zte_ums_ict_pm_action_modify=Modify +com_zte_ums_ict_pm_action_delete=Delete +com_zte_ums_ict_pm_action_query=Query + +com_zte_ums_ict_pm_submit=Submit +com_zte_ums_ict_pm_back=Back +com_zte_ums_ict_sm_confirmToDeleteThreshold=Are you sure to remove this task? + +com_zte_ums_ict_pm_query_data=PM Data Query +com_zte_ums_ict_pm_query_edit=Edit Query Condition +com_zte_ums_ict_pm_query_result=Query Data Result +com_zte_ums_ict_pm_query_start_time=Start Time +com_zte_ums_ict_pm_query_end_time=End Time +com_zte_ums_ict_pm_query_granularity=Granularity +com_zte_ums_ict_pm_query_resource_type=Resource Type +com_zte_ums_ict_pm_query_resource_name=Resource Name +com_zte_ums_ict_pm_query_time=Query Time +com_zte_ums_ict_pm_query_granularity=Query Granularity +com_zte_ums_ict_pm_query_pmIndex=PM Index +com_zte_ums_ict_pm_query_moType=Mo Type +com_zte_ums_ict_pm_query_index=Counters +com_zte_ums_ict_pm_query_resource=Resource +com_zte_ums_ict_pm_query_target_resource=Query Resource +com_zte_ums_ict_pm_query_selected_resource=Selected Resources +com_zte_ums_ict_pm_query_selected_search=Search +com_zte_ums_ict_pm_query_5=5 Minutes +com_zte_ums_ict_pm_query_15=15 Minutes +com_zte_ums_ict_pm_query_60=One Hour +resourcesToFilter=Search + +//表格相关 +ngict-log-iui-table-sLengthMenu=View _MENU_ records +ngict-log-iui-table-sZeroRecords=No matching records found +ngict-log-iui-table-sInfo=Found total _TOTAL_ records +ngict-log-iui-table-sInfoEmpty=No records found to show +ngict-log-iui-table-sGroupActions=_TOTAL_ records selected: +ngict-log-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection. +ngict-log-iui-table-sEmptyTable=No data available in table +ngict-log-iui-table-sPrevious=Prev +ngict-log-iui-table-sNext=Next +ngict-log-iui-table-sPage=Page +ngict-log-iui-table-sPageOf=of + +//日期组件 +ngict-iui-dateRange-month=Month +ngict-iui-dateRange-Jan=Jan +ngict-iui-dateRange-Feb=Feb +ngict-iui-dateRange-Mar=Mar +ngict-iui-dateRange-Apr=Apr +ngict-iui-dateRange-May=May +ngict-iui-dateRange-Jun=Jun +ngict-iui-dateRange-Jul=Jul +ngict-iui-dateRange-Aug=Aug +ngict-iui-dateRange-Sep=Sep +ngict-iui-dateRange-Oct=Oct +ngict-iui-dateRange-Nov=Nov +ngict-iui-dateRange-Dec=Dec +ngict-iui-dateRange-applyLabel=Confirm +ngict-iui-dateRange-cancelLabel=Cancel +ngict-iui-dateRange-fromLabel=From +ngict-iui-dateRange-toLabel=To +ngict-iui-dateRange-customRangeLabel=Custom +ngict-iui-dateRange-Sunday=Su +ngict-iui-dateRange-Monday=Mo +ngict-iui-dateRange-Tuesday=Tu +ngict-iui-dateRange-Wednesday=We +ngict-iui-dateRange-Thursday=Th +ngict-iui-dateRange-Friday=Fr +ngict-iui-dateRange-Saturday=Sa + + + + + + + + + + + + + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/aos_view-fm.gif b/openo-portal/portal-performance/src/main/webapp/performance/image/aos_view-fm.gif new file mode 100644 index 00000000..7914b55a Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/aos_view-fm.gif differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/arrow.png b/openo-portal/portal-performance/src/main/webapp/performance/image/arrow.png new file mode 100644 index 00000000..5c66dd78 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/arrow.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/chart_icon.png b/openo-portal/portal-performance/src/main/webapp/performance/image/chart_icon.png new file mode 100644 index 00000000..f4fbc311 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/chart_icon.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/delete.png b/openo-portal/portal-performance/src/main/webapp/performance/image/delete.png new file mode 100644 index 00000000..5947c7c9 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/delete.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/details_close.png b/openo-portal/portal-performance/src/main/webapp/performance/image/details_close.png new file mode 100644 index 00000000..e6281bae Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/details_close.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/details_open.png b/openo-portal/portal-performance/src/main/webapp/performance/image/details_open.png new file mode 100644 index 00000000..5bf4389c Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/details_open.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/down.png b/openo-portal/portal-performance/src/main/webapp/performance/image/down.png new file mode 100644 index 00000000..f7732ba8 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/down.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/filter.png b/openo-portal/portal-performance/src/main/webapp/performance/image/filter.png new file mode 100644 index 00000000..d7600c8b Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/filter.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/statistics.png b/openo-portal/portal-performance/src/main/webapp/performance/image/statistics.png new file mode 100644 index 00000000..8be1db19 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/statistics.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/table_icon.png b/openo-portal/portal-performance/src/main/webapp/performance/image/table_icon.png new file mode 100644 index 00000000..4a7be176 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/table_icon.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/image/up.png b/openo-portal/portal-performance/src/main/webapp/performance/image/up.png new file mode 100644 index 00000000..8bd53741 Binary files /dev/null and b/openo-portal/portal-performance/src/main/webapp/performance/image/up.png differ diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/alarmConds.js b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmConds.js new file mode 100644 index 00000000..ffda35af --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmConds.js @@ -0,0 +1,261 @@ +var AlarmConds = function () { + + return { + + parseActiveConds2JSon: function (conds) { + return this.parseConds2JSon(conds, 1); + }, + parseHistoryConds2JSon: function (conds) { + return this.parseConds2JSon(conds, 2); + }, + + /** + * 传入的条件数组说明: + * 每个条件都是一个对象,包含2个属性:type和data。type表示条件的类型,data是一个数组,每项都表示一个条件。 + * 下面是支持的所有条件的说明: + * 1)网元 + * { + * type : 'Position', + * data : [{ //支持多个 + * locationId : 'lId1', + * oid : 'oid1', + * isSelf : true //是否分组,true表示只包含自己,false表示分组 + * } + * ] + * } + * 2)级别 + * { + * type : 'Severity', + * data : [{ //支持多个 + * severity : 1 //1表示严重,2表示主要,3表示次要,4表示警告 + * } + * ] + * } + * 3)确认状态 + * { + * type : 'AckState', + * data : [{ //支持多个 + * ackState : 1 //1表示已确认,2表示未确认 + * } + * ] + * } + * 4)可见性 + * { + * type : 'FilterState', + * data : [{ //支持多个 + * filterState : 1 //1表示可见,0表示不可见 + * } + * ] + * } + * 5)告警类型 + * { + * type : 'AlarmType', + * data : [{ //支持多个 + * alarmType : 1 //0表示通信告警,1表示处理错误告警,2表示服务质量告警,3表示设备告警,4表示环境告警,5表示网管系统告警,6表示完整性告警,7表示可用性告警,8表示物理攻击告警,9表示安全攻击告警,10表示时限告警 + * } + * ] + * } + * 6)告警码 + * { + * type : 'ProbableCause', + * data : [{ //支持多个 + * systemType : 6, + * code : 1001 + * } + * ] + * } + * 7)发生时间 + * { + * type : 'RaisedTime', + * data : [{ //支持一个 + * mode : 0, //0表示区间,1表示最近 + * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值 + * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值 + * } + * ] + * } + * 8)确认时间 + * { + * type : 'AckTime', + * data : [{ //支持一个 + * mode : 0, //0表示区间,1表示最近 + * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值 + * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值 + * } + * ] + * } + * 9)清除时间 + * { + * type : 'ClearedTime', + * data : [{ //支持一个 + * mode : 0, //0表示区间,1表示最近 + * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值 + * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值 + * } + * ] + * } + * 10)告警ID + * { + * type : 'AlarmId', + * data : [{ //支持一个 + * id : 1412923648983 + * } + * ] + * } + * 11)MOC + * { + * type : 'Moc', + * data : [{ //支持一个 + * moc : 'moc' //支持前缀匹配,如:'moc%' + * } + * ] + * } + * 12)ip地址 + * { + * type : 'NeIp', + * data : [{ //支持一个 + * neIp : '10.74.165.57' + * } + * ] + * } + */ + parseConds2JSon: function (conds, ruleType) { + var parser = { + Position: function (cond) { + var condStr = ""; + if (cond.type === "Position" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + Severity: function (cond) { + var condStr = ""; + if (cond.type === "Severity" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + AckState: function (cond) { + var condStr = ""; + if (cond.type === "AckState" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + FilterState: function (cond) { + var condStr = ""; + if (cond.type === "FilterState" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + AlarmType: function (cond) { + var condStr = ""; + if (cond.type === "AlarmType" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + ProbableCause: function (cond) { + var condStr = ""; + if (cond.type === "ProbableCause" && cond.data.length > 0) { + condStr = ""; + } + return condStr; + }, + RaisedTime: function (cond) { + var condStr = ""; + if (cond.type === "RaisedTime" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + }, + AckTime: function (cond) { + var condStr = ""; + if (cond.type === "AckTime" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + }, + ClearedTime: function (cond) { + var condStr = ""; + if (cond.type === "ClearedTime" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + }, + AlarmId: function (cond) { + var condStr = ""; + if (cond.type === "AlarmId" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + }, + Moc: function (cond) { + var condStr = ""; + if (cond.type === "Moc" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + }, + NeIp: function (cond) { + var condStr = ""; + if (cond.type === "NeIp" && cond.data.length === 1) { + condStr = ""; + } + return condStr; + } + }; + + var d = new Date(); + var JSonObj = { + rule: { + ruleId: -1, + name: "Alarm", + creator: "admin", + createTime: d.getTime(), + modifier: "", + modifyTime: 0, + description: "", + state: true, + ruleType: ruleType, + ruleSort: 1, + owner: "", + attrs: "" + } + }; + var condStr = ""; + for (var i = 0; i < conds.length; i++) { + condStr += parser[conds[i].type](conds[i]); + } + JSonObj.rule.ruleData = condStr + ""; + //return JSON.stringify(JSonObj); + return JSonObj; + } + + }; +}(); \ No newline at end of file diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsServerPageTable.js b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsServerPageTable.js new file mode 100644 index 00000000..d6ea7b88 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsServerPageTable.js @@ -0,0 +1,514 @@ +var serverPageTable = {}; +var queryCacheId = null; +var alarmCount; +/* Bootstrap style full number pagination control */ +$.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( + '
' + oLang.sPage + ' ' + + '' + + '' + + ' ' + + oLang.sPageOf + ' ' + + '
' + ); + + 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"' : ''; + $('
  • ' + j + '
  • ') + .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'); + } + } + } + } +}); + +//构造查询条件 +serverPageTable.getRestPara = function (cond, tableSetting) { + + var conditions = {}; + //告警级别 + if (cond.severity != null && cond.severity != "undefined" && cond.severity.length > 0) { + var severity = '['+cond.severity+']'; + var severityObj = window.JSON.parse(severity); + conditions.severities=severityObj; + } + + //确认状态 + if (cond.ackState != null && cond.ackState != "undefined" && cond.ackState.length > 0) { + var ackState = '[' + cond.ackState + ']'; + var ackStateObj = window.JSON.parse(ackState) + conditions.ackStates=ackStateObj; + } + + //可见性 + if (cond.filterState != null && cond.filterState != "undefined" && cond.filterState.length > 0) { + var filterState = '[' + cond.filterState + ']'; + var filterStateObj = window.JSON.parse(filterState); + conditions.isVisibles=filterStateObj; + } + + //告警确认时间 + if (cond.ackTimeMode != null && cond.ackTimeMode != "undefined") { + var ackTime; + if(cond.ackTimeMode === 1){ + ackTime = '{"timeMode": '+cond.ackTimeMode+',"relativeTime": '+cond.ackRelativeTime+'}'; + }else{ + ackTime = '{"beginTime": '+cond.ackTimeStarTime+',"endTime": '+cond.ackTimeEndTime+',"timeMode": '+cond.ackTimeMode+'}'; + } + var ackTimeObj = window.JSON.parse(ackTime); + conditions.ackTime = ackTimeObj; + } + + //告警发生时间 + if (cond.alarmRaisedTimeMode != null && cond.alarmRaisedTimeMode != "undefined") { + var alarmRaisedTime; + if(cond.alarmRaisedTimeMode === 1){ + alarmRaisedTime = '{"timeMode": '+cond.alarmRaisedTimeMode+',"relativeTime": '+cond.alarmRaisedRelativeTime+'}'; + }else{ + alarmRaisedTime = '{"beginTime": '+cond.alarmRaisedStartTime+',"endTime": '+cond.alarmRaisedEndTime+',"timeMode": '+cond.alarmRaisedTimeMode+'}'; + } + var alarmRaisedTimeObj = window.JSON.parse(alarmRaisedTime); + conditions.alarmRaisedTime = alarmRaisedTimeObj; + } + + //告警清除时间 + if (cond.clearedTimeMode != null && cond.clearedTimeMode != "undefined") { + var clearedTime; + if(cond.clearedTimeMode === 1){ + clearedTime = '{"timeMode": '+cond.clearedTimeMode+',"relativeTime": '+cond.clearedTimeRelativeTime+'}'; + }else{ + clearedTime = '{"beginTime": '+cond.clearedTimeStartTime+',"endTime": '+cond.clearedTimeEndTime+',"timeMode": '+cond.clearedTimeMode+'}'; + } + var clearedTimeTimeObj = window.JSON.parse(clearedTime); + conditions.alarmClearedTime = clearedTimeTimeObj; + } + + //告警码 + if (cond.probableCause != null && cond.probableCause != "undefined") { + //var probableCauseArr = cond.probableCause.split(','); + var str = ""; + var arr="["; + for (var i = 0; i < cond.probableCause.length; i++) { + if(i === 0){ + if(cond.probableCause[i].type === "1"){ + arr+='{"systemType":'+cond.probableCause[i].codeid+',"codes":[]}'; + }else{ + arr+='{"systemType":'+cond.probableCause[i].parentid+',"codes":['+cond.probableCause[i].codeid+']}'; + } + }else{ + if(cond.probableCause[i].type === "1"){ + arr+=',{"systemType":'+cond.probableCause[i].codeid+',"codes":[]}'; + }else{ + arr+=',{"systemType":'+cond.probableCause[i].parentid+',"codes":['+cond.probableCause[i].codeid+']}'; + } + } + } + arr+="]"; + var probableCausesObj = window.JSON.parse(arr); + conditions.probableCauses = probableCausesObj; + } + + var requests={}; + requests.condition=conditions; + requests.pageSize=tableSetting._iDisplayLength; + requests.pageNumber=tableSetting._iDisplayStart / tableSetting._iDisplayLength + 1; + if(cond.alarmType===2 && requests.pageNumber === 1){ + requests.queryCacheId=""; + }else if(cond.alarmType===2 && requests.pageNumber != 1){ + requests.queryCacheId=queryCacheId; + } + + var resStr = window.JSON.stringify(requests); + result={ + request:resStr + }; + return result; +}; + + +serverPageTable.initDataTable = function (setting, cond, divId) { + //转换colomn + var column = setting.columns; + var setting; + //先把原来的表格清空 + $('#' + divId).children().remove(); + var tableId = setting.tableId; + var tableEleStr = '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
    '; + $('#' + divId).append(tableEleStr); + //$('#'+ tableId).append(' '); + var trEle = $('#' + tableId + ' > thead >tr'); + //var dataTableColumn = []; + for (var one in column) { + if (one != "contains") { + var th = '' + column[one].name + ''; + trEle.append(th); + } + } + + var table = $("#" + tableId).dataTable({ + //"sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout + // "sDom" : "<'row'<'col-md-12 col-sm-12'lip>r><'table-scrollable't>>", + "oLanguage": setting.language,//汉化 + "bJQueryUI": true, + "bPaginate": true,// 分页按钮 + "bFilter": false,// 搜索栏 + "bAutoWidth": true,//自动设置列宽 + "bLengthChange": true,// 每行显示记录数 + "iDisplayLength": 10,// 每页显示行数 + "bSort": false,// 排序 + "bInfo": true,// Showing 1 to 10 of 23 entries 总记录数没也显示多少等信息 + "bWidth": true, + "bScrollCollapse": false, + "sScrollY": "400px", + "sScrollX": "100%", + "sPaginationType": "bootstrap_extended", // 分页, bootstrap_extended 一共两种样式 另一种为two_button // 是datatables默认 + "bProcessing": true, + "bServerSide": true, + "bDestroy": true, + "bSortCellsTop": true, + "sDom": '<"top"rt><"bottom"lip>', + "sAjaxSource": setting.restUrl,// ./js/testJson.json setting.restUrl + "aoColumns": setting.columns, + "bRetrieve": true, + "fnServerData": function (sSource, aoData, fnCallback, oSettings) { + oSettings.jqXHR = $.ajax({ + "type": 'get', + "url": sSource, + "dataType": "json", + "data": serverPageTable.getRestPara(cond, oSettings), + "success": function (resp) { + oSettings.iDraw = oSettings.iDraw + 1; + + var data = {}; + if(cond.ruleType===1){ + var logList = resp.alarms; + data.iTotalRecords = resp.totalCount; + data.iTotalDisplayRecords = resp.totalCount; + + }else if(cond.ruleType===2){ + var logList = resp.alarms; + if(resp.queryCacheId === ""){ + data.iTotalRecords = alarmCount; + data.iTotalDisplayRecords = alarmCount; + }else{ + alarmCount = resp.totalCount; + data.iTotalRecords = resp.totalCount; + data.iTotalDisplayRecords = resp.totalCount; + queryCacheId = resp.queryCacheId; + } + + } + + var pageInfo = null; + setting=oSettings; + if (pageInfo != null) { + vm.logInfo[vm.logType].pageInfo = pageInfo; + } + + //添加序号 + for(var i=0;i"; + } + //组合告警码 + for(var i=0;i table.dataTable', tableWrapper); + var tbodyHead = $('tbody', $tableHead); + if(tbodyHead && tbodyHead.length >0){ + $(tbodyHead).remove(); + } + + var $tableBody = $('table#' + tableId, tableWrapper); + var trIn = $('thead > tr:nth-child(1)', $tableHead); + var trBodyHead = $('thead > tr:nth-child(1)', $tableBody); + var tds = $(trIn).children(); + var ths = $(trBodyHead).children(); + for(var k=0;k' + tds.eq(k).html() + ''); + } + var bodyRows = $('tbody > tr', $tableBody); + for(var i=0;i' + tds.eq(j).html() + ''); + $(tds.eq(j)).height('0px'); + $(tds.eq(j)).css('padding-top','0px'); + $(tds.eq(j)).css('padding-bottom','0px'); + $(tds.eq(j)).css('border-top-width','0px'); + $(tds.eq(j)).css('border-bottom-width','0px'); + } + $(rowClone).height('0px'); + $tableHead.append($(rowClone).prop("outerHTML")); + } + + $('div.dataTables_scrollBody', tableWrapper).css('width','100%'); + //$('div.dataTables_scrollHead', tableWrapper).css('width','98.5%'); + $('div.dataTables_scrollHeadInner', tableWrapper).css('padding-right', 0); + + //$("table.dataTable > thead > tr > th:nth-child(2)", $(".dataTables_scrollHeadInner")).click(); + + //设置表格本体高度 + //$('div.dataTables_scrollBody', tableWrapper).css('height', "280px"); + //填充表头右边界 + /* $('div.dataTables_scrollHead', tableWrapper).css('display','inline-block'); + $("div.dataTables_scrollHead", tableWrapper).after("
    "); */ + /* if($.browser.mozilla){ + $('div#divRightPadding', tableWrapper).css('height', '40'); + } */ + } + }); + + $(window).bind('resize', function () { + //oTable.DataTable.models.oSettings.bAjaxDataGet = false; + table.fnAdjustColumnSizing(setting); + } ); + + function format_Detail(oTable, nTr) { + var aData = oTable.fnGetData(nTr); + + var sOut = ''; + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + + sOut += ''; + sOut += ''; + // sOut += ''; + + // sOut += ''; + // sOut += ''; + // sOut += ''; + + // sOut += ''; + // sOut += ''; + + sOut += ''; + + return sOut; + } + function null2space(nullStr){ + if(nullStr == null){ + return ""; + } else { + return nullStr; + } + } + $('#' + tableId + '>tbody').on('click', 'td.details-control', function () { + var tr = $(this).closest('tr'); + //var nTr = $(this).parents('tr')[0]; + //var row = table.row( tr ); + if (table.fnIsOpen(tr[0])) { + table.fnClose(tr[0]); + //if ( row.child.isShown() ) { + // This row is already open - close it + //row.child.hide(); + tr.removeClass('shown'); + } + else { + // Open this row + table.fnOpen(tr[0], format_Detail(table, tr[0]), 'details'); + //row.child( format_Detail(row.data()) ).show(); + tr.addClass('shown'); + } + }); + + // mod by chenhao 2015-10-26 注释掉 + // // 所有td注册一个点击事件用来展示出详情。 + // $('#ict_alarms_table >tbody').on('click', 'td', function () { + + // var className= $(this).eq(0).attr('class'); + // //当点击的是如下的table页的时候 + // if(className &&(className.indexOf('relInfo')>-1 || className.indexOf('details-check')>-1 || className.indexOf('ackState')>-1 || className.indexOf('details-control')>-1)){ + // $('#right-menu').fadeOut(); + // }else{ + // //填充table的数据 + // var tbody=$('#ict_table_general >tbody'); + // tbody.children().remove(); + // var trHtml=""; + // var tr = $(this).closest('tr'); + // var aData = table.fnGetData(tr[0]); + // for (var i = 0; i < column.length; i++) { + // if( column[i].bVisible == false ){//如果列可见就继续遍历下一个 + // trHtml += ''; + // } + // } + // tbody.append(trHtml); + // if(!vm.alarmId ||vm.alarmId==aData.alarmId){ + // $('#right-menu').fadeToggle(); + // }else{ + // $('#right-menu').fadeIn(); + // } + // vm.alarmId=aData.alarmId; + // } + // }); + //重新调节列宽以适应window resize + $(window).bind('resize', function () { + //oTable.fnAdjustColumnSizing(); + $("table.dataTable > thead > tr > th:nth-child(2)", $(".dataTables_scrollHeadInner")).click(); + } ); + +}; + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsUtil.js b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsUtil.js new file mode 100644 index 00000000..8ef58b8c --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/alarmsUtil.js @@ -0,0 +1,1154 @@ +var alarmsUtil = {}; +var alarmTemp=[]; + +alarmsUtil.timeRender = function (obj) { + if (obj.aData[obj.mDataProp] == -1 || obj.aData[obj.mDataProp] == 0) { + return ""; + } else { + var date = new Date(obj.aData[obj.mDataProp]); + return commonUtil.parseDate(date, 'yyyy-MM-dd hh:mm:ss'); + } +}; + +alarmsUtil.LinkRender = function (obj) { + return '' + obj.aData[obj.mDataProp] + ''; +}; + +alarmsUtil.ackState = function (obj) { + + var innerHtml = ""; + var ackState = obj.aData.ackState; + var alarmId = obj.aData.id; + var alarmIdArr = [alarmId]; + var tableId="\'" + obj.oSettings.sTableId + "\'"; + var divId="\'" + obj.oSettings.nTableWrapper.parentElement.id + "\'"; + if (ackState == "1" && vm.ruleType == 1) { + innerHtml = "Acknowledge"; + } else if(ackState == "1" && vm.ruleType == 2){ + innerHtml = "
    Acknowledge
    "; + } else if(ackState == "2" ){ + innerHtml = "Unacknowledge"; + } + return innerHtml; +}; + +alarmsUtil.Severity = function (obj) { + + var innerHtml = ""; + var Severity = obj.aData.perceivedSeverity; + if (Severity == "1") { + innerHtml = "Critical"; + } else if (Severity == "2") { + innerHtml = "Major"; + } else if (Severity == "3") { + innerHtml = "Minor"; + } else if (Severity == "4") { + innerHtml = "Warning"; + } + return innerHtml; + +}; + +alarmsUtil.operate = function (obj) { + + var alarmId = obj.aData.alarmId; + return ""; + +}; + +alarmsUtil.congfirms = function (alarmId) { + + bootbox.confirm('你确定要删除该告警吗?', function (result) { //你确定要删除该用户吗? + + if (result) { + var sSource = "/web/rest/web/fm/curalarms?data={\"alarmId\":" + alarmId + "}&_dataSource=isc_PageRestDataSource_0&isc_metaDataPrefix=_&isc_dataFormat=json&_operationType=remove&_componentId=isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0"; + $.ajax({ + dataType : "json", + type : "DELETE", + //数据格式:[tab标签id,tabItem的名字,图片路径,tabItem的描述,更多的LInk地址] + contentType : 'application/json; charset=utf-8', + url : sSource, + data : null, + async : false, + success : function (msg) { + setTimeout(function () { + refreshByCond(); + }, 500); + } + }); + } + + }); + +}; + +alarmsUtil.allOperate = function (obj) { + + var record = obj.aData; + var hasModify = commonUtil.hasRigth('uep.pfl.sm.updateuser'); + var hasDel = commonUtil.hasRigth('uep.pfl.sm.deluser'); + var selectUsername = new String(record.userName); + var innerHtml = ""; + + // 如果有权限,显示操作列 + if (hasModify) { + if (hasDel && selectUsername != "admin") { + innerHtml = ""; + } else { + innerHtml = "
    "; + } + } + + return innerHtml; + +}; + +alarmsUtil.refresh = function () { + + refreshByCond(); + +} + +/* + +1.确认 + +2.反确认 + + */ + +alarmsUtil.loopAffirm = function (type) { + + var checkArr = $('#ict_alarms_table_div .details-check input[type="checkbox"]'); + var aidArr = []; + for (var i = 0; i < checkArr.length; i++) { + if($(checkArr[i]).prop("checked")){ + if ($(checkArr[i]).attr('alarmId') != 'undefined' && $(checkArr[i]).attr('alarmId') != null) { + aidArr.push($(checkArr[i]).attr('alarmId')); + } + } + } + + if (type == "1" && aidArr.length > 0) { + alarmsUtil.affirm(aidArr); + } else if (type == "2" && aidArr.length > 0) { + alarmsUtil.unaffirm(aidArr); + } + +} + +/* + + + + */ + +alarmsUtil.loopDelAralms = function () { + + var checkArr = $('#ict_alarms_table_div .details-check input[type="checkbox"]'); + var aidArr = []; + for (var i = 0; i < checkArr.length; i++) { + if($(checkArr[i]).prop("checked")){ + if ($(checkArr[i]).attr('alarmId') != 'undefined' && $(checkArr[i]).attr('alarmId') != null) { + aidArr.push($(checkArr[i]).attr('alarmId')); + } + } + } + + if (aidArr.length > 0) { + bootbox.confirm('Are you sure to delete alarm(s)', function (result) { + if (result) { + var sSource = "/api/umcfm/v1/curalarms?request={\"ids\":["+ aidArr +"]}"; + $.ajax({ + type : "DELETE", + dataType : "json", + contentType : 'application/json; charset=utf-8', + url : sSource, + data : null, + async : false, + success : function (msg) { + setTimeout(function () { + refreshByCond() + }, 500); + } + }); + } + }); + } +} + +alarmsUtil.affirm = function (alarmIdArr,tableId,divId) { + + var getData = {}; + var request = {}; + request.ids=[]; + for(i=0;i '; + return innerHtml; +} + +//初始化告警码树 +alarmsUtil.initProbableCausesTree = function () { + //zTree设置 + var setting = { + view : { + selectedMulti : false, //设置是否可以同时选中多个借点。 + showIcon : true, //不显示图标 + showLine : false, //是否显示节点之间的连线 + }, + data : { + simpleData : { + enable : true //如果设置为 true,请务必设置 setting.data.simpleData 内的其他参数: idKey / pIdKey / rootPId,并且让数据满足父子关系。 + } + }, + callback : { + onExpand : zTreeOnExpand, //每次节点展开后触发的事件。 + onCollapse : zTreeOnCollapse, + //onClick: zTreeOnClick + } + }; + var probableCausesNodes; + + //获取告警码树数据 + getProbableCausesTreeNodes(""); + //创建告警码树 + $.fn.zTree.init($("#probableCausesTree"), setting, probableCausesNodes); + //获取所有现有的tree节点 + var treeObj = $.fn.zTree.getZTreeObj("probableCausesTree"); + initDataAtTree(); + function initDataAtTree(){ + getAllNodesWithoutTypeEqual2("") + }; + + function getAllNodesWithoutTypeEqual2(parentId){ + var treeNodes=treeObj.getNodesByParam("parentId", parentId, null); + for(var i=0;i" + text + ""; + } else if (treeType == "probableCausesTree") { + + parentId = treeNodes[i].parentId; + type = treeNodes[i].type; + htmlStr = "
    "; + } + + if(treeType == "probableCausesTree"){ + if(treeNodes[i].type === 2){ + for(i=0;i 0) { + var severity = '{ "type": "Severity", "data": [{"severity": "' + cond.severity + '"}]}'; //级别 + var severityObj = window.JSON.parse(severity) + conds.push(severityObj); + } + if (cond.ackState != null && cond.ackState != "undefined") { + var ackState = '{ "type": "AckState", "data": [{"ackState": "' + cond.ackState + '"}]}'; //级别 + var ackStateObj = window.JSON.parse(ackState) + conds.push(ackStateObj); + } + if (cond.filterState != null && cond.filterState != "undefined") { + var filterState = '{ "type": "FilterState", "data": [{"filterState": "' + cond.filterState + '"}]}'; //级别 + var filterStateObj = window.JSON.parse(filterState) + conds.push(filterStateObj); + } + + if (cond.ackTimeStarTime != null && cond.ackTimeStarTime != "undefined") { + var ackTime = '{ "type": "AckTime", "data": [{"mode":"0","start":"' + cond.ackTimeStarTime + '","end":"' + cond.ackTimeEndTime + '" }]}'; //级别 + var ackTimeObj = window.JSON.parse(ackTime) + conds.push(ackTimeObj); + } + if (cond.alarmRaisedStartTime != null && cond.alarmRaisedStartTime != "undefined") { + var alarmRaisedTime = '{ "type": "RaisedTime", "data": [{"mode":"0","start":"' + cond.alarmRaisedStartTime + '","end":"' + cond.alarmRaisedEndTime + '" }]}'; //级别 + var alarmRaisedTimeObj = window.JSON.parse(alarmRaisedTime) + conds.push(alarmRaisedTimeObj); + } + + if (cond.clearedTimeStarTime != null && cond.clearedTimeStarTime != "undefined") { + var clearedTime = '{ "type": "ClearedTime", "data": [{"mode":"0","start":"' + cond.clearedTimeStarTime + '","end":"' + cond.clearedTimeEndime + '" }]}'; //级别 + var severityObj = window.JSON.parse(clearedTime) + conds.push(severityObj); + } + var resJsonObj = AlarmConds.parseActiveConds2JSon(conds); + resJsonObj.rule.name = name; + resJsonObj.rule.ruleType = vm.ruleType; + var resStr = window.JSON.stringify(resJsonObj); + var dataSource = "isc_AosRestDataSource_1"; + var operationType = "add"; + var data1 = { + dataSource : dataSource, + operationType : operationType, + data : resJsonObj, + oldValues : null + }; + $.ajax({ + dataType : "json", + type : "POST", + contentType : 'application/json; charset=utf-8', + url : saveUrl, + data : JSON.stringify(data1), + async : false, + success : function (msg) { + $('#saveModalCancle').trigger("click"); + } + }); + +} + +Array.prototype.contains = function (item) { + return RegExp("(^|,)" + item.toString() + "($|,)").test(this); +}; + +/* +@param alarmsType 1当前告警 2历史告警 +@param condRuleId 查询条件的RuleId + */ +alarmsUtil.queryByParma = function (alarmsType, condRuleId) { + + //1.判断是当前告警还是历史告警。 + + var sourceUrl; + if (alarmsType == 1) { //当前告警 + sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":1,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json'; + vm.ruleType = 1; + vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/curalarms"; + vm.curalarmsType = "curalarms"; + vm.showClear = true; //清除按钮 + + } else if(alarmsType == 2){ //历史告警 + + sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":2,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json'; + vm.ruleType = 2; + vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/hisalarms"; + vm.hisalarmsType = "hisalarms"; + vm.showClear = false; //清除按钮 + }else if(alarmsType == 3){ //通知 + sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":2,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json'; + vm.ruleType = 3; + vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/notify"; + vm.notificationType = "notification"; + vm.showClear = false; //清除按钮 + } + + //如果没传condRuleId 直接返回 + if (condRuleId == null || condRuleId == "undefined") { + return; + } + + //2.取出告警规则的数据。 + + $.ajax({ + type : "get", + data : null, + url : sourceUrl, + async : false, + success : function (msg) { + //1.遍历返回的条件数组确定是哪一个rule规则。 + var ruleCondArr = msg.response.data; + var xmlData = ""; + for (var i = 0; i < ruleCondArr.length; i++) { + if (ruleCondArr[i].ruleId == condRuleId) { //condRuleId + xmlData = "" + ruleCondArr[i].ruleData + "" //在jQuery裡,如果要直接将字串转成XML物件,记得前后方要加上,才会被当成XML处理; + break; + } + }; + + //3.解析数据的xml联动页面的组件。 + $(xmlData).find("CompoundCond").each(function () { + //1.级别 + for (var i = 0; i < vm.severityTypes.length; i++) { + vm.severityTypes[i].value = false; + } + if ($(this).find("PerceivedSeverity").attr('value') != null && $(this).find("PerceivedSeverity ").attr('value') != 'undefined') { + var perceivedSeverityArr = $(this).find("PerceivedSeverity ").attr('value').split(','); + for (var i = 0; i < perceivedSeverityArr.length; i++) { + if (perceivedSeverityArr.contains(vm.severityTypes[i].id)) { + vm.severityTypes[i].value = true; + } + }; + } + + //2.确认状态 + for (var i = 0; i < vm.ackStateTypes.length; i++) { + vm.ackStateTypes[i].value = false; + }; + var ackStateV = $(this).find("AckState").attr('value'); + if (ackStateV != null && ackStateV != "undefined") { + var ackStateArr = ackStateV.split(','); + for (var i = 0; i < vm.ackStateTypes.length; i++) { + if (ackStateArr.contains(vm.ackStateTypes[i].id)) { + vm.ackStateTypes[i].value = true; + } + }; + } + + //3.可见性 + if(vm.ruleType === 1){ + for (var i = 0; i < vm.filterStateTypes.length; i++) { + vm.filterStateTypes[i].value = false; + }; + var filterStateV = $(this).find("FilterState").attr('value') + if (filterStateV != null && filterStateV != "undefined") { + var filterStateArr = filterStateV.split(','); + for (var i = 0; i < vm.filterStateTypes.length; i++) { + if (filterStateArr.contains(vm.filterStateTypes[i].id)) { + vm.filterStateTypes[i].value = true; + } + }; + } + } + //4.确认时间 + + var dataRangeAck = $('input[dtitle="ackTime"]'); //日历组件 + vm.fmConds.ackTimeStarTime = null; + vm.fmConds.ackTimeEndTime = null; + dataRangeAck.val(''); + var ackTimeStartMs = $(this).find("AckTime").attr('start'); + var ackTimeEndMs = $(this).find("AckTime").attr('end'); + if (ackTimeStartMs != null && ackTimeStartMs != "undefined" && ackTimeEndMs != null && ackTimeEndMs != "undefined") { + vm.fmConds.ackTimeStarTime = ackTimeStartMs; //确认时间 + vm.fmConds.ackTimeEndTime = ackTimeEndMs; + var ackTimeStarTime = new Date(parseInt(ackTimeStartMs)).format('yyyy-MM-dd'); + var ackTimeEndTime = new Date(parseInt(ackTimeEndMs)).format('yyyy-MM-dd'); + dataRangeAck.val(ackTimeStarTime + ' - ' + ackTimeEndTime); + } + + //5.发生时间 + vm.fmConds.alarmRaisedStartTime = null; + vm.fmConds.alarmRaisedEndTime = null; + var dataRangeRaised = $('input[dtitle="raisedTime"]'); //日历组件 + dataRangeRaised.val(''); + var raisedTimeStartMs = $(this).find("RaisedTime").attr('start'); + var raisedTimeEndMs = $(this).find("RaisedTime").attr('end'); + if (raisedTimeStartMs != null && raisedTimeStartMs != "undefined" && raisedTimeEndMs != null && raisedTimeEndMs != "undefined") { + vm.fmConds.alarmRaisedStartTime = raisedTimeStartMs; //发生时间 + vm.fmConds.alarmRaisedEndTime = raisedTimeEndMs; + var raisedTimeStart = new Date(parseInt(raisedTimeStartMs)).format('yyyy-MM-dd'); + var raisedTimeEnd = new Date(parseInt(raisedTimeEndMs)).format('yyyy-MM-dd'); + dataRangeRaised.val(raisedTimeStart + ' - ' + raisedTimeEnd); + } + + //6.清除时间 + + + //7.告警码 + + vm.fmConds.probableCause = null; + var probableCauseArr = $(this).find("ProbableCause").attr('value'); + if (probableCauseArr != null && probableCauseArr != "undefined") { + for (var i = 0; i < probableCauseArr.length; i++) { + vm.fmConds.probableCause = probableCauseArr; + // 联动 + }; + } + + //8.告警位置 + vm.fmConds.probableCause = null; + var newPositionCondArr = $(this).find("NewPositionCond").attr('value'); + if (newPositionCondArr != null && newPositionCondArr != "undefined") + for (var i = 0; i < newPositionCondArr.length; i++) { + // 联动 + }; + + //9.告警类型 + vm.fmConds.alarmType = null; + var alarmTypeArr = $(this).find("AlarmType").attr('value'); + if (alarmTypeArr != null && alarmTypeArr != "undefined") { + for (var i = 0; i < alarmTypeArr.length; i++) { + vm.fmConds.alarmType = alarmTypeArr; + }; + } + }); + } + }); +} + + +/* + 获取系统类型中的告警码数量 +*/ +alarmsUtil.getProbableCauseCountBySystemType=function(systemType){ + + //"/ngict/rest/fm/probableCause?request={"systemTypes":[6,12]}" + var getData={}; + var request={}; + request.systemTypes=systemType; + getData.request = JSON.stringify(request); + $.ajax({ + type : "get", + data : getData, + url : "/ngict/rest/fm/probableCause", + async : true, + success : function (msg) { + vm.alarmCodeSelectedCount+=msg.length; + }}); +} \ No newline at end of file diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/commonUtil.js b/openo-portal/portal-performance/src/main/webapp/performance/js/commonUtil.js new file mode 100644 index 00000000..be44cc7b --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/commonUtil.js @@ -0,0 +1,60 @@ +var commonUtil = {}; + +commonUtil.sendSynRequest = function(url){ + var response; + $.ajax({ + "type": 'get', + "url": url, + "dataType": "json", + "async": false, + success: function (resp) { + response = resp; + return response; + }, + error: function(XMLHttpRequest, textStatus, errorThrown){ + } + }); +}; + +commonUtil.strToJson = function(str){ + var json = eval('(' + str + ')'); + return json; +}; + +commonUtil.arrayRemove = function(aryInstance, index){ + if (aryInstance == undefined || aryInstance == null) { + return; + } + for (var i = 0, n = 0; i < aryInstance.length; i++) { + if (aryInstance[i] != aryInstance[dx]) { + aryInstance[n++] = aryInstance[i]; + } + } + aryInstance.length -= 1; +}; + +// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 +// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 +commonUtil.parseDate = function(dateObj, format){ + var o = { + "M+": dateObj.getMonth() + 1, + "d+": dateObj.getDate(), + "h+": dateObj.getHours(), + "m+": dateObj.getMinutes(), + "s+": dateObj.getSeconds(), + "q+": Math.floor((dateObj.getMonth() + 3) / 3), + "S": dateObj.getMilliseconds() + } + if (/(y+)/.test(format)) format = format.replace(RegExp.$1, + (dateObj.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(format)) + format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : + ("00" + o[k]).substr(("" + o[k]).length)); + return format; +}; + +commonUtil.strToJson = function(str){ + var json = eval('(' + str + ')'); + return json; +}; diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/curAlarmsController.js b/openo-portal/portal-performance/src/main/webapp/performance/js/curAlarmsController.js new file mode 100644 index 00000000..1228d876 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/curAlarmsController.js @@ -0,0 +1,430 @@ +var refreshByCond; +var lang = 'en-US'; + +avalon.config({ + interpolate: [""] +}) + +refreshByCond = function(){ + vm.$initTable(); +}; + +var vm = avalon.define({ + $id: "curAlarmsController", + logType: 'secLog', + severity: '', + ackState: '', + filterState: '', + ruleType: 1, + curalarmsType: 'curalarms', + moreCondBtn: false, + showClear: true, + dataRangeLocationDisabled:true, + dataRangeTypeDisabled:true, + dataRangeCodeDisabled:true, + alCodeTree_affirm:false, + alLocationTree_affirm:false, + alarmCodeSelectedCount: 0, + alarmLocationSelectedCount: 0, + alarmTypeSelectedCount: 0, + tempHide:false, + treeIcons: [ + "ict-arrowRight", + "ict-arrowLeft", + "ict-selectLeft" + ], + + severityTypes: [ + {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_critical"), value: true, type: "severityTypes", class: "alarm-serious"}, + {id: '2', name: $.i18n.prop("ngict_fm_iui_curalarm_major"), value: true, type: "severityTypes", class: "alarm-important"}, + {id: '3', name: $.i18n.prop("ngict_fm_iui_curalarm_minor"), value: true, type: "severityTypes", class: "alarm-secondary"}, + {id: '4', name: $.i18n.prop("ngict_fm_iui_curalarm_warning"), value: true, type: "severityTypes", class: "alarm-slightly"} + ], + + ackStateTypes: [ + {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_ackAlarm"), value: false, type: "ackStateTypes"}, + {id: '2', name: $.i18n.prop("ngict_fm_iui_curalarm_unackAlarm"), value: true, type: "ackStateTypes"} + ], + + filterStateTypes: [ + {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_visible"), value: true, type: "filterStateTypes"}, + {id: '0', name: $.i18n.prop("ngict_fm_iui_curalarm_invisible"), value: false, type: "filterStateTypes"} + ], + + alTypes:[ + "Communications Alarm", + "Processing Error Alarm", + "Quality of Service Alarm", + "Equipment Alarm", + "Environmental Alarm", + "OMC Alarm", + "Integrity Violation", + "Operational Violation", + "Physical Violation", + "Security Violation", + "Time Domain Violation" + ], + + $alarmsTableFields: { + curalarms: [ + {"mData": null,name: "","sClass": 'details-check',"sWidth": '5%',"fnRender": alarmsUtil.checkBox}, + {"mData": "order", name: $.i18n.prop("ngict_fm_iui_curalarm_order"),"sClass": 'details-control', "sWidth": '6%'}, + {"mData": "id", sWidth : "10%",name: $.i18n.prop("ngict_fm_iui_curalarm_id"),"bVisible": true}, + {"mData": "position1DisplayName", sWidth : "10%",name:$.i18n.prop("ngict_fm_iui_curalarm_ne")}, + {"mData": "mocName",sWidth : "14%", name: $.i18n.prop("ngict_fm_iui_curalarm_moc")}, + {"mData": "probableCauseCodeNameAndCode", sWidth : "14%",name: $.i18n.prop("ngict_fm_iui_curalarm_probableCauseCode")}, + {"mData": "alarmRaisedTime", sWidth : "15%",name: $.i18n.prop("ngict_fm_iui_curalarm_alarmRaisedTime"),"fnRender": alarmsUtil.timeRender}, + {"mData": "perceivedSeverity",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_perceivedSeverity"),fnRender:alarmsUtil.Severity}, + {"mData": "alarmType",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmType"),"bVisible": false}, + {"mData": "ackState",sClass:"ackState",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_ackState"),"fnRender":alarmsUtil.ackState}, + {"mData": "ackTime", sWidth : "13%",name: $.i18n.prop("ngict_fm_iui_curalarm_ackTime"),"fnRender": alarmsUtil.timeRender,"bVisible": false}, + {"mData": "position1", name: $.i18n.prop("ngict_fm_iui_curalarm_position1"),"bVisible": false}, + {"mData": "alarmChangedTime", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmChangedTime"),"bVisible": false,"fnRender": alarmsUtil.timeRender}, + {"mData": "ackUserId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackUserId"),"bVisible": false}, + {"mData": "ackSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackSystemId"),"bVisible": false}, + {"mData": "alarmClearedTime", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmClearedTime"),"bVisible": false,"fnRender": alarmsUtil.timeRender}, + {"mData": "additionalText", name: $.i18n.prop("ngict_fm_iui_curalarm_additionalText"),"bVisible": false}, + {"mData": "ackSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackSystem"),"bVisible": false}, + {"mData": "clearUserId", name: $.i18n.prop("ngict_fm_iui_curalarm_clearUserId"),"bVisible": false}, + {"mData": "clearSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_clearSystemId"),"bVisible": false}, + {"mData": "clearType", name: $.i18n.prop("ngict_fm_iui_curalarm_clearType"),"bVisible": false}, + {"mData": "probableCauseCode", name: $.i18n.prop("ngict_fm_iui_curalarm_probableCauseCode"),"bVisible": false}, + {"mData": "specificProblem", name: $.i18n.prop("ngict_fm_iui_curalarm_specificProblem"),"bVisible": false}, + {"mData": "neIp", name: $.i18n.prop("ngict_fm_iui_curalarm_neIp"),"bVisible": false}, + {"mData": "pathIds", name: $.i18n.prop("ngict_fm_iui_curalarm_pathIds"),"bVisible": false}, + {"mData": "pathName", name: $.i18n.prop("ngict_fm_iui_curalarm_pathName"),"bVisible": false} + ], + }, + + $language: { + "sProcessing": "  处理中...", + "sLengthMenu": $.i18n.prop("ngict-fm-iui-table-sLengthMenu"), + "sZeroRecords": $.i18n.prop("ngict-fm-iui-table-sZeroRecords"), + "sInfo": "" + $.i18n.prop("ngict-fm-iui-table-sInfo"), + "sInfoEmpty": $.i18n.prop("ngict-fm-iui-table-sInfoEmpty"), + "sGroupActions": $.i18n.prop("ngict-fm-iui-table-sGroupActions"), + "sAjaxRequestGeneralError": $.i18n.prop("ngict-fm-iui-table-sAjaxRequestGeneralError"), + "sEmptyTable": $.i18n.prop("ngict-fm-iui-table-sEmptyTable"), + "oPaginate": { + "sPrevious": $.i18n.prop("ngict-fm-iui-table-sPrevious"), + "sNext": $.i18n.prop("ngict-fm-iui-table-sNext"), + "sPage": $.i18n.prop("ngict-fm-iui-table-sPage"), + "sPageOf": $.i18n.prop("ngict-fm-iui-table-sPageOf") + } + }, + + $queryAlarmsInfoUrl: '/api/umcfm/v1/curalarms', + $saveCondUrl: '/web/rest/web/fm/rules?isc_dataFormat=json', + fmConds: {}, + $sunburstSetting: {width: 450, height: 400}, + + $getLogCond: function(){ + var cond = {}; + var severitys = []; + var ackState = []; + var filterState = []; + for (var i = 0; i < vm.severityTypes.length; i++) { + vm.severityTypes[i].value ? severitys.push(vm.severityTypes[i].id) : null; + }; + for (var i = 0; i < vm.ackStateTypes.length; i++) { + vm.ackStateTypes[i].value ? cond.ackState = ackState.push(vm.ackStateTypes[i].id) : null; + }; + for (var i = 0; i < vm.filterStateTypes.length; i++) { + vm.filterStateTypes[i].value ? cond.filterState = filterState.push(vm.filterStateTypes[i].id) : null; + }; + cond.severity = severitys; + cond.ackState = ackState; + cond.filterState = filterState; + cond.location=vm.fmConds.location; + cond.ackTimeStarTime = vm.fmConds.ackTimeStarTime; + cond.ackTimeEndTime = vm.fmConds.ackTimeEndTime; + cond.ackRelativeTime = vm.fmConds.ackRelativeTime; + cond.ackTimeMode = vm.fmConds.ackTimeMode; + cond.alarmRaisedStartTime = vm.fmConds.alarmRaisedStartTime; + cond.alarmRaisedEndTime = vm.fmConds.alarmRaisedEndTime; + cond.alarmRaisedRelativeTime = vm.fmConds.alarmRaisedRelativeTime; + cond.alarmRaisedTimeMode = vm.fmConds.alarmRaisedTimeMode; + cond.clearedTimeStarTime = vm.fmConds.clearedTimeStarTime; + cond.clearedTimeEndTime = vm.fmConds.clearedTimeEndTime; + cond.clearedTimeMode = vm.fmConds.clearedTimeMode; + cond.probableCause = vm.fmConds.probableCause; + cond.alarmType = vm.fmConds.alarmType; + cond.ruleType = vm.ruleType; + return cond; + }, + + $initRegister: function(){ + $('#alCode .condSelect').click(function(){ + $('#alCodeTree').modal('show'); + }); + + $('#alCodeTree').on('hide.bs.modal', function(){ + $table = $("#selectedProbableCausesTreeTable"); + if(vm.alCodeTree_affirm===false){ + $('#selectedProbableCausesTreeTable tbody').children().remove(); + for(i=0;i"; + }; + $('#selectedAlTypeTable').append(html); +} + +initPage = function(){ + bootbox.setDefaults({ + locale: lang.replace("-", "_") + }); + //自定义确认时间组件 + alarmsUtil.setDateRange("daterangeConfirm", vm); + alarmsUtil.dateRangeEnableDisable("customAckTime"); + //自定义发生时间组件 + alarmsUtil.setDateRange("daterangeOccur", vm); + alarmsUtil.dateRangeEnableDisable("customRaisedTime"); + //高级菜单界面中,对告警发生时间、确认时间、清除时间初始化 + alarmsUtil.dateRangeCustom(vm); + //告警码树初始化 + alarmsUtil.initTree(); + //告警类型初始化 + initAlTypeTable(); + vm.$initRegister(); + refreshByCond(); + localStorage.setItem("curRuleDataId",0); +} + +initPage(); diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/performanceChart.js b/openo-portal/portal-performance/src/main/webapp/performance/js/performanceChart.js new file mode 100644 index 00000000..01aff1e1 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/performanceChart.js @@ -0,0 +1,181 @@ +// draw the chart by performance datas +function drawPerformanceChart() { + var chartType = ""; + var titleText = document.getElementById("tableTitleText").innerHTML; + var subTitleText = "subTitleText"; + var chartDataList = []; + var resourceNameList = []; + var timeList = []; + + // get table datas + var tableObj = document.getElementById("ict_pm_data"); + if (tableObj == null || tableObj.rows.length < 1) { + return; + } + + // distinguish between chart types + var ratioType = tableObj.rows[0].cells[5].innerText; + if (ratioType.indexOf("CPU") > -1) { + chartType = "CPU"; + subTitleText = "CPU USE RATIO"; + } else if (ratioType.indexOf("RAM") > -1) { + chartType = "RAM"; + subTitleText = "RAM USE RATIO"; + } else if (ratioType.indexOf("VOLUME") > -1) { + chartType = "FILESYSTEM"; + subTitleText = "LOGIC VOLUME FILESYSTEM USE RATIO"; + } else if (ratioType.indexOf("NIC") > -1) { + chartType = "NIC"; + subTitleText = "ERROR PACKET RATIO BY ONE COLLECT-PERIOD (SEND AND RECEIVED)"; + } else { + return; + } + + // collect datas for chart horizontal axis + for (var i = 1; i < tableObj.rows.length; i++) { + var strTime = tableObj.rows[i].cells[0].innerText; + + if (timeList.length == 0) { + // push the first start time into the x-axis + timeList.push(strTime); + } else { + // push the start times into the x-axis and sort them + for (var j = 0; j < timeList.length; j++) { + if (timeList[j] == strTime) { + break; + } else if (timeList[j] > strTime) { + timeList.splice(j, 0, strTime); + break; + } else if (j + 1 == timeList.length && timeList[j] < strTime) { + timeList.push(strTime); + break; + } + } + } + } + + // create chart resources + for (var i = 1; i < tableObj.rows.length; i++) { + var strTime = tableObj.rows[i].cells[0].innerText; + var ratioIndex = getListIndex(timeList, strTime); + var strName = ""; + var strRatio = ""; + + if (chartType == "CPU" || chartType == "RAM") { + strName = tableObj.rows[i].cells[4].innerText; + strRatio = tableObj.rows[i].cells[5].innerText; + } else if (chartType == "FILESYSTEM") { + strName = tableObj.rows[i].cells[4].innerText + "(" + tableObj.rows[i].cells[6].innerText + ")"; + strRatio = tableObj.rows[i].cells[9].innerText; + } else if (chartType == "NIC") { + strName = tableObj.rows[i].cells[4].innerText + "(" + tableObj.rows[i].cells[5].innerText + ")"; + strRatio = parseFloat(tableObj.rows[i].cells[10].innerText) + parseFloat(tableObj.rows[i].cells[11].innerText); + } + + if (chartDataList.length == 0) { + // create the first chart resource and push it into the chartlist + insertChartDataList(chartDataList, strName, strRatio, ratioIndex); + } else { + // update the chart resources which exist in chartlist + var existFlg = false; + for (var j = 0; j < chartDataList.length; j++) { + if (chartDataList[j].name == strName) { + chartDataList[j].data[ratioIndex] = strRatio; + existFlg = true; + break; + } + } + + // create a new chart resource and push it into the chartlist + if (!existFlg) { + insertChartDataList(chartDataList, strName, strRatio, ratioIndex); + } + } + } + + for (var i = 0; i < chartDataList.length; i++) { + // complete length of datalist for each chart resource + if (chartDataList[i].data.length < timeList.length) { + chartDataList[i].data[timeList.length - 1] = ""; + } + + // create the name list of chart resources + resourceNameList.push(chartDataList[i].name); + } + + // initialize the chart + var dom = document.getElementById("chartCanvasDiv"); + var myChart = echarts.init(dom); + option = null; + + // set the chart by collected chart resources + option = { + title: { + text: titleText, + subtext: subTitleText, + x: 'center' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data:resourceNameList, + top: '10%' + }, + grid: { + top: '20%' + }, + toolbox: { + show: true, + feature: { + magicType: {type: ['line', 'bar']}, + restore: {}, + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data : timeList.map(function (str) { + return str.replace(' ', '\n') + }) + }, + yAxis: { + name : 'percentage(%)', + type: 'value' + }, + series: chartDataList + }; + + // draw the performance chart of all resources + if (option && typeof option === "object") { + myChart.setOption(option, true); + }; +}; + +// define the struct of chart resource +function chartData() { + this.name = ""; + this.type = "line"; + this.smooth = true; + this.data = []; +}; + +// create a new chart resource and push it into the chartlist +function insertChartDataList(chartDataList, name, data, dataIndex) { + var cd = new chartData(); + cd.name = name; + cd.data[dataIndex] = data; + chartDataList.push(cd); +}; + +// return the index of the specified element in the list +function getListIndex(list, data) { + var dataIndex = 0; + for (var i = 0; i < list.length; i++) { + if (list[i] == data) { + return i; + } + } + return dataIndex; +}; diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/performanceQueryController.js b/openo-portal/portal-performance/src/main/webapp/performance/js/performanceQueryController.js new file mode 100644 index 00000000..9fd8489f --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/performanceQueryController.js @@ -0,0 +1,843 @@ +var pm = {}; +pm.query = {}; +pm.query.vmPmQuery = avalon.define({ + $id: "pmQueryController", + tableTitle:'', + pmDataVisable:true, + pmChartVisable:false, + tableIconVisable:false, + chartIconVisable:false, + queryRuleVisable:false, + boxVisible:true, + pmQueries:[], + + $postData:{}, + + beginTime: "", + endTime: "", + granularity:"", + + granularities: [ + {id: '5', name: $.i18n.prop('com_zte_ums_ict_pm_query_5'), value: true}, + {id: '15', name: $.i18n.prop('com_zte_ums_ict_pm_query_15'), value: false}, + {id: '60', name: $.i18n.prop('com_zte_ums_ict_pm_query_60'), value: false} + ], + + granularityClicked: function(modelItem, item){ + if(modelItem.id =="5"){ + pm.query.vmPmQuery.granularity = "5*60"; + pm.query.vmPmQuery.granularities[0].value = true; + pm.query.vmPmQuery.granularities[1].value = false; + pm.query.vmPmQuery.granularities[2].value = false; + }else if(modelItem.id =="15"){ + pm.query.vmPmQuery.granularity = "15*60"; + pm.query.vmPmQuery.granularities[0].value = false; + pm.query.vmPmQuery.granularities[1].value = true; + pm.query.vmPmQuery.granularities[2].value = false; + }else{ + pm.query.vmPmQuery.granularity = "60*60"; + pm.query.vmPmQuery.granularities[0].value = false; + pm.query.vmPmQuery.granularities[1].value = false; + pm.query.vmPmQuery.granularities[2].value = true; + } + }, + + resources: [ + /* {id: 'vnfInstance', name: $.i18n.prop('ngict-pm-iui-name-vnfInstance'), value: "SSS"}, + {id: 'host', name: $.i18n.prop('ngict-pm-iui-name-host'), value: ""} */ + ], + + resourcesMap:{}, + + resourceSlected:[], + + resourceSlectedObjs:[], + + rmSelectedResource: function(modelItem, elem){ + $(elem).parent().remove(); + pm.query.vmPmQuery.resourceSlected.splice(pm.query.vmPmQuery.resourceSlected.indexOf(modelItem.id), 1); + }, + + initResources: function(resourceTypeId){ + var that = this; + $.ajax({ + async: false, + "dataType": 'json', + "type": "GET", + //"url": "/api/umcpm/v1/resources/" + resourceTypeId, + "url": "/api/umcpm/v1/resources/", + "contentType": 'application/json; charset=utf-8', + "success": function (res, textStatus, jqXHR) { + //var nodes = res.content; + var nodes = res; + that.resources = []; + for (var i = 0; i < nodes.length; i++) { + var resource = { + id: nodes[i].id, + name: nodes[i].name, + resType: nodes[i].resType + }; + that.resources.push(resource); + //保存id和resource的映射关系 + var resourceCopy = { + id: nodes[i].id, + name: nodes[i].name, + resType: nodes[i].resType + }; + that.resourcesMap[nodes[i].id] = resourceCopy; + } + //过滤框注册 + $("input[id=resourcesToFilter]").keyup(function(){ + $("table#resources tbody tr").hide().filter(":contains('"+( $(this).val() )+"')").show(); + }); + }, + "error": function () { + } + }); + }, + + resTypeArray : [], + selectedResourceType : "", + selectedResourceTypeId : "", + + moTypeArray:[], + selectedMoType:"", + selectedMoTypeId:"", + + counterArray:[], + selectedCounter:[], + + resTypeSelectAction:function(){ + var resourceTypeId = getIdFromName(pm.query.vmPmQuery.selectedResourceType,pm.query.vmPmQuery.resTypeArray); + pm.query.vmPmQuery.selectedResourceTypeId = resourceTypeId; + getMoTypeArray(resourceTypeId); + pm.query.vmPmQuery.counterArray=[]; + pm.query.vmPmQuery.initResources(resourceTypeId); + }, + moTypeSelectAction:function(obj){ + var resourceTypeId=getIdFromName(pm.query.vmPmQuery.selectedResourceType,pm.query.vmPmQuery.resTypeArray); + //var moTypeId=$(obj).val(); + var moTypeId = getIdFromName(pm.query.vmPmQuery.selectedMoType, pm.query.vmPmQuery.moTypeArray); + pm.query.vmPmQuery.selectedMoTypeId = moTypeId; + getCounterArray(resourceTypeId,moTypeId); + }, + /* counterSelectAction:function(obj){ + var counterId=$(obj).val(); + pm.query.vmPmQuery.selectedCounter=counterId; + pm.query.vmPmQuery.indexDescription+=pm.query.vmPmQuery.selectedCounter; + }, */ + returnQueryPage: function(){ + pm.query.vmPmQuery.pmDataVisable=true; + pm.query.vmPmQuery.pmChartVisable=false; + pm.query.vmPmQuery.tableIconVisable=false; + pm.query.vmPmQuery.chartIconVisable=true; + pm.query.vmPmQuery.queryRuleVisable=false; + pm.query.vmPmQuery.clickDisplayGraphAlink(); + }, + + queryRuleView: function(event, el){ + event.stopPropagation(); + + pm.query.vmPmQuery.tableTitle=$.i18n.prop('com_zte_ums_ict_pm_query_edit'); + + //取得测量任务详情 + var elem = {}; + $.ajax({ + async: false, + "dataType": 'json', + "type": "GET", + "url": "/api/umcpm/v1/meatasks/" + el.id, + "data": null, + "contentType": 'application/json; charset=utf-8', + "success": function (res, textStatus, jqXHR) { + elem = res; + }, + "error": function () { + } + }); + + pm.query.vmPmQuery.pmDataVisable=false; + pm.query.vmPmQuery.pmChartVisable=false; + pm.query.vmPmQuery.tableIconVisable=false; + pm.query.vmPmQuery.chartIconVisable=false; + pm.query.vmPmQuery.queryRuleVisable=true; + + pm.query.vmPmQuery.beginTime = elem.beginTime; + pm.query.vmPmQuery.endTime = elem.endTime; + + var timetext = pmUtil.formatTime(pm.query.vmPmQuery.beginTime) + " - " + pmUtil.formatTime(pm.query.vmPmQuery.endTime); + $("#queryTimeRange").val(timetext); + + //选择粒度 + pm.query.vmPmQuery.granularity = elem.granularity; + var granularity = pm.query.vmPmQuery.granularity / 60; + var granularities = pm.query.vmPmQuery.granularities; + for(var i=0;i tr > td:nth-child(1) input[type="checkbox"]', table); + var checked = $(this).is(":checked"); + $(set).each(function () { + //$(this).attr("checked", checked); + if(checked){ + if(!$(this).is(":checked")){ + $(this).click(); + } + }else{ + if($(this).is(":checked")){ + $(this).click(); + } + } + }); + }); + + $('.resourceAll').unbind().bind("change", function () { + var table = $("table#resources"); + var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table); + var checked = $(this).is(":checked"); + $(set).each(function () { + //$(this).attr("checked", checked); + if(checked){ + if(!$(this).is(":checked")){ + $(this).click(); + } + }else{ + if($(this).is(":checked")){ + $(this).click(); + } + } + }); + }); + //国际化 + var i18nItems = $("[name_i18n=com_zte_ums_ict_pm_query]"); + for(var i=0;i  处理中...", + "sLengthMenu": $.i18n.prop("ngict-log-iui-table-sLengthMenu"), + "sZeroRecords": $.i18n.prop("ngict-log-iui-table-sZeroRecords"), + "sInfo": " " + $.i18n.prop("ngict-log-iui-table-sInfo"), + "sInfoEmpty": $.i18n.prop("ngict-log-iui-table-sInfoEmpty"), + "sGroupActions": $.i18n.prop("ngict-log-iui-table-sGroupActions"), + "sAjaxRequestGeneralError":$.i18n.prop("ngict-log-iui-table-sAjaxRequestGeneralError"), + "sEmptyTable": $.i18n.prop("ngict-log-iui-table-sEmptyTable"), + "oPaginate": { + "sPrevious": $.i18n.prop("ngict-log-iui-table-sPrevious"), + "sNext": $.i18n.prop("ngict-log-iui-table-sNext"), + "sPage": $.i18n.prop("ngict-log-iui-table-sPage"), + "sPageOf": $.i18n.prop("ngict-log-iui-table-sPageOf") + } + }, + $initTable: function () { + var setting = {}; + setting.language = this.$language; + setting.columns = this.$queryDataTableFields; + setting.pageHtml="r<'table-scrollable't><'row page-info-bottom'<'col-md-12 col-sm-12'lip>>>"; + //setting.restUrl ="/api/umcpm/v1/indexes"; + //setting.restUrl ="../../json/thresholdList.json"; + setting.restUrl = "/api/umcpm/v1/historydataqueries"; + setting.tableId = "ict_pm_data"; + serverPageTable.initDataTable(setting, 'ict_pm_data_div' ); + } +}); + +pm.query.vmPmQuery.resourceSlected.$watch("length", function(newValue, oldValue){ + var resourceSlected = pm.query.vmPmQuery.resourceSlected; + //pm.query.vmPmQuery.resourceSlectedObjs = []; + var resourceSlectedObjs = []; + for(var i=0;i0){ + pm.query.vmPmQuery.selectedResourceType=pm.query.vmPmQuery.resTypeArray[0].name; + resourceTypeId=pm.query.vmPmQuery.resTypeArray[0].id; + pm.query.vmPmQuery.selectedDataType=pm.query.vmPmQuery.dataTypeArray[0].name; + getMoTypeArray( pm.query.vmPmQuery.resTypeArray[0].id); + getCounterArray(resourceTypeId,moTypeId); + } */ +}(); + +function getResTypeArray(){ + var url="/api/umcpm/v1/resourcetypes"; + $.ajax({ + "type": 'get', + "url": url, + "dataType": "json", + "async": false, + "success": function (resp) { + //pm.query.vmPmQuery.resTypeArray= resp.content; + pm.query.vmPmQuery.resTypeArray= resp; + }, + "error":function(resp){ + // pm.index.vm.ResTypeArray=resp; + } + }); +} + +function getMoTypeArray(resourceTypeId){ + if(resourceTypeId){ + //获取测量类型 + var url="/api/umcpm/v1/motypes"; + var data={}; + data.resourceTypeId=resourceTypeId; + $.ajax({ + "type": 'get', + "url": url, + data:data, + "dataType": "json", + "async": false, + "success": function (resp) { + //pm.query.vmPmQuery.moTypeArray= resp.content; + pm.query.vmPmQuery.moTypeArray= resp; + }, + "error":function(resp){ + pm.query.vmPmQuery.moTypeArray=[]; + //for test + /* var res = {"message":null,"content":[{"name":"性能KPI-1","id":"ns.cn.ims.metrictype"},{"name":"性能KPI-2","id":"ns.cn.ims.metrictype1"},{"name":"性能KPI-3","id":"ns.cn.ims.metrictype2"},{"name":"性能KPI-4","id":"ns.cn.ims.metrictype3"},{"name":"性能KPI-5","id":"ns.cn.ims.metrictype4"}],"status":0}; + pm.query.vmPmQuery.moTypeArray = res.content; */ + } + }); + } +} + +function getCounterArray(MoTypeId){ + if(MoTypeId){ + var url="/api/umcpm/v1/motypes/"+MoTypeId+"/counters"; + var data={}; + data.moTypeId=MoTypeId; + $.ajax({ + "type": 'get', + "url": url, + "dataType": "json", + data:data, + "async": false, + "success": function (resp) { + //pm.query.vmPmQuery.counterArray= resp.content; + pm.query.vmPmQuery.counterArray= resp; + //默认全选 + pm.query.vmPmQuery.selectedCounter = []; + for(var i=0;i/g, ">"); + s = s.replace(/ /g, " "); + s = s.replace(/\'/g, "'"); + s = s.replace(/\"/g, """); + s = s.replace(/\n/g, "
    "); + return s; +}; +pmUtil.indexOperate = function (obj) { + + var aIndex={}; + aIndex.id=obj.aData.id; + aIndex.name=obj.aData.indexName; + aIndex.dataType=obj.aData.indexDataType; + aIndex.indexDes=obj.aData.indexDes; + aIndex.strExpression=obj.aData.strExpression; + aIndex.resourceType=obj.aData.resourceType; + aIndex.moType=obj.aData.moType; + var index = html_encode(JSON.stringify(aIndex)); + var indexId = obj.aData.id; + var innerHtml = ""; + + return innerHtml; +}; +pmUtil.dataTypeRender = function (obj) { + var record = obj.aData; + obj.aData.indexDataType=obj.aData.dataType; + var innerHtml = ""+$.i18n.prop(record.dataType)+"" + return innerHtml; +}; +pmUtil.indexNameLink = function (obj) { + var index = html_encode(JSON.stringify(obj.aData)); + obj.aData.indexName=obj.aData.name; + return "" + obj.aData.name + ""; +}; +pmUtil.queryIndex=function(index){ + + newIndexWizard(commonUtil.strToJson(index),"query"); + pm.index.vm.title="查看指标"; + $(".form-group").attr("disabled",true); + pm.index.vm.viewVisible=false; + pm.index.vm.rtnVisible=true; + pm.index.vm.indexVisible=true; +}; +pmUtil.addIndex=function(){ + + newIndexWizard(); + pm.index.vm.title="新建指标"; + pm.index.vm.viewVisible=false; + pm.index.vm. indexVisible=true; +}; +pmUtil.modifyIndex=function(index){ + + newIndexWizard(commonUtil.strToJson(index)); + pm.index.vm.title="修改指标"; + pm.index.vm.viewVisible=false; + pm.index.vm.indexVisible=true; +}; +pmUtil.deleteIndex=function(indexId,moTypeId){ + bootbox.confirm($.i18n.prop('com_zte_ums_ict_sm_confirmToDeleteIndex'), function (result) { + if (result) { + var ids=[]; + var del={}; + ids.push(indexId); + del.ids=ids; + $.ajax({ + "dataType": 'json', + "type": "DELETE", + "url": "/api/umcpm/v1/motype/"+moTypeId+"/indexes", + "data" : JSON.stringify(del), + "contentType": 'application/json; charset=utf-8', + "success": function (res, textStatus, jqXHR) { + window.location.href="./indexView.html"; + }, + "error": function () { + } + }); + } + }); +} + +pmUtil.idLink = function (obj) { + var record = obj.aData; + var thresholdId = new String(record.id); + return "" + thresholdId + ""; +} + +pmUtil.congfirmDel = function (obj) { + bootbox.confirm($.i18n.prop('com_zte_ums_ict_sm_confirmToDeleteThreshold'), function (result) { + if (result) { + pm.threshold.vm.deleteThreshold(obj); + } + }); +} + +pmUtil.allOperate = function (obj) { + + var record = obj.aData; + var thresholdId = record.id; + //此时的id字段已经被渲染成html片段,如10001需要提取id + thresholdId = thresholdId.substring(thresholdId.indexOf("('") + 2, thresholdId.indexOf("')")); + + var innerHtml = ""; + + innerHtml = ""; + + return innerHtml; +} + +//获取QueryId +pmUtil.getUrlParam=function(name){ + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 + var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。 + var r =search.match(reg); //匹配目标参数 + if (r != null) return unescape(r[2]); //unescape() 函数可对通过 escape() 编码的字符串进行解码。 + return null; //返回参数值 +} + + +pmUtil.addMeatask = function() { + newMeataskWizard(); + pm.meatask.vm.pageTitle="新建任务"; + pm.meatask.vm.viewVisible=false; + pm.meatask.vm.createMeataskVisible=true; + pm.meatask.vm.queryMeataskVisible=false; +} + +pmUtil.meataskOperate = function (obj) { + var record = obj.aData; + var meataskId = record.id; + //此时的id字段已经被渲染成html片段,如10001需要提取id + meataskId = meataskId.substring(meataskId.indexOf("('") + 2, meataskId.indexOf("')")); + + var innerHtml = ""; + + innerHtml = + [ + "" + ].join("\n"); + return innerHtml; +} + +pmUtil.getActiveStatus = function(obj) { + var meataskId = obj.aData.id; + meataskId = meataskId.substring(meataskId.indexOf("('") + 2, meataskId.indexOf("')")); + var activeStatus = obj.aData.activeStatus; + + var prefixStr = ""; + var suffixStr = ""; + if(activeStatus == 0){ + prefixStr = "暂停"; + }else{ + prefixStr = "激活"; + } + + var innerHtml = prefixStr + meataskId + "'," + activeStatus + "," + obj.iDataRow + suffixStr; + + return innerHtml; +} + +pmUtil.granularityRender = function(obj) { + var data = obj.aData; + switch(data.granularity){ + case (300): + return "5分钟"; + case (900): + return "15分钟"; + case (3600): + return "1小时"; + } + return "5分钟"; +} + +pmUtil.queryMeatask = function(meataskId) { + queryMeataskWizard("queryID"); + pm.meatask.vm.pageTitle="查询任务"; + pm.meatask.vm.viewVisible=false; + pm.meatask.vm.createMeataskVisible=false; + pm.meatask.vm.queryMeataskVisible=true; + + $("#queryMeataskSubmit").click(function() { + pm.meatask.vm.$showResultTable(); + }); +} + +pmUtil.meataskIdLink = function(obj) { + var meatskId = obj.aData.id; + return "" + meatskId + ""; +} + +pmUtil.viewMeataskById = function(meatskId) { + newMeataskWizard(meatskId); + pm.meatask.vm.pageTitle="查看任务"; + pm.meatask.vm.viewVisible=false; + pm.meatask.vm.createMeataskVisible=true; + pm.meatask.vm.queryMeataskVisible=false; +} + +pmUtil.timeRender = function( obj ){ + var time=obj.aData[obj.mDataProp]; + if(time!="0"){ + var date = new Date(obj.aData[obj.mDataProp]); + return commonUtil.parseDate(date , 'yyyy-MM-dd hh:mm:ss'); + } +}; + +pmUtil.deleteMeatask=function(meataskId, row){ + bootbox.confirm("确认删除此任务吗?", function (result) { + if (result) { + $("#ict_meatask_table_div tr:eq("+(row+1)+")").attr('style', 'display:none;'); + } + }); +} + +pmUtil.modifyMeatask = function(meataskId, row) { + modifyMeataskWizard("modifyID"); + pm.meatask.vm.pageTitle="修改任务"; + pm.meatask.vm.viewVisible=false; + pm.meatask.vm.createMeataskVisible=true; + pm.meatask.vm.queryMeataskVisible=false; +} + +pmUtil.randomCPU = function() { + var percent = Math.random()*100; + percent = Math.round(percent); + return percent + "%"; +} + +pmUtil.calculateTime = function(obj) { + var data = obj.aData; + var time = data.beginTime + data.granularity; + + if(time!="0"){ + var date = new Date(data.granularity * 1000 + obj.aData[obj.mDataProp]); + return commonUtil.parseDate(date , 'yyyy-MM-dd hh:mm:ss'); + } +} + +pmUtil.queryMeatask = function(meataskId) { + pm.meatask.vm.pageTitle="查询任务"; + pm.meatask.vm.viewVisible=false; + pm.meatask.vm.createMeataskVisible=false; + pm.meatask.vm.queryMeataskVisible=true; +} + +pmUtil.setDateRange = function (dataRangeId, vm) { + + var open = 'right'; + + //var month = $.i18n.prop('ngict-iui-dateRange-month'); + + var optionSet1 = { + + //startDate: moment().subtract(179, 'days'), + + //endDate: moment(), + + startDate : "2015-12-31", + + endDate : "2016-12-31", + + //format: 'YYYY-MM-DD', + format : 'YYYY-MM-DD h:mm A', + + dateLimit : { + days : 180 + }, + + showWeekNumbers : false, + + timePicker : true, + timePickerIncrement : 5, + + opens : open, + + separator : ' - ', + + locale : { + + applyLabel : $.i18n.prop('ngict-iui-dateRange-applyLabel'), + + cancelLabel : $.i18n.prop('ngict-iui-dateRange-cancelLabel'), + + fromLabel : $.i18n.prop('ngict-iui-dateRange-fromLabel'), + + toLabel : $.i18n.prop('ngict-iui-dateRange-toLabel'), + + customRangeLabel : $.i18n.prop('ngict-iui-dateRange-customRangeLabel'), + + daysOfWeek : [ + + $.i18n.prop('ngict-iui-dateRange-Sunday'), + + $.i18n.prop('ngict-iui-dateRange-Monday'), + + $.i18n.prop('ngict-iui-dateRange-Tuesday'), + + $.i18n.prop('ngict-iui-dateRange-Wednesday'), + + $.i18n.prop('ngict-iui-dateRange-Thursday'), + + $.i18n.prop('ngict-iui-dateRange-Friday'), + + $.i18n.prop('ngict-iui-dateRange-Saturday')], + + //monthNames : ['1' + month, '2' + month, '3' + month, '4' + month, '5' + month, '6' + month, '7' + month, '8' + month, '9' + month, '10' + month, '11' + month, '12' + month], + + //months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + + monthNames: [$.i18n.prop('ngict-iui-dateRange-Jan'), + $.i18n.prop('ngict-iui-dateRange-Feb'), + $.i18n.prop('ngict-iui-dateRange-Mar'), + $.i18n.prop('ngict-iui-dateRange-Apr'), + $.i18n.prop('ngict-iui-dateRange-May'), + $.i18n.prop('ngict-iui-dateRange-Jun'), + $.i18n.prop('ngict-iui-dateRange-Jul'), + $.i18n.prop('ngict-iui-dateRange-Aug'), + $.i18n.prop('ngict-iui-dateRange-Sep'), + $.i18n.prop('ngict-iui-dateRange-Oct'), + $.i18n.prop('ngict-iui-dateRange-Nov'), + $.i18n.prop('ngict-iui-dateRange-Dec')], + + firstDay : 1 + + } + + }; + + //datarangepicker确认 + $('input[id="' + dataRangeId + '"]').bind('apply.daterangepicker', function () { + + //获取时间范围,查询 + + // 都设置为0点 + + pmUtil.setTime($(this)); + + // 更新tooltip内容 + //$(this).attr("data-original-title", $(this).val()); + + }); + + $('input[id="' + dataRangeId + '"]').daterangepicker(optionSet1); + +}; + +//daterangepicker设置时间 +pmUtil.setTime = function setTime($obj) { + + //var title = $obj.attr('dtitle'); + + var arr = $obj.val().split(' - '); + + //排除日历组件空字符串的情况。 + + if (arr[0] != '') { + + var beginTime = new Date(arr[0].replace(/-/g, "/")).getTime(); + + var endTime = new Date(arr[1].replace(/-/g, "/")).getTime(); + + pm.query.vmPmQuery.beginTime = beginTime; + + pm.query.vmPmQuery.endTime = endTime; + + } + +} + +pmUtil.formatTime = function formatTime(ms) { + var date = new Date(ms); + return date.format("yyyy-MM-dd hh:mm:ss"); +} + +/*格式化日期*/ + +Date.prototype.format = function (format) { + + /* + + * format="yyyy-MM-dd hh:mm:ss"; + + */ + + var o = { + + "M+" : this.getMonth() + 1, + + "d+" : this.getDate(), + + "h+" : this.getHours(), + + "m+" : this.getMinutes(), + + "s+" : this.getSeconds(), + + "q+" : Math.floor((this.getMonth() + 3) / 3), + + "S" : this.getMilliseconds() + + } + + if (/(y+)/.test(format)) { + + format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 + + - RegExp.$1.length)); + + } + + for (var k in o) { + + if (new RegExp("(" + k + ")").test(format)) { + + format = format.replace(RegExp.$1, RegExp.$1.length == 1 + + ? o[k] + + : ("00" + o[k]).substr(("" + o[k]).length)); + + } + + } + + return format; + +} \ No newline at end of file diff --git a/openo-portal/portal-performance/src/main/webapp/performance/js/serverPageTable.js b/openo-portal/portal-performance/src/main/webapp/performance/js/serverPageTable.js new file mode 100644 index 00000000..85113e78 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/js/serverPageTable.js @@ -0,0 +1,217 @@ +var serverPageTable = {}; +/* Bootstrap style full number pagination control */ +$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) +{ + return { + "iStart": oSettings._iDisplayStart, + "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( + '
    ' + oLang.sPage + ' ' + + '' + + '' + + ' ' + + oLang.sPageOf + ' ' + + '
    ' + ); + + 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'+j+'') + .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'); + } + } + } + } +} ); +serverPageTable.initDataTable = function( setting , divId ,pageInfos) { + serverPageTable.pageInfo = pageInfos; + //转换colomn + + var column = setting.columns; + //先把原来的表格清空 + $('#'+ divId).children().remove(); + var tableId = setting.tableId; + var tableEleStr = '
    ' + column[3].name + '' + null2space(aData[column[3].mData]) + '' + column[8].name + '' + null2space(vm.alTypes[aData[column[8].mData]]) + '
    ' + column[9].name + '' + null2space(aData[column[9].mData]) + '' + column[7].name + '' + null2space(aData[column[7].mData]) + '
    ' + column[6].name + '' + null2space(aData[column[6].mData]) + '' + column[11].name + '' + null2space(aData[column[11].mData]) + '
    ' + column[10].name + '' + null2space(aData[column[10].mData]) + '' + column[13].name + '' + null2space(aData[column[13].mData]) + '
    ' + column[12].name + '' + null2space(aData[column[12].mData]) + '' + column[5].name + '' + null2space(aData[column[5].mData]) + '
    ' + column[23].name + '' + null2space(aData[column[23].mData]) + '' + column[4].name + '' + null2space(aData[column[4].mData]) + '
    ' + column[5].name + '' + aData[column[5].mData] + '
    ' + column[4].name + '' + aData[column[4].mData] + '
    ' + column[22].name + '' + aData[column[22].mData] + '
    ' + column[22].name + '' + aData[column[22].mData] + '
    ' + column[12].name + '' + aData[column[12].mData] + '' + column[17].name + '' + aData[column[17].mData] + '
    ' + column[16].name + '' + null2space(aData.additionalText) + '
    '+column[i].name+':' + aData[column[i].mData] + '
    " + text + "
    ' + + '' + +'' + + '' + + '' + +'' + +'' + +'
    '; + $('#'+ divId).append(tableEleStr); + //$('#'+ tableId).append(' '); + var trEle = $('#'+ tableId + ' > thead >tr'); + //var dataTableColumn = []; + for ( var one in column){ + var th = '' + column[one].name + ''; + trEle.append(th); + } + serverPageTable.pageInfo = pageInfos; + if(!setting.pageHtml){ + pageHtml="<'row'<'col-md-12 col-sm-12'lip>r><'table-scrollable't>>"; + }else{ + pageHtml=setting.pageHtml; + } + var table = $("#" + tableId).dataTable({ + //"sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout + "sDom" : pageHtml, + "oLanguage": setting.language,//汉化 + "bJQueryUI": true, + "bPaginate": true,// 分页按钮 + "bFilter": false,// 搜索栏 + "bAutoWidth":true,//自动设置列宽 + "bLengthChange": true,// 每行显示记录数 + "iDisplayLength": 10,// 每页显示行数 + "bSort": false,// 排序 + "bInfo": true,// Showing 1 to 10 of 23 entries 总记录数没也显示多少等信息 + "bWidth": true, + "bScrollCollapse": true, + "sPaginationType": "bootstrap_extended", // 分页,一共两种样式 另一种为two_button // 是datatables默认 + "bProcessing": true, + "bServerSide": true, + "bDestroy": true, + "bSortCellsTop": true, + "sAjaxSource": setting.restUrl, + "aoColumns": setting.columns, + "fnServerData": function (sSource, aoData, fnCallback, oSettings) { + fnServerData(sSource, aoData, fnCallback, oSettings); + } + }); + $('#'+ tableId + '>tbody').on('click', 'td.details-control', function () { + var tr = $(this).closest('tr'); + //var nTr = $(this).parents('tr')[0]; + //var row = table.row( tr ); + if ( table.fnIsOpen(tr[0]) ){ + table.fnClose( tr[0] ); + //if ( row.child.isShown() ) { + // This row is already open - close it + //row.child.hide(); + tr.removeClass('shown'); + } + else { + // Open this row + table.fnOpen( tr[0], format_Detail(table, tr[0],column) ); + //row.child( format_Detail(row.data()) ).show(); + tr.addClass('shown'); + } + } ); + return table; + + +}; + + + + diff --git a/openo-portal/portal-performance/src/main/webapp/performance/performance_query_rule.html b/openo-portal/portal-performance/src/main/webapp/performance/performance_query_rule.html new file mode 100644 index 00000000..b72cd5c0 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/performance_query_rule.html @@ -0,0 +1,141 @@ +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    {{el.name}}
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + +
    + + {{elem.name}}
    +
    +
    +
    +
    + +
    +
    +
    + +
    + + + + + + + + + +
    +
    +
    +
    {{elem.name}}
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    {{elem.name}}
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/openo-portal/portal-performance/src/main/webapp/performance/performance_view.html b/openo-portal/portal-performance/src/main/webapp/performance/performance_view.html new file mode 100644 index 00000000..a55a5ac4 --- /dev/null +++ b/openo-portal/portal-performance/src/main/webapp/performance/performance_view.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + {{tableTitle}} + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg