Formatting OS info in manager and agent tabs

Formatting os name
This commit is contained in:
Manuel Albarral 2017-08-10 16:39:06 +02:00 committed by GitHub
commit 898443f547
4 changed files with 31 additions and 9 deletions

View File

@ -166,8 +166,22 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier,
$scope.agentInfo = data.data;
if(angular.isUndefined($scope.agentInfo.version))
$scope.agentInfo.version = "Unknown";
if(angular.isUndefined($scope.agentInfo.os))
$scope.agentInfo.os = "Unknown";
if(angular.isUndefined($scope.agentInfo.os)) {
$scope.agentOs = "Unknown";
}
else {
if(!angular.isUndefined($scope.agentInfo.os.name)) {
$scope.agentOs = $scope.agentInfo.os.name + ' ' + $scope.agentInfo.os.version;
}
else {
if(!angular.isUndefined($scope.agentInfo.os.uname)){
$scope.agentOs = $scope.agentInfo.os.uname;
}
else {
$scope.agentOs = "Unknown";
}
}
}
if(angular.isUndefined($scope.agentInfo.lastKeepAlive))
$scope.agentInfo.lastKeepAlive = "Unknown";

View File

@ -978,6 +978,13 @@ md-select-menu.md-default-theme md-content md-option:not([disabled]):focus, md-s
.metric-vis .metric-value {
font-weight: normal;
}
.metric-value {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.managerConfigurationArrow {
float: right;
margin-top: 6px;

View File

@ -5,28 +5,29 @@
<div class='uil-ring-css' ng-if="tabView == 'panels'" ng-show='!hideRing(7)'><div></div></div>
<div ng-show='hideRing(7) && results && !loading' ng-if="tabView == 'panels'">
<md-content class="no-legend" layout="row">
<md-card class="text-centered" flex layout="column">
<md-card flex layout="column">
<md-card-content style="text-align: center;">
<div class="metric-value ng-binding" style="font-size: 14pt;">{{agentInfo.name}}</div>
<div class="ng-binding">Name</div>
</md-card-content>
</md-card>
<md-card class="text-centered" flex="10" layout="column">
<md-card flex="10" layout="column">
<md-card-content style="text-align: center;">
<div class="metric-value ng-binding" style="font-size: 14pt;">{{agentInfo.ip}}</div>
<div class="ng-binding">IP Address</div>
</md-card-content>
</md-card>
<md-card class="text-centered" flex="10" layout="column">
<md-card flex="10" layout="column">
<md-card-content style="text-align: center;">
<div class="metric-value ng-binding" style="font-size: 14pt;">{{agentInfo.version}}</div>
<div class="metric-value ng-binding" style="font-size: 14pt;">{{ agentInfo.version | limitTo: 12 }}{{agentInfo.version.length > 12 ? '...' : ''}}</div>
<md-tooltip md-direction="bottom">{{ agentInfo.version }}</md-tooltip>
<div class="ng-binding">Version</div>
</md-card-content>
</md-card>
<md-card flex layout="column">
<md-card-content style="text-align: center;">
<div class="metric-value ng-binding" class="legend-value-title ng-binding legend-value-truncate" style="font-size: 14pt;">{{ agentInfo.os | limitTo: 70 }}{{agentInfo.os.length > 70 ? '...' : ''}}</div>
<md-tooltip md-direction="bottom">{{ agentInfo.os }}</md-tooltip>
<div class="metric-value ng-binding" class="legend-value-title ng-binding legend-value-truncate" style="font-size: 14pt;">{{ agentOs }}</div>
<md-tooltip md-direction="bottom">{{ agentOs }}</md-tooltip>
<div class="ng-binding">OS</div>
</md-card-content>
</md-card>

View File

@ -120,7 +120,7 @@
</span>
<span layout="row">
<p style="font-weight: bold; min-width: 150px" >Operating system</p>
<p class="right-text">{{agentInfo.os ? agentInfo.os : '-'}}</p>
<p class="right-text">{{agentInfo.os.name ? agentInfo.os.name + agentInfo.os.version : agentInfo.os.uname ? agentInfo.os.uname : '-'}}</p>
</span>
</div>
</md-card-content>