mirror of https://github.com/portainer/portainer
feat(storidge): update 6
parent
99e9afe4c8
commit
8fb8aba075
|
@ -7,14 +7,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
<!-- <button type="button" class="btn btn-sm btn-danger"
|
||||
ng-disabled="$ctrl.state.selectedItemCount === 0" ng-click="$ctrl.removeAction($ctrl.state.selectedItems)">
|
||||
<i class="fa fa-trash-alt space-right" aria-hidden="true"></i>Remove
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-primary"
|
||||
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
|
||||
</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>
|
||||
|
@ -28,10 +20,6 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<!-- <span class="md-checkbox">
|
||||
<input id="select_all" type="checkbox" ng-model="$ctrl.state.selectAll" ng-change="$ctrl.selectAll()" />
|
||||
<label for="select_all"></label>
|
||||
</span> -->
|
||||
<a ng-click="$ctrl.changeOrderBy('Id')">
|
||||
Id
|
||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Id' && !$ctrl.state.reverseOrder"></i>
|
||||
|
@ -85,10 +73,6 @@
|
|||
<tbody>
|
||||
<tr dir-paginate="item in ($ctrl.state.filteredDataSet = ($ctrl.dataset | filter:$ctrl.state.textFilter | orderBy:$ctrl.state.orderBy:$ctrl.state.reverseOrder | itemsPerPage: $ctrl.state.paginatedItemLimit))" ng-class="{active: item.Checked}">
|
||||
<td>
|
||||
<!-- <span class="md-checkbox">
|
||||
<input id="select_{{ $index }}" type="checkbox" ng-model="item.Checked" ng-change="$ctrl.selectItem(item)" ng-disabled="item.Status === 'normal'"/>
|
||||
<label for="select_{{ $index }}"></label>
|
||||
</span> -->
|
||||
<a ui-sref="storidge.drives.drive({id: item.Id})"> {{ item.Id }}</a>
|
||||
</td>
|
||||
<td>{{ item.Node }}</td>
|
||||
|
|
|
@ -61,86 +61,3 @@
|
|||
></storidge-nodes-datatable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// TODO: remove
|
||||
<!-- <div class="row" ng-if="clusterInfo">
|
||||
<div class="col-sm-12">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-object-group" title-text="Storage nodes">
|
||||
<div class="pull-right">
|
||||
Items per page:
|
||||
<select ng-model="state.pagination_count" ng-change="changePaginationCount()">
|
||||
<option value="0">All</option>
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
</div>
|
||||
</rd-widget-header>
|
||||
<rd-widget-taskbar classes="col-lg-12">
|
||||
<div class="pull-right">
|
||||
<input type="text" id="filter" ng-model="state.filter" placeholder="Filter..." class="form-control input-sm" />
|
||||
</div>
|
||||
</rd-widget-taskbar>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<a ng-click="order('Name')">
|
||||
Name
|
||||
<span ng-show="sortType == 'Name' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||
<span ng-show="sortType == 'Name' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a ng-click="order('IP')">
|
||||
IP address
|
||||
<span ng-show="sortType == 'IP' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||
<span ng-show="sortType == 'IP' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a ng-click="order('Role')">
|
||||
Role
|
||||
<span ng-show="sortType == 'Role' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||
<span ng-show="sortType == 'Role' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a ng-click="order('Status')">
|
||||
Status
|
||||
<span ng-show="sortType == 'Status' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||
<span ng-show="sortType == 'Status' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr dir-paginate="node in (clusterNodes | filter:state.filter | orderBy:sortType:sortReverse | itemsPerPage: state.pagination_count)">
|
||||
<td>{{ node.Name }}</td>
|
||||
<td>{{ node.IP }}</td>
|
||||
<td>{{ node.Role }}</td>
|
||||
<td>
|
||||
<i class="fa fa-heartbeat space-right green-icon"></i>
|
||||
{{ node.Status }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="!clusterNodes">
|
||||
<td colspan="4" class="text-center text-muted">Loading...</td>
|
||||
</tr>
|
||||
<tr ng-if="clusterNodes.length === 0">
|
||||
<td colspan="4" class="text-center text-muted">No nodes available.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div ng-if="clusterNodes" class="pull-left pagination-controls">
|
||||
<dir-pagination-controls></dir-pagination-controls>
|
||||
</div>
|
||||
</div>
|
||||
</rd-widget-body>
|
||||
</rd-widget>
|
||||
</div>
|
||||
</div> -->
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
title-text="Drives" title-icon="fa-hdd"
|
||||
dataset="drives" table-key="storidge_drives"
|
||||
order-by="Id"
|
||||
<!-- remove-action="removeAction" -->
|
||||
<!-- add-action="addAction" -->
|
||||
rescan-action="rescanAction"
|
||||
></storidge-drives-datatable>
|
||||
</div>
|
||||
|
|
|
@ -1,63 +1,6 @@
|
|||
angular.module('extension.storidge')
|
||||
.controller('StoridgeDrivesController', ['$q', '$scope', '$state', 'Notifications', 'StoridgeDriveService',
|
||||
function ($q, $scope, $state, Notifications, StoridgeDriveService) {
|
||||
|
||||
// $scope.removeAction = function(selectedItems) {
|
||||
// ModalService.confirm({
|
||||
// title: 'Are you sure?',
|
||||
// message: 'Do you want really want to remove the drives from the storage pool?',
|
||||
// buttons: {
|
||||
// confirm: {
|
||||
// label: 'Remove',
|
||||
// className: 'btn-danger'
|
||||
// }
|
||||
// },
|
||||
// callback: function onConfirm(confirmed) {
|
||||
// if(!confirmed) { return; }
|
||||
// var actionCount = selectedItems.length;
|
||||
// selectedItems = selectedItems.filter(function (item) {
|
||||
// return item.Status === 'faulty';
|
||||
// });
|
||||
// angular.forEach(selectedItems, function (drive) {
|
||||
// StoridgeDriveService.remove(drive.Id)
|
||||
// .then(function success() {
|
||||
// Notifications.success('Drive successfully removed', drive.Id);
|
||||
// })
|
||||
// .catch(function error(err) {
|
||||
// Notifications.error('Failure', err, 'Unable to remove drive');
|
||||
// })
|
||||
// .finally(function final() {
|
||||
// --actionCount;
|
||||
// if (actionCount === 0) {
|
||||
// $state.reload();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// $scope.addAction = function (selectedItems) {
|
||||
// var actionCount = selectedItems.length;
|
||||
// selectedItems = selectedItems.filter(function (item) {
|
||||
// return item.Status === 'available';
|
||||
// });
|
||||
// angular.forEach(selectedItems, function (drive) {
|
||||
// StoridgeDriveService.add(drive.Device, drive.Node)
|
||||
// .then(function success() {
|
||||
// Notifications.success('Drive ' + drive.Device + ' successfully added on node ' + drive.Node);
|
||||
// })
|
||||
// .catch(function error(err) {
|
||||
// Notifications.error('Failure', err, 'Unable to add drive');
|
||||
// })
|
||||
// .finally(function final() {
|
||||
// --actionCount;
|
||||
// if (actionCount === 0) {
|
||||
// $state.reload();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// };
|
||||
.controller('StoridgeDrivesController', ['$scope', '$state', 'Notifications', 'StoridgeDriveService',
|
||||
function ($scope, $state, Notifications, StoridgeDriveService) {
|
||||
|
||||
$scope.rescanAction = function () {
|
||||
StoridgeDriveService.rescan()
|
||||
|
|
Loading…
Reference in New Issue