modify alarm time display 89/49689/1
authorzhangab <zhanganbing@chinamobile.com>
Thu, 31 May 2018 02:35:19 +0000 (10:35 +0800)
committerzhangab <zhanganbing@chinamobile.com>
Thu, 31 May 2018 02:35:27 +0000 (10:35 +0800)
Change-Id: Ic5c5a7657f7aa0be1b5eea071fc85a06681258bb
Issue-ID: USECASEUI-124
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/alarmController.js
usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js
usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/alarm.html
usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/performance.html

index 38f263d..8dfa998 100644 (file)
@@ -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
index cb897a4..6c1e685 100644 (file)
@@ -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
index 6711749..dcc6d44 100644 (file)
                 <thead>
                     <tr>
                         <th width="5%">Id</th>
-                        <th width="25%">Event Name</th>
-                        <th width="25%">Source Name</th>
+                        <th width="20%">Event Name</th>
+                        <th width="20%">Source Name</th>
                         <th width="10%">Priority</th>
                         <th width="15%">Start Time</th>
-                        <th width="10%">Status</th>
+                        <th width="15%">Clear Time</th>
+                        <th width="8%">Status</th>
                         <th>Option</th>
                     </tr>
                 </thead>
                         <td>{{row.alarmsHeader.eventName}}</td>
                         <td>{{row.alarmsHeader.sourceName}}</td>
                         <td>{{row.alarmsHeader.priority}}</td>
-                        <td>{{row.alarmsHeader.createTime}}</td>
+                        <td>{{row.alarmsHeader.startEpochMicrosec || row.alarmsHeader.lastEpochMicroSec | dateformater}}</td>
+                        <td>{{row.alarmsHeader.startEpochMicrosecCleared || row.alarmsHeader.lastEpochMicrosecCleared | dateformater}}</td>
                         <td>{{row.alarmsHeader.status}}</td>
                         <td>
                             <button ng-click="jump(row.alarmsHeader.id)" class="btn btn-primary">Detail</button>
index 1a7348a..11e183c 100644 (file)
@@ -90,7 +90,7 @@
                             <td>{{row.performanceHeader.eventName}}</td>
                             <td>{{row.performanceHeader.sourceName}}</td>
                             <td>{{row.performanceHeader.priority}}</td>
-                            <td>{{row.performanceHeader.createTime}}</td>
+                            <td>{{row.performanceHeader.startEpochMicrosec || row.performanceHeader.lastEpochMicrosec | dateformater}}</td>
                             <td>
                                 <button ng-click="jump(row.performanceHeader.id)" class="btn btn-primary">Detail</button>
                             </td>