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
f068fe84
authored
Mar 25, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-115' into 'master'
Issue 115 Fixes issue #115 + node js cleanup
parents
8a7407ff
77309d9b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
42 deletions
+12
-42
circle/dashboard/static/dashboard/node-details.js
+1
-3
circle/dashboard/static/dashboard/node-list.js
+7
-37
circle/dashboard/templates/dashboard/confirm/mass-delete.html
+1
-0
circle/dashboard/templates/dashboard/node-list/column-actions.html
+2
-2
circle/dashboard/templates/dashboard/node-list/column-admin.html
+1
-0
No files found.
circle/dashboard/static/dashboard/node-details.js
View file @
f068fe84
...
...
@@ -48,9 +48,7 @@ function changeNodeStatus(data) {
if
(
!
data
[
'redirect'
])
{
selected
=
[];
addMessage
(
re
[
'message'
],
'success'
);
$
(
'a[data-'
+
data
[
'type'
]
+
'-pk="'
+
data
[
'pk'
]
+
'"]'
).
closest
(
'tr'
).
fadeOut
(
function
()
{
$
(
this
).
remove
();
});
}
else
{
window
.
location
.
replace
(
'/dashboard'
);
}
...
...
circle/dashboard/static/dashboard/node-list.js
View file @
f068fe84
...
...
@@ -132,8 +132,7 @@ $(function() {
return
false
;
});
function
enabletableSuccess
(
unit
){
var
tr
=
$
(
unit
).
closest
(
"tr"
);
function
statuschangeSuccess
(
tr
){
var
tspan
=
tr
.
children
(
'.enabled'
).
children
();
var
buttons
=
tr
.
children
(
'.actions'
).
children
(
'.btn-group'
).
children
(
'.dropdown-menu'
).
children
(
'li'
).
children
(
'.node-enable'
);
...
...
@@ -158,54 +157,25 @@ $(function() {
colortable
();
}
function
enabledetailsSuccess
(){
// change big status span
$
(
'#node-info-pane'
).
load
(
location
.
href
+
" #node-info-data"
);
$
(
'#activity-timeline-wrapper'
).
load
(
location
.
href
+
" #activity-timeline"
);
}
$
(
'#table_container'
).
on
(
'click'
,
'.node-enable'
,
function
()
{
enablenode
(
$
(
this
).
attr
(
'data-node-pk'
),
$
(
this
).
attr
(
'data-status'
),
enabletableSuccess
,
this
);
return
false
;
});
// on node details, change node status, with calling enable node, refresh status span, resources div
$
(
'#node-info-pane'
).
on
(
'click'
,
'.node-enable'
,
function
(){
// post, change node status
enablenode
(
$
(
this
).
attr
(
'data-node-pk'
),
$
(
this
).
attr
(
'data-status'
),
enabledetailsSuccess
);
return
false
;
});
// enabling / disabling node
function
enablenode
(
pk
,
new_status
,
onsuccess
,
params
)
{
var
url
=
'/dashboard/node/'
+
pk
+
'/'
;
var
tr
=
$
(
this
).
closest
(
"tr"
);
var
pk
=
$
(
this
).
attr
(
'data-node-pk'
);
var
url
=
$
(
this
).
attr
(
'href'
);
$
.
ajax
({
method
:
'POST'
,
url
:
url
,
data
:
{
'
new_status'
:
new_status
},
data
:
{
'
change_status'
:
''
},
headers
:
{
"X-CSRFToken"
:
getCookie
(
'csrftoken'
)},
success
:
function
(
data
,
textStatus
,
xhr
)
{
onsuccess
(
params
);
statuschangeSuccess
(
tr
);
},
error
:
function
(
xhr
,
textStatus
,
error
)
{
addMessage
(
"Error!"
,
"danger"
);
}
});
return
false
;
}
// refresh the given contents, parameter is the array of contents, in pair
function
contentrefresh
(
elements
,
callbacks
){
for
(
var
i
=
0
;
i
<
elements
.
length
;
i
+=
2
)
{
$
(
elements
[
i
]).
load
(
location
.
href
+
" "
+
elements
[
i
+
1
],
callbacks
[
i
/
2
]);
}
}
});
/* group actions */
...
...
circle/dashboard/templates/dashboard/confirm/mass-delete.html
View file @
f068fe84
{% load i18n %}
<div
class=
"modal fade"
id=
"confirmation-modal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
...
...
circle/dashboard/templates/dashboard/node-list/column-actions.html
View file @
f068fe84
...
...
@@ -4,8 +4,8 @@
<ul
class=
"dropdown-menu nojs-dropdown-toogle"
role=
"menu"
>
<li><a
href=
"#"
class=
"node-details-rename-button"
><i
class=
"icon-pencil"
></i>
{% trans "Rename" %}
</a></li>
<li><a
data-node-pk=
"{{ record.pk }}"
class=
"real-link node-flush"
href=
"{% url "
dashboard
.
views
.
flush-node
"
pk=
record.pk
%}"
><i
class=
"icon-cloud-upload"
></i>
{% trans "Flush" %}
</a>
<li><a
style=
{%
if
record
.
enabled
%}"
display:none
"{%
else
%}"
display:block
"{%
endif
%}
data-
status=
"enable"
data-node-pk=
"{{ record.pk }}"
class=
"real-link node-enable"
href=
"{% url "
dashboard
.
views
.
status-node
"
pk=
record.pk
%}?
next=
{{
request
.
path
}}&
status=
enable
"
><i
class=
"icon-check"
></i>
{% trans "Enable" %}
</a>
<a
style=
{%
if
record
.
enabled
%}"
display:block
"{%
else
%}"
display:none
"{%
endif
%}
data-
status=
"disable"
data-node-pk=
"{{ record.pk }}"
class=
"real-link node-enable"
href=
"{% url "
dashboard
.
views
.
status-node
"
pk=
record.pk
%}?
next=
{{
request
.
path
}}&
status=
disable
"
><i
class=
"icon-remove"
></i>
{% trans "Disable" %}
</a></li>
<li><a
style=
{%
if
record
.
enabled
%}"
display:none
"{%
else
%}"
display:block
"{%
endif
%}
data-
node-pk=
"{{ record.pk }}"
class=
"real-link node-enable"
href=
"{% url "
dashboard
.
views
.
status-node
"
pk=
record.pk
%}?
next=
{{
request
.
path
}}
"
><i
class=
"icon-check"
></i>
{% trans "Enable" %}
</a>
<a
style=
{%
if
record
.
enabled
%}"
display:block
"{%
else
%}"
display:none
"{%
endif
%}
data-
node-pk=
"{{ record.pk }}"
class=
"real-link node-enable"
href=
"{% url "
dashboard
.
views
.
status-node
"
pk=
record.pk
%}?
next=
{{
request
.
path
}}
"
><i
class=
"icon-remove"
></i>
{% trans "Disable" %}
</a></li>
<li><a
data-node-pk=
"{{ record.pk }}"
class=
"real-link node-delete"
href=
"{% url "
dashboard
.
views
.
delete-node
"
pk=
record.pk
%}?
next=
{{
request
.
path
}}"
><i
class=
"icon-trash"
></i>
{% trans "Delete" %}
</a></li>
</ul>
</div>
circle/dashboard/templates/dashboard/node-list/column-admin.html
View file @
f068fe84
{% load i18n %}
<a
class=
"btn btn-default btn-xs"
title=
"{% trans "
Flush
"
%}"
>
<i
class=
"icon-cloud-upload"
></i>
</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