Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Expose swap size to the volume manager

  • Loading branch information...
commit 8610a4aac84136016c59b45b65e5d2db3ce09c80 1 parent 27bc0f4
@williambr williambr authored
View
3  gui/storage/views.py
@@ -46,6 +46,7 @@
from freenasUI.middleware import zfs
from freenasUI.middleware.exceptions import MiddlewareError
from freenasUI.middleware.notifier import notifier
+from freenasUI.system.models import Advanced
from freenasUI.services.exceptions import ServiceFailed
from freenasUI.services.models import iSCSITargetExtent
from freenasUI.storage import forms, models
@@ -174,10 +175,12 @@ def volumemanager(request):
bysize = OrderedDict(sorted(bysize.iteritems(), reverse=True))
qs = models.Volume.objects.filter(vol_fstype='ZFS')
+ swap = Advanced.objects.latest('id').adv_swapondrive
return render(request, "storage/volumemanager.html", {
'disks': json.dumps(bysize),
'dedup_warning': forms.DEDUP_WARNING,
+ 'swap_size': swap * 1024 * 1024 * 1024,
'extend': json.dumps(
[{'value': '', 'label': '-----'}] +
[{'label': x.vol_name, 'value': x.vol_name} for x in qs]
View
2  gui/templates/storage/volumemanager.html
@@ -1,2 +1,2 @@
-<div data-dojo-type="freeadmin.VolumeManager" data-dojo-props="disks: '{{ disks|escapejs }}', url: '{{ request.path }}', url_progress: '{% url "storage_volumemanager_progress" %}', dedup_warning: '{{ dedup_warning|escapejs }}', extend: '{{ extend|escapejs }}'">
+<div data-dojo-type="freeadmin.VolumeManager" data-dojo-props="disks: '{{ disks|escapejs }}', url: '{{ request.path }}', url_progress: '{% url "storage_volumemanager_progress" %}', dedup_warning: '{{ dedup_warning|escapejs }}', extend: '{{ extend|escapejs }}', swapSize: {{ swap_size }}">
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.