Merge "Use commonized serial console"
This commit is contained in:
commit
1efb2069dd
@ -15,15 +15,16 @@ from zun_ui.api import client
|
|||||||
|
|
||||||
|
|
||||||
class SerialConsoleView(generic.TemplateView):
|
class SerialConsoleView(generic.TemplateView):
|
||||||
template_name = 'project/instances/serial_console.html'
|
template_name = 'serial_console.html'
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(SerialConsoleView, self).get_context_data(**kwargs)
|
context = super(SerialConsoleView, self).get_context_data(**kwargs)
|
||||||
context['container_id'] = self.kwargs['container_id']
|
context['page_title'] = self.kwargs['container_id']
|
||||||
try:
|
try:
|
||||||
console_url = client.container_attach(self.request,
|
console_url = client.container_attach(self.request,
|
||||||
self.kwargs['container_id'])
|
self.kwargs['container_id'])
|
||||||
context["console_url"] = console_url
|
context["console_url"] = console_url
|
||||||
|
context["protocols"] = "['binary', 'base64']"
|
||||||
except Exception:
|
except Exception:
|
||||||
context["error_message"] = "Cannot get console for container %s." \
|
context["error_message"] = "Cannot get console for container %s." \
|
||||||
% self.kwargs['container_id']
|
% self.kwargs['container_id']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user