mirror of https://github.com/portainer/portainer
refactor(storidge): webpack migration
parent
f9bfb0fc26
commit
fa3005e9df
|
@ -37,7 +37,7 @@ angular.module('extension.storidge', [])
|
|||
url: '/drives',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: 'app/extensions/storidge/views/drives/drives.html',
|
||||
templateUrl: './views/drives/drives.html',
|
||||
controller: 'StoridgeDrivesController'
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ angular.module('extension.storidge', [])
|
|||
url: '/:id',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: 'app/extensions/storidge/views/drives/inspect/drive.html',
|
||||
templateUrl: './views/drives/inspect/drive.html',
|
||||
controller: 'StoridgeDriveController'
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ angular.module('extension.storidge', [])
|
|||
url: '/:snapshotId',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: 'app/extensions/storidge/views/snapshots/inspect/snapshot.html',
|
||||
templateUrl: './views/snapshots/inspect/snapshot.html',
|
||||
controller: 'StoridgeSnapshotController'
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ angular.module('extension.storidge', [])
|
|||
url: '/:name',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: 'app/extensions/storidge/views/nodes/inspect/node.html',
|
||||
templateUrl: './views/nodes/inspect/node.html',
|
||||
controller: 'StoridgeNodeController'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
angular.module('extension.storidge').component('storidgeDrivesDatatable', {
|
||||
templateUrl: 'app/extensions/storidge/components/drives-datatable/storidgeDrivesDatatable.html',
|
||||
templateUrl: './storidgeDrivesDatatable.html',
|
||||
controller: 'StoridgeDrivesDatatableController',
|
||||
bindings: {
|
||||
titleText: '@',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
angular.module('portainer.docker').component('storidgeSnapshotCreation', {
|
||||
templateUrl: 'app/extensions/storidge/components/snapshot-creation/storidgeSnapshotCreation.html',
|
||||
templateUrl: './storidgeSnapshotCreation.html',
|
||||
controller: 'StoridgeSnapshotCreationController',
|
||||
bindings: {
|
||||
volumeId: '<'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('StoridgeSnapshotCreationController', ['StoridgeSnapshotService', 'Notifications',
|
||||
function (StoridgeSnapshotService, Notifications) {
|
||||
.controller('StoridgeSnapshotCreationController', ['StoridgeSnapshotService', 'Notifications', '$state',
|
||||
function (StoridgeSnapshotService, Notifications, $state) {
|
||||
var ctrl = this;
|
||||
|
||||
this.formValues = {};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
angular.module('extension.storidge').component('storidgeSnapshotsDatatable', {
|
||||
templateUrl: 'app/extensions/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.html',
|
||||
templateUrl: './storidgeSnapshotsDatatable.html',
|
||||
controller: 'StoridgeSnapshotsDatatableController',
|
||||
bindings: {
|
||||
titleText: '@',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
angular.module('portainer.docker').component('volumeStoridgeInfo', {
|
||||
templateUrl: 'app/extensions/storidge/components/volume-storidge-info/volumeStoridgeInfo.html',
|
||||
templateUrl: './volumeStoridgeInfo.html',
|
||||
controller: 'VolumeStoridgeInfoController',
|
||||
bindings: {
|
||||
volume: '<'
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
import _ from 'lodash-es';
|
||||
|
||||
function includeString(text, values) {
|
||||
return values.some(function(val){
|
||||
return text.indexOf(val) !== -1;
|
||||
});
|
||||
}
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.filter('drivestatusbadge', function () {
|
||||
'use strict';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function StoridgeDriveModel(data) {
|
||||
export function StoridgeDriveModel(data) {
|
||||
this.Id = data.driveid;
|
||||
this.Node = data.node;
|
||||
this.Use = data.use;
|
||||
|
|
|
@ -5,7 +5,7 @@ export function StoridgeNodeModel(name, data) {
|
|||
this.Status = data.status;
|
||||
}
|
||||
|
||||
function StoridgeNodeDetailedModel(name, properties) {
|
||||
export function StoridgeNodeDetailedModel(name, properties) {
|
||||
this.Name = name;
|
||||
this.Domain = properties.domain;
|
||||
this.DomainID = properties.domainID;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function StoridgeSnapshotModel(data) {
|
||||
export function StoridgeSnapshotModel(data) {
|
||||
this.Id = data.identifier;
|
||||
this.Date = data.date;
|
||||
this.Description = data.description;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function StoridgeVolumeModel(data) {
|
||||
export function StoridgeVolumeModel(data) {
|
||||
this.Allocated = data['alloc percent'];
|
||||
this.Capacity = data.capacity;
|
||||
this.Directory = data.directory;
|
||||
|
@ -28,7 +28,7 @@ function StoridgeVolumeModel(data) {
|
|||
this.Filesystem = data.filesystem;
|
||||
}
|
||||
|
||||
function StoridgeVolumeUpdateModel(data) {
|
||||
export function StoridgeVolumeUpdateModel(data) {
|
||||
this.name = data.Name;
|
||||
this.opts = {
|
||||
node: data.Node,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { StoridgeDriveModel } from '../models/drive';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeDriveService', ['$q', 'Storidge', function StoridgeDriveServiceFactory($q, Storidge) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { StoridgeNodeModel } from '../models/node';
|
||||
import { StoridgeNodeModel, StoridgeNodeDetailedModel } from '../models/node';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeNodeService', ['$q', 'Storidge', function StoridgeNodeServiceFactory($q, Storidge) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { StoridgeSnapshotModel } from '../models/snapshot'
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeSnapshotService', ['$q', 'Storidge', function StoridgeSnapshotServiceFactory($q, Storidge) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { StoridgeVolumeModel, StoridgeVolumeUpdateModel } from '../models/volume';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeVolumeService', ['$q', 'Storidge', function StoridgeVolumeServiceFactory($q, Storidge) {
|
||||
'use strict';
|
||||
|
|
|
@ -64,7 +64,7 @@ function ($q, $scope, $state, Notifications, ModalService, StoridgeDriveService)
|
|||
.then(function sucess() {
|
||||
$state.reload();
|
||||
})
|
||||
.catch(function error() {
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to scan drives');
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue