Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
15d45d3c
authored
Nov 14, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: make select all button work in vm list
parent
73536165
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
circle/dashboard/static/dashboard/vm-list.js
+17
-3
circle/dashboard/templates/dashboard/vm-list.html
+1
-1
No files found.
circle/dashboard/static/dashboard/vm-list.js
View file @
15d45d3c
...
@@ -46,12 +46,12 @@ $(function() {
...
@@ -46,12 +46,12 @@ $(function() {
$
(
'.vm-list-table tbody tr .btn'
).
attr
(
'disabled'
,
false
);
$
(
'.vm-list-table tbody tr .btn'
).
attr
(
'disabled'
,
false
);
// show/hide group controls
// show/hide group controls
if
(
selected
.
length
>
1
)
{
if
(
selected
.
length
>
1
)
{
$
(
'.vm-list-group-control
.btn
'
).
attr
(
'disabled'
,
false
);
$
(
'.vm-list-group-control
a
'
).
attr
(
'disabled'
,
false
);
for
(
var
i
=
0
;
i
<
selected
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
selected
.
length
;
i
++
)
{
$
(
'.vm-list-table tbody tr'
).
eq
(
selected
[
i
]).
find
(
'.btn'
).
attr
(
'disabled'
,
true
);
$
(
'.vm-list-table tbody tr'
).
eq
(
selected
[
i
]).
find
(
'.btn'
).
attr
(
'disabled'
,
true
);
}
}
}
else
{
}
else
{
$
(
'.vm-list-group-control
.btn
'
).
attr
(
'disabled'
,
true
);
$
(
'.vm-list-group-control
a
'
).
attr
(
'disabled'
,
true
);
}
}
return
false
;
return
false
;
});
});
...
@@ -87,6 +87,19 @@ $(function() {
...
@@ -87,6 +87,19 @@ $(function() {
/* group actions */
/* group actions */
/* select all */
$
(
'#vm-list-group-select-all'
).
click
(
function
()
{
$
(
'.vm-list-table tbody tr'
).
each
(
function
()
{
var
index
=
$
(
this
).
index
();
if
(
selected
.
indexOf
(
index
)
<
0
)
{
selected
.
push
(
index
);
$
(
this
).
addClass
(
'vm-list-selected'
);
}
});
console
.
log
(
selected
);
return
false
;
});
/* mass vm delete */
/* mass vm delete */
$
(
'#vm-list-group-delete'
).
click
(
function
()
{
$
(
'#vm-list-group-delete'
).
click
(
function
()
{
$
.
ajax
({
$
.
ajax
({
...
@@ -100,7 +113,8 @@ $(function() {
...
@@ -100,7 +113,8 @@ $(function() {
$
(
'.vm-list-table tbody tr'
).
eq
(
selected
[
i
]).
fadeOut
(
500
,
function
()
{
$
(
'.vm-list-table tbody tr'
).
eq
(
selected
[
i
]).
fadeOut
(
500
,
function
()
{
// reset group buttons
// reset group buttons
selected
=
[]
selected
=
[]
$
(
'.vm-list-group-control .btn'
).
attr
(
'disabled'
,
true
);
$
(
'.vm-list-group-control a'
).
attr
(
'disabled'
,
true
);
$
(
this
).
remove
();
addMessage
(
data
[
'message'
],
'success'
);
addMessage
(
data
[
'message'
],
'success'
);
});
});
},
},
...
...
circle/dashboard/templates/dashboard/vm-list.html
View file @
15d45d3c
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div
class=
"panel-body vm-list-group-control"
>
<div
class=
"panel-body vm-list-group-control"
>
<p>
<p>
<strong>
Group actions
</strong>
<strong>
Group actions
</strong>
<button
class=
"btn btn-info btn-xs"
disabled
>
Select all
</button>
<button
id=
"vm-list-group-select-all"
class=
"btn btn-info btn-xs"
>
Select all
</button>
<a
class=
"btn btn-default btn-xs"
id=
"vm-list-group-migrate"
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>
<a
disabled
href=
"#"
class=
"btn btn-default btn-xs"
><i
class=
"icon-refresh"
></i>
Reboot
</a>
<a
disabled
href=
"#"
class=
"btn btn-default btn-xs"
><i
class=
"icon-refresh"
></i>
Reboot
</a>
<a
disabled
href=
"#"
class=
"btn btn-default btn-xs"
><i
class=
"icon-off"
></i>
Shutdown
</a>
<a
disabled
href=
"#"
class=
"btn btn-default btn-xs"
><i
class=
"icon-off"
></i>
Shutdown
</a>
...
...
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