1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 03:54:15 +00:00

Move tempates

This commit is contained in:
Retspen 2015-04-02 11:48:40 +03:00
parent 8b39d4e429
commit ea41412aac
46 changed files with 47 additions and 48 deletions

View file

@ -2,9 +2,9 @@ from django.conf.urls import url
from . import views
urlpatterns =[
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'),
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.html'}, name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'accounts/logout.html'}, name='logout'),
url(r'^profile/$', views.profile, name='profile'),
url(r'^$', views.accounts, name='accounts'),
url(r'^profile/(\d+)/$', views.account, name='account'),
url(r'^profile/(?P<user_id>[0-9]+)/$', views.account, name='account'),
]

View file

@ -42,7 +42,7 @@ def profile(request):
user.save()
return HttpResponseRedirect(request.get_full_path())
return render(request, 'profile.html', locals())
return render(request, 'accounts/profile.html', locals())
def accounts(request):
@ -101,7 +101,7 @@ def accounts(request):
user_delete.delete()
return HttpResponseRedirect(request.get_full_path())
return render(request, 'accounts.html', locals())
return render(request, 'accounts/accounts.html', locals())
def account(request, user_id):
@ -150,4 +150,4 @@ def account(request, user_id):
add_user_inst.save()
return HttpResponseRedirect(request.get_full_path())
return render(request, 'account.html', locals())
return render(request, 'accounts/account.html', locals())

View file

@ -3,6 +3,6 @@ from . import views
urlpatterns =[
url(r'^$', views.computes, name='computes'),
url(r'^overview/(\d+)/$', views.overview, name='overview'),
url(r'^statistics/(\d+)/$', views.compute_graph, name='compute_graph'),
url(r'^overview/(?P<compute_id>[0-9]+)/$', views.overview, name='overview'),
url(r'^statistics/(?P<compute_id>[0-9]+)/$', views.compute_graph, name='compute_graph'),
]

View file

@ -127,7 +127,7 @@ def computes(request):
else:
for msg_err in form.errors.values():
error_messages.append(msg_err.as_text())
return render(request, 'computes.html', locals())
return render(request, 'computes/computes.html', locals())
def overview(request, compute_id):
@ -157,7 +157,7 @@ def overview(request, compute_id):
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'overview.html', locals())
return render(request, 'computes/overview.html', locals())
def compute_graph(request, compute_id):

View file

@ -137,4 +137,4 @@ def create_instance(request, compute_id):
error_messages.append(lib_err)
conn.close()
return render(request, 'create_instance.html', locals())
return render(request, 'create/create_instance.html', locals())

BIN
db.sqlite3 Normal file

Binary file not shown.

View file

@ -2,7 +2,7 @@ from django.conf.urls import url
from . import views
urlpatterns =[
url(r'^(\d+)/([\w\-\.]+)/$', views.instance, name='instance'),
url(r'^statistics/(\d+)/([\w\-\.]+)/$', views.inst_graph, name='inst_graph'),
url(r'^status/(\d+)/([\w\-\.]+)/$', views.inst_status, name='inst_status'),
url(r'^(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.instance, name='instance'),
url(r'^statistics/(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.inst_graph, name='inst_graph'),
url(r'^status/(?P<compute_id>[0-9]+)/(?P<vname>[\w\-\.]+)/$', views.inst_status, name='inst_status'),
]

View file

@ -120,7 +120,7 @@ def instances(request):
error_messages.append(lib_err)
addlogmsg(request.user.id, instance.id, lib_err.message)
return render(request, 'instances.html', locals())
return render(request, 'instances/instances.html', locals())
def instance(request, compute_id, vname):
@ -421,7 +421,7 @@ def instance(request, compute_id, vname):
error_messages.append(lib_err.message)
addlogmsg(request.user.id, instance.id, lib_err.message)
return render(request, 'instance.html', locals())
return render(request, 'instances/instance.html', locals())
def inst_status(request, host_id, vname):

View file

@ -54,7 +54,7 @@ def interfaces(request, compute_id):
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'interfaces.html', locals())
return render(request, 'interfaces/interfaces.html', locals())
def interface(request, compute_id, iface):
@ -103,4 +103,4 @@ def interface(request, compute_id, iface):
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'interface.html', locals())
return render(request, 'interfaces/interface.html', locals())

View file

@ -27,4 +27,4 @@ def showlogs(request):
logs = Logs.objects.all()
return render(request, 'showlogs.html', locals())
return render(request, 'logs/showlogs.html', locals())

View file

@ -57,7 +57,7 @@ def networks(request, compute_id):
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'networks.html', locals())
return render(request, 'networks/networks.html', locals())
def network(request, compute_id, pool):
@ -127,4 +127,4 @@ def network(request, compute_id, pool):
conn.close()
return render(request, 'network.html', locals())
return render(request, 'networks/network.html', locals())

View file

@ -62,4 +62,4 @@ def secrets(request, compute_id):
except libvirtError as err:
error_messages.append(err)
return render(request, 'secrets.html', locals())
return render(request, 'secrets/secrets.html', locals())

View file

@ -65,7 +65,7 @@ def storages(request, compute_id):
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'storages.html', locals())
return render(request, 'storages/storages.html', locals())
def storage(request, compute_id, pool):
@ -202,4 +202,4 @@ def storage(request, compute_id, pool):
error_messages.append(msg_err.as_text())
conn.close()
return render(request, 'storage.html', locals())
return render(request, 'storages/storage.html', locals())

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_user_inst_block.html' %}
{% include 'accounts/create_user_inst_block.html' %}
<h1 class="page-header">{{ user }}</h1>
</div>
</div>

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_user_block.html' %}
{% include 'accounts/create_user_block.html' %}
<h1 class="page-header">{% trans "Users" %}</h1>
</div>
</div>

View file

@ -1,4 +1,4 @@
{% extends "base_auth.html" %}
{% extends "accounts/base_auth.html" %}
{% load i18n %}
{% block title %}{% trans "WebVirtCloud - Sign In" %}{% endblock %}
{% block content %}

View file

@ -1,4 +1,4 @@
{% extends "base_auth.html" %}
{% extends "accounts/base_auth.html" %}
{% load i18n %}
{% block title %}{% trans "WebVirtCloud - Sign Out" %}{% endblock %}
{% block content %}

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_comp_block.html' %}
{% include 'computes/create_comp_block.html' %}
<h1 class="page-header">{% trans "Computes" %}</h1>
</div>
</div>

View file

@ -9,7 +9,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_flav_block.html' %}
{% include 'create/create_flav_block.html' %}
<h1 class="page-header">{% trans "New instance on" %} {{ compute.name }}</h1>
</div>
</div>

View file

@ -8,7 +8,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_inst_block.html' %}
{% include 'instances/create_inst_block.html' %}
<div class="pull-right search">
<input id="filter" class="form-control" type="text" placeholder="Search">
</div>

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_iface_block.html' %}
{% include 'interfaces/create_iface_block.html' %}
<h1 class="page-header">{{ compute.name }}</h1>
<ol class="breadcrumb">
<li class="active">

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_net_block.html' %}
{% include 'networks/create_net_block.html' %}
<h1 class="page-header">{{ compute.name }}</h1>
<ol class="breadcrumb">
<li class="active">

View file

@ -8,7 +8,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_secret_block.html' %}
{% include 'secrets/create_secret_block.html' %}
<h1 class="page-header">{% trans "Secrets" %}</h1>
<ol class="breadcrumb">
<li class="active">

View file

@ -2,13 +2,13 @@
{% load i18n %}
{% block title %}{% trans "Storage" %} - {{ pool }}{% endblock %}
{% block style %}
<link rel="stylesheet" href="{{ STATIC_URL }}/css/sortable-theme-bootstrap.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/sortable-theme-bootstrap.css" />
{% endblock %}
{% block content %}
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_stg_vol_block.html' %}
{% include 'storages/create_stg_vol_block.html' %}
<h1 class="page-header">{% trans "Storage:" %} {{ pool }}</h1>
<ol class="breadcrumb">
<li class="active">

View file

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_stg_block.html' %}
{% include 'storages/create_stg_block.html' %}
<h1 class="page-header">{{ compute.name }}</h1>
<ol class="breadcrumb">
<li class="active">

View file

@ -45,7 +45,7 @@ WSGI_APPLICATION = 'webvirtcloud.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'webvirtcloud.sqlite3'),
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
@ -98,4 +98,3 @@ QEMU_KEYMAPS = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
# keepalive interval and count for libvirt connections
LIBVIRT_KEEPALIVE_INTERVAL = 5
LIBVIRT_KEEPALIVE_COUNT = 5

View file

@ -8,19 +8,19 @@ urlpatterns = patterns('',
url(r'^accounts/', include('accounts.urls')),
url(r'^computes/', include('computes.urls')),
url(r'^compute/stgs/(\d+)/$', 'storages.views.storages', name='storages'),
url(r'^compute/stg/(\d+)/([\w\-\.]+)/$', 'storages.views.storage', name='storage'),
url(r'^compute/stgs/(?P<compute_id>[0-9]+)/$', 'storages.views.storages', name='storages'),
url(r'^compute/stg/(?P<compute_id>[0-9]+)/(?P<pool>[\w\-\.]+)/$', 'storages.views.storage', name='storage'),
url(r'^compute/nets/(\d+)/$', 'networks.views.networks', name='networks'),
url(r'^compute/net/(\d+)/([\w\-\.]+)/$', 'networks.views.network', name='network'),
url(r'^compute/nets/(?P<compute_id>[0-9]+)/$', 'networks.views.networks', name='networks'),
url(r'^compute/net/(?P<compute_id>[0-9]+)/(?P<pool>[\w\-\.]+)/$', 'networks.views.network', name='network'),
url(r'^compute/ifaces/(\d+)/$', 'interfaces.views.interfaces', name='interfaces'),
url(r'^compute/iface/(\d+)/([\w\.\:]+)$', 'interfaces.views.interface', name='interface'),
url(r'^compute/ifaces/(?P<compute_id>[0-9]+)/$', 'interfaces.views.interfaces', name='interfaces'),
url(r'^compute/iface/(?P<compute_id>[0-9]+)/(?P<iface>[\w\-\.\:]+)/$', 'interfaces.views.interface', name='interface'),
url(r'^compute/secret/(\d+)/$', 'secrets.views.secrets', name='secrets'),
url(r'^compute/secret/(?P<compute_id>[0-9]+)/$', 'secrets.views.secrets', name='secrets'),
url(r'^console/$', 'console.views.console', name='console'),
url(r'^create/(\d+)/$', 'create.views.create_instance', name='create_instance'),
url(r'^create/(?P<compute_id>[0-9]+)/$', 'create.views.create_instance', name='create_instance'),
url(r'^logs/$', 'logs.views.showlogs', name='showlogs'),
# (r'^admin/', include(admin.site.urls)),
)