feat(docker): new docker view (#292)

pull/294/head
Anthony Lapenna 8 years ago committed by GitHub
parent e5396091a7
commit fa53339fea

@ -3,139 +3,113 @@
<a data-toggle="tooltip" title="Refresh" ui-sref="docker" ui-sref-opts="{reload: true}"> <a data-toggle="tooltip" title="Refresh" ui-sref="docker" ui-sref-opts="{reload: true}">
<i class="fa fa-refresh" aria-hidden="true"></i> <i class="fa fa-refresh" aria-hidden="true"></i>
</a> </a>
<i id="loadingViewSpinner" class="fa fa-cog fa-spin"></i>
</rd-header-title> </rd-header-title>
<rd-header-content>Docker</rd-header-content> <rd-header-content>Docker</rd-header-content>
</rd-header> </rd-header>
<div class="row">
<div class="col-lg-3 col-md-6 col-xs-12">
<rd-widget>
<rd-widget-body>
<div class="widget-icon pull-left">
<i class="fa fa-code"></i>
</div>
<div class="title">{{ docker.Version }}</div>
<div class="comment">Docker version</div>
</rd-widget-body>
</rd-widget>
</div>
<div class="col-lg-3 col-md-6 col-xs-12">
<rd-widget>
<rd-widget-body>
<div class="widget-icon pull-left">
<i class="fa fa-code"></i>
</div>
<div class="title">{{ docker.ApiVersion }}</div>
<div class="comment">API version</div>
</rd-widget-body>
</rd-widget>
</div>
<div class="col-lg-3 col-md-6 col-xs-12">
<rd-widget>
<rd-widget-body>
<div class="widget-icon pull-left">
<i class="fa fa-code"></i>
</div>
<div class="title">{{ docker.GoVersion }}</div>
<div class="comment">Go version</div>
</rd-widget-body>
</rd-widget>
</div>
</div>
<div class="row"> <div class="row" ng-if="state.loaded">
<div class="col-lg-12"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<rd-widget> <rd-widget>
<rd-widget-header icon="fa-object-group" title="Engine status"></rd-widget-header> <rd-widget-header icon="fa-code" title="Engine version"></rd-widget-header>
<rd-widget-body classes="no-padding"> <rd-widget-body classes="no-padding">
<table class="table"> <table class="table">
<tbody> <tbody>
<tr> <tr>
<td>Containers</td> <td>Version</td>
<td>{{ info.Containers }}</td> <td>{{ version.Version }}</td>
</tr>
<tr>
<td>Images</td>
<td>{{ info.Images }}</td>
</tr> </tr>
<tr> <tr>
<td>Debug</td> <td>API version</td>
<td>{{ info.Debug }}</td> <td>{{ version.ApiVersion }}</td>
</tr> </tr>
<tr> <tr>
<td>CPUs</td> <td>Go version</td>
<td>{{ info.NCPU }}</td> <td>{{ version.GoVersion }}</td>
</tr> </tr>
<tr> <tr>
<td>Total Memory</td> <td>OS type</td>
<td>{{ info.MemTotal|humansize }}</td> <td>{{ version.Os }}</td>
</tr> </tr>
<tr> <tr>
<td>Operating System</td> <td>OS</td>
<td>{{ info.OperatingSystem }}</td> <td>{{ info.OperatingSystem }}</td>
</tr> </tr>
<tr> <tr>
<td>Kernel Version</td> <td>Architecture</td>
<td>{{ info.KernelVersion }}</td> <td>{{ version.Arch }}</td>
</tr> </tr>
<tr> <tr>
<td>ID</td> <td>Kernel version</td>
<td>{{ info.ID }}</td> <td>{{ version.KernelVersion }}</td>
</tr> </tr>
</tbody>
</table>
</rd-widget-body>
</rd-widget>
</div>
</div>
<div class="row" ng-if="state.loaded">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<rd-widget>
<rd-widget-header icon="fa-th" title="Engine status"></rd-widget-header>
<rd-widget-body classes="no-padding">
<table class="table">
<tbody>
<tr> <tr>
<td>Labels</td> <td>Total CPU</td>
<td>{{ info.Labels }}</td> <td>{{ info.NCPU }}</td>
</tr> </tr>
<tr> <tr>
<td>File Descriptors</td> <td>Total memory</td>
<td>{{ info.NFd }}</td> <td>{{ info.MemTotal|humansize }}</td>
</tr> </tr>
<tr> <tr>
<td>Goroutines</td> <td>Docker root directory</td>
<td>{{ info.NGoroutines }}</td> <td>{{ info.DockerRootDir }}</td>
</tr> </tr>
<tr> <tr>
<td>Storage Driver</td> <td>Storage driver</td>
<td>{{ info.Driver }}</td> <td>{{ info.Driver }}</td>
</tr> </tr>
<tr> <tr>
<td>Storage Driver Status</td> <td>Logging driver</td>
<td> <td>{{ info.LoggingDriver }}</td>
<p ng-repeat="val in info.DriverStatus">
{{ val[0] }}: {{ val[1] }}
</p>
</td>
</tr> </tr>
<tr> <tr ng-if="info.CgroupDriver">
<td>Execution Driver</td> <td>Cgroup driver</td>
<td>{{ info.ExecutionDriver }}</td> <td>{{ info.CgroupDriver }}</td>
</tr>
<tr>
<td>IPv4 Forwarding</td>
<td>{{ info.IPv4Forwarding }}</td>
</tr> </tr>
<tr> <tr ng-if="info.ExecutionDriver">
<td>Index Server Address</td> <td>Execution driver</td>
<td>{{ info.IndexServerAddress }}</td> <td>{{ info.ExecutionDriver }}</td>
</tr>
<tr>
<td>Init Path</td>
<td>{{ info.InitPath }}</td>
</tr>
<tr>
<td>Docker Root Directory</td>
<td>{{ info.DockerRootDir }}</td>
</tr> </tr>
<tr> </tbody>
<td>Init SHA1</td> </table>
<td>{{ info.InitSha1 }}</td> </rd-widget-body>
</rd-widget>
</div>
</div>
<div class="row" ng-if="state.loaded && info.Plugins">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<rd-widget>
<rd-widget-header icon="fa-plug" title="Engine plugins"></rd-widget-header>
<rd-widget-body classes="no-padding">
<table class="table">
<tbody>
<tr ng-if="info.Plugins.Volume">
<td>Volume</td>
<td>{{ info.Plugins.Volume|arraytostr: ', '}}</td>
</tr> </tr>
<tr> <tr ng-if="info.Plugins.Network">
<td>Memory Limit</td> <td>Network</td>
<td>{{ info.MemoryLimit }}</td> <td>{{ info.Plugins.Network|arraytostr: ', '}}</td>
</tr> </tr>
<tr> <tr ng-if="info.Plugins.Authorization">
<td>Swap Limit</td> <td>Authorization</td>
<td>{{ info.SwapLimit }}</td> <td>{{ info.Plugins.Authorization|arraytostr: ', '}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -1,19 +1,24 @@
angular.module('docker', []) angular.module('docker', [])
.controller('DockerController', ['$scope', 'Info', 'Version', 'Settings', .controller('DockerController', ['$scope', 'Info', 'Version', 'Messages',
function ($scope, Info, Version, Settings) { function ($scope, Info, Version, Messages) {
$scope.state = {
$scope.info = {}; loaded: false
$scope.docker = {};
$scope.order = function(sortType) {
$scope.sortReverse = ($scope.sortType === sortType) ? !$scope.sortReverse : false;
$scope.sortType = sortType;
}; };
$scope.info = {};
$scope.version = {};
Version.get({}, function (d) { Info.get({}, function (infoData) {
$scope.docker = d; $scope.info = infoData;
Version.get({}, function (versionData) {
$scope.version = versionData;
$scope.state.loaded = true;
$('#loadingViewSpinner').hide();
}, function (e) {
Messages.error("Failure", e, 'Unable to retrieve engine details');
$('#loadingViewSpinner').hide();
}); });
Info.get({}, function (d) { }, function (e) {
$scope.info = d; Messages.error("Failure", e, 'Unable to retrieve engine information');
$('#loadingViewSpinner').hide();
}); });
}]); }]);

@ -213,4 +213,13 @@ angular.module('portainer.filters', [])
return function (ip) { return function (ip) {
return ip.slice(0, ip.indexOf('/')); return ip.slice(0, ip.indexOf('/'));
}; };
})
.filter('arraytostr', function () {
'use strict';
return function (arr, separator) {
if (arr) {
return _.join(arr, separator);
}
return '';
};
}); });

@ -66,7 +66,7 @@
<a ui-sref="swarm">Swarm <span class="menu-icon fa fa-object-group"></span></a> <a ui-sref="swarm">Swarm <span class="menu-icon fa fa-object-group"></span></a>
</li> </li>
<li class="sidebar-list" ng-if="!swarm"> <li class="sidebar-list" ng-if="!swarm">
<a ui-sref="docker">Docker <span class="menu-icon fa fa-cogs"></span></a> <a ui-sref="docker">Docker <span class="menu-icon fa fa-th"></span></a>
</li> </li>
</ul> </ul>
<div class="sidebar-footer"> <div class="sidebar-footer">

Loading…
Cancel
Save