fix path thing (path is now path of pool, not of share)

This commit is contained in:
Daniel 2019-11-23 18:31:38 +01:00
parent 2751095810
commit ccb51aab8e
3 changed files with 8 additions and 15 deletions

View file

@ -95,7 +95,7 @@ def pool_gen():
raid = "unbekannt"
drives = ""
for part in value:
drives = drives + str(Drive.query.get(part.drive_id)) + ","
drives = drives + str(Drive.query.get(part.drive_id).name) + ","
drives = drives[:-1]
value = value[0]
missing = absent_drive(drives)

View file

@ -13,7 +13,7 @@ def get_pools():
:return: List of tuples (id, label) of pools
"""
pools = Pool.query.all()
choices = [(str(pool.id), pool.label) for pool in pools]
choices = [(str(pool.id), pool.label + ": " + pool.drives + " mounted on " + pool.mountpoint) for pool in pools]
return choices
@ -39,6 +39,7 @@ def create_share(name, path, user, dir_mask, create_mask, writeable, btrfs, recy
:return: Nothing
:rtype: None
"""
path = Pool.query.get(int(path))
share = SambaShare(name, path, btrfs=btrfs, recycle=recycling)
user = SambaOption("valid users", user)
if dir_mask is None:

View file

@ -15,7 +15,7 @@
{% endif %}
{{ field(**kwargs)|safe }}
</div>
{% elif field.type == 'SelectField' or field.type =='QuerySelectField' %}
{% elif field.type == 'SelectField' %}
<div class="field">
{% if field.errors %}
<div class="ui mymindrop selection dropdown error">
@ -26,17 +26,9 @@
<i class="dropdown icon"></i>
<div class="default text">{{ field.label.text }}</div>
<div class="menu">
{% if field.type == 'SelectField' %}
{% for value, label in field.choices %}
<div class="item" data-value="{{ value }}">{{ label }}</div>
{% endfor %}
{% else %}
{% for drive in query %}
<div class="item" data-value="{{ drive.name }}">{{ drive.name }}: {{ drive.model }}
({{ drive.size|filesizeformat(true) }})
</div>
{% endfor %}
{% endif %}
{% for value, label in field.choices %}
<div class="item" data-value="{{ value }}">{{ label }}</div>
{% endfor %}
</div>
</div>
</div>
@ -104,6 +96,6 @@
</div>
</div>
{% else %}
ERROR LOL
This field is not defined in formhelpers.
{% endif %}
{% endmacro %}