1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

feat(container-inspect): display content in tree view by default (#1310)

This commit is contained in:
1138-4EB 2017-10-24 09:32:21 +02:00 committed by Anthony Lapenna
parent c97f1d24cd
commit ddd804ee2e
5 changed files with 35 additions and 8 deletions

View file

@ -10,9 +10,14 @@
<div class="col-lg-12 col-md-12 col-xs-12">
<rd-widget>
<rd-widget-header icon="fa-icon-circle" title="Inspect">
<span class="btn-group btn-group-sm">
<label class="btn btn-primary" ng-model="state.DisplayTextView" uib-btn-radio="false"><i class="fa fa-code space-right" aria-hidden="true"></i>Tree</label>
<label class="btn btn-primary" ng-model="state.DisplayTextView" uib-btn-radio="true"><i class="fa fa-file-text-o space-right" aria-hidden="true"></i>Text</label>
</span>
</rd-widget-header>
<rd-widget-body>
<pre>{{ containerInfo|json:4 }}</pre>
<pre ng-show="state.DisplayTextView">{{ containerInfo|json:4 }}</pre>
<json-tree ng-hide="state.DisplayTextView" object="containerInfo" root-name="containerInfo.Id" start-expanded="true"></json-tree>
</rd-widget-body>
</rd-widget>
</div>

View file

@ -1,9 +1,13 @@
angular.module('containerInspect', [])
angular.module('containerInspect', ['angular-json-tree'])
.controller('ContainerInspectController', ['$scope', '$transition$', 'Notifications', 'ContainerService',
function ($scope, $transition$, Notifications, ContainerService) {
$scope.state = { DisplayTextView: false };
$scope.containerInfo = {};
function initView() {
$('#loadingViewSpinner').show();
ContainerService.inspect($transition$.params().id)
.then(function success(d) {
$scope.containerInfo = d;
@ -15,6 +19,6 @@ function ($scope, $transition$, Notifications, ContainerService) {
$('#loadingViewSpinner').hide();
});
}
initView();
}]);