Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c4938eb6
authored
Feb 10, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: updating js for groups
parent
d2c2f0df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
circle/dashboard/static/dashboard/dashboard.js
+35
-7
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
c4938eb6
...
@@ -112,12 +112,12 @@ $(function () {
...
@@ -112,12 +112,12 @@ $(function () {
$
(
'.vm-delete'
).
click
(
function
()
{
$
(
'.vm-delete'
).
click
(
function
()
{
var
vm_pk
=
$
(
this
).
data
(
'vm-pk'
);
var
vm_pk
=
$
(
this
).
data
(
'vm-pk'
);
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
addModalConfirmation
(
delete
Vm
,
addModalConfirmation
(
delete
Object
,
{
'url'
:
'/dashboard/vm/delete/'
+
vm_pk
+
'/'
,
{
'url'
:
'/dashboard/vm/delete/'
+
vm_pk
+
'/'
,
'data'
:
[],
'data'
:
[],
'vm_pk'
:
vm_pk
,
'pk'
:
vm_pk
,
'type'
:
"vm"
,
'redirect'
:
dir
});
'redirect'
:
dir
});
return
false
;
return
false
;
});
});
...
@@ -125,10 +125,38 @@ $(function () {
...
@@ -125,10 +125,38 @@ $(function () {
$
(
'.node-delete'
).
click
(
function
()
{
$
(
'.node-delete'
).
click
(
function
()
{
var
node_pk
=
$
(
this
).
data
(
'node-pk'
);
var
node_pk
=
$
(
this
).
data
(
'node-pk'
);
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
addModalConfirmation
(
delete
Node
,
addModalConfirmation
(
delete
Object
,
{
'url'
:
'/dashboard/node/delete/'
+
node_pk
+
'/'
,
{
'url'
:
'/dashboard/node/delete/'
+
node_pk
+
'/'
,
'data'
:
[],
'data'
:
[],
'node_pk'
:
node_pk
,
'pk'
:
node_pk
,
'type'
:
"node"
,
'redirect'
:
dir
});
return
false
;
});
/* for Node removes buttons */
$
(
'.group-delete'
).
click
(
function
()
{
var
group_pk
=
$
(
this
).
data
(
'group-pk'
);
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
addModalConfirmation
(
deleteObject
,
{
'url'
:
'/dashboard/group/delete/'
+
group_pk
+
'/'
,
'data'
:
[],
'type'
:
"group"
,
'pk'
:
group_pk
,
'redirect'
:
dir
});
return
false
;
});
/* for Group removes buttons */
$
(
'.group-delete'
).
click
(
function
()
{
var
group_pk
=
$
(
this
).
data
(
'group-pk'
);
var
dir
=
window
.
location
.
pathname
.
indexOf
(
'list'
)
==
-
1
;
addModalConfirmation
(
deleteGroup
,
{
'url'
:
'/dashboard/group/delete/'
+
group_pk
+
'/'
,
'data'
:
[],
'group_pk'
:
group_pk
,
'redirect'
:
dir
});
'redirect'
:
dir
});
return
false
;
return
false
;
...
@@ -222,7 +250,7 @@ function refreshSliders() {
...
@@ -222,7 +250,7 @@ function refreshSliders() {
/* deletes the VM with the pk
/* deletes the VM with the pk
* if dir is true, then redirect to the dashboard landing page
* if dir is true, then redirect to the dashboard landing page
* else it adds a success message */
* else it adds a success message */
function
delete
Vm
(
data
)
{
function
delete
Object
(
data
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
data
:
{
'redirect'
:
data
[
'redirect'
]},
data
:
{
'redirect'
:
data
[
'redirect'
]},
...
@@ -232,7 +260,7 @@ function deleteVm(data) {
...
@@ -232,7 +260,7 @@ function deleteVm(data) {
if
(
!
data
[
'redirect'
])
{
if
(
!
data
[
'redirect'
])
{
selected
=
[];
selected
=
[];
addMessage
(
re
[
'message'
],
'success'
);
addMessage
(
re
[
'message'
],
'success'
);
$
(
'a[data-
vm-pk="'
+
data
[
'vm_
pk'
]
+
'"]'
).
closest
(
'tr'
).
fadeOut
(
function
()
{
$
(
'a[data-
'
+
data
[
'type'
]
+
'-pk="'
+
data
[
'
pk'
]
+
'"]'
).
closest
(
'tr'
).
fadeOut
(
function
()
{
$
(
this
).
remove
();
$
(
this
).
remove
();
});
});
}
else
{
}
else
{
...
...
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