mirror of https://github.com/portainer/portainer
feat(storidge): add rescan drives button
parent
a30171c141
commit
62f6ac926c
|
@ -15,6 +15,9 @@
|
||||||
ng-disabled="$ctrl.state.selectedItemCount === 0" ng-click="$ctrl.addAction($ctrl.state.selectedItems)">
|
ng-disabled="$ctrl.state.selectedItemCount === 0" ng-click="$ctrl.addAction($ctrl.state.selectedItems)">
|
||||||
<i class="fa fa-plus space-right" aria-hidden="true"></i>Add to storage pool
|
<i class="fa fa-plus space-right" aria-hidden="true"></i>Add to storage pool
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-primary" ng-click="$ctrl.rescanAction()">
|
||||||
|
<i class="fa fa-sync space-right" aria-hidden="true"></i>Rescan drives
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="searchBar">
|
<div class="searchBar">
|
||||||
<i class="fa fa-search searchIcon" aria-hidden="true"></i>
|
<i class="fa fa-search searchIcon" aria-hidden="true"></i>
|
||||||
|
|
|
@ -9,6 +9,7 @@ angular.module('extension.storidge').component('storidgeDrivesDatatable', {
|
||||||
orderBy: '@',
|
orderBy: '@',
|
||||||
reverseOrder: '<',
|
reverseOrder: '<',
|
||||||
removeAction: '<',
|
removeAction: '<',
|
||||||
addAction: '<'
|
addAction: '<',
|
||||||
|
rescanAction: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,6 +28,7 @@ angular.module('extension.storidge')
|
||||||
getDrive: { method: 'GET', params: { resource: 'drives', id: '@id' } },
|
getDrive: { method: 'GET', params: { resource: 'drives', id: '@id' } },
|
||||||
addDrive: { method: 'POST', params: { resource: 'drives' } },
|
addDrive: { method: 'POST', params: { resource: 'drives' } },
|
||||||
removeDrive: { method: 'DELETE', params: { resource: 'drives', id: '@id' } },
|
removeDrive: { method: 'DELETE', params: { resource: 'drives', id: '@id' } },
|
||||||
|
rescanDrives: { method: 'POST', params: { resource: 'drives', action: 'rescan' } },
|
||||||
|
|
||||||
queryVolumes: { method: 'GET', params: { resource: 'volumes' } },
|
queryVolumes: { method: 'GET', params: { resource: 'volumes' } },
|
||||||
createVolume: { method: 'POST', params: { resource: 'volumes' } },
|
createVolume: { method: 'POST', params: { resource: 'volumes' } },
|
||||||
|
|
|
@ -69,5 +69,9 @@ angular.module('extension.storidge')
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
service.rescan = function () {
|
||||||
|
return Storidge.rescanDrives().$promise;
|
||||||
|
};
|
||||||
|
|
||||||
return service;
|
return service;
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
order-by="Id"
|
order-by="Id"
|
||||||
remove-action="removeAction"
|
remove-action="removeAction"
|
||||||
add-action="addAction"
|
add-action="addAction"
|
||||||
|
rescan-action="rescanAction"
|
||||||
></storidge-drives-datatable>
|
></storidge-drives-datatable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,6 +59,16 @@ function ($q, $scope, $state, Notifications, ModalService, StoridgeDriveService)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.rescanAction = function () {
|
||||||
|
StoridgeDriveService.rescan()
|
||||||
|
.then(function sucess() {
|
||||||
|
$state.reload();
|
||||||
|
})
|
||||||
|
.catch(function error() {
|
||||||
|
Notifications.error('Failure', err, 'Unable to scan drives');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
StoridgeDriveService.drives()
|
StoridgeDriveService.drives()
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
|
Loading…
Reference in New Issue