Commit bfe7a9b3 by Kálmán Viktor

dashboard: ipv6 and handling no open ports

parent 1d7255f3
......@@ -335,13 +335,12 @@ a.hover-black {
/* vm details connection */
.vm-details-connection dd {
padding-top: 8px;
padding: 4px 0 4px 0;
}
.vm-details-connection dt {
text-align: left;
padding-top: 8px;
padding-left: 15px;
padding: 4px 0 4px 15px;
}
#vm-details-pw-confirm {
......
......@@ -72,7 +72,19 @@
<dt>{% trans "Protocol" %}</dt>
<dd>{{ instance.access_method|upper }}</dd>
<dt>{% trans "Host" %}</dt>
<dd>{{ instance.get_connect_host }}:<strong>{{ instance.get_connect_port }}</strong></dd>
<dd>
{% if instance.get_connect_port %}
{{ instance.get_connect_host }}:<strong>{{ instance.get_connect_port }}</strong>
{% else %}
<strong>{% trans "The required port for this protocol is not forwarded." %}</strong>
{% endif %}
</dd>
{% if instance.ipv6 %}
<dt>{% trans "Host (IPv6)" %}</dt>
<dd>{{ ipv6_host }}:<strong>{{ instance.ipv6_port }}</strong></dd>
{% endif %}
<dt>{% trans "Username" %}</dt>
<dd>cloud</dd>
<dt>{% trans "Password" %}</dt>
......@@ -100,7 +112,10 @@
<div class="input-group">
<span class="input-group-addon input-tags">{% trans "Command" %}</span>
<input type="text" value="{{ instance.get_connect_command }}" id="vm-details-connection-string" class="form-control input-tags" />
<input type="text"
value="{% if instance.get_connect_command %}{{ instance.get_connect_command }}
{% else %}{% trans "Connection is not possible." %}{% endif %}"
id="vm-details-connection-string" class="form-control input-tags" />
<span class="input-group-addon input-tags" id="vm-details-connection-string-copy">
<i class="icon-copy" title="{% trans "Select all" %}"></i>
</span>
......
......@@ -249,6 +249,9 @@ class VmDetailView(CheckedDetailView):
}
context['os_type_icon'] = instance.os_type.replace("unknown",
"question")
# ipv6 infos
context['ipv6_host'] = instance.get_connect_host(use_ipv6=True)
context['ipv6_port'] = instance.get_connect_port(use_ipv6=True)
return context
def post(self, request, *args, **kwargs):
......
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