1515 */
1616'use strict' ;
1717
18- var angular = require ( 'angular' ) ;
19-
20- module . exports = function ( $scope , $location , $interval , $q , $state , Application , Notification ) {
18+ module . exports = function ( $scope , $location , $interval , $q , $state , $filter , Application , Notification ) {
2119 var createNote = function ( app ) {
2220 var title = app . name + ( app . statusInfo . status === 'UP' ? ' is back ' : ' went ' ) + app . statusInfo . status ;
2321 var options = { tag : app . id ,
@@ -37,18 +35,28 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
3735 //find application in known applications and copy state --> less flickering
3836 for ( var j = 0 ; $scope . applications != null && j < $scope . applications . length ; j ++ ) {
3937 if ( app . id === $scope . applications [ j ] . id ) {
40- app . info = $scope . applications [ j ] . info ;
41-
38+ app . infoShort = $scope . applications [ j ] . infoShort ;
39+ app . infoDetails = $scope . applications [ j ] . infoDetails ;
40+ app . version = $scope . applications [ j ] . version ;
4241 //issue notifiaction on state change
4342 if ( app . statusInfo . status !== $scope . applications [ j ] . statusInfo . status ) {
4443 createNote ( app ) ;
4544 }
4645 break ;
4746 }
4847 }
49-
5048 app . getInfo ( ) . success ( function ( info ) {
51- angular . copy ( info , app . info ) ;
49+ app . version = info . version ;
50+ app . infoDetails = null ;
51+ app . infoShort = '' ;
52+ delete info . version ;
53+ var infoYml = $filter ( 'yaml' ) ( info ) ;
54+ if ( infoYml !== '{}\n' ) {
55+ app . infoShort = $filter ( 'limitLines' ) ( infoYml , 3 ) ;
56+ if ( app . infoShort !== infoYml ) {
57+ app . infoDetails = $filter ( 'limitLines' ) ( infoYml , 32000 , 3 ) ;
58+ }
59+ }
5260 } ) . finally ( function ( ) {
5361 app . refreshing = false ;
5462 } ) ;
0 commit comments