Permalink
Browse files

Expose swap size to the volume manager

  • Loading branch information...
william-gr committed Jun 7, 2013
1 parent 27bc0f4 commit 8610a4aac84136016c59b45b65e5d2db3ce09c80
Showing with 4 additions and 1 deletion.
  1. +3 −0 gui/storage/views.py
  2. +1 −1 gui/templates/storage/volumemanager.html
View
@@ -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]
@@ -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>

0 comments on commit 8610a4a

Please sign in to comment.