mirror of https://github.com/portainer/portainer
feat(engine-details): add host-view container component
parent
65f542f722
commit
d612ec9cee
|
@ -1,22 +1,3 @@
|
||||||
angular.module('portainer.docker')
|
angular
|
||||||
.controller('HostOverviewController', ['$q', '$scope', 'SystemService', 'Notifications',
|
.module('portainer.docker')
|
||||||
function HostOverviewController($q, $scope, SystemService, Notifications) {
|
.controller('HostOverviewController', [function HostOverviewController() {}]);
|
||||||
|
|
||||||
function initView() {
|
|
||||||
$q.all({
|
|
||||||
version: SystemService.version(),
|
|
||||||
info: SystemService.info()
|
|
||||||
})
|
|
||||||
.then(function success(data) {
|
|
||||||
$scope.version = data.version;
|
|
||||||
$scope.info = data.info;
|
|
||||||
})
|
|
||||||
.catch(function error(err) {
|
|
||||||
$scope.info = {};
|
|
||||||
$scope.version = {};
|
|
||||||
Notifications.error('Failure', err, 'Unable to retrieve engine details');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
initView();
|
|
||||||
}]);
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
angular.module('portainer.docker').controller('HostViewController', [
|
||||||
|
'$q',
|
||||||
|
'$scope',
|
||||||
|
'SystemService',
|
||||||
|
'Notifications',
|
||||||
|
function HostViewController($q, $scope, SystemService, Notifications) {
|
||||||
|
var ctrl = this;
|
||||||
|
this.$onInit = initView;
|
||||||
|
|
||||||
|
this.engineDetails = {};
|
||||||
|
this.hostDetails = {};
|
||||||
|
|
||||||
|
function initView() {
|
||||||
|
$q.all({
|
||||||
|
version: SystemService.version(),
|
||||||
|
info: SystemService.info()
|
||||||
|
})
|
||||||
|
.then(function success(data) {
|
||||||
|
ctrl.engineDetails = buildEngineDetails(data);
|
||||||
|
ctrl.hostDetails = buildHostDetails(data);
|
||||||
|
})
|
||||||
|
.catch(function error(err) {
|
||||||
|
Notifications.error(
|
||||||
|
'Failure',
|
||||||
|
err,
|
||||||
|
'Unable to retrieve engine details'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildEngineDetails(data) {
|
||||||
|
var versionDetails = data.version;
|
||||||
|
var info = data.info;
|
||||||
|
return {
|
||||||
|
releaseVersion: versionDetails.Version,
|
||||||
|
apiVersion: versionDetails.ApiVersion,
|
||||||
|
rootDirectory: info.DockerRootDir,
|
||||||
|
storageDriver: info.Driver,
|
||||||
|
loggingDriver: info.LoggingDriver,
|
||||||
|
volumePlugins: info.Plugins.Volume,
|
||||||
|
networkPlugins: info.Plugins.Network
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildHostDetails() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
|
@ -0,0 +1,4 @@
|
||||||
|
<host-overview
|
||||||
|
engine-details="$ctrl.engineDetails"
|
||||||
|
host-details="$ctrl.hostDetails"
|
||||||
|
></host-overview>
|
|
@ -0,0 +1,4 @@
|
||||||
|
angular.module('portainer.docker').component('hostView', {
|
||||||
|
templateUrl: 'app/docker/views/host/host-view.html',
|
||||||
|
controller: 'HostViewController'
|
||||||
|
});
|
Loading…
Reference in New Issue