Revision 65ecc5e4

b/ui/static/synnefo.js
1238 1238
    }
1239 1239
    
1240 1240
    // prefer metadata values for specific options (username, domain)
1241
    var username_meta_key = 'User';
1242
    var domain_meta_key = "Domain";
1241
    var username_meta_key = 'user';
1242
    var domain_meta_key = "domain";
1243 1243

  
1244 1244
    var serverID = serverIDs.pop();
1245 1245
    var machine = get_machine(serverID);
......
1273 1273
        params_url += "&domain=" + domain;
1274 1274
    }
1275 1275
    
1276
    if ($.client.os == "Windows" && os == "windows") {
1277
        // request rdp file
1278
        window.open('machines/connect' + params_url + "&rdp=1");
1279
        return;
1280
    }
1276
    //if ($.client.os == "Windows" && os == "windows") {
1277
        //// request rdp file
1278
        //window.open('machines/connect' + params_url + "&rdp=1");
1279
        //return;
1280
    //}
1281 1281
    
1282 1282
    // FIXME: I18n ???
1283 1283
    var title = 'Connect to: ' + '<span class="machine-title"><img src="static/icons/machines/small/'+os+'-on.png" /> '+serverName+'</span>';
b/ui/views.py
104 104
To do so, open the following file with an appropriate remote desktop client.""")
105 105
CONNECT_LINUX_WINDOWS_SUBMESSAGE = _("""If you don't have one already
106 106
installed, we suggest the use of <a target="_blank" href="http://sourceforge.net/projects/tsclient/files/tsclient/tsclient-unstable/tsclient-2.0.1.tar.bz2/download">tsclient</a>.""")
107

  
108 107
CONNECT_WINDOWS_LINUX_MESSAGE = _("""A direct connection to this machine can be established using the <a target="_blank"
109 108
href="http://en.wikipedia.org/wiki/Secure_Shell">SSH Protocol</a>.
110 109
Open an ssh client such as PuTTY and type the following:""")
111 110
CONNECT_WINDOWS_LINUX_SUBMESSAGE = _("""If you do not have an ssh client already installed,
112 111
<a target="_blank" href="http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe">Download PuTTY</a>""")
113
CONNECT_WINDOWS_WINDOWS_MESSAGE = _("Trying to connect from windows to windows")
114 112

  
113
CONNECT_WINDOWS_WINDOWS_MESSAGE = _("""A direct connection to this machine can be
114
established using Remote Desktop. Click on the following link, and if asked open it using "Remote Desktop Connection" """)
115
CONNECT_WINDOWS_WINDOWS_SUBMESSAGE = _("""Save this file to disk for future use""")
115 116

  
116 117
# info/subinfo for all os combinations
117 118
#
118 119
# [0] info gets displayed on top of the message box
119 120
# [1] subinfo gets displayed on the bottom as extra info
120 121
# provided to the user when needed
121
CONNECT_PROMT_MESSAGES = {
122
CONNECT_PROMPT_MESSAGES = {
122 123
    'linux': {
123 124
            'linux': [CONNECT_LINUX_LINUX_MESSAGE, ""],
124 125
            'windows': [CONNECT_LINUX_WINDOWS_MESSAGE, CONNECT_LINUX_WINDOWS_SUBMESSAGE]
125 126
        },
126 127
    'windows': {
127 128
            'linux': [CONNECT_WINDOWS_LINUX_MESSAGE, CONNECT_WINDOWS_LINUX_SUBMESSAGE],
128
            'windows': [CONNECT_WINDOWS_WINDOWS_MESSAGE, ""]
129
            'windows': [CONNECT_WINDOWS_WINDOWS_MESSAGE, CONNECT_WINDOWS_WINDOWS_SUBMESSAGE]
129 130
        }
130 131
    }
131 132

  
133
# retrieve domain prefix from settings
134
DOMAIN_PREFIX = getattr(settings, 'MACHINE_DOMAIN_PREFIX', getattr(settings, 'BACKEND_PREFIX_ID', ""))
135

  
136
# domain template string
137
DOMAIN_TPL = "%s%%s" % DOMAIN_PREFIX
138

  
132 139
def machines_connect(request):
133 140
    ip_address = request.GET.get('ip_address','')
134 141
    operating_system = metadata_os = request.GET.get('os','')
135 142
    server_id = request.GET.get('srv', 0)
136 143
    host_os = request.GET.get('host_os','Linux').lower()
137 144
    username = request.GET.get('username', None)
138
    domain = request.GET.get("domain", "snf-%d" % int(server_id))
145
    domain = request.GET.get("domain", DOMAIN_TPL % int(server_id))
139 146

  
140 147
    # guess host os
141 148
    if host_os != "windows":
......
189 196

  
190 197
        # try to find a specific message
191 198
        try:
192
            connect_message = CONNECT_PROMT_MESSAGES[host_os][operating_system][0]
193
            subinfo = CONNECT_PROMT_MESSAGES[host_os][operating_system][1]
199
            connect_message = CONNECT_PROMPT_MESSAGES[host_os][operating_system][0]
200
            subinfo = CONNECT_PROMPT_MESSAGES[host_os][operating_system][1]
194 201
        except KeyError:
195 202
            connect_message = _("You are trying to connect from a %s machine to a %s machine") % (host_os, operating_system)
196 203
            subinfo = ""

Also available in: Unified diff