Revision a6213c91

b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
307 307
            try {
308 308
              var users = this.get_meta('users').split(" ");
309 309
            } catch (err) { users = null }
310
            if (!users) { users = [synnefo.config.os_created_users[this.get_os()] || "root"]}
310
            if (!users) {
311
                var osfamily = this.get_meta('osfamily');
312
                if (osfamily == 'windows') { 
313
                  users = ['Administrator'];
314
                } else {
315
                  users = ['root'];
316
                }
317
            }
311 318
            return users;
312 319
        },
313 320

  
......
1498 1505
            return this.url() + "/diagnostics";
1499 1506
        },
1500 1507

  
1508
        get_users: function() {
1509
            var image;
1510
            var users = [];
1511
            try {
1512
              var users = this.get_meta('users').split(" ");
1513
            } catch (err) { users = null }
1514
            if (!users) {
1515
              image = this.get_image();
1516
              if (image) {
1517
                  users = image.get_created_users();
1518
              }
1519
            }
1520
            return users;
1521
        },
1522

  
1501 1523
        get_connection_info: function(host_os, success, error) {
1502 1524
            var url = synnefo.config.ui_connect_url;
1525
            var users = this.get_users();
1526

  
1503 1527
            params = {
1504 1528
                ip_address: this.get_public_nic().get('ipv4'),
1505 1529
                hostname: this.get_hostname(),
......
1507 1531
                host_os: host_os,
1508 1532
                srv: this.id
1509 1533
            }
1534
            
1535
            if (users.length) { 
1536
                params['username'] = _.last(users)
1537
            }
1510 1538

  
1511 1539
            url = url + "?" + $.param(params);
1512 1540

  

Also available in: Unified diff