feat(storidge): remove snapshots panels when volume snapshots are disabled

storidge-standalone
baron_l 2019-03-18 16:14:05 +01:00
parent a8586fea61
commit 79802d1999
4 changed files with 60 additions and 14 deletions

View File

@ -54,12 +54,12 @@
<div class="row" ng-if="isCioDriver"> <div class="row" ng-if="isCioDriver">
<div class="col-sm-12"> <div class="col-sm-12">
<storidge-snapshot-creation volume-id="storidgeVolume.Vdisk"> <storidge-snapshot-creation volume-id="storidgeVolume.Vdisk" ng-if="storidgeVolume.SnapshotEnabled">
</storidge-snapshot-creation> </storidge-snapshot-creation>
</div> </div>
</div> </div>
<div class="row" ng-if="isCioDriver"> <div class="row" ng-if="isCioDriver && storidgeVolume.SnapshotEnabled">
<div class="col-sm-12"> <div class="col-sm-12">
<storidge-snapshots-datatable <storidge-snapshots-datatable
title-text="Snapshots" title-icon="fa-camera" title-text="Snapshots" title-icon="fa-camera"

View File

@ -86,7 +86,9 @@ function ($scope, $state, $transition$, $q, ModalService, VolumeService, Contain
if ($scope.isCioDriver) { if ($scope.isCioDriver) {
$scope.storidgeVolume = data.storidgeVolume; $scope.storidgeVolume = data.storidgeVolume;
return StoridgeSnapshotService.snapshots(data.storidgeVolume.Vdisk); if ($scope.storidgeVolume.SnapshotEnabled) {
return StoridgeSnapshotService.snapshots(data.storidgeVolume.Vdisk);
}
} }
}) })
.then(function success(data) { .then(function success(data) {

View File

@ -74,6 +74,50 @@
<td>Vdisk</td> <td>Vdisk</td>
<td>{{ $ctrl.volume.Vdisk }}</td> <td>{{ $ctrl.volume.Vdisk }}</td>
</tr> </tr>
<tr>
<td>IP</td>
<td>{{ $ctrl.volume.IP}}</td>
</tr>
<tr>
<td>Volume</td>
<td>{{ $ctrl.volume.Volume}}</td>
</tr>
<tr>
<td>DriveType</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>
</tr>
<tr>
<td>Replication</td>
<td>{{ $ctrl.volume.Replication}}</td>
</tr>
<tr>
<td>Snapshot</td>
<td>{{ $ctrl.volume.Snapshot}}</td>
</tr>
<tr>
<td>Snapshot Interval</td>
<td>{{ $ctrl.volume.SnapshotInterval}}</td>
</tr>
<tr>
<td>Max Snapshots</td>
<td>{{ $ctrl.volume.SnapshotMax}}</td>
</tr>
<tr>
<td>Filesystem</td>
<td>{{ $ctrl.volume.Filesystem}}</td>
</tr>
<tr ng-if="$ctrl.volume.Labels"> <tr ng-if="$ctrl.volume.Labels">
<td>Labels</td> <td>Labels</td>
<td> <td>

View File

@ -15,17 +15,17 @@ function StoridgeVolumeModel(data) {
this.Vdisk = data.vdisk; this.Vdisk = data.vdisk;
this.Labels = data.labels; this.Labels = data.labels;
// this.IP = data.ipaddr; this.IP = data.ipaddr;
// this.Volume = data.volume; this.Volume = data.volume;
// this.DriveType = data.type; this.DriveType = data.type;
// this.Compression = data.compression; this.Compression = data.compression;
// this.Dedup = data.dedup; this.Dedup = data.dedup;
// this.Encryption = data.encryption; this.Encryption = data.encryption;
// this.Replication = data.replication; this.Replication = data.replication;
// this.Snapshot = data.snapshot; this.SnapshotEnabled = data.snapshot;
// this.SnapshotInterval = data.snap_interval; this.SnapshotInterval = data.snapshotinterval;
// this.SnapshotMax = data.snap_max; this.SnapshotMax = data.snapshotmax;
// this.Filesystem = data.filesystem; this.Filesystem = data.filesystem;
} }
function StoridgeVolumeUpdateModel(data) { function StoridgeVolumeUpdateModel(data) {