From 99e9afe4c8f746f09ebc51f69dcb70a6846f9061 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Wed, 17 Apr 2019 12:23:28 +1200 Subject: [PATCH] feat(storidge): wip on update 6 --- .../storidgeDrivesDatatable.html | 12 +- app/extensions/storidge/models/profile.js | 5 +- .../storidge/views/cluster/cluster.html | 1 + .../storidge/views/drives/drives.html | 6 +- .../storidge/views/drives/drivesController.js | 114 +++++++++--------- 5 files changed, 71 insertions(+), 67 deletions(-) diff --git a/app/extensions/storidge/components/drives-datatable/storidgeDrivesDatatable.html b/app/extensions/storidge/components/drives-datatable/storidgeDrivesDatatable.html index dd07b3349..116265141 100644 --- a/app/extensions/storidge/components/drives-datatable/storidgeDrivesDatatable.html +++ b/app/extensions/storidge/components/drives-datatable/storidgeDrivesDatatable.html @@ -7,14 +7,14 @@
- + --> @@ -28,10 +28,10 @@ - + Id @@ -85,10 +85,10 @@ - + {{ item.Id }} {{ item.Node }} diff --git a/app/extensions/storidge/models/profile.js b/app/extensions/storidge/models/profile.js index 173bdd08f..8c17e3d45 100644 --- a/app/extensions/storidge/models/profile.js +++ b/app/extensions/storidge/models/profile.js @@ -13,7 +13,8 @@ export function StoridgeProfileDefaultModel() { this.SnapshotInterval = 1440; this.SnapshotMax = 1; this.EncryptionEnabled = false; - this.InterfaceType = 'nfs'; + // this.InterfaceType = 'nfs'; + this.InterfaceType = ''; this.InterfaceDriver = ''; this.InterfaceNetwork = ''; this.InterfaceConf = ''; @@ -89,6 +90,7 @@ export function StoridgeCreateProfileRequest(model) { }; } +// TODO: investigate bandwith if (model.MinBandwidth && model.MaxBandwidth) { this.bandwidth = { min: model.MinBandwidth, @@ -100,6 +102,7 @@ export function StoridgeCreateProfileRequest(model) { var service = {}; +// TODO: investigate snapshot service.snapshot = { enabled: model.SnapshotEnabled }; diff --git a/app/extensions/storidge/views/cluster/cluster.html b/app/extensions/storidge/views/cluster/cluster.html index 3101df571..35420122d 100644 --- a/app/extensions/storidge/views/cluster/cluster.html +++ b/app/extensions/storidge/views/cluster/cluster.html @@ -62,6 +62,7 @@
+// TODO: remove + rescan-action="rescanAction" > diff --git a/app/extensions/storidge/views/drives/drivesController.js b/app/extensions/storidge/views/drives/drivesController.js index e07f2abf5..7a2942bd8 100644 --- a/app/extensions/storidge/views/drives/drivesController.js +++ b/app/extensions/storidge/views/drives/drivesController.js @@ -1,63 +1,63 @@ angular.module('extension.storidge') -.controller('StoridgeDrivesController', ['$q', '$scope', '$state', 'Notifications', 'ModalService', 'StoridgeDriveService', -function ($q, $scope, $state, Notifications, ModalService, StoridgeDriveService) { +.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.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(); - } - }); - }); - }; + // $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(); + // } + // }); + // }); + // }; $scope.rescanAction = function () { StoridgeDriveService.rescan()