Revision 29772683

b/ui/static/main.css
1867 1867
    margin-top: 15px;
1868 1868
}
1869 1869

  
1870
#error-success {
1870
#error-success, #notification-box {
1871 1871
    z-index: 9999;
1872 1872
    border-bottom: 5px solid #4085A5;
1873 1873
    min-height: 150px;
......
1875 1875
    position: absolute !important;
1876 1876
}
1877 1877

  
1878
#error-success p {
1878
#error-success p, #notification-box p {
1879 1879
    margin-top: 5px;
1880 1880
}
1881 1881

  
1882
#error-success strong {
1882
#error-success strong, #notification-box strong {
1883 1883
    color: #F49C1A;
1884 1884
}
1885 1885

  
1886
#error-success .close {
1886
#error-success .close, #notification-box .close {
1887 1887
    background-image: url("./close-popup.png");
1888 1888
    background-repeat: no-repeat;
1889 1889
    cursor: pointer;
......
1911 1911
    margin-bottom: 5px !important;
1912 1912
}
1913 1913

  
1914
#error-success .popup-header {
1914
#error-success .popup-header, #notification-box .popup-header {
1915 1915
    background-color: #4085A5;
1916 1916
    color: white;
1917 1917
    font-size: 95%;
......
1927 1927
}
1928 1928

  
1929 1929

  
1930
#error-success.success h3 span.header-box{
1930
#error-success.success h3 span.header-box, #notification-box h3 span.header-box {
1931 1931
    background-color: #71c837;
1932 1932
    display: block;
1933 1933
    background-image: url("./save-green.png");
......
1940 1940
    margin-left: -11px;
1941 1941
}
1942 1942

  
1943
#error-success .popup-body {
1943
#error-success .popup-body, #notification-box .popup-body {
1944 1944
    background: url("./popup-bg.png") repeat-x scroll 0 0 transparent;
1945 1945
    margin-left: -16px;
1946 1946
    margin-right: -16px;
......
1949 1949
    padding-top: 10px;
1950 1950
}
1951 1951

  
1952
#error-success .popup-body-inner {
1952
#error-success .popup-body-inner, #notification-box .popup-body-inner {
1953 1953
    background: url("./popup-inner-bg.png") repeat-x scroll 0 0 transparent;
1954 1954
    font-size: 80%;
1955 1955
    min-height: 120px;
......
1958 1958
    width: 460px;
1959 1959
}
1960 1960

  
1961
#error-success .popup-separator {
1961
#error-success .popup-separator, #notification-box .popup-seperator {
1962 1962
    background-color: #74AEC9;
1963 1963
    height: 1px;
1964 1964
    font-size:1%;
......
1976 1976
    padding-bottom: 14px !important;
1977 1977
}
1978 1978

  
1979
#error-success .password-container {
1979
#error-success .password-container, #notification-box .password-container {
1980 1980
    width: 430px;
1981 1981
    padding: 5px;
1982 1982
    border: 2px solid #75b54a;
1983 1983
    background-color: #aade87;
1984 1984
}
1985 1985

  
1986
#error-success .password-header {
1986
#error-success .password-header, #notification-box .password-header {
1987 1987
    margin-bottom: 5px;
1988 1988
}
1989 1989

  
1990
#error-success .password {
1990
#error-success .password, #notification-box .password {
1991 1991
    color: #447821;
1992 1992
}
1993 1993

  
......
2030 2030
    display: block;
2031 2031
}
2032 2032

  
2033
#notification-box h3 span.header-box {
2034
    background: transparent;
2035
}
2036

  
2037
#notification-box .machine-now-building {
2038
    padding: 20px 0;
2039
}
2040

  
2041
#notification-box .header-box {
2042
    width: auto !important;
2043
}
2044

  
2045
#notification-box .password {
2046
    text-align: center;
2047
}
2048
#notification-box .password a:hover {
2049
    background-color: #447821;
2050
    color: #fff;
2051
}
2052

  
2053
#notification-box .password a {
2054
    padding: 0.2em;
2055
    text-align: center;
2056
    color: #447821;
2057
    font-weight: bold;
2058
    font-size: 1.2em;
2059
    text-decoration: none;
2060
}
2061

  
2033 2062
.popup-details a:link, .popup-details a:visited{
2034 2063
    color: black;
2035 2064
}
b/ui/static/synnefo.js
1156 1156
    return false;
1157 1157
}
1158 1158

  
1159
function vm_has_address(vmId) {
1160
    var vm = get_machine(vmId);
1161

  
1162
    if (!vm) return false;
1163

  
1164
    try {
1165
        var ip = vm.addresses.values[0].values[0].addr;
1166
    } catch (err) {
1167
        console.log(err);
1168
        return false;
1169
    }
1170
    return ip;
1171
}
1172

  
1159 1173
// connect to machine action
1160 1174
function machine_connect(serverIDs){
1161 1175
    if (!serverIDs.length){
......
1163 1177
        return false;
1164 1178
    }
1165 1179
    var serverID = serverIDs.pop();
1166

  
1180
    
1167 1181
    var machine = get_machine(serverID);
1168 1182
    var serverName = machine.name;
1169 1183
    try {
......
1179 1193
    //console.log(serverIP);
1180 1194
    //console.log(machine.addresses);
1181 1195
    //console.log(machine.addresses.values[0].values[0].addr);
1182

  
1196
    
1197
    //show_connect_dialog(machine, ip);
1183 1198
    window.open('machines/connect' + params_url);
1199
    
1200

  
1184 1201

  
1185 1202
    // Restore os icon in list view
1186 1203
    osIcon = $('#'+serverID).parent().parent().find('.list-logo');
......
2046 2063
    el.addClass("single-image-" + cls);
2047 2064
}
2048 2065

  
2066

  
2067
// generic info box
2068

  
2069
function msg_box(config) {
2070
    var config = $.extend({'title':'Info message', 'content': 'this is an info message', 'ajax': false, 'extra':false}, config);
2071
    // prepare the error message
2072
    // bring up success notification
2073

  
2074
    var box = $("#notification-box");
2075
    box.addClass('success');
2076
    box.removeClass('error');
2077

  
2078
    var sel = function(s){console.log(box); return $(s, box)};
2079

  
2080
    sel("h3 span.header-box").text(config.title);
2081
    sel("div.machine-now-building").html(config.content);
2082
    sel(".popup-header").removeClass("popup-header-error");
2083
    box.removeClass("popup-border-error");
2084
    sel(".popup-details").removeClass("popup-details-error");
2085
    sel(".popup-separator").removeClass("popup-separator-error");
2086
    
2087
    sel(".password-container").hide();
2088
    if (config.extra) {
2089
        sel(".password-container .password").html(config.extra);
2090
        sel(".password-container").show();
2091
    }
2092

  
2093
    var triggers = $("a#msgbox").overlay({
2094
        // some mask tweaks suitable for modal dialogs
2095
        mask: '#666',
2096
        top: 'center',
2097
        closeOnClick: false,
2098
        oneInstance: false,
2099
        load: false,
2100
        onClose: function () {
2101
            // With partial refresh working properly,
2102
            // it is no longer necessary to refresh the whole page
2103
            // choose_view();
2104
        }
2105
    });
2106
    $("a#msgbox").data('overlay').load();
2107
    
2108
    var parse_data = config.parse_data || false;
2109
    if (config.ajax) {
2110
        $.ajax({ 
2111
            url:config.ajax, 
2112
            success: function(data){
2113
                if (parse_data) {
2114
                    data = parse_data(data);
2115
                }
2116

  
2117
                if (data.title)
2118
                    sel("h3 span.header-box").text(data.title);
2119

  
2120
                if (data.content)
2121
                    sel("div.machine-now-building").html(data.content);
2122

  
2123
                if (data.extra) {
2124
                    sel(".password-container .password").html(data.extra);
2125
                    sel(".password-container").show();
2126
                }
2127
            }
2128
        });
2129
    }
2130
    return false;
2131
}
b/ui/templates/home.html
440 440
            $(".usermenu .logout").click(function() {
441 441
                user_session_logout();
442 442
            });
443

  
443 444
        });
444 445
    </script>
445 446
    <!-- base notification for error/success reporting -->
446 447
    <a id="notification" rel="#error-success" href="#"></a>
448
    <a id="msgbox" rel="#notification-box" href="#"></a>
447 449

  
448 450
    <div class="modal" id="error-success">
449 451
        <h3 class="popup-header">
......
464 466
            </div>
465 467
        </div>
466 468
    </div>
469

  
470
    <div class="modal" id="notification-box">
471
        <h3 class="popup-header">
472
            <span class="header-box"></span>
473
        </h3>
474
        <div class="popup-body">
475
            <div class="popup-body-inner">
476
                <div class="machine-now-building"></div>
477
                <div class="popup-separator"></div>
478
                <div class="password-container">
479
                    <div class="password-header"></div>
480
                    <div class="password"></div>
481
                </div>
482
            </div>
483
        </div>
484
    </div>
467 485
</body>
468 486
</html>

Also available in: Unified diff