Revision 1c922789
b/ui/static/main.css | ||
---|---|---|
4357 | 4357 |
width: 600px; |
4358 | 4358 |
} |
4359 | 4359 |
|
4360 |
.overlay a { |
|
4361 |
color: #387693; |
|
4362 |
} |
|
4363 |
|
|
4360 | 4364 |
.overlay .overlay-content .description.subinfo { |
4361 | 4365 |
margin-bottom:0; |
4362 | 4366 |
border-bottom: none; |
... | ... | |
5358 | 5362 |
border-bottom: 1px solid #A1C8DB; |
5359 | 5363 |
padding-bottom: 20px; |
5360 | 5364 |
} |
5365 |
|
|
5366 |
.vm-connect .connection-info { |
|
5367 |
padding-bottom: 0px; |
|
5368 |
margin-bottom: 0; |
|
5369 |
border-bottom: none; |
|
5370 |
} |
|
5371 |
|
|
5372 |
.vm-connect .connection-info .connect a { |
|
5373 |
color: #fff; |
|
5374 |
} |
|
5375 |
|
|
5376 |
.vm-connect .connection-info .connect { |
|
5377 |
background-color: #387693; |
|
5378 |
color: #fff; |
|
5379 |
padding: 10px; |
|
5380 |
font-size: 1.2em; |
|
5381 |
text-align: center; |
|
5382 |
} |
b/ui/static/snf/js/models.js | ||
---|---|---|
953 | 953 |
|
954 | 954 |
get_action_url: function(name) { |
955 | 955 |
return this.url() + "/action"; |
956 |
}, |
|
957 |
|
|
958 |
get_connection_info: function(host_os, success, error) { |
|
959 |
var url = "/machines/connect"; |
|
960 |
params = { |
|
961 |
ip_address: this.get_addresses().ip4, |
|
962 |
os: this.get_os(), |
|
963 |
host_os: host_os, |
|
964 |
srv: this.id |
|
965 |
} |
|
966 |
|
|
967 |
url = url + "?" + $.param(params); |
|
968 |
|
|
969 |
var ajax = snf.api.sync("read", undefined, { url: url, |
|
970 |
error:error, |
|
971 |
success:success, |
|
972 |
handles_error:1}); |
|
956 | 973 |
} |
957 | 974 |
}) |
958 | 975 |
|
b/ui/static/snf/js/ui/web/ui_connect_view.js | ||
---|---|---|
28 | 28 |
|
29 | 29 |
initialize: function(options) { |
30 | 30 |
views.VMConnectView.__super__.initialize.apply(this); |
31 |
_.bindAll(this, "handle_success", "handle_error"); |
|
32 |
|
|
33 |
this.error = this.$("div.error"); |
|
34 |
this.info = this.$("div.connection-info"); |
|
35 |
this.description = this.info.find(".description p"); |
|
36 |
this.connect = this.info.find(".connect p"); |
|
37 |
this.subinfo = this.info.find(".subinfo"); |
|
38 |
}, |
|
39 |
|
|
40 |
handle_success: function(data) { |
|
41 |
this.error.hide(); |
|
42 |
this.info.show(); |
|
43 |
this.description.html(data.info); |
|
44 |
if (data.ssh) { |
|
45 |
this.connect.html(data.link.title); |
|
46 |
} else { |
|
47 |
this.connect.html('<a href="{0}">{1}</a>'.format(data.link.url, data.link.title)) |
|
48 |
} |
|
49 |
|
|
50 |
this.subinfo.html(data.subinfo).show(); |
|
51 |
if (!data.subinfo) { this.subinfo.hide() }; |
|
52 |
|
|
53 |
}, |
|
54 |
|
|
55 |
handle_error: function() { |
|
56 |
this.error.show(); |
|
57 |
this.info.hide(); |
|
31 | 58 |
}, |
32 | 59 |
|
33 | 60 |
handle_vm_change: function(vm) { |
... | ... | |
38 | 65 |
}, |
39 | 66 |
|
40 | 67 |
update_vm_details: function() { |
68 |
}, |
|
69 |
|
|
70 |
show: function() { |
|
71 |
views.VMConnectView.__super__.show.apply(this, arguments); |
|
72 |
|
|
73 |
this.error.hide(); |
|
74 |
this.info.hide(); |
|
75 |
|
|
76 |
this.vm.get_connection_info($.client.os, this.handle_success, this.handle_error) |
|
41 | 77 |
} |
42 | 78 |
|
43 | 79 |
}); |
b/ui/static/snf/js/ui/web/ui_icon_view.js | ||
---|---|---|
250 | 250 |
|
251 | 251 |
case "click": |
252 | 252 |
//logo.addCLass('single-image-state4'); |
253 |
this.view.connect_to_console(vm); |
|
254 |
//this.view.connect_overlay.show(this.vm);
|
|
253 |
//this.view.connect_to_console(vm);
|
|
254 |
this.view.connect_overlay.show(this.vm); |
|
255 | 255 |
break; |
256 | 256 |
|
257 | 257 |
default: |
b/ui/templates/partials/vm_connect.html | ||
---|---|---|
1 | 1 |
{% load i18n %} |
2 |
<div id="vm-connect-overlay-content" class="hidden vm-connect"> |
|
3 |
<div class="connect-cont"> |
|
4 |
<h4>{% trans "Connection details" %}</h4> |
|
5 |
<div class="desc"> |
|
6 |
<p>{% blocktrans %}Blah blah blha lbha blahb glbh{% endblocktrans %}</p> |
|
7 |
</div> |
|
8 |
<div class="ips"> |
|
9 |
<div class="ip-cont"> |
|
10 |
<span class="title">IP v4</span> |
|
11 |
<span class="value ipv4">195.2.2.12</span> |
|
12 |
</div> |
|
13 |
<div class="ip-cont"> |
|
14 |
<span class="title">IP v4</span> |
|
15 |
<span class="value ipv6">2001:db8::a800:ff:fe4e:ccd2</span> |
|
16 |
</div> |
|
17 |
</div> |
|
2 |
<div id="vm-connect-overlay-content" class="hidden vm-connect overlay-content"> |
|
3 |
<div class="error hidden description"> |
|
4 |
<p>{% trans "Cannot retrieve machine connection infromation" %}</p> |
|
18 | 5 |
</div> |
19 |
<div class="connect-cont"> |
|
20 |
<h4>{% trans "Connect using SSH" %}</h4> |
|
21 |
<div class="desc"> |
|
22 |
<p>{% blocktrans %}Blah blah blha lbha blahb glbh{% endblocktrans %}</p> |
|
6 |
<div class="connection-info connect-cont"> |
|
7 |
<div class="description"> |
|
8 |
<p></p> |
|
23 | 9 |
</div> |
24 |
<div class="ips"> |
|
25 |
<div class="ip-cont"> |
|
26 |
<span class="title">IP v4</span> |
|
27 |
<span class="value ipv4">195.2.2.12</span> |
|
28 |
</div> |
|
29 |
<div class="ip-cont"> |
|
30 |
<span class="title">IP v4</span> |
|
31 |
<span class="value ipv6">2001:db8::a800:ff:fe4e:ccd2</span> |
|
32 |
</div> |
|
33 |
</div> |
|
34 |
</div> |
|
35 |
<div class="connect-cont"> |
|
36 |
<h4>{% trans "Connect with out of bound console" %}</h4> |
|
37 |
<div class="desc"> |
|
38 |
<p>{% blocktrans %}Blah blah blha lbha blahb glbh{% endblocktrans %}</p> |
|
10 |
<div class="connect"> |
|
11 |
<p></p> |
|
39 | 12 |
</div> |
40 |
<div class="ips"> |
|
41 |
<div class="ip-cont"> |
|
42 |
<span class="title">IP v4</span> |
|
43 |
<span class="value ipv4">195.2.2.12</span> |
|
44 |
</div> |
|
45 |
<div class="ip-cont"> |
|
46 |
<span class="title">IP v4</span> |
|
47 |
<span class="value ipv6">2001:db8::a800:ff:fe4e:ccd2</span> |
|
48 |
</div> |
|
13 |
<div class="subinfo description"> |
|
14 |
<p></p> |
|
49 | 15 |
</div> |
50 | 16 |
</div> |
51 | 17 |
</div> |
Also available in: Unified diff