Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
0c8fc223
authored
Aug 27, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-timeline-icons' into 'master'
Feature Timeline Icons
parents
50bdf11a
df43baaa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
6 deletions
+26
-6
circle/dashboard/templates/dashboard/instanceactivity_detail.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
+1
-1
circle/dashboard/views.py
+20
-4
circle/vm/models/activity.py
+4
-0
No files found.
circle/dashboard/templates/dashboard/instanceactivity_detail.html
View file @
0c8fc223
...
...
@@ -4,7 +4,7 @@
{% block content %}
<div
class=
"body-content"
>
<div
class=
"page-header"
>
<h1>
<h1>
<i
class=
"fa fa-{{icon}}"
></i>
{{ object.instance.name }}:
{% if user.is_superuser %}
{{object.readable_name.get_admin_text}}
...
...
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
View file @
0c8fc223
...
...
@@ -5,7 +5,7 @@
{% for a in activities %}
<div
class=
"activity{% if a.pk == active.pk %} activity-active{%endif%}"
data-activity-id=
"{{ a.pk }}"
>
<span
class=
"timeline-icon{% if a.has_failed %} timeline-icon-failed{% endif %}"
>
<i
class=
"fa {% if not a.finished %}fa-refresh fa-spin {% else %}fa-
plus
{% endif %}"
></i>
<i
class=
"fa {% if not a.finished %}fa-refresh fa-spin {% else %}fa-
{{a.icon}}
{% endif %}"
></i>
</span>
<strong
{%
if
a
.
result
%}
title=
"{{ a.result.get_user_text }}"
{%
endif
%}
>
<a
href=
"{{ a.get_absolute_url }}"
>
...
...
circle/dashboard/views.py
View file @
0c8fc223
...
...
@@ -309,7 +309,7 @@ class VmDetailView(CheckedDetailView):
activities
=
instance
.
get_merged_activities
(
user
)
show_show_all
=
len
(
activities
)
>
10
activities
=
activities
[:
10
]
context
[
'activities'
]
=
activities
context
[
'activities'
]
=
_format_activities
(
activities
)
context
[
'show_show_all'
]
=
show_show_all
latest
=
instance
.
get_latest_activity_in_progress
()
context
[
'is_new_state'
]
=
(
latest
and
...
...
@@ -2501,7 +2501,8 @@ def vm_activity(request, pk):
response
=
{}
show_all
=
request
.
GET
.
get
(
"show_all"
,
"false"
)
==
"true"
activities
=
instance
.
get_merged_activities
(
request
.
user
)
activities
=
_format_activities
(
instance
.
get_merged_activities
(
request
.
user
))
show_show_all
=
len
(
activities
)
>
10
if
not
show_all
:
activities
=
activities
[:
10
]
...
...
@@ -2958,6 +2959,20 @@ def get_disk_download_status(request, pk):
)
def
_get_activity_icon
(
act
):
op
=
act
.
get_operation
()
if
op
and
op
.
id
in
vm_ops
:
return
vm_ops
[
op
.
id
]
.
icon
else
:
return
"cog"
def
_format_activities
(
acts
):
for
i
in
acts
:
i
.
icon
=
_get_activity_icon
(
i
)
return
acts
class
InstanceActivityDetail
(
CheckedDetailView
):
model
=
InstanceActivity
context_object_name
=
'instanceactivity'
# much simpler to mock object
...
...
@@ -2968,8 +2983,9 @@ class InstanceActivityDetail(CheckedDetailView):
def
get_context_data
(
self
,
**
kwargs
):
ctx
=
super
(
InstanceActivityDetail
,
self
)
.
get_context_data
(
**
kwargs
)
ctx
[
'activities'
]
=
self
.
object
.
instance
.
get_activities
(
self
.
request
.
user
)
ctx
[
'activities'
]
=
_format_activities
(
self
.
object
.
instance
.
get_activities
(
self
.
request
.
user
))
ctx
[
'icon'
]
=
_get_activity_icon
(
self
.
object
)
return
ctx
...
...
circle/vm/models/activity.py
View file @
0c8fc223
...
...
@@ -190,6 +190,10 @@ class InstanceActivity(ActivityModel):
readable_name
=
readable_name
)
return
activitycontextimpl
(
act
,
on_abort
=
on_abort
,
on_commit
=
on_commit
)
def
get_operation
(
self
):
return
self
.
instance
.
get_operation_from_activity_code
(
self
.
activity_code
)
@contextmanager
def
instance_activity
(
code_suffix
,
instance
,
on_abort
=
None
,
on_commit
=
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