Commit 41d99935 by Kálmán Viktor

dashboard: fail message for vms after ajax refresh

parent d5f44571
......@@ -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']);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment