From a3be3e341d242b8544e0f75f6bd067d9eb481df6 Mon Sep 17 00:00:00 2001 From: zhangab Date: Thu, 31 May 2018 10:35:19 +0800 Subject: modify alarm time display Change-Id: Ic5c5a7657f7aa0be1b5eea071fc85a06681258bb Issue-ID: USECASEUI-124 Signed-off-by: zhangab --- .../uui/fusion/scripts/controller/alarmController.js | 19 ++++++++++++++++++- .../scripts/controller/performanceController.js | 18 +++++++++++++++++- .../app/uui/fusion/scripts/view-models/alarm.html | 10 ++++++---- .../uui/fusion/scripts/view-models/performance.html | 2 +- 4 files changed, 42 insertions(+), 7 deletions(-) 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 index 38f263d6..8dfa998b 100644 --- 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 @@ -120,6 +120,7 @@ app.controller('pipeAlarmCtrl', ['$scope', 'ResourceAlarm', '$interval', functio $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; @@ -177,4 +178,20 @@ app.controller('pipeAlarmCtrl', ['$scope', 'ResourceAlarm', '$interval', functio return { getPage: getPage }; -}]); \ No newline at end of file +}]).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/performanceController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js index cb897a46..6c1e6853 100644 --- 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 @@ -87,6 +87,7 @@ app.controller('pipeCtrl', ['$scope', 'Resource', '$interval', function ($scope, 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; @@ -102,7 +103,6 @@ app.controller('pipeCtrl', ['$scope', 'Resource', '$interval', function ($scope, .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]; @@ -165,4 +165,20 @@ app.controller('pipeCtrl', ['$scope', 'Resource', '$interval', function ($scope, }); } } + }).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/view-models/alarm.html b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/alarm.html index 6711749f..dcc6d44a 100644 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/alarm.html +++ b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/alarm.html @@ -87,11 +87,12 @@ Id - Event Name - Source Name + Event Name + Source Name Priority Start Time - Status + Clear Time + Status Option @@ -101,7 +102,8 @@ {{row.alarmsHeader.eventName}} {{row.alarmsHeader.sourceName}} {{row.alarmsHeader.priority}} - {{row.alarmsHeader.createTime}} + {{row.alarmsHeader.startEpochMicrosec || row.alarmsHeader.lastEpochMicroSec | dateformater}} + {{row.alarmsHeader.startEpochMicrosecCleared || row.alarmsHeader.lastEpochMicrosecCleared | dateformater}} {{row.alarmsHeader.status}} diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/performance.html b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/performance.html index 1a7348a5..11e183cf 100644 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/performance.html +++ b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/performance.html @@ -90,7 +90,7 @@ {{row.performanceHeader.eventName}} {{row.performanceHeader.sourceName}} {{row.performanceHeader.priority}} - {{row.performanceHeader.createTime}} + {{row.performanceHeader.startEpochMicrosec || row.performanceHeader.lastEpochMicrosec | dateformater}} -- cgit 1.2.3-korg