Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
b8927f46
authored
Nov 13, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: start activity panel in vm details
parent
3b0c7f0a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
circle/dashboard/templates/dashboard/vm-detail-activity.html
+22
-1
circle/dashboard/views.py
+10
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail-activity.html
View file @
b8927f46
{% load i18n %}
{% load i18n %}
<h3>
{% trans "Activity" %}
</h3>
<h3>
{% trans "Activity" %}
</h3>
<style>
.sub-timeline
{
border-left
:
3px
solid
green
;
margin-left
:
30px
;
padding-left
:
10px
;
}
</style>
<div
class=
"timeline"
>
<div
class=
"timeline"
>
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-remove"
></i></span>
<strong>
Removing
</strong>
2013-11-21 15:32
</div>
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-remove"
></i></span>
<strong>
Removing
</strong>
2013-11-21 15:32
</div>
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-pause"
></i></span>
<strong>
Suspending
</strong>
2013-09-21 15:32
</div>
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-pause"
></i></span>
<strong>
Suspending
</strong>
2013-09-21 15:32
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-ellipsis-vertical"
></i></span>
<strong>
(now)
</strong></div>
{% for a in activity %}
<div><span
class=
"timeline-icon"
><i
class=
"icon-plus"
></i></span>
<strong>
{{ a.get_readable_name }}
</strong>
{{ a.started|date:"Y-m-d. H:i" }}, {{ a.user }}
{% if a.instanceactivity_set.count > 0 %}
<div
class=
"sub-timeline"
>
{% for s in a.instanceactivity_set.all %}
{{ s.get_readable_name }} - {{ a.started|time:"H:i:s" }}
<br
/>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-remove"
></i></span>
<strong>
Removing
</strong>
2013-11-21 15:32
</div>
<div><span
class=
"timeline-icon timeline-warning"
><i
class=
"icon-pause"
></i></span>
<strong>
Suspending
</strong>
2013-09-21 15:32
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-ellipsis-vertical"
></i></span>
<strong>
(now)
</strong></div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-truck"
></i></span>
<strong>
Migrated to mega5
</strong>
2013-04-21 15:32, ABC123
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-truck"
></i></span>
<strong>
Migrated to mega5
</strong>
2013-04-21 15:32, ABC123
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-refresh"
></i></span>
<strong>
Forced reboot
</strong>
2013-04-21 15:32, ABC123
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-refresh"
></i></span>
<strong>
Forced reboot
</strong>
2013-04-21 15:32, ABC123
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-plus"
></i></span>
<strong>
Created
</strong>
2013-04-21 15:32, ABC123
</div>
<div><span
class=
"timeline-icon"
><i
class=
"icon-plus"
></i></span>
<strong>
Created
</strong>
2013-04-21 15:32, ABC123
</div>
...
...
circle/dashboard/views.py
View file @
b8927f46
...
@@ -19,7 +19,8 @@ from django.utils.translation import ugettext as _
...
@@ -19,7 +19,8 @@ from django.utils.translation import ugettext as _
from
django_tables2
import
SingleTableView
from
django_tables2
import
SingleTableView
from
.tables
import
VmListTable
from
.tables
import
VmListTable
from
vm.models
import
Instance
,
InstanceTemplate
,
InterfaceTemplate
from
vm.models
import
(
Instance
,
InstanceTemplate
,
InterfaceTemplate
,
InstanceActivity
)
from
firewall.models
import
Vlan
from
firewall.models
import
Vlan
from
storage.models
import
Disk
from
storage.models
import
Disk
...
@@ -88,6 +89,14 @@ class VmDetailView(CheckedDetailView):
...
@@ -88,6 +89,14 @@ class VmDetailView(CheckedDetailView):
context
.
update
({
context
.
update
({
'vnc_url'
:
'
%
s'
%
value
'vnc_url'
:
'
%
s'
%
value
})
})
# activity data
ia
=
InstanceActivity
.
objects
.
filter
(
instance
=
self
.
object
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()
context
[
'activity'
]
=
ia
for
i
in
ia
[
0
]
.
instanceactivity_set
.
all
():
print
i
context
[
'acl'
]
=
get_acl_data
(
instance
)
context
[
'acl'
]
=
get_acl_data
(
instance
)
return
context
return
context
...
...
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