Revision fd70c1db

b/ui/static/synnefo-windows.rdp
1
screen mode id:i:2
2
desktopwidth:i:1920
3
desktopheight:i:1080
4
session bpp:i:32
5
winposstr:s:0,1,210,229,1234,996
6
compression:i:1
7
keyboardhook:i:2
8
audiomode:i:0
9
redirectprinters:i:1
10
redirectcomports:i:0
11
redirectsmartcards:i:0
12
redirectclipboard:i:0
13
redirectposdevices:i:0
14
drivestoredirect:s:
15
displayconnectionbar:i:1
16
autoreconnection enabled:i:0
17
authentication level:i:2
18
prompt for credentials:i:0
19
negotiate security layer:i:1
20
remoteapplicationmode:i:0
21
alternate shell:s:
22
shell working directory:s:
23
disable wallpaper:i:0
24
disable full window drag:i:0
25
allow desktop composition:i:1
26
allow font smoothing:i:1
27
disable menu anims:i:0
28
disable themes:i:0
29
disable cursor setting:i:0
30
bitmapcachepersistenable:i:1
31
gatewayhostname:s:
32
gatewayusagemethod:i:0
33
gatewaycredentialssource:i:4
34
gatewayprofileusagemethod:i:0
35
promptcredentialonce:i:1
b/ui/static/synnefo.js
1070 1070
    return false;
1071 1071
}
1072 1072

  
1073
// connect to machine action
1074
function machine_connect(serverIDs){
1075
    if (!serverIDs.length){
1076
        //ajax_success('DEFAULT');
1077
        return false;
1078
    }
1079
    var serverID = serverIDs.pop();
1080

  
1081
    var machine = get_machine(serverID);
1082
    var serverName = machine.name;
1083
    var serverIP = machine.addresses.values[0].values[0].addr;
1084

  
1085
    var params_url = '?ip_address=' + serverIP;
1086

  
1087
    window.open('machines/connect' + params_url);
1088

  
1089
    // Restore os icon in list view
1090
    osIcon = $('#'+serverID).parent().parent().find('.list-logo');
1091
    osIcon.attr('src',osIcon.attr('os'));
1092

  
1093
    return false;
1094
}
1095

  
1096

  
1073 1097
// rename server
1074 1098
function rename(serverID, serverName){
1075 1099
    if (!serverID.length){
b/ui/templates/machines_list.html
229 229
    return false;
230 230
});
231 231

  
232
$("#machinesview .list a.enabled#action-connect").live('click', function() {
233
    var checked = $("#machinesview .list table.list-machines tbody input[type='checkbox']:checked");
234
    $("#machinesview .list .selected").removeClass('selected');
235
    $(this).addClass('selected');
236
    pending_actions = []; // reset pending actions
237
    checked.each(function(i,c) {
238
        serverID=c.id;
239
        serverName = $('#machinesview .list #'+serverID+' span.name').text();
240
        pending_actions.push([machine_connect, serverID]);
241
    });
242
    update_confirmations();
243
    return false;
244
});
245

  
246

  
232 247
$("#machinesview .list a.enabled#action-details").live('click', function() {
233 248
    var checked = $("#machinesview .list table.list-machines tbody input[type='checkbox']:checked");
234 249
    $("#machinesview .list .selected").removeClass('selected');
b/ui/urls.py
41 41
    url(r'^machines/list$', 'synnefo.ui.views.machines_list', name='machines-list'),
42 42
    url(r'^machines/single$', 'synnefo.ui.views.machines_single', name='machines-single'),
43 43
    url(r'^machines/console$', 'synnefo.ui.views.machines_console', name='machines-console'),
44
    url(r'^machines/connect$', 'synnefo.ui.views.machines_connect', name='machines-connect'),
44 45
    url(r'^disks$', 'synnefo.ui.views.disks', name='disks'),
45 46
    url(r'^images$', 'synnefo.ui.views.images', name='images'),
46 47
    url(r'^networks$', 'synnefo.ui.views.networks', name='networks'),
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