mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-15 01:45:17 +00:00
Compare commits
4 commits
58e215f755
...
9a675918c6
Author | SHA1 | Date | |
---|---|---|---|
|
9a675918c6 | ||
|
91aaa93c2b | ||
|
149044a90c | ||
|
5a211c0c56 |
6 changed files with 15 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base_auth.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans "WebVirtCloud" %} - {% trans "Sign Out"%}
|
{% trans "WebVirtCloud" %} - {% trans "Sign Out"%}
|
||||||
|
|
|
@ -196,7 +196,7 @@ def get_dhcp_mac_address(vname):
|
||||||
|
|
||||||
|
|
||||||
def get_random_mac_address():
|
def get_random_mac_address():
|
||||||
mac = "52:54:00:%02x:%02x:%02x" % (
|
mac = settings.MAC_OUI + ":%02x:%02x:%02x" % (
|
||||||
random.randint(0x00, 0xFF),
|
random.randint(0x00, 0xFF),
|
||||||
random.randint(0x00, 0xFF),
|
random.randint(0x00, 0xFF),
|
||||||
random.randint(0x00, 0xFF),
|
random.randint(0x00, 0xFF),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base_auth.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "403" %}{% endblock %}
|
{% block title %}{% trans "403" %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base_auth.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "404" %}{% endblock %}
|
{% block title %}{% trans "404" %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import string
|
||||||
import libvirt
|
import libvirt
|
||||||
import lxml.etree as etree
|
import lxml.etree as etree
|
||||||
|
|
||||||
|
from django.conf import UserSettingsHolder, settings
|
||||||
|
|
||||||
|
|
||||||
def is_kvm_available(xml):
|
def is_kvm_available(xml):
|
||||||
kvm_domains = get_xml_path(xml, "//domain/@type='kvm'")
|
kvm_domains = get_xml_path(xml, "//domain/@type='kvm'")
|
||||||
|
@ -15,10 +17,12 @@ def is_kvm_available(xml):
|
||||||
def randomMAC():
|
def randomMAC():
|
||||||
"""Generate a random MAC address."""
|
"""Generate a random MAC address."""
|
||||||
# qemu MAC
|
# qemu MAC
|
||||||
oui = [0x52, 0x54, 0x00]
|
mac = settings.MAC_OUI + ":%02x:%02x:%02x" % (
|
||||||
|
random.randint(0x00, 0xFF),
|
||||||
mac = oui + [random.randint(0x00, 0xFF), random.randint(0x00, 0xFF), random.randint(0x00, 0xFF)]
|
random.randint(0x00, 0xFF),
|
||||||
return ":".join(map(lambda x: "%02x" % x, mac))
|
random.randint(0x00, 0xFF),
|
||||||
|
)
|
||||||
|
return mac
|
||||||
|
|
||||||
|
|
||||||
def randomUUID():
|
def randomUUID():
|
||||||
|
|
|
@ -15,6 +15,8 @@ SECRET_KEY = ""
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
MAC_OUI = '52:54:10'
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
CSRF_TRUSTED_ORIGINS = ['http://localhost',]
|
CSRF_TRUSTED_ORIGINS = ['http://localhost',]
|
||||||
|
|
Loading…
Reference in a new issue