Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3ba5a9ce
authored
Sep 27, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix UI in vm listing
parent
c0ad4f0b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
15 deletions
+79
-15
circle/dashboard/tables.py
+21
-6
circle/dashboard/templates/dashboard/vm-list.html
+17
-0
circle/dashboard/templates/dashboard/vm-list/column-actions.html
+9
-1
circle/dashboard/templates/dashboard/vm-list/column-admin.html
+12
-1
circle/dashboard/templates/dashboard/vm-list/column-details.html
+14
-2
circle/dashboard/templates/dashboard/vm-list/test-one.html
+5
-5
circle/dashboard/views.py
+1
-0
No files found.
circle/dashboard/tables.py
View file @
3ba5a9ce
...
@@ -6,12 +6,27 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -6,12 +6,27 @@ from django.utils.translation import ugettext_lazy as _
class
VmListTable
(
Table
):
class
VmListTable
(
Table
):
name
=
LinkColumn
(
'dashboard.views.detail'
,
args
=
[
A
(
'pk'
)])
pk
=
Column
(
admin
=
TemplateColumn
(
template_name
=
'dashboard/vm-list/column-admin.html'
)
verbose_name
=
"ID"
,
details
=
TemplateColumn
(
template_name
=
attrs
=
{
'th'
:
{
'class'
:
'vm-list-table-thin'
}},
'dashboard/vm-list/column-details.html'
)
)
actions
=
TemplateColumn
(
template_name
=
name
=
LinkColumn
(
'dashboard/vm-list/column-actions.html'
)
'dashboard.views.detail'
,
args
=
[
A
(
'pk'
)],
attrs
=
{
'class'
:
'real-link'
}
)
admin
=
TemplateColumn
(
template_name
=
'dashboard/vm-list/column-admin.html'
,
attrs
=
{
'th'
:
{
'class'
:
'vm-list-table-admin'
}},
)
details
=
TemplateColumn
(
template_name
=
'dashboard/vm-list/column-details.html'
,
attrs
=
{
'th'
:
{
'class'
:
'vm-list-table-thin'
}},
)
actions
=
TemplateColumn
(
template_name
=
'dashboard/vm-list/column-actions.html'
,
attrs
=
{
'th'
:
{
'class'
:
'vm-list-table-thin'
}},
)
time_of_suspend
=
TemplateColumn
(
time_of_suspend
=
TemplateColumn
(
'{{ record.time_of_suspend|timesince }}'
,
'{{ record.time_of_suspend|timesince }}'
,
verbose_name
=
_
(
"Suspend in"
))
verbose_name
=
_
(
"Suspend in"
))
...
...
circle/dashboard/templates/dashboard/vm-list.html
View file @
3ba5a9ce
...
@@ -71,6 +71,14 @@
...
@@ -71,6 +71,14 @@
.vm-list-selected
td
:first-child
{
.vm-list-selected
td
:first-child
{
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.vm-list-table-thin
{
width
:
10px
;
}
.vm-list-table-admin
{
width
:
130px
;
}
</style>
</style>
{% endblock %}
{% endblock %}
...
@@ -106,6 +114,15 @@ $(function() {
...
@@ -106,6 +114,15 @@ $(function() {
'trigger': 'click'
'trigger': 'click'
});
});
$('tbody a').click(function(e) {
// parent tr doesn't get selected when clicked
e.stopPropagation();
// browser doesn't jump to top when clicked the buttons
if(!$(this).hasClass('real-link')) {
return false;
}
});
/*
/*
$('#check_all').click(function() {
$('#check_all').click(function() {
var checked = $(this).prop('checked');
var checked = $(this).prop('checked');
...
...
circle/dashboard/templates/dashboard/vm-list/column-actions.html
View file @
3ba5a9ce
sziahello
<div
class=
"btn-group"
>
<button
type=
"button"
class=
"btn btn-xs btn-warning 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>
circle/dashboard/templates/dashboard/vm-list/column-admin.html
View file @
3ba5a9ce
admin
<a
class=
"btn btn-default btn-xs"
title
data-original-title=
"Migrate"
>
<i
class=
"icon-truck"
></i>
</a>
<a
class=
"btn btn-default btn-xs"
title
data-original-title=
"Rename"
>
<i
class=
"icon-pencil"
></i>
</a>
<a
href=
"#"
class=
"btn btn-default btn-xs vm-list-connect"
data-toggle=
"popover"
data-content=
'
Belépés: <input style="width: 300px;" type="text" class="form-control" value="ssh cloud@vm.ik.bme.hu -p22312"/>
Jelszó: <input style="width: 300px;" type="text" class="form-control" value="asdfkicsiasdfkocsi"/>
'
>
Connect
</a>
circle/dashboard/templates/dashboard/vm-list/column-details.html
View file @
3ba5a9ce
detail
<a
class=
"btn btn-info btn-xs vm-list-details"
href=
"#"
data-toggle=
"popover"
data-content=
'
<h4>Quick details</h4>
<dl class="dl-horizontal">
<dt>Number of cores:</dt><dd>{{ record.num_cores }}</dd>
<dt>Memory:</dt> <dd>{{ record.ram_size }} Mebibytes</dd>
<dt>Architecture:</td><dd>{{ record.arch }}</dd>
</dl>
<dl>
<dt>IPv4 address:</dt><dd>{{ record.ipv4 }}10.9.8.7</dd>
<dt>IPv6 address:</dt><dd> 2001:2001:2001:2001:2001:2001::</dd>
<dt>DNS name:</dt><dd>1825.vm.ik.bme.hu</dd>
</ul>
'
>
Details
</a>
circle/dashboard/templates/dashboard/vm-list/test-one.html
View file @
3ba5a9ce
...
@@ -2,17 +2,17 @@
...
@@ -2,17 +2,17 @@
<tr>
<tr>
<!--<td><input type="checkbox"/ class="vm-checkbox" id="vm-1825{{ c }}"></td>-->
<!--<td><input type="checkbox"/ class="vm-checkbox" id="vm-1825{{ c }}"></td>-->
<td>
182{{ c }}
</td>
<td>
182{{ c }}
</td>
<td><a
href=
""
>
network-devenv
</a></td>
<td><a
href=
""
class=
"real-link"
>
network-devenv
</a></td>
<td>
running
</td>
<td>
running
</td>
<td>
10 days
</td>
<td>
10 days
</td>
<td>
1 month
</td>
<td>
1 month
</td>
<td>
<td>
<
span
class=
"btn btn-default btn-xs"
title
data-original-title=
"Migrate"
>
<
a
class=
"btn btn-default btn-xs"
title
data-original-title=
"Migrate"
>
<i
class=
"icon-truck"
></i>
<i
class=
"icon-truck"
></i>
</
span
>
</
a
>
<
span
class=
"btn btn-default btn-xs"
title
data-original-title=
"Rename"
>
<
a
class=
"btn btn-default btn-xs"
title
data-original-title=
"Rename"
>
<i
class=
"icon-pencil"
></i>
<i
class=
"icon-pencil"
></i>
</
span
>
</
a
>
<a
href=
"#"
class=
"btn btn-default btn-xs vm-list-connect"
data-toggle=
"popover"
<a
href=
"#"
class=
"btn btn-default btn-xs vm-list-connect"
data-toggle=
"popover"
data-content=
'
data-content=
'
Belépés: <input style="width: 300px;" type="text" class="form-control" value="ssh cloud@vm.ik.bme.hu -p22312"/>
Belépés: <input style="width: 300px;" type="text" class="form-control" value="ssh cloud@vm.ik.bme.hu -p22312"/>
...
...
circle/dashboard/views.py
View file @
3ba5a9ce
...
@@ -45,3 +45,4 @@ class VmList(SingleTableView):
...
@@ -45,3 +45,4 @@ class VmList(SingleTableView):
template_name
=
"dashboard/vm-list.html"
template_name
=
"dashboard/vm-list.html"
model
=
Instance
model
=
Instance
table_class
=
VmListTable
table_class
=
VmListTable
table_pagination
=
False
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