Commit 7f6baffa by Őry Máté

dashboard: create activity on console access

parent 9a4d49e4
...@@ -182,12 +182,14 @@ class VmDetailVncTokenView(CheckedDetailView): ...@@ -182,12 +182,14 @@ class VmDetailVncTokenView(CheckedDetailView):
if not self.object.has_level(request.user, 'operator'): if not self.object.has_level(request.user, 'operator'):
raise PermissionDenied() raise PermissionDenied()
if self.object.node: if self.object.node:
port = self.object.vnc_port with instance_activity(code_suffix='console-accessed',
host = str(self.object.node.host.ipv4) instance=self.object, user=request.user,
value = signing.dumps({'host': host, concurrency_check=False):
'port': port}, port = self.object.vnc_port
key=getenv("PROXY_SECRET", 'asdasd')), host = str(self.object.node.host.ipv4)
return HttpResponse('vnc/?d=%s' % value) value = signing.dumps({'host': host, 'port': port},
key=getenv("PROXY_SECRET", 'asdasd')),
return HttpResponse('vnc/?d=%s' % value)
else: else:
raise Http404() raise Http404()
......
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