Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
e22e8f62
authored
Apr 17, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: removing pk from js, changing tag colors
parent
0a7dbb2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
circle/dashboard/static/dashboard/dashboard.js
+1
-2
circle/dashboard/views.py
+0
-1
circle/vm/models/node.py
+3
-3
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
e22e8f62
...
@@ -234,7 +234,6 @@ $(function () {
...
@@ -234,7 +234,6 @@ $(function () {
for
(
var
i
in
result
)
{
for
(
var
i
in
result
)
{
console
.
log
(
result
[
i
]);
console
.
log
(
result
[
i
]);
my_nodes
.
push
({
my_nodes
.
push
({
'pk'
:
result
[
i
].
pk
,
'name'
:
result
[
i
].
name
.
toLowerCase
(),
'name'
:
result
[
i
].
name
.
toLowerCase
(),
'icon'
:
result
[
i
].
icon
,
'icon'
:
result
[
i
].
icon
,
'status'
:
result
[
i
].
status
,
'status'
:
result
[
i
].
status
,
...
@@ -274,7 +273,7 @@ $(function () {
...
@@ -274,7 +273,7 @@ $(function () {
// if there is only one result and ENTER is pressed redirect
// if there is only one result and ENTER is pressed redirect
if
(
e
.
keyCode
==
13
&&
search_result
.
length
==
1
)
{
if
(
e
.
keyCode
==
13
&&
search_result
.
length
==
1
)
{
window
.
location
.
href
=
"/dashboard/node/"
+
search_result
[
0
].
pk
+
"/"
;
window
.
location
.
href
=
search_result
[
0
].
url
;
}
}
if
(
e
.
keyCode
==
13
&&
search_result
.
length
>
1
&&
input
.
length
>
0
)
{
if
(
e
.
keyCode
==
13
&&
search_result
.
length
>
1
&&
input
.
length
>
0
)
{
window
.
location
.
href
=
"/dashboard/node/list/?s="
+
input
;
window
.
location
.
href
=
"/dashboard/node/list/?s="
+
input
;
...
...
circle/dashboard/views.py
View file @
e22e8f62
...
@@ -929,7 +929,6 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
...
@@ -929,7 +929,6 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
if
self
.
request
.
is_ajax
():
if
self
.
request
.
is_ajax
():
nodes
=
Node
.
objects
.
all
()
nodes
=
Node
.
objects
.
all
()
nodes
=
[{
nodes
=
[{
'pk'
:
i
.
pk
,
'name'
:
i
.
name
,
'name'
:
i
.
name
,
'icon'
:
i
.
get_status_icon
(),
'icon'
:
i
.
get_status_icon
(),
'url'
:
i
.
get_absolute_url
(),
'url'
:
i
.
get_absolute_url
(),
...
...
circle/vm/models/node.py
View file @
e22e8f62
...
@@ -278,9 +278,9 @@ class Node(OperatedMixin, TimeStampedModel):
...
@@ -278,9 +278,9 @@ class Node(OperatedMixin, TimeStampedModel):
def
get_status_label
(
self
):
def
get_status_label
(
self
):
return
{
return
{
'OFFLINE'
:
'label-
danger
'
,
'OFFLINE'
:
'label-
warning
'
,
'DISABLED'
:
'label-
danger
'
,
'DISABLED'
:
'label-
warning
'
,
'MISSING'
:
'label-
warning
'
,
'MISSING'
:
'label-
danger
'
,
'ONLINE'
:
'label-success'
}
.
get
(
self
.
get_state
(),
'ONLINE'
:
'label-success'
}
.
get
(
self
.
get_state
(),
'label-danger'
)
'label-danger'
)
...
...
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