mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-14 07:25:41 +00:00
Compare commits
No commits in common. "a272740be6599f632b74096f25d886782c13c527" and "bb31c09d252937bf1ee05f2bf1fa6bd0428befc2" have entirely different histories.
a272740be6
...
bb31c09d25
5 changed files with 3 additions and 43 deletions
|
|
@ -1,29 +0,0 @@
|
||||||
# Generated by Django 3.2.12 on 2022-06-29 12:13
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
def add_default_settings(apps, schema_editor):
|
|
||||||
setting = apps.get_model("appsettings", "AppSettings")
|
|
||||||
db_alias = schema_editor.connection.alias
|
|
||||||
setting.objects.using(db_alias).bulk_create([
|
|
||||||
setting(31, _("VM DRBD Status"), "VM_DRBD_STATUS", "False", "True,False", _("Show VM DRBD Status")),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def del_default_settings(apps, schema_editor):
|
|
||||||
setting = apps.get_model("appsettings", "AppSettings")
|
|
||||||
db_alias = schema_editor.connection.alias
|
|
||||||
setting.objects.using(db_alias).filter(key="VM_DRBD_STATUS").delete()
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('appsettings', '0006_alter_appsettings_id'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RunPython(add_default_settings, del_default_settings),
|
|
||||||
]
|
|
||||||
|
|
@ -7,9 +7,7 @@
|
||||||
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>
|
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>
|
||||||
<th scope="col" class="d-none d-sm-table-cell">{% trans "User"%}</th>
|
<th scope="col" class="d-none d-sm-table-cell">{% trans "User"%}</th>
|
||||||
<th scope="col">{% trans "Status" %}</th>
|
<th scope="col">{% trans "Status" %}</th>
|
||||||
{% if app_settings.VM_DRBD_STATUS == 'True' %}
|
|
||||||
<th scope="col">{% trans "Role/Disk" %}</th>
|
<th scope="col">{% trans "Role/Disk" %}</th>
|
||||||
{% endif %}
|
|
||||||
<th scope="col" class="d-none d-sm-table-cell">{% trans "VCPU" %}</th>
|
<th scope="col" class="d-none d-sm-table-cell">{% trans "VCPU" %}</th>
|
||||||
<th scope="col" class="d-none d-sm-table-cell">{% trans "Memory" %}</th>
|
<th scope="col" class="d-none d-sm-table-cell">{% trans "Memory" %}</th>
|
||||||
<th scope="col" style="width:200px;" data-sortable="false">{% trans "Actions" %} & {% trans "Mem Usage" %}</th>
|
<th scope="col" style="width:200px;" data-sortable="false">{% trans "Actions" %} & {% trans "Mem Usage" %}</th>
|
||||||
|
|
@ -30,9 +28,7 @@
|
||||||
<td>
|
<td>
|
||||||
<span class="text-success">{% trans "Connected" %}</span>
|
<span class="text-success">{% trans "Connected" %}</span>
|
||||||
</td>
|
</td>
|
||||||
{% if app_settings.VM_DRBD_STATUS == 'True' %}
|
|
||||||
<td class="d-none d-sm-table-cell"></td>
|
<td class="d-none d-sm-table-cell"></td>
|
||||||
{% endif %}
|
|
||||||
<td class="d-none d-sm-table-cell text-center">{{ compute.cpu_count }}</td>
|
<td class="d-none d-sm-table-cell text-center">{{ compute.cpu_count }}</td>
|
||||||
<td class="d-none d-sm-table-cell text-right">{{ compute.ram_size|filesizeformat }}</td>
|
<td class="d-none d-sm-table-cell text-right">{{ compute.ram_size|filesizeformat }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
@ -68,11 +64,9 @@
|
||||||
<span class="text-warning">{% trans "Suspended" %}</span>
|
<span class="text-warning">{% trans "Suspended" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if app_settings.VM_DRBD_STATUS == 'True' %}
|
|
||||||
<td>
|
<td>
|
||||||
{% if instance.drbd == "Primary/OK" or instance.drbd == "Secondary/OK" %}<span class="text-success">{% else %}<span class="text-danger">{% endif %}{{ instance.drbd }}</span>
|
{% if instance.drbd == "Primary/OK" or instance.drbd == "Secondary/OK" %}<span class="text-success">{% else %}<span class="text-danger">{% endif %}{{ instance.drbd }}</span>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
|
||||||
<td>{{ instance.proxy.instance.info.3 }}</td>
|
<td>{{ instance.proxy.instance.info.3 }}</td>
|
||||||
<td>{{ instance.cur_memory }} MB</td>
|
<td>{{ instance.cur_memory }} MB</td>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@
|
||||||
<th scope="col">{% trans 'Host' %}<br>{% trans 'User' %}</th>
|
<th scope="col">{% trans 'Host' %}<br>{% trans 'User' %}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th scope="col">{% trans 'Status' %}</th>
|
<th scope="col">{% trans 'Status' %}</th>
|
||||||
{% if app_settings.VM_DRBD_STATUS == 'True' %}
|
|
||||||
<th scope="col">{% trans 'Role/Disk' %}</th>
|
<th scope="col">{% trans 'Role/Disk' %}</th>
|
||||||
{% endif %}
|
|
||||||
<th scope="col">{% trans 'VCPU' %}</th>
|
<th scope="col">{% trans 'VCPU' %}</th>
|
||||||
<th scope="col">{% trans 'Memory' %}</th>
|
<th scope="col">{% trans 'Memory' %}</th>
|
||||||
<th scope="col" data-sortable="false">{% trans 'Actions' %}</th>
|
<th scope="col" data-sortable="false">{% trans 'Actions' %}</th>
|
||||||
|
|
@ -47,11 +45,9 @@
|
||||||
{% if instance.proxy.instance.info.0 == 3 %}<span
|
{% if instance.proxy.instance.info.0 == 3 %}<span
|
||||||
class="text-warning">{% trans "Suspended" %}</span>{% endif %}
|
class="text-warning">{% trans "Suspended" %}</span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if app_settings.VM_DRBD_STATUS == 'True' %}
|
|
||||||
<td>
|
<td>
|
||||||
{% if instance.drbd == "Primary/OK" or instance.drbd == "Secondary/OK" %}<span class="text-success">{% else %}<span class="text-danger">{% endif %}{{ instance.drbd }}</span>
|
{% if instance.drbd == "Primary/OK" or instance.drbd == "Secondary/OK" %}<span class="text-success">{% else %}<span class="text-danger">{% endif %}{{ instance.drbd }}</span>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
|
||||||
<td>{{ instance.proxy.instance.info.3 }}</td>
|
<td>{{ instance.proxy.instance.info.3 }}</td>
|
||||||
<td>{{ instance.cur_memory }} MB</td>
|
<td>{{ instance.cur_memory }} MB</td>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
|
|
|
||||||
|
|
@ -128,9 +128,8 @@ def instance(request, pk):
|
||||||
storages_host = sorted(instance.proxy.get_storages(True))
|
storages_host = sorted(instance.proxy.get_storages(True))
|
||||||
net_models_host = instance.proxy.get_network_models()
|
net_models_host = instance.proxy.get_network_models()
|
||||||
|
|
||||||
if app_settings.VM_DRBD_STATUS == 'True':
|
instance.drbd = drbd_status(request, pk)
|
||||||
instance.drbd = drbd_status(request, pk)
|
instance.save()
|
||||||
instance.save()
|
|
||||||
|
|
||||||
return render(request, "instance.html", locals())
|
return render(request, "instance.html", locals())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ USE_SSL = False
|
||||||
## The user with search rights on ldap. (e.g cn=admin,dc=kendar,dc=org)
|
## The user with search rights on ldap. (e.g cn=admin,dc=kendar,dc=org)
|
||||||
LDAP_MASTER_DN = ''
|
LDAP_MASTER_DN = ''
|
||||||
LDAP_MASTER_PW_ENC = ''
|
LDAP_MASTER_PW_ENC = ''
|
||||||
LDAP_MASTER_PW = subprocess.Popen(["bash", str(BASE_DIR) + "/webvirtcloud/.dec_ldap_pwd.sh", LDAP_MASTER_PW_ENC],stdout=subprocess.PIPE, encoding='utf8').stdout.read().strip('\n')
|
LDAP_MASTER_PW = subprocess.Popen(["bash", str(BASE_DIR) + "/webvirtcloud/.dec_ldap_pwd.sh", LDAP_MASTER_PW_ENC],stdout=subprocess.PIPE, text=True).stdout.read().strip('\n')
|
||||||
## The root dn (e.g. dc=kendar,dc=org)
|
## The root dn (e.g. dc=kendar,dc=org)
|
||||||
LDAP_ROOT_DN = ''
|
LDAP_ROOT_DN = ''
|
||||||
## Queries to identify the users, i use groupOfUniqueNames on openldap
|
## Queries to identify the users, i use groupOfUniqueNames on openldap
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue