Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
83fdaf87
authored
Oct 01, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: get ids from row selections in vm list
parent
1942bfb9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
circle/dashboard/tables.py
+2
-1
circle/dashboard/templates/dashboard/vm-list.html
+14
-1
circle/dashboard/templates/dashboard/vm-list/column-id.html
+1
-0
circle/dashboard/templates/dashboard/vm-list/test-one.html
+3
-1
No files found.
circle/dashboard/tables.py
View file @
83fdaf87
...
...
@@ -6,7 +6,8 @@ from django.utils.translation import ugettext_lazy as _
class
VmListTable
(
Table
):
pk
=
Column
(
pk
=
TemplateColumn
(
template_name
=
'dashboard/vm-list/column-id.html'
,
verbose_name
=
"ID"
,
attrs
=
{
'th'
:
{
'class'
:
'vm-list-table-thin'
}},
)
...
...
circle/dashboard/templates/dashboard/vm-list.html
View file @
83fdaf87
...
...
@@ -21,7 +21,7 @@
<p>
<strong>
Group actions
</strong>
<button
class=
"btn btn-info btn-xs"
disabled
>
Select all
</button>
<a
class=
"btn btn-default btn-xs"
disabled
><i
class=
"icon-truck"
></i>
Migrate
</a>
<a
class=
"btn btn-default btn-xs"
id=
"vm-list-group-migrate"
disabled
><i
class=
"icon-truck"
></i>
Migrate
</a>
<button
type=
"button"
class=
"btn btn-xs btn-warning dropdown-toggle"
data-toggle=
"dropdown"
disabled
>
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>
...
...
@@ -158,6 +158,11 @@ $(function() {
return
false
;
});
$('#
vm-list-group-migrate
').
click
(
function
()
{
console
.
log
(
collectIds
(
selected
));
});
$('.
vm-list-details
').
popover
({
'
placement
'
:
'
auto
',
'
html
'
:
true
,
...
...
@@ -180,6 +185,14 @@ $(function() {
});
});
function
collectIds
(
rows
)
{
var
ids =
[];
for
(
var
i =
0;
i
<
rows
.
length
;
i
++)
{
var
div =
$('td:first-child
div
',
$('.
vm-list-table
tbody
tr
').
eq
(
i
));
ids
.
push
(
div
.
prop
('
id
').
replace
('
vm-
',
''));
}
return
ids
;
}
function
setRowColor
(
row
)
{
if
(!
row
.
hasClass
('
vm-list-selected
'))
{
...
...
circle/dashboard/templates/dashboard/vm-list/column-id.html
0 → 100644
View file @
83fdaf87
<div
id=
"vm-{{ record.pk }}"
>
{{ record.pk }}
</div>
circle/dashboard/templates/dashboard/vm-list/test-one.html
View file @
83fdaf87
<tr>
<!--<td><input type="checkbox"/ class="vm-checkbox" id="vm-1825{{ c }}"></td>-->
<td>
182{{ c }}
</td>
<td>
<div
id=
"vm-1{{ c }}"
>
1{{ c }}
</div>
</td>
<td><a
href=
""
class=
"real-link"
>
network-devenv
</a></td>
<td>
running
</td>
<td>
10 days
</td>
...
...
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