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
6554ddff
authored
Apr 04, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: rename state variable names to status in views and js
parent
d0f18ec8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
circle/dashboard/static/dashboard/vm-details.js
+8
-8
circle/dashboard/views.py
+4
-4
No files found.
circle/dashboard/static/dashboard/vm-details.js
View file @
6554ddff
...
...
@@ -199,24 +199,24 @@ function decideActivityRefresh() {
return
check
;
}
function
checkNewActivity
(
only_stat
e
,
runs
)
{
// set default only_stat
e
to false
only_stat
e
=
typeof
only_state
!==
'undefined'
?
only_state
:
false
;
function
checkNewActivity
(
only_stat
us
,
runs
)
{
// set default only_stat
us
to false
only_stat
us
=
typeof
only_status
!==
'undefined'
?
only_status
:
false
;
var
instance
=
location
.
href
.
split
(
'/'
);
instance
=
instance
[
instance
.
length
-
2
];
$
.
ajax
({
type
:
'GET'
,
url
:
'/dashboard/vm/'
+
instance
+
'/activity/'
,
data
:
{
'only_stat
e'
:
only_state
},
data
:
{
'only_stat
us'
:
only_status
},
success
:
function
(
data
)
{
if
(
!
only_stat
e
)
{
if
(
!
only_stat
us
)
{
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"[title]"
).
tooltip
();
}
$
(
"#vm-details-state i"
).
prop
(
"class"
,
data
[
'icon'
]);
$
(
"#vm-details-state span"
).
html
(
data
[
'human_readable_stat
e
'
].
toUpperCase
());
if
(
data
[
'stat
e
'
]
==
"RUNNING"
)
{
$
(
"#vm-details-state span"
).
html
(
data
[
'human_readable_stat
us
'
].
toUpperCase
());
if
(
data
[
'stat
us
'
]
==
"RUNNING"
)
{
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"pill"
).
attr
(
"href"
,
"#console"
).
parent
(
"li"
).
removeClass
(
"disabled"
);
}
else
{
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"_pill"
).
attr
(
"href"
,
"#"
).
parent
(
"li"
).
addClass
(
"disabled"
);
...
...
@@ -224,7 +224,7 @@ function checkNewActivity(only_state, runs) {
if
(
runs
>
0
&&
decideActivityRefresh
())
{
setTimeout
(
function
()
{
checkNewActivity
(
only_stat
e
,
runs
+
1
)},
function
()
{
checkNewActivity
(
only_stat
us
,
runs
+
1
)},
1000
+
Math
.
exp
(
runs
*
0.05
)
);
}
...
...
circle/dashboard/views.py
View file @
6554ddff
...
...
@@ -1613,12 +1613,12 @@ def vm_activity(request, pk):
raise
PermissionDenied
()
response
=
{}
only_stat
e
=
request
.
GET
.
get
(
"only_state
"
)
only_stat
us
=
request
.
GET
.
get
(
"only_status
"
)
response
[
'human_readable_stat
e
'
]
=
instance
.
get_status_display
()
response
[
'stat
e'
]
=
instance
.
state
response
[
'human_readable_stat
us
'
]
=
instance
.
get_status_display
()
response
[
'stat
us'
]
=
instance
.
status
response
[
'icon'
]
=
instance
.
get_status_icon
()
if
only_stat
e
is
not
None
and
only_state
==
"false"
:
# instance activity
if
only_stat
us
==
"false"
:
# instance activity
context
=
{
'activities'
:
InstanceActivity
.
objects
.
filter
(
instance
=
instance
,
parent
=
None
...
...
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