mirror of https://github.com/portainer/portainer
fix(storidge): display modifications + fix js errors
parent
fa3005e9df
commit
77d51a8465
|
@ -4,7 +4,7 @@
|
|||
<rd-widget-body>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="comment" class="col-sm-3 col-lg-2 control-label text-left">Comment</label>
|
||||
<label for="comment" class="col-sm-3 col-lg-2 control-label text-left">Description</label>
|
||||
<div class="col-sm-9 col-lg-10">
|
||||
<input type="text" class="form-control" id="comment" ng-model="$ctrl.formValues.Comment">
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<td>{{ $ctrl.volume.Name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Uuid</td>
|
||||
<td>UUID</td>
|
||||
<td>{{ $ctrl.volume.Uuid }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -66,10 +66,6 @@
|
|||
<td>Redundancy</td>
|
||||
<td>{{ $ctrl.volume.Redundancy }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{ $ctrl.volume.Type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vdisk</td>
|
||||
<td>{{ $ctrl.volume.Vdisk }}</td>
|
||||
|
@ -83,17 +79,9 @@
|
|||
<td>{{ $ctrl.volume.Volume}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DriveType</td>
|
||||
<td>Drive Type</td>
|
||||
<td>{{ $ctrl.volume.DriveType}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Compression</td>
|
||||
<td>{{ $ctrl.volume.Compression}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dedup</td>
|
||||
<td>{{ $ctrl.volume.Dedup}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Encryption</td>
|
||||
<td>{{ $ctrl.volume.Encryption}}</td>
|
||||
|
@ -142,14 +130,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- !Node -->
|
||||
<!-- Node ID -->
|
||||
<div class="form-group">
|
||||
<label for="volume_nodeid" class="col-sm-2 col-lg-1 control-label text-left">Node ID</label>
|
||||
<div class="col-sm-10 col-lg-11">
|
||||
<input type="text" class="form-control" ng-model="$ctrl.formValues.NodeID" name="volume_nodeid" placeholder="2">
|
||||
</div>
|
||||
</div>
|
||||
<!-- !Node ID -->
|
||||
<!-- Capacity -->
|
||||
<div class="form-group">
|
||||
<label for="volume_capacity" class="col-sm-2 col-lg-1 control-label text-left">Capacity</label>
|
||||
|
|
|
@ -31,7 +31,6 @@ function ($state, StoridgeVolumeService, Notifications) {
|
|||
IOPSMin: this.volume.IOPSMin,
|
||||
IOPSMax: this.volume.IOPSMax,
|
||||
Node: this.volume.Node,
|
||||
NodeID: this.volume.NodeID,
|
||||
Capacity: this.volume.Capacity,
|
||||
BandwidthMin: this.volume.BandwidthMin,
|
||||
BandwidthMax: this.volume.BandwidthMax,
|
||||
|
@ -62,9 +61,6 @@ function ($state, StoridgeVolumeService, Notifications) {
|
|||
if (volume.Node === data.Node || !volume.Node) {
|
||||
delete volume.Node;
|
||||
}
|
||||
if (volume.NodeID === data.NodeID || !volume.NodeID) {
|
||||
delete volume.NodeID;
|
||||
}
|
||||
if (volume.Capacity === data.Capacity || !volume.Capacity) {
|
||||
delete volume.Capacity;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ angular.module('extension.storidge')
|
|||
.filter('drivestatusbadge', function () {
|
||||
'use strict';
|
||||
return function (text) {
|
||||
var status = _.toLower(text);
|
||||
var status = text ? _.toLower(text) : '';
|
||||
if (includeString(status, ['normal'])) {
|
||||
return 'success';
|
||||
} else if (includeString(status, ['available'])) {
|
||||
|
@ -24,7 +24,7 @@ angular.module('extension.storidge')
|
|||
.filter('nodeStatusBadge', function () {
|
||||
'use strict';
|
||||
return function (text) {
|
||||
var status = _.toLower(text);
|
||||
var status = text ? _.toLower(text) : '';
|
||||
if (status === 'maintenance') {
|
||||
return 'orange-icon';
|
||||
}
|
||||
|
@ -34,10 +34,22 @@ angular.module('extension.storidge')
|
|||
.filter('clusterStatusBadge', function () {
|
||||
'use strict';
|
||||
return function (text) {
|
||||
var status = _.toLower(text);
|
||||
var status = text ? _.toLower(text) : '';
|
||||
if (status === 'alert') {
|
||||
return 'red-icon';
|
||||
}
|
||||
return 'green-icon';
|
||||
};
|
||||
}).filter('bytes', function() {
|
||||
return function(bytes, precision) {
|
||||
bytes = parseFloat(bytes);
|
||||
if (isNaN(bytes) || !isFinite(bytes)) return '-';
|
||||
if (!precision) precision = 1;
|
||||
var units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
|
||||
var number = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
if (bytes === 0) {
|
||||
return ('0 B');
|
||||
}
|
||||
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
|
||||
}
|
||||
});
|
|
@ -10,7 +10,6 @@ export function StoridgeVolumeModel(data) {
|
|||
this.NodeID = data.nodeid;
|
||||
this.Provisioning = data.provisioning;
|
||||
this.Redundancy = data.redundancy;
|
||||
this.Type = data.type;
|
||||
this.Uuid = data.uuid;
|
||||
this.Vdisk = data.vdisk;
|
||||
this.Labels = data.labels;
|
||||
|
@ -18,8 +17,6 @@ export function StoridgeVolumeModel(data) {
|
|||
this.IP = data.ipaddr;
|
||||
this.Volume = data.volume;
|
||||
this.DriveType = data.type;
|
||||
this.Compression = data.compression;
|
||||
this.Dedup = data.dedup;
|
||||
this.Encryption = data.encryption;
|
||||
this.Replication = data.replication;
|
||||
this.SnapshotEnabled = data.snapshot;
|
||||
|
|
|
@ -107,19 +107,19 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>Free</td>
|
||||
<td>{{ node.FreeCapacity }}</td>
|
||||
<td>{{ node.FreeCapacity | bytes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Used</td>
|
||||
<td>{{ node.UsedCapacity }}</td>
|
||||
<td>{{ node.UsedCapacity | bytes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Provisioned</td>
|
||||
<td>{{ node.ProvisionedCapacity }}</td>
|
||||
<td>{{ node.ProvisionedCapacity | bytes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total</td>
|
||||
<td>{{ node.TotalCapacity }}</td>
|
||||
<td>{{ node.TotalCapacity | bytes }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -38,7 +38,7 @@ angular.module('portainer.app')
|
|||
.filter('capitalize', function () {
|
||||
'use strict';
|
||||
return function (text) {
|
||||
return _.capitalize(text);
|
||||
return text ? _.capitalize(text) : '';
|
||||
};
|
||||
})
|
||||
.filter('stripprotocol', function() {
|
||||
|
|
Loading…
Reference in New Issue