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
41d99935
authored
Mar 12, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fail message for vms after ajax refresh
parent
d5f44571
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
circle/dashboard/static/dashboard/vm-details.js
+2
-0
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
+1
-1
circle/dashboard/views.py
+8
-4
No files found.
circle/dashboard/static/dashboard/vm-details.js
View file @
41d99935
...
...
@@ -209,8 +209,10 @@ function checkNewActivity(only_state, runs) {
url
:
'/dashboard/vm/'
+
instance
+
'/activity/'
,
data
:
{
'only_state'
:
only_state
},
success
:
function
(
data
)
{
console
.
log
(
data
[
'activities'
]);
if
(
!
only_state
)
{
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"[title]"
).
tooltip
();
}
$
(
"#vm-details-state"
).
html
(
data
[
'state'
]);
...
...
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
View file @
41d99935
...
...
@@ -12,7 +12,7 @@
<div
class=
"sub-timeline"
>
{% for s in a.children.all %}
<div
data-activity-id=
"{{ s.pk }}"
class=
"sub-activity{% if s.has_failed %} sub-activity-failed{% endif %}"
>
<span
{%
if
user
.
is_superuser
and
s
.
result
%}
title=
"{{ s.result }}"
{%
endif
%}
>
<span
{%
if
user
.
is_superuser
and
s
.
result
%}
title=
"{{ s.result }}"
{%
endif
%}
>
{{ s.get_readable_name }}
</span>
–
{% if s.finished %}
{{ s.finished|time:"H:i:s" }}
...
...
circle/dashboard/views.py
View file @
41d99935
...
...
@@ -24,6 +24,7 @@ from django.contrib import messages
from
django.utils.translation
import
ugettext
as
_
from
django.template.defaultfilters
import
title
from
django.template.loader
import
render_to_string
from
django.template
import
RequestContext
from
django.forms.models
import
inlineformset_factory
from
django_tables2
import
SingleTableView
...
...
@@ -1470,12 +1471,15 @@ def vm_activity(request, pk):
response
[
'state'
]
=
instance
.
state
if
only_state
is
not
None
and
only_state
==
"false"
:
# instance activity
print
"Sdsa"
context
=
{
'activities'
:
InstanceActivity
.
objects
.
filter
(
instance
=
instance
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()
}
activities
=
render_to_string
(
"dashboard/vm-detail/_activity-timeline.html"
,
{
'activities'
:
InstanceActivity
.
objects
.
filter
(
instance
=
instance
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()}
RequestContext
(
request
,
context
),
)
response
[
'activities'
]
=
activities
...
...
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