2020-01-08 05:53:50 +00:00
{% load i18n %}
{% if request.user.is_superuser %}
2021-07-07 11:12:38 +00:00
< button href = "#editvol{{ id }}" type = "button" class = "btn btn-sm btn-secondary" data-bs-toggle = "modal" title = "{% trans " Edit Volume " % } " >
2020-05-19 16:53:54 +00:00
< i class = "fa fa-edit" aria-hidden = "true" > < / i >
2020-01-08 08:28:46 +00:00
< / button >
2020-01-08 05:53:50 +00:00
<!-- Modal pool -->
2020-01-08 08:28:46 +00:00
< div class = "modal fade" id = "editvol{{ id }}" tabindex = "-1" role = "dialog" aria-labelledby = "editInstanceVolumeLabel{{ id }}" aria-hidden = "true" >
2020-01-08 05:53:50 +00:00
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header" >
2020-05-19 16:53:54 +00:00
< h5 class = "modal-title" > {% trans "Edit Instance Volume" %}< / h5 >
2021-07-07 11:12:38 +00:00
< button type = "button" class = "btn-close" data-bs-dismiss = "modal" aria-label = "Close" > < / button >
2020-01-08 05:53:50 +00:00
< / div >
2020-01-08 08:28:46 +00:00
2020-01-08 05:53:50 +00:00
< div class = "modal-body" >
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs mb-3" role = "tablist" aria-label = "Disk options" >
2021-07-07 11:12:38 +00:00
< li class = "nav-item" role = "presentation" >
< button class = "nav-link active" data-bs-toggle = "tab" data-bs-target = "#VirtualDisk{{ id }}" type = "button" role = "tab" aria-controls = "VirtualDisk{{ id }}" aria-selected = "true" >
{% trans 'Virtual Disk' %}
< / button >
2020-05-19 16:53:54 +00:00
< / li >
2021-07-07 11:12:38 +00:00
< li class = "nav-item" role = "presentation" >
< button class = "nav-link" data-bs-toggle = "tab" data-bs-target = "#PerformanceVolume{{ id }}" type = "button" role = "tab" aria-controls = "PerformanceVolume{{ id }}" aria-selected = "false" >
{% trans 'Performance' %}
< / button >
2020-05-19 16:53:54 +00:00
< / li >
2021-07-07 11:12:38 +00:00
< li class = "nav-item" role = "presentation" >
< button class = "nav-link" data-bs-toggle = "tab" data-bs-target = "#AdvancedVolume{{ id }}" type = "button" role = "tab" aria-controls = "AdvancedVolume{{ id }}" aria-selected = "false" >
{% trans 'Advanced' %}
< / button >
2020-05-19 16:53:54 +00:00
< / li >
< / ul >
2020-01-08 08:28:46 +00:00
2020-05-19 16:53:54 +00:00
< div class = "tab-content" >
2020-05-21 22:13:39 +00:00
< div class = "tab-pane active" role = "tabpanel" id = "VirtualDisk{{ id }}" >
2021-07-07 11:12:38 +00:00
< div class = "mb-3" >
< label class = "form-label" for = "vol_path" > {% trans 'Volume Path' %}< / label >
< input class = "form-control" id = "vol_path" name = "vol_path" value = "{{ disk.path }}" / >
2020-05-19 16:53:54 +00:00
< / div >
2021-07-07 11:12:38 +00:00
< div class = "mb-3 form-check form-switch" >
< label class = "form-check-label" > {% trans 'Readonly' %}< / label >
< input class = "form-check-input" type = "checkbox" name = "vol_readonly" value = "True" { % if disk . readonly % } checked { % endif % } / >
2020-05-19 16:53:54 +00:00
< / div >
2021-07-07 11:12:38 +00:00
< div class = "mb-3 form-check form-switch" >
< label class = "form-check-label" > {% trans 'Shareable' %}< / label >
< input class = "form-check-input" type = "checkbox" name = "vol_shareable" value = "True" { % if disk . shareable % } checked { % endif % } / >
2020-01-08 08:28:46 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< / div >
2020-01-08 08:28:46 +00:00
2021-07-07 11:12:38 +00:00
< div class = "tab-pane" role = "tabpanel" id = "PerformanceVolume{{ id }}" >
< div class = "mb-3" >
< label class = "form-label" for = "vol_cache" > {% trans 'Cache mode' %}< / label >
< select class = "form-select" id = "vol_cache" name = "vol_cache" >
{% for key, val in instance.cache_modes %}
< option value = "{{ key }}" { % if key = = disk . cache % } selected { % endif % } > {{ val }}< / option >
{% endfor %}
< / select >
< / div >
< div class = "mb-3" >
< label class = "form-label" id = "vol_io_mode" > {% trans 'IO mode' %}< / label >
< select class = "form-select" name = "vol_io_mode" >
{% for key, val in instance.io_modes %}
< option value = "{{ key }}" { % if key = = disk . io % } selected { % endif % } > {{ val }}< / option >
2020-05-19 16:53:54 +00:00
{% endfor %}
2021-07-07 11:12:38 +00:00
< / select >
2020-05-19 16:53:54 +00:00
< / div >
2021-07-07 11:12:38 +00:00
< div class = "mb-3" >
< label class = "form-label" for = "vol_discard_mode" > {% trans 'Discard mode' %}< / label >
< select class = "form-select" id = "vol_discard_mode" name = "vol_discard_mode" >
{% for key, val in instance.discard_modes %}
< option value = "{{ key }}" { % if key = = disk . discard % } selected { % endif % } > {{ val }}< / option >
{% endfor %}
< / select >
< / div >
< div class = "mb-3" >
< label class = "form-label" for = "vol_detect_zeroes" > {% trans 'Detect zeroes' %}< / label >
< select class = "form-select" id = "vol_detect_zeroes" name = "vol_detect_zeroes" >
{% for key, val in instance.detect_zeroes_modes %}
< option value = "{{ key }}" { % if key = = disk . detect_zeroes % } selected { % endif % } > {{ val }}< / option >
{% endfor %}
< / select >
2020-01-08 08:28:46 +00:00
< / div >
2021-07-07 11:12:38 +00:00
< input class = "form-control" name = "vol_bus_old" value = "{{ disk.bus }}" hidden / >
< / div >
2020-01-08 08:28:46 +00:00
2021-07-07 11:12:38 +00:00
< div class = "tab-pane" role = "tabpanel" id = "AdvancedVolume{{ id }}" >
< div class = "mb-3" >
< label class = "form-label" for = "vol_bus" > {% trans 'Bus' %}< / label >
< select class = "form-select" id = "vol_Bus" name = "vol_bus" { % if instance . status ! = 5 % } disabled { % endif % } >
{% for bus in bus_host %}
< option value = "{{ bus }}" { % if bus = = disk . bus % } selected { % endif % } > {{ bus }}< / option >
{% endfor %}
< / select >
< / div >
< div class = "mb-3" >
< label class = "form-label" for = "vol_serial" > {% trans 'Serial Number' %}< / label >
< input class = "form-control" id = "vol_serial" name = "vol_serial" type = "text" value = "{{ disk.serial }}" / >
< / div >
< div class = "mb-3" >
< label class = "form-label" for = "vol_format" > {% trans 'Storage Format' %}< / label >
< input class = "form-control" id = "vol_format" name = "vol_format" type = "text" value = "{{ disk.format }}" / >
< / div >
< / div >
< / div > <!-- /.tab - content -->
2020-01-08 05:53:50 +00:00
< / div > <!-- /.modal - body -->
2020-01-08 08:28:46 +00:00
< div class = "clearfix" > < / div >
< div class = "modal-footer" >
2021-07-07 11:12:38 +00:00
< button type = "button" class = "btn btn-secondary" data-bs-dismiss = "modal" > {% trans "Close" %}< / button >
2021-06-10 10:46:08 +00:00
< button type = "submit" class = "btn btn-success" name = "edit_volume" onclick = "return confirm('{% trans " Are you sure to change volume properties ? " % } ' ) " > {% trans "Save" %}< / button >
2020-01-08 08:28:46 +00:00
< / div > <!-- /.modal - footer -->
2020-01-08 05:53:50 +00:00
< / div > <!-- /.modal - content -->
< / div > <!-- /.modal - dialog -->
2020-01-08 08:28:46 +00:00
2020-01-08 05:53:50 +00:00
< / div > <!-- /.modal -->
{% endif %}