mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(volume-browser): add the ability to browse volume content (#2051)
This commit is contained in:
parent
cec878b01d
commit
48179b9e3d
22 changed files with 366 additions and 18 deletions
|
@ -383,6 +383,17 @@ angular.module('portainer.docker', ['portainer.app'])
|
|||
}
|
||||
};
|
||||
|
||||
var volumeBrowse = {
|
||||
name: 'docker.volumes.volume.browse',
|
||||
url: '/browse',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: 'app/docker/views/volumes/browse/browsevolume.html',
|
||||
controller: 'BrowseVolumeController'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var volumeCreation = {
|
||||
name: 'docker.volumes.new',
|
||||
url: '/new',
|
||||
|
@ -430,5 +441,6 @@ angular.module('portainer.docker', ['portainer.app'])
|
|||
$stateRegistryProvider.register(taskLogs);
|
||||
$stateRegistryProvider.register(volumes);
|
||||
$stateRegistryProvider.register(volume);
|
||||
$stateRegistryProvider.register(volumeBrowse);
|
||||
$stateRegistryProvider.register(volumeCreation);
|
||||
}]);
|
||||
|
|
|
@ -103,7 +103,10 @@
|
|||
<label for="select_{{ $index }}"></label>
|
||||
</span>
|
||||
<a ui-sref="docker.volumes.volume({ id: item.Id, nodeName: item.NodeName })" class="monospaced" title="{{ item.Id }}">{{ item.Id | truncate:40 }}</a>
|
||||
<span style="margin-left: 10px;" class="label label-warning image-tag" ng-if="item.dangling">Unused</span>
|
||||
<a ui-sref="docker.volumes.volume.browse({ id: item.Id, nodeName: item.NodeName })" class="btn btn-xs btn-primary space-left" ng-if="$ctrl.showBrowseAction">
|
||||
<i class="fa fa-search"></i> browse</a>
|
||||
</a>
|
||||
<span style="margin-left: 10px;" class="label label-warning image-tag space-left" ng-if="item.dangling">Unused</span>
|
||||
</td>
|
||||
<td>{{ item.StackName ? item.StackName : '-' }}</td>
|
||||
<td>{{ item.Driver }}</td>
|
||||
|
|
|
@ -10,6 +10,7 @@ angular.module('portainer.docker').component('volumesDatatable', {
|
|||
reverseOrder: '<',
|
||||
showOwnershipColumn: '<',
|
||||
showHostColumn: '<',
|
||||
removeAction: '<'
|
||||
removeAction: '<',
|
||||
showBrowseAction: '<'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -67,11 +67,7 @@ function ContainerServiceFactory($q, Container, ResourceControlService, LogHelpe
|
|||
var deferred = $q.defer();
|
||||
Container.create(configuration).$promise
|
||||
.then(function success(data) {
|
||||
if (data.message) {
|
||||
deferred.reject({ msg: data.message });
|
||||
} else {
|
||||
deferred.resolve(data);
|
||||
}
|
||||
deferred.resolve(data);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
deferred.reject({ msg: 'Unable to create container', err: err });
|
||||
|
|
11
app/docker/views/volumes/browse/browseVolumeController.js
Normal file
11
app/docker/views/volumes/browse/browseVolumeController.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('BrowseVolumeController', ['$scope', '$transition$',
|
||||
function ($scope, $transition$) {
|
||||
|
||||
function initView() {
|
||||
$scope.volumeId = $transition$.params().id;
|
||||
$scope.nodeName = $transition$.params().nodeName;
|
||||
}
|
||||
|
||||
initView();
|
||||
}]);
|
15
app/docker/views/volumes/browse/browsevolume.html
Normal file
15
app/docker/views/volumes/browse/browsevolume.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<rd-header>
|
||||
<rd-header-title title-text="Volume browser"></rd-header-title>
|
||||
<rd-header-content>
|
||||
<a ui-sref="docker.volumes">Volumes</a> > <a ui-sref="docker.volumes.volume({ id: volumeId })">{{ volumeId }}</a> > browse
|
||||
</rd-header-content>
|
||||
</rd-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<volume-browser
|
||||
volume-id="volumeId"
|
||||
node-name="nodeName"
|
||||
></volume-browser>
|
||||
</div>
|
||||
</div>
|
|
@ -10,12 +10,13 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<volumes-datatable
|
||||
title-text="Volumes" title-icon="fa-cubes"
|
||||
dataset="volumes" table-key="volumes"
|
||||
order-by="Id"
|
||||
remove-action="removeAction"
|
||||
show-ownership-column="applicationState.application.authentication"
|
||||
show-host-column="applicationState.endpoint.mode.agentProxy"
|
||||
title-text="Volumes" title-icon="fa-cubes"
|
||||
dataset="volumes" table-key="volumes"
|
||||
order-by="Id"
|
||||
remove-action="removeAction"
|
||||
show-ownership-column="applicationState.application.authentication"
|
||||
show-host-column="applicationState.endpoint.mode.agentProxy"
|
||||
show-browse-action="applicationState.endpoint.mode.agentProxy"
|
||||
></volumes-datatable>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue