mirror of https://github.com/portainer/portainer
feat(storidge): v5 update without style (profile / statuses / volume)
parent
b29e43073d
commit
33a02c59b5
|
@ -74,10 +74,6 @@
|
|||
<td>IP</td>
|
||||
<td>{{ $ctrl.volume.IP}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Volume</td>
|
||||
<td>{{ $ctrl.volume.Volume}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Drive Type</td>
|
||||
<td>{{ $ctrl.volume.DriveType}}</td>
|
||||
|
@ -86,10 +82,6 @@
|
|||
<td>Encryption</td>
|
||||
<td>{{ $ctrl.volume.Encryption}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Replication</td>
|
||||
<td>{{ $ctrl.volume.Replication}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Snapshot Enabled</td>
|
||||
<td>{{ $ctrl.volume.SnapshotEnabled}}</td>
|
||||
|
|
|
@ -1,24 +1,16 @@
|
|||
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';
|
||||
return function (text) {
|
||||
var status = text ? _.toLower(text) : '';
|
||||
if (includeString(status, ['normal'])) {
|
||||
return 'success';
|
||||
} else if (includeString(status, ['available'])) {
|
||||
return 'info';
|
||||
} else if (includeString(status, ['faulty'])) {
|
||||
return 'danger';
|
||||
if (status === 'available') {
|
||||
return 'info';
|
||||
} else if (status === 'faulty') {
|
||||
return 'danger';
|
||||
}
|
||||
return 'info';
|
||||
return 'success';
|
||||
};
|
||||
})
|
||||
.filter('storidgeNodeStatusBadge', function () {
|
||||
|
@ -27,7 +19,7 @@ angular.module('extension.storidge')
|
|||
var status = text ? _.toLower(text) : '';
|
||||
if (status === 'cordoned') {
|
||||
return 'orange-icon';
|
||||
} else if (status === 'alert') {
|
||||
} else if (status === 'leaving') {
|
||||
return 'red-icon'
|
||||
}
|
||||
return 'green-icon';
|
||||
|
|
|
@ -15,10 +15,8 @@ export function StoridgeVolumeModel(data) {
|
|||
this.Labels = data.labels;
|
||||
|
||||
this.IP = data.ipaddr;
|
||||
this.Volume = data.volume;
|
||||
this.DriveType = data.type;
|
||||
this.Encryption = data.encryption;
|
||||
this.Replication = data.replication;
|
||||
this.SnapshotEnabled = data.snapshot;
|
||||
this.SnapshotInterval = data.snapinterval;
|
||||
this.SnapshotMax = data.snapmax;
|
||||
|
|
|
@ -51,7 +51,7 @@ angular.module('extension.storidge')
|
|||
|
||||
function create(volumeId, description) {
|
||||
var deferred = $q.defer();
|
||||
Storidge.createSnapshot({id: volumeId, description: description}).$promise
|
||||
Storidge.createSnapshot({id: volumeId, opts: {description: description}}).$promise
|
||||
.then(function success(data) {
|
||||
deferred.resolve(data);
|
||||
})
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<rd-widget>
|
||||
<rd-widget-header icon="fa-object-group" title-text="Node details">
|
||||
<button type="button" class="btn btn-sm btn-danger"
|
||||
ng-disabled="node.Status === 'cordoned'" ng-click="removeNodeAction()">
|
||||
ng-disabled="node.Status !== 'normal'" ng-click="removeNodeAction()">
|
||||
<i class="fa fa-trash-alt space-right" aria-hidden="true"></i>Remove node
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-primary"
|
||||
ng-disabled="node.Status === 'cordoned'" ng-click="cordonNodeAction()">
|
||||
ng-disabled="node.Status !== 'normal'" ng-click="cordonNodeAction()">
|
||||
<i class="fas fa-wrench space-right" aria-hidden="true"></i>Enter maintenance mode
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-primary"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import _ from 'lodash-es';
|
||||
import { StoridgeProfileDefaultModel } from '../../../models/profile';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
|
@ -86,7 +87,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
|
|||
$scope.updatedName = function() {
|
||||
if (!$scope.state.ManualInputDirectory) {
|
||||
var profile = $scope.model;
|
||||
profile.Directory = '/cio/' + profile.Name;
|
||||
profile.Directory = '/cio/' + (profile.Name ? _.toLower(profile.Name) : '');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -99,7 +100,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
|
|||
function initView() {
|
||||
var profile = new StoridgeProfileDefaultModel();
|
||||
profile.Name = $transition$.params().profileName;
|
||||
profile.Directory = '/cio/' + profile.Name;
|
||||
profile.Directory = '/cio/' + _.toLower(profile.Name);
|
||||
$scope.model = profile;
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
<!-- !interfaceType -->
|
||||
<!-- interfaceDriver -->
|
||||
<div class="form-group">
|
||||
<label for="profile_interfaceDriver" class="col-sm-2 col-lg-1 control-label text-left">Interface driver</label>
|
||||
<label for="profile_interfaceDriver" class="col-sm-2 col-lg-1 control-label text-left">Network driver</label>
|
||||
<div class="col-sm-10 col-lg-11">
|
||||
<select name="profile_interfaceDriver" ng-model="model.InterfaceDriver" class="form-control">
|
||||
<option value="macvlan">macvlan</option>
|
||||
|
@ -190,7 +190,7 @@
|
|||
<!-- !interfaceDriver -->
|
||||
<!-- interfaceNetwork -->
|
||||
<div class="form-group">
|
||||
<label for="profile_interfaceNetwork" class="col-sm-2 col-lg-1 control-label text-left">Interface network</label>
|
||||
<label for="profile_interfaceNetwork" class="col-sm-2 col-lg-1 control-label text-left">Network name</label>
|
||||
<div class="col-sm-10 col-lg-11">
|
||||
<input type="text" class="form-control" ng-model="model.InterfaceNetwork" name="profile_interfaceNetwork" pattern="[a-zA-Z0-9]+">
|
||||
</div>
|
||||
|
|
|
@ -172,7 +172,7 @@
|
|||
<!-- !interfaceType -->
|
||||
<!-- interfaceDriver -->
|
||||
<div class="form-group">
|
||||
<label for="profile_interfaceDriver" class="col-sm-2 col-lg-1 control-label text-left">Interface driver</label>
|
||||
<label for="profile_interfaceDriver" class="col-sm-2 col-lg-1 control-label text-left">Network driver</label>
|
||||
<div class="col-sm-10 col-lg-11">
|
||||
<select name="profile_interfaceDriver" ng-model="profile.InterfaceDriver" class="form-control">
|
||||
<option value="macvlan">macvlan</option>
|
||||
|
@ -183,7 +183,7 @@
|
|||
<!-- !interfaceDriver -->
|
||||
<!-- interfaceNetwork -->
|
||||
<div class="form-group">
|
||||
<label for="profile_interfaceNetwork" class="col-sm-2 col-lg-1 control-label text-left">Interface network</label>
|
||||
<label for="profile_interfaceNetwork" class="col-sm-2 col-lg-1 control-label text-left">Network name</label>
|
||||
<div class="col-sm-10 col-lg-11">
|
||||
<input type="text" class="form-control" ng-model="profile.InterfaceNetwork" name="profile_interfaceNetwork" pattern="[a-zA-Z0-9]+">
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue