Revision fd70c1db ui/views.py
b/ui/views.py | ||
---|---|---|
85 | 85 |
context = {'host': host, 'port': port, 'password': password, 'machine': machine, 'host_ip': host_ip} |
86 | 86 |
return template('machines_console', context) |
87 | 87 |
|
88 |
def machines_connect(request): |
|
89 |
ip_address = request.GET.get('ip_address','') |
|
90 |
TODO = True |
|
91 |
if TODO: # TODO: check if we are on windows |
|
92 |
rdp_file = os.path.join(os.path.dirname(__file__), "static/") + 'synnefo-windows.rdp' |
|
93 |
connect_data = open(rdp_file, 'r').read() |
|
94 |
connect_data = connect_data + 'full address:s:' + ip_address + '\n' |
|
95 |
response = HttpResponse(connect_data, mimetype='application/x-rdp') |
|
96 |
response['Content-Disposition'] = 'attachment; filename=synnefo-windows.rdp' |
|
97 |
else: |
|
98 |
pass #no windows, no rdp |
|
99 |
return response |
|
100 |
|
|
101 |
|
|
88 | 102 |
def images(request): |
89 | 103 |
context = {} |
90 | 104 |
return template('images', context) |
Also available in: Unified diff