Commit 3d1ceb98 by Kálmán Viktor

network: vm list

parent ab32ba2c
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
</div> </div>
<div class="col-sm-6 text-right"> <div class="col-sm-6 text-right">
<a class="btn btn-primary btn-xs"><i class="icon-chevron-sign-right"></i> <strong>13</strong> more </a> <a class="btn btn-primary btn-xs" href="{% url "dashboard.views.vm-list" %}"><i class="icon-chevron-sign-right"></i> <strong>13</strong> more </a>
<a class="btn btn-success btn-xs"><i class="icon-plus-sign"></i> new </a> <a class="btn btn-success btn-xs"><i class="icon-plus-sign"></i> new </a>
</div> </div>
</div> </div>
......
{% extends "dashboard/base.html" %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="no-margin"><i class="icon-desktop"></i> Your virtual machines</h3>
</div>
<div class="panel-body">
<table class="table table-striped table-bordered">
<thead>
<tr>
<td style="width: 10px;"><input type="checkbox"/></td>
<td>Name</td>
<td>State</td>
<td>Suspend in</td>
<td>Delete in</td>
<td style="width: 10px;">Actions</td>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox"/></td>
<td><a href="">network-devenv</a></td>
<td>running</td>
<td>10 days</td>
<td>1 month</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">Action <i class="icon-caret-down"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="#"><i class="icon-refresh"></i> Reboot</a></li>
<li><a href="#"><i class="icon-off"></i> Shutdown</a></li>
<li><a href="#"><i class="icon-remove"></i> Discard</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from .views import IndexView, VmDetailView from .views import IndexView, VmDetailView, VmList
urlpatterns = patterns('', urlpatterns = patterns(
url(r'^$', IndexView.as_view()), '',
url(r'^vm/(?P<pk>\d+)/$', VmDetailView.as_view(), url(r'^$', IndexView.as_view()),
name='dashboard.views.detail'),) url(r'^vm/(?P<pk>\d+)/$', VmDetailView.as_view(),
name='dashboard.views.detail'),
url(r'^vm/list/$', VmList.as_view(), name='dashboard.views.vm-list'),
)
from django.views.generic import TemplateView, DetailView from django.views.generic import TemplateView, DetailView
# from django_tables2 import SingleTableView
from vm.models import Instance from vm.models import Instance
from django.core import signing from django.core import signing
...@@ -35,3 +37,7 @@ class VmDetailView(DetailView): ...@@ -35,3 +37,7 @@ class VmDetailView(DetailView):
'vnc_url': '%s' % value 'vnc_url': '%s' % value
}) })
return context return context
class VmList(TemplateView):
template_name = "dashboard/vm-list.html"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment