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
5a2fcb2f
authored
Mar 12, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add flush to view NodeDetails
parent
5c80450e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
circle/dashboard/templates/dashboard/node-list/column-admin.html
+1
-1
circle/dashboard/views.py
+20
-0
No files found.
circle/dashboard/templates/dashboard/node-list/column-admin.html
View file @
5a2fcb2f
...
...
@@ -4,4 +4,4 @@
<a
id=
"node-list-rename-button"
class=
"btn btn-default btn-xs"
title
data-original-title=
"Rename"
>
<i
class=
"icon-pencil"
></i>
</a>
circle/dashboard/views.py
View file @
5a2fcb2f
...
...
@@ -504,6 +504,8 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
return
self
.
__set_status
(
request
)
if
request
.
POST
.
get
(
'to_remove'
):
return
self
.
__remove_trait
(
request
)
if
request
.
POST
.
get
(
'flush'
):
return
self
.
__flush
(
request
)
return
redirect
(
reverse_lazy
(
"dashboard.views.node-detail"
,
kwargs
=
{
'pk'
:
self
.
get_object
()
.
pk
}))
...
...
@@ -529,6 +531,24 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
return
redirect
(
reverse_lazy
(
"dashboard.views.node-detail"
,
kwargs
=
{
'pk'
:
self
.
object
.
pk
}))
def
__flush
(
self
,
request
):
self
.
object
=
self
.
get_object
()
self
.
object
.
flush_async
(
user
=
request
.
user
)
success_message
=
_
(
"Node successfully flushed!"
)
if
request
.
is_ajax
():
response
=
{
'message'
:
success_message
,
'node_pk'
:
self
.
object
.
pk
}
return
HttpResponse
(
json
.
dumps
(
response
),
content_type
=
"application/json"
)
else
:
messages
.
success
(
request
,
success_message
)
return
redirect
(
reverse_lazy
(
"dashboard.views.node-detail"
,
kwargs
=
{
'pk'
:
self
.
object
.
pk
}))
def
__set_status
(
self
,
request
):
self
.
object
=
self
.
get_object
()
if
not
self
.
object
.
enabled
:
...
...
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