1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

add show/hide bottom bar option in instance details

This commit is contained in:
catborise 2020-04-17 15:37:34 +03:00
parent f37d6601e1
commit 52c856c504
3 changed files with 37 additions and 30 deletions

View file

@ -4,35 +4,37 @@
{% block title %}{% trans "Instance" %} - {{ vname }}{% endblock %}
{% block content %}
{% include 'pleasewaitdialog.html' %}
<nav class="navbar navbar-default navba navbar-fixed-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar_bottom" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">{% trans 'Toggle navigation' %}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">{% trans 'HOST' %}</a>
{% if bottom_bar %}
<nav class="navbar navbar-default navbar navbar-fixed-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar_bottom" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">{% trans 'Toggle navigation' %}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">{% trans 'HOST' %}</a>
</div>
<div id="navbar_bottom" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a class="navbar-link" href="{% url 'overview' compute.id %}">
<i class="fa fa-server"></i>
{{ compute.name }} {% if compute.name != compute.hostname %} - {{ compute.hostname }}{% endif %}
</a>
</li>
<li>
<a href="{% url 'instances' compute.id %}"><i class="fa fa-desktop"></i> {% trans "Instances" %}</a>
</li>
<li class="active">
<a href="{% url 'instance' compute.id vname %}"><i class="fa fa-hdd-o"></i> {{ vname }}</a>
</li>
</ul>
</div>
</div>
<div id="navbar_bottom" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a class="navbar-link" href="{% url 'overview' compute.id %}">
<i class="fa fa-server"></i>
{{ compute.name }} {% if compute.name != compute.hostname %} - {{ compute.hostname }}{% endif %}
</a>
</li>
<li>
<a href="{% url 'instances' compute.id %}"><i class="fa fa-desktop"></i> {% trans "Instances" %}</a>
</li>
<li class="active">
<a href="{% url 'instance' compute.id vname %}"><i class="fa fa-hdd-o"></i> {{ vname }}</a>
</li>
</ul>
</div>
</div>
</nav>
</nav>
{% endif %}
<!-- Page Heading -->
<div>
<div>
@ -1781,7 +1783,7 @@
image = new_vname + '-clone';
}
$('#disk_name-{{ disk.dev }}').val(image);
{% endfor %}
{% endfor %}
}
</script>
<script>

View file

@ -117,6 +117,7 @@ def instance(request, compute_id, vname):
keymaps = settings.QEMU_KEYMAPS
console_types = settings.QEMU_CONSOLE_TYPES
console_listen_addresses = settings.QEMU_CONSOLE_LISTEN_ADDRESSES
bottom_bar = settings.VIEW_INSTANCE_DETAIL_BOTTOM_BAR
try:
userinstance = UserInstance.objects.get(instance__compute_id=compute_id,
instance__name=vname,

View file

@ -173,6 +173,9 @@ VIEW_ACCOUNTS_STYLE = 'grid'
# available list style: default (grouped), nongrouped
VIEW_INSTANCES_LIST_STYLE = 'grouped'
# available options: True, False
VIEW_INSTANCE_DETAIL_BOTTOM_BAR = True
# available volume format: raw, qcow2, qcow
INSTANCE_VOLUME_DEFAULT_FORMAT = 'qcow2'
@ -207,4 +210,5 @@ INSTANCE_MACHINE_DEFAULT_TYPE = 'q35'
INSTANCE_FIRMWARE_DEFAULT_TYPE = 'BIOS'
# Architecture: x86_64, i686, etc
INSTANCE_ARCH_DEFAULT_TYPE = 'x86_64'
INSTANCE_ARCH_DEFAULT_TYPE = 'x86_64'