Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fd1eae32
authored
Nov 28, 2013
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add node index view
parent
2c033559
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
7 deletions
+36
-7
circle/dashboard/tables.py
+23
-3
circle/dashboard/urls.py
+6
-2
circle/dashboard/views.py
+7
-2
No files found.
circle/dashboard/tables.py
View file @
fd1eae32
from
django_tables2
import
Table
#
A
from
django_tables2
import
Table
,
A
from
django_tables2.columns
import
TemplateColumn
# Link
Column
from
django_tables2.columns
import
LinkColumn
,
TemplateColumn
,
Column
from
vm.models
import
Instance
from
vm.models
import
Instance
,
Node
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
...
@@ -40,3 +40,23 @@ class VmListTable(Table):
...
@@ -40,3 +40,23 @@ class VmListTable(Table):
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover '
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover '
'vm-list-table'
)}
'vm-list-table'
)}
fields
=
(
'pk'
,
'name'
,
'state'
,
'time_of_suspend'
,
'time_of_delete'
,
)
fields
=
(
'pk'
,
'name'
,
'state'
,
'time_of_suspend'
,
'time_of_delete'
,
)
class
NodeListTable
(
Table
):
pk
=
Column
(
verbose_name
=
"ID"
,
)
name
=
LinkColumn
(
'dashboard.views.node-detail'
,
args
=
[
A
(
'pk'
)],
attrs
=
{
'a'
:
{
'class'
:
'real-link'
}}
)
class
Meta
:
model
=
Node
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover '
'node-list-table'
)}
fields
=
(
'pk'
,
'name'
,
'host'
,
'enabled'
,
'created'
,
'modified'
,
'priority'
,
'overcommit'
,)
circle/dashboard/urls.py
View file @
fd1eae32
...
@@ -3,7 +3,7 @@ from django.conf.urls import patterns, url
...
@@ -3,7 +3,7 @@ from django.conf.urls import patterns, url
from
vm.models
import
Instance
from
vm.models
import
Instance
from
.views
import
(
from
.views
import
(
IndexView
,
VmDetailView
,
VmList
,
VmCreate
,
TemplateDetail
,
AclUpdateView
,
IndexView
,
VmDetailView
,
VmList
,
VmCreate
,
TemplateDetail
,
AclUpdateView
,
VmDelete
,
VmMassDelete
,
vm_activity
)
VmDelete
,
VmMassDelete
,
vm_activity
,
NodeList
,
NodeDetailView
)
urlpatterns
=
patterns
(
urlpatterns
=
patterns
(
''
,
''
,
...
@@ -21,5 +21,9 @@ urlpatterns = patterns(
...
@@ -21,5 +21,9 @@ urlpatterns = patterns(
name
=
"dashboard.views.delete-vm"
),
name
=
"dashboard.views.delete-vm"
),
url
(
r'^vm/mass-delete/'
,
VmMassDelete
.
as_view
(),
url
(
r'^vm/mass-delete/'
,
VmMassDelete
.
as_view
(),
name
=
'dashboard.view.mass-delete-vm'
),
name
=
'dashboard.view.mass-delete-vm'
),
url
(
r'^vm/(?P<pk>\d+)/activity/$'
,
vm_activity
)
url
(
r'^vm/(?P<pk>\d+)/activity/$'
,
vm_activity
),
url
(
r'^node/list/$'
,
NodeList
.
as_view
(),
name
=
'dashboard.views.node-list'
),
url
(
r'^node/(?P<pk>\d+)/$'
,
NodeDetailView
.
as_view
(),
name
=
'dashboard.views.node-detail'
),
)
)
circle/dashboard/views.py
View file @
fd1eae32
...
@@ -18,9 +18,9 @@ from django.utils.translation import ugettext as _
...
@@ -18,9 +18,9 @@ from django.utils.translation import ugettext as _
from
django_tables2
import
SingleTableView
from
django_tables2
import
SingleTableView
from
.tables
import
VmListTable
from
.tables
import
(
VmListTable
,
NodeListTable
)
from
vm.models
import
(
Instance
,
InstanceTemplate
,
InterfaceTemplate
,
from
vm.models
import
(
Instance
,
InstanceTemplate
,
InterfaceTemplate
,
InstanceActivity
)
InstanceActivity
,
Node
)
from
firewall.models
import
Vlan
from
firewall.models
import
Vlan
from
storage.models
import
Disk
from
storage.models
import
Disk
...
@@ -276,6 +276,11 @@ class VmList(SingleTableView):
...
@@ -276,6 +276,11 @@ class VmList(SingleTableView):
table_class
=
VmListTable
table_class
=
VmListTable
table_pagination
=
False
table_pagination
=
False
class
NodeList
(
SingleTableView
):
template_name
=
"dashboard/node-list.html"
model
=
Node
table_class
=
NodeListTable
table_pagination
=
False
class
VmCreate
(
TemplateView
):
class
VmCreate
(
TemplateView
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment