diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-09-03 10:17:22 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-09-03 10:18:08 +0800 |
commit | 3c3840524ee11c1385045e9801918bcb05b71fb5 (patch) | |
tree | a159deba4778f796d084b2e3b8d75444244f086d /usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller | |
parent | 19abe2af19ba49073949f8254aec897afe7bb303 (diff) |
feat: delete useless modules and update tomcat version
Change-Id: I38d0c0b65cf210074c7222a535f1b3d7c150f53d
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller')
7 files changed, 0 insertions, 1048 deletions
diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-chartController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-chartController.js deleted file mode 100644 index c98336e0..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-chartController.js +++ /dev/null @@ -1,231 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -app.controller('alarmchartCtrl', ['$scope', '$http', '$routeParams', '$window', - function ($scope, $http, $routeParams, $window) { - $scope.chartShow = false; - $scope.valuess = []; - $scope.ndaShow = false; - $scope.hdaShow = false; - $scope.sourceId = ""; - $scope.hourshow = false; - $scope.dayshow = true; - $scope.today = function () { - $scope.startTime = new Date(); - $scope.endTime = new Date(); - $http({ - method: "GET", - url: global_url + "/alarm/sourceId", - headers: { - 'Access-Control-Allow-Origin': "*", - "Content-Type": "application/json" - } - }).then(function successCallback(resp) { - $scope.sourceIds = resp.data; - }, function errorCallback(resp) { - - }); - }; - $scope.today(); - - $scope.genDiagram = function () { - $http({ - method: 'POST', - url: global_url + "/alarm/diagram", - data: { - "sourceId": $scope.sourceId, - "startTime": FormatDate($scope.startTime), - "endTime": FormatDate($scope.endTime), - "format" : ($scope.showModeId==undefined?"auto":$scope.showModeId) - }, - headers: {'Content-Type': 'application/x-www-form-urlencoded'}, - transformRequest: function (obj) { - var str = []; - for (var p in obj) { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - } - return str.join("&"); - } - }).then(function successCallback(resp) { - console.log(resp); - $scope.chartShow = true; - if (resp.data.allList){ - $scope.ndaShow = false; - $scope.hdaShow = true; - drawAlarmLine(resp.data,alarmChart); - } - else{ - $scope.ndaShow = true; - $scope.hdaShow = false; - } - - - }, function errorCallback(resp) { - - }); - } - $scope.showModeIdChanged = function(){ - - if($scope.showModeId == 'hour'){ - // console.log(typeof($scope.startTime)) - // console.log(String($scope.startTime)) - var str = String($scope.startTime); - var str2 = String($scope.endTime); - $scope.startTime = new Date(str.replace(/\:[0-9]{2}\:/,':00:')); - $scope.endTime = new Date(str2.replace(/\:[0-9]{2}\:/,':00:')); - $scope.hourshow = true; - $scope.dayshow = true; - }else if($scope.showModeId == 'day'){ - $scope.hourshow = false; - $scope.dayshow = true; - }else if($scope.showModeId == 'month'){ - $scope.hourshow = false; - $scope.dayshow = false; - } - - } - $scope.startTimeChanged = function () { - - if ($scope.startTime > $scope.endTime) - $scope.endTime = ""; - }; - $scope.endTimeChanged = function () { - if ($scope.endTime < $scope.startTime) - $scope.startTime = ""; - }; - - $scope.open1 = function () { - $scope.popup1.opened = true; - }; - - $scope.open2 = function () { - $scope.popup2.opened = true; - }; - - $scope.popup1 = { - opened: false - }; - - $scope.popup2 = { - opened: false - }; - - $scope.showModeIds = ["hour","day","month"]; - $scope.showModeId = 'day'; - function FormatDate(strTime) { - var date = new Date(strTime); - if($scope.showModeId == 'hour'){ - return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() - } - if($scope.showModeId == 'day'){ - return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() - } - if($scope.showModeId == 'month'){ - return date.getFullYear() + "-" + (date.getMonth() + 1) - } - - // return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes(); - } - // 获取折线图盒子 - var alarmChart = echarts.init(document.getElementById("alarmChart")); - - function drawAlarmLine(data,myChart){ - var names = Object.keys(data); - var myseries = []; - names.forEach(function (item) { - if(item != 'dateList'){ - myseries.push({ - name: item, - type: 'line', - symbol: 'circle', - symbolSize: 10, - data: data[item] - }) - } - }) - var options = { - tooltip: { - trigger: 'axis', - formatter: function(params) { - var res = '<p>' + params[0].name + '</p>' + '<div>'; - // console.log(params); - for (var i = 0; i < params.length; i++) { - res += '<span></span>' + params[i].seriesName + ' : ' + params[i].value + '</br>'; - } - res += '</div>'; - return res; - } - }, - legend: { - data: names, - top: 10, - icon: 'rect', - itemWidth: 10, - itemHeight: 10 - }, - grid: { - left: '3%', - right: '5%', - bottom: '5%', - top: '15%', - containLabel: true - }, - xAxis: { - type: 'category', - name: 'Time', - boundaryGap: false, - data: data.dateList, - axisLabel:{ - formatter:function(value){ - if($scope.showModeId == 'day'){ - return value.slice(5,10) - }else if($scope.showModeId == 'hour'){ - return value.slice(5,16) - }else if($scope.showModeId == 'month'){ - return value.slice(2,7) - } - } - }, - axisLine: { - symbol: ['none', 'arrow'], - symbolOffset: [0, 12] - }, - axisTick: { - show: false - }, - splitLine: { - show: true - } - }, - yAxis: { - type: 'value', - name: 'Num', - // max: 3, - axisLine: { - symbol: ['none', 'arrow'], - symbolOffset: [0, 12] - }, - axisTick: { - show: false - } - }, - color: ['blue', 'orange', 'red', 'pink','gray','purple'], - series: myseries - } - myChart.setOption(options, true); - } - // drawAlarmLine(data,alarmChart) - }]); diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-detailsController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-detailsController.js deleted file mode 100644 index 8a4c1edc..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarm-detailsController.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -app.controller("alarmDetailsController",function ($scope,$http,$window) { - $scope.back = function () { - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/alarm.html"; - }; - $http({ - method : "GET", - // url : global_url + "/alarm/1/1/"+alarmDetailId+"/null/null/null/null/null" - url : global_url + "/alarm/getAlarmsHeaderDetail/"+alarmDetailId - }).then(function successCallback(resp) { - if (resp.data){ - $scope.alarmCondition = resp.data.alarmsHeader.alarmCondition; - $scope.alarmInterfaceA = resp.data.alarmsHeader.alarmInterfaceA; - $scope.eventCategory = resp.data.alarmsHeader.eventCategory; - $scope.eventId = resp.data.alarmsHeader.eventId; - $scope.eventName = resp.data.alarmsHeader.eventName; - $scope.eventServrity = resp.data.alarmsHeader.eventServrity; - $scope.eventSourceType = resp.data.alarmsHeader.eventSourceType; - $scope.eventType = resp.data.alarmsHeader.eventType; - $scope.faultFieldsVersion = resp.data.alarmsHeader.faultFieldsVersion; - $scope.lastEpochMicroSec = resp.data.alarmsHeader.lastEpochMicroSec; - $scope.nfNamingCode = resp.data.alarmsHeader.nfNamingCode; - $scope.nfcNamingCode = resp.data.alarmsHeader.nfcNamingCode; - $scope.priority = resp.data.alarmsHeader.priority; - $scope.reportingEntityId = resp.data.alarmsHeader.reportingEntityId; - $scope.reportingEntityName = resp.data.alarmsHeader.reportingEntityName; - $scope.sequence = resp.data.alarmsHeader.sequence; - $scope.sourceId = resp.data.alarmsHeader.sourceId; - $scope.sourceName = resp.data.alarmsHeader.sourceName; - $scope.specificProblem = resp.data.alarmsHeader.specificProblem; - $scope.startEpochMicrosec = resp.data.alarmsHeader.startEpochMicrosec; - $scope.startTIme = resp.data.alarmsHeader.createTime; - $scope.alarmInformation = resp.data.list; - }else { - alert("No Data!"); - } - },function errorCallback(resq) { - - }); -});
\ No newline at end of file diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarmController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarmController.js deleted file mode 100644 index 8dfa998b..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarmController.js +++ /dev/null @@ -1,197 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -var alarmDetailId = ""; - -app.controller('alarmGridCtrl', ['$scope', '$log', '$http', '$timeout', '$interval', '$window', - function ($scope, $log, $http, $timeout, $interval, $window) { - $scope.jump = function (value) { - alarmDetailId = value; - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/alarm-details.html"; - }; - $scope.toChart = function () { - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/alarm-chart.html"; - }; - - $scope.itemsByPagea = 10; - - $http({ - url: global_url + "/alarm/statusCount", - method: "GET" - }).then(function successCallback(resp) { - $scope.open[0].count = resp.data[1]; - $scope.open[1].count = resp.data[2]; - $scope.open[2].count = resp.data[0]; - - }); - - // li的数据 - $scope.open = [{ - id: 'active', - name: 'Active', - count: 0 - }, - { - id: 'close', - name: 'Closed', - count: 0 - }, - { - id: undefined, - name: 'All', - count: 0 - } - ]; - - $scope.menuState = { - show: false - }; - - $scope.toggleMenu = function () { - $scope.menuState.show = !$scope.menuState.show; - }; - - $scope.open1 = function () { - $scope.popup1.opened = true; - }; - - $scope.open2 = function () { - $scope.popup2.opened = true; - }; - - $scope.popup1 = { - opened: false - }; - - $scope.popup2 = { - opened: false - }; - - } -]); -app.controller('pipeAlarmCtrl', ['$scope', 'ResourceAlarm', '$interval', function ($scope, service, $interval) { - $scope.condition1 = ""; - $scope.condition2 = ""; - $scope.condition3 = ""; - $scope.condition4 = ""; - $scope.condition5 = ""; - $scope.vfstatus = "null"; - - $scope.selectOpen = function (v, func) { - $scope.vfstatus = typeof (v) == "undefined" ? "null" : v; - $scope.tableState.pagination.start = 0; - $scope.selectedOpen = v; - func($scope.tableState); - }; - - - $scope.activeOpen = function (open_id) { - return open_id == $scope.selectedOpen; - }; - - var ctrl = this; - - ctrl.displayed = []; - - ctrl.callServer = function callServer(tableState) { - ctrl.isLoading = true; - $scope.tableState = tableState; - var pagination = tableState.pagination; - // console.log(pagination); - - var start = pagination.start / pagination.number + 1 || 0; - var number = pagination.number || 10; - - service.getPage(start, number, $scope.condition1 === "" ? "" : $scope.condition1, - $scope.condition2 === "" ? "" : $scope.condition2, $scope.condition3 === "" ? "" : $scope.condition3, - $scope.condition4 === "" ? "" : $scope.condition4, $scope.condition5 === "" ? "" : $scope.condition5, - $scope.vfstatus).then(function (result) { - // console.log(result) - ctrl.displayed = result.data; - tableState.pagination.numberOfPages = result.numberOfPages; - ctrl.isLoading = false; - }); - - // var timer = $interval(function () { - // ctrl.callServer($scope.tableState); - // }, 5000) - - // console.log($scope) - }; - -}]).factory('ResourceAlarm', ['$q', '$filter', '$timeout', '$http', function ($q, $filter, $timeout, $http) { - var randomsItems = []; - var totalCount = 0; - - function getPage(start, number) { - var url = global_url + '/alarm/' + start + '/' + number + ''; - url += arguments[2] === "" ? "/null" : "/" + arguments[2]; - url += arguments[3] === "" ? "/null" : "/" + arguments[3]; - url += arguments[4] === "" ? "/null" : "/" + arguments[4]; - url += arguments[5] === "" ? "/null" : "/" + FormatDate(arguments[5]); - url += arguments[6] === "" ? "/null" : "/" + FormatDate(arguments[6]); - url += arguments[7] === "" ? "/null" : "/" + arguments[7]; - $http({ - url: url, - method: "GET" - }).then(function SuccessCallback(resp) { - if (resp.data.alarms.length > 0) { - randomsItems = resp.data.alarms; - totalCount = resp.data.totalRecords; - } else { - randomsItems = []; - totalCount = 0; - } - }); - - var deferred = $q.defer(); - - $timeout(function () { - deferred.resolve({ - data: randomsItems, - numberOfPages: Math.ceil(totalCount / number) - }); - }, 1500); - - return deferred.promise; - } - - function FormatDate(strTime) { - var date = new Date(strTime); - return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes(); - }; - - return { - getPage: getPage - }; -}]).filter('dateformater',function(){ - return function(vmstime){ - if(!vmstime){ - return '' - } - let mstime = Number((vmstime + '').slice(0,13)); - let time = new Date(mstime); - let year = time.getFullYear(); - let month = time.getMonth() + 1; - let day = time.getDate(); - let hours = time.getHours(); - let minutes = time.getMinutes(); - let seconds = time.getSeconds(); - let formattime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; - return formattime; - } -});
\ No newline at end of file diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/left-menuController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/left-menuController.js deleted file mode 100644 index 135ed768..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/left-menuController.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -var currentTab = 'app/uui/fusion/scripts/view-models/lifecyclemanagement.html'; - -app.controller('cmCtrl', ['$scope', function ($scope) { - $scope.routeData = [{ - name: 'Services', - url: 'app/uui/fusion/scripts/view-models/lifecyclemanagement.html', - nclass: 'fa fa-users' - }, - { - name: 'Alarm', - url: 'app/uui/fusion/scripts/view-models/alarm.html', - nclass: 'fa fa-users' - }, - { - name: 'Performance', - url: 'app/uui/fusion/scripts/view-models/performance.html', - nclass: 'fa fa-cog' - } - ]; - $scope.currentTab = currentTab; - $scope.$watch('currentTab', function (newValue, oldValue) { - if (newValue === oldValue) { - return; - } // AKA first run - // $scope.onClickTab(newValue); - }); - $scope.onClickTab = function (url) { - $scope.currentTab = url; - }; - $scope.isActiveTab = function (tabRoute) { - return tabRoute == $scope.currentTab; - } -}]);
\ No newline at end of file diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-chartController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-chartController.js deleted file mode 100644 index 21363ff0..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-chartController.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -app.controller('pertabCtrl', ['$scope', '$http', '$routeParams', '$window' , - function ($scope, $http,$routeParams,$window) { - $scope.chartShow = false; - $scope.ndaShow = false; - $scope.hdaShow = false; - $scope.valuess = []; - $scope.namesPIsShow = false; - $scope.goIsShow = true; - $scope.hourshow = false; - $scope.dayshow = true; - $scope.timestep = '5'; - $scope.today = function() { - $scope.startTime = new Date(); - $scope.endTime = new Date(); - $http({ - method : "GET", - url : global_url+"/performance/resourceIds", - headers: { - 'Access-Control-Allow-Origin': "*", - "Content-Type": "application/json" - } - }).then(function successCallback(resp) { - $scope.sourceIds = resp.data; - },function errorCallback(reps) { - - }); - }; - $scope.today(); - - - $scope.startTimeChanged = function () { - if ($scope.startTime > $scope.endTime) - $scope.endTime = ""; - }; - $scope.endTimeChanged = function () { - if ($scope.endTime < $scope.startTime) - $scope.startTime = ""; - }; - - $scope.sourceIdChanged = function () { - if ($scope.sourceId != null){ - $scope.namesPIsShow = true; - $http({ - method : "POST", - url : global_url + "/performance/names", - data : { "sourceId":$scope.sourceId }, - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - transformRequest: function(obj) { - var str = []; - for (var p in obj) { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - } - return str.join("&"); - } - - }).then(function successCallback(resp) { - $scope.namePs = resp.data; - $scope.nameP = null; - },function errorCallback(resq) { - - }); - } - else{ - $scope.goIsShow = true; - $scope.namesPIsShow = false; - } - - }; - - $scope.namePChanged = function () { - if ($scope.nameP != null){ - $scope.goIsShow = false; - // $http({ - // method : "POST", - // url : global_url + "/performance/names", - // data : { "sourceId":$scope.nameP }, - // headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - // transformRequest: function(obj) { - // var str = []; - // for (var p in obj) { - // str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - // } - // return str.join("&"); - // } - // }).then(function successCallback(resp) { - // $scope.goIsShow = false; - // },function errorCallback(resq) { - - // }); - } - else{ - $scope.goIsShow = true; - $scope.namesCIsShow = false; - } - }; - - - $scope.genDiagram = function () { - $scope.chartShow = true; - $http({ - method : 'POST', - url : global_url + "/performance/diagram", - data : { - "sourceId":$scope.sourceId, - "startTime":FormatDate($scope.startTime), - "endTime":FormatDate($scope.endTime), - "nameParent":$scope.nameP, - "format":$scope.showModeId==undefined?"auto":$scope.showModeId - }, - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - transformRequest: function(obj) { - var str = []; - for (var p in obj) { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - } - return str.join("&"); - } - }).then(function successCallback(resp) { - console.info(resp); - if (resp.data.dateList){ - $scope.ndaShow = false; - $scope.hdaShow = true; - - drawPerformanceBar(resp.data,performanceChart); - } - else{ - $scope.ndaShow = true; - $scope.hdaShow = false; - - } - - },function errorCallback(resp) { - - }); - }; - $scope.showModeIdChanged = function(){ - - if($scope.showModeId == 'minute'){ - $scope.hourshow = true; - $scope.timestep = '5'; - }else if($scope.showModeId == 'hour'){ - var str = String($scope.startTime); - var str2 = String($scope.endTime); - $scope.startTime = new Date(str.replace(/\:[0-9]{2}\:/,':00:')); - $scope.endTime = new Date(str2.replace(/\:[0-9]{2}\:/,':00:')); - $scope.hourshow = true; - $scope.timestep = '0'; - }else if($scope.showModeId == 'day'){ - $scope.hourshow = false; - } - - } - $scope.open1 = function() { - $scope.popup1.opened = true; - }; - - $scope.open2 = function() { - $scope.popup2.opened = true; - }; - - $scope.popup1 = { - opened: false - }; - - $scope.popup2 = { - opened: false - }; - - $scope.modeShow = false; - - $scope.showModeIds = ["minute","hour","day"]; - $scope.showModeId = 'day'; - function FormatDate (strTime) { - var date = new Date(strTime); - return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes(); - } - - // 获取柱状图盒子 - var performanceChart = echarts.init(document.getElementById("performanceChart")); - - function drawPerformanceBar(data,myChart){ - var names = Object.keys(data); - var myseries = []; - names.forEach(function (item) { - if(item != 'dateList'){ - myseries.push({ - name: item, - type: 'bar', - // symbol: 'circle', - // symbolSize: 10, - data: data[item] - }) - } - }) - var options = { - tooltip: { - trigger: 'axis', - formatter: function(params){ - var res = '<p>' + params[0].name + '</p>' + '<div>'; - // console.log(params); - for (var i = 0; i < params.length; i++) { - res += '<span></span>' + params[i].seriesName + ' : ' + params[i].value + '</br>'; - } - res += '</div>'; - return res; - } - }, - legend: { - data: names, - top: 10, - icon: 'rect', - itemWidth: 10, - itemHeight: 10 - }, - grid: { - left: '3%', - right: '5%', - bottom: '5%', - top: '15%', - containLabel: true - }, - xAxis: { - type: 'category', - name: 'Time', - boundaryGap: true, - data: data.dateList, - axisLabel:{ - formatter:function(value){ - if($scope.showModeId == 'day'){ - return value.slice(5,10) - }else if($scope.showModeId == 'hour'){ - return value.slice(5,16) - }else if($scope.showModeId == 'minute'){ - return value.slice(5,16) - } - } - }, - axisLine: { - symbol: ['none', 'arrow'], - symbolOffset: [0, 12] - }, - axisTick: { - show: false, - }, - splitLine: { - show: true - } - }, - yAxis: { - type: 'value', - name: 'Num', - // max: 3, - axisLine: { - symbol: ['none', 'arrow'], - symbolOffset: [0, 12] - }, - axisTick: { - show: false - } - }, - color: ['green', 'orange', 'red', 'pink','gray','purple'], - series: myseries - } - myChart.setOption(options, true); - } - // var data = { - // dateList:["2018-05-23 34:35:00",2,3,4,5,6,7,8,9,10], - // valueList:[5,3,1,7,3,5,8,3,5,2] - // } - // drawPerformanceBar(data,performanceChart) - }]); diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-detailsController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-detailsController.js deleted file mode 100644 index a6003d4a..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performance-detailsController.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -app.controller("performanceDetailsController",function ($scope,$http,$window) { - $scope.back = function () { - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/performance.html"; - }; - console.log(permanceId); - $http({ - method : "GET", - // url : global_url + "/performance/1/1/"+permanceId+"/null/null/null/null" - url : global_url + "/performance/getPerformanceHeaderDetail/"+permanceId - }).then(function successCallback(resp) { - console.log(resp.data); - if (resp.data){ - $scope.eventName = resp.data.performanceHeader.eventName; - $scope.eventId = resp.data.performanceHeader.eventId; - $scope.sourceId = resp.data.performanceHeader.sourceId; - $scope.sourceName = resp.data.performanceHeader.sourceName; - $scope.reportingEntityId = resp.data.performanceHeader.reportingEntityId; - $scope.reportingEntityName = resp.data.performanceHeader.reportingEntityName; - $scope.priority = resp.data.performanceHeader.priority; - $scope.createTime = resp.data.performanceHeader.createTime; - $scope.nfcNamingCode = resp.data.performanceHeader.nfcNamingCode; - $scope.nfNamingCode = resp.data.performanceHeader.nfNamingCode; - $scope.performanceInformation = resp.data.list; - }else { - alert("No Data"); - } - },function errorCallback(resq) { - - }); -});
\ No newline at end of file diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js deleted file mode 100644 index 6c1e6853..00000000 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js +++ /dev/null @@ -1,184 +0,0 @@ -/* - Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -// -var permanceId = ""; -app.controller('perGridCtrl', ['$scope', '$http', '$window', '$interval', - function ($scope, $http, $window, $interval) { - $scope.jump = function (value) { - permanceId = value; - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/performance-details.html"; - }; - - $scope.itemsByPage = 10; - - $scope.toChart = function () { - var obj = $("#lm"); - angular.element(obj).scope().currentTab = "app/uui/fusion/scripts/view-models/performance-chart.html"; - }; - - $scope.menuState = { - show: false - } - $scope.toggleMenu = function () { - $scope.menuState.show = !$scope.menuState.show; - } - - $scope.checkResults = []; - - - // $scope.menuState = { - // show: false - // } - // $scope.toggleMenu = function () { - // $scope.menuState.show = !$scope.menuState.show; - // } - - $scope.open1 = function () { - $scope.popup1.opened = true; - }; - - $scope.open2 = function () { - $scope.popup2.opened = true; - }; - - $scope.popup1 = { - opened: false - }; - - $scope.popup2 = { - opened: false - }; - - } -]); -app.controller('pipeCtrl', ['$scope', 'Resource', '$interval', function ($scope, service, $interval) { - $scope.seek1 = ""; - $scope.seek2 = ""; - $scope.seek3 = ""; - $scope.seek4 = ""; - $scope.seek5 = ""; - - var ctrl = this; - - ctrl.displayed = []; - - ctrl.callServer = function callServer(tableState) { - ctrl.isLoading = true; - $scope.tableState = tableState; - var pagination = tableState.pagination; - - var start = pagination.start / pagination.number + 1 || 0; - var number = pagination.number || 10; - - service.getPage(start, number, $scope.seek1 === "" ? "null" : $scope.seek1, - $scope.seek2 === "" ? "null" : $scope.seek2, $scope.seek3 === "" ? "null" : $scope.seek3, - $scope.seek4 === "" ? "null" : $scope.seek4, $scope.seek5 === "" ? "null" : $scope.seek5).then(function (result) { - console.log(result) - ctrl.displayed = result.data; - tableState.pagination.numberOfPages = result.numberOfPages; - ctrl.isLoading = false; - }); - - // $interval(function () { - // ctrl.callServer($scope.tableState); - // }, 5000) - - }; - - }]) - .factory('Resource', ['$q', '$filter', '$timeout', '$http', function ($q, $filter, $timeout, $http) { - var randomsItems = []; - var totalCount = 0; - function getPage(start, number) { - var url = global_url + '/performance/' + start + '/' + number + ''; - url += arguments[2] === "" ? "/null" : "/" + arguments[2]; - url += arguments[3] === "" ? "/null" : "/" + arguments[3]; - url += arguments[4] === "" ? "/null" : "/" + arguments[4]; - url += arguments[5] === "null" ? "/null" : "/" + FormatDate(arguments[5]); - url += arguments[6] === "null" ? "/null" : "/" + FormatDate(arguments[6]); - $http({ - url: url, - method: "GET" - }).then(function SuccessCallback(resp) { - if (resp.data.performances.length > 0) { - randomsItems = resp.data.performances; - totalCount = resp.data.totalRecords; - } else { - randomsItems = []; - totalCount = 0; - } - }); - - var deferred = $q.defer(); - - $timeout(function () { - deferred.resolve({ - data: randomsItems, - numberOfPages: Math.ceil(totalCount / number) - }); - }, 1500); - - - return deferred.promise; - } - - function FormatDate(strTime) { - var date = new Date(strTime); - return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes(); - }; - - return { - getPage: getPage - }; - - - }]).directive('stRatio', function () { - return { - link: function (scope, element, attr) { - var ratio = +(attr.stRatio); - - element.css('width', ratio + '%'); - - } - }; - }).directive('pageSelect', function () { - return { - restrict: 'E', - template: '<input type="text" class="select-page" ng-model="inputPage" ng-change="selectPage(inputPage)">', - link: function (scope, element, attrs) { - scope.$watch('currentPage', function (c) { - scope.inputPage = c; - }); - } - } - }).filter('dateformater',function(){ - return function(vmstime){ - if(!vmstime){ - return '' - } - let mstime = Number((vmstime + '').slice(0,13)); - let time = new Date(mstime); - let year = time.getFullYear(); - let month = time.getMonth() + 1; - let day = time.getDate(); - let hours = time.getHours(); - let minutes = time.getMinutes(); - let seconds = time.getSeconds(); - let formattime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; - return formattime; - } - });
\ No newline at end of file |