Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#1195 Improve Pool Delete UX #1436

Merged
merged 15 commits into from
Nov 19, 2016
4 changes: 4 additions & 0 deletions src/rockstor/storageadmin/models/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ class Share(models.Model):
rusage = models.BigIntegerField(default=0)
eusage = models.BigIntegerField(default=0)

@property
def size_gb(self):
return self.size / (1024.0 * 1024.0)

class Meta:
app_label = 'storageadmin'
7 changes: 7 additions & 0 deletions src/rockstor/storageadmin/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ class Meta:
model = IscsiTarget


class SharePoolSerializer(serializers.ModelSerializer):
size_gb = serializers.FloatField()

class Meta:
model = Share


class ShareSerializer(serializers.ModelSerializer):
snapshots = SnapshotSerializer(many=True, source='snapshot_set')
pool = PoolInfoSerializer()
Expand Down
Loading