Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
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() {
...
@@ -199,24 +199,24 @@ function decideActivityRefresh() {
return
check
;
return
check
;
}
}
function
checkNewActivity
(
only_stat
e
,
runs
)
{
function
checkNewActivity
(
only_stat
us
,
runs
)
{
// set default only_stat
e
to false
// set default only_stat
us
to false
only_stat
e
=
typeof
only_state
!==
'undefined'
?
only_state
:
false
;
only_stat
us
=
typeof
only_status
!==
'undefined'
?
only_status
:
false
;
var
instance
=
location
.
href
.
split
(
'/'
);
instance
=
instance
[
instance
.
length
-
2
];
var
instance
=
location
.
href
.
split
(
'/'
);
instance
=
instance
[
instance
.
length
-
2
];
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
url
:
'/dashboard/vm/'
+
instance
+
'/activity/'
,
url
:
'/dashboard/vm/'
+
instance
+
'/activity/'
,
data
:
{
'only_stat
e'
:
only_state
},
data
:
{
'only_stat
us'
:
only_status
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
!
only_stat
e
)
{
if
(
!
only_stat
us
)
{
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"[title]"
).
tooltip
();
$
(
"[title]"
).
tooltip
();
}
}
$
(
"#vm-details-state i"
).
prop
(
"class"
,
data
[
'icon'
]);
$
(
"#vm-details-state i"
).
prop
(
"class"
,
data
[
'icon'
]);
$
(
"#vm-details-state span"
).
html
(
data
[
'human_readable_stat
e
'
].
toUpperCase
());
$
(
"#vm-details-state span"
).
html
(
data
[
'human_readable_stat
us
'
].
toUpperCase
());
if
(
data
[
'stat
e
'
]
==
"RUNNING"
)
{
if
(
data
[
'stat
us
'
]
==
"RUNNING"
)
{
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"pill"
).
attr
(
"href"
,
"#console"
).
parent
(
"li"
).
removeClass
(
"disabled"
);
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"pill"
).
attr
(
"href"
,
"#console"
).
parent
(
"li"
).
removeClass
(
"disabled"
);
}
else
{
}
else
{
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"_pill"
).
attr
(
"href"
,
"#"
).
parent
(
"li"
).
addClass
(
"disabled"
);
$
(
"[data-target=#_console]"
).
attr
(
"data-toggle"
,
"_pill"
).
attr
(
"href"
,
"#"
).
parent
(
"li"
).
addClass
(
"disabled"
);
...
@@ -224,7 +224,7 @@ function checkNewActivity(only_state, runs) {
...
@@ -224,7 +224,7 @@ function checkNewActivity(only_state, runs) {
if
(
runs
>
0
&&
decideActivityRefresh
())
{
if
(
runs
>
0
&&
decideActivityRefresh
())
{
setTimeout
(
setTimeout
(
function
()
{
checkNewActivity
(
only_stat
e
,
runs
+
1
)},
function
()
{
checkNewActivity
(
only_stat
us
,
runs
+
1
)},
1000
+
Math
.
exp
(
runs
*
0.05
)
1000
+
Math
.
exp
(
runs
*
0.05
)
);
);
}
}
...
...
circle/dashboard/views.py
View file @
6554ddff
...
@@ -1613,12 +1613,12 @@ def vm_activity(request, pk):
...
@@ -1613,12 +1613,12 @@ def vm_activity(request, pk):
raise
PermissionDenied
()
raise
PermissionDenied
()
response
=
{}
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
[
'human_readable_stat
us
'
]
=
instance
.
get_status_display
()
response
[
'stat
e'
]
=
instance
.
state
response
[
'stat
us'
]
=
instance
.
status
response
[
'icon'
]
=
instance
.
get_status_icon
()
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
=
{
context
=
{
'activities'
:
InstanceActivity
.
objects
.
filter
(
'activities'
:
InstanceActivity
.
objects
.
filter
(
instance
=
instance
,
parent
=
None
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