Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / templates / home.html @ d194e869

History | View | Annotate | Download (27.6 kB)

1
<!doctype html>
2
<html>
3

    
4
{% load i18n %}
5
<head>
6
    <title>~okeanos</title>
7
    
8
    <!--<meta http-equiv="X-UA-Compatible" content="IE=7">-->
9
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
10

    
11
    <link href="https://fonts.googleapis.com/css?family=Ubuntu&subset=latin,greek" rel="stylesheet" type="text/css" >
12
    <link href='https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek' rel='stylesheet' type='text/css'>
13

    
14
    <link rel="shortcut icon" href="{{ SYNNEFO_IMAGES_URL }}favicon.ico" />
15

    
16
    {% comment %}
17
    <script type="text/javascript" src="{% url javascript_catalog %}"></script> 
18
    {% endcomment %}
19

    
20
    <link rel="stylesheet" type="text/css" href="{{ SYNNEFO_CSS_URL }}main.css"/>
21

    
22
    <!--[if IE]>
23
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie.css);</style>
24
    <![endif]-->
25
    <!--[if (lte IE 8)]>
26
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie8.css);</style>
27
    <![endif]-->
28
    <!--[if (lte IE 7)]>
29
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie7.css);</style>
30
    <![endif]-->
31

    
32
    <script src="{{ SYNNEFO_JS_LIB_URL }}jquery-1.7.1.js"></script>
33
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.cookie.js"></script>
34
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.client.js"></script>
35
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.tools.min.js"></script>
36
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.dataTables.min.js"></script>
37
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.pagination.js"></script>
38
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.zclip.js"></script>
39
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.base64.js"></script>
40

    
41

    
42
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.js"></script>
43
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.string.js"></script>
44
    <script src="{{ SYNNEFO_JS_LIB_URL}}backbone.js"></script>
45
    <script src="{{ SYNNEFO_JS_LIB_URL}}json2.js"></script>
46
    <script src="{{ SYNNEFO_JS_LIB_URL}}stacktrace.js"></script>
47

    
48
    <!--[if (lt IE 7)]>
49
        <script src="{{ SYNNEFO_JS_LIB_URL }}selectivizr.js"></script>
50
    <! [endif] -->
51

    
52
    <!--[if IE]>
53
        <script src="{{ SYNNEFO_JS_URL }}ui/ie_fixes.js"></script>
54
    <![endif]-->
55
    
56
    <script src="{{ SYNNEFO_JS_URL }}utils.js"></script>
57
    <script src="{{ SYNNEFO_JS_URL }}auth.js"></script>
58
    <script src="{{ SYNNEFO_JS_URL }}sync.js"></script>
59
    <script src="{{ SYNNEFO_JS_URL }}models.js"></script>
60
    <script src="{{ SYNNEFO_JS_URL }}glance_models.js"></script>
61
    <script src="{{ SYNNEFO_JS_URL }}views.js"></script>
62

    
63
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_vms_base_view.js"></script>
64
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_model_views.js"></script>
65
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_error_view.js"></script>
66
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_icon_view.js"></script>
67
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_single_view.js"></script>
68
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_list_view.js"></script>
69
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_networks_view.js"></script>
70
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_metadata_view.js"></script>
71
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_feedback_view.js"></script>
72
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_create_view.js"></script>
73
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_connect_view.js"></script>
74
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_public_keys_view.js"></script>
75
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_custom_images.js"></script>
76

    
77
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_router.js"></script>
78
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_main_view.js"></script>
79

    
80
    <!-- the following views require refactor -->
81
    <script src="{{ SYNNEFO_JS_URL }}synnefo.js"></script>
82
    <script>
83
        tmp_auth_client = new synnefo.auth.AstakosClient({
84
            cookie_name: '{{ auth_cookie_name }}',
85
            login_url: '{{ login_redirect }}'
86
        });
87
        if (!tmp_auth_client.get_user()) { tmp_auth_client.redirect_to_login(); }
88
    </script>
89
    {{ CLOUDBAR_CODE }}
90
    
91
    <script>
92
        // empty object for console to avoid errors in browsers that don't support it
93
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
94
            window.console.error = function() {}};
95
        
96
        //populate available image icons array
97
        var os_icons = {{image_icons|safe}};
98
        
99
        // timeout value from settings.py
100
        var TIMEOUT = {{ timeout }};
101
        var TIMEOUTS_OCCURED = 0;
102
        var SKIP_TIMEOUTS = {{ skip_timeouts }};
103
        var UPDATE_INTERVAL = {{ update_interval }};
104
        var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %};
105
        var FEEDBACK_URL = "{% url ui_feedback %}";
106
        var FEEDBACK_TITLE = "{% trans "Send feedback" %}";
107
        var API_OVERLAY_TITLE = "{% trans "API access" %}";
108
        var API_OVERLAY_SUBCONTENT = "{% trans "The API key provides full access to your <em>~okeanos</em> account, so always keep it private." %}";
109

110
        STATE_TEXTS = {
111
            'UNKNOWN': '{% trans "Unknown" %}',
112
            'BUILD':  '{% trans "Building..." %}',
113
            'FIREWALL':  '{% trans "Firewall change..." %}',
114
            'REBOOT': '{% trans "Rebooting..." %}',
115
            'STOPPED':'{% trans "Stopped" %}',
116
            'ACTIVE': '{% trans "Running" %}',
117
            'ERROR':  '{% trans "Error" %}',
118
            'DELETE': '',
119
            'DESTROY': '{% trans "Destroying..." %}',
120
            'BUILD_INIT':  '{% trans "Building..." %}',
121
            'BUILD_COPY':  '{% trans "Building..." %}',
122
            'BUILD_FINAL':  '{% trans "Building..." %}',
123
            'SHUTDOWN': '{% trans "Shutting down..." %}',
124
            'START': '{% trans "Starting..." %}',
125
            'CONNECT': '{% trans "Connecting..." %}',
126
            'DISCONNECT': '{% trans "Disconnecting..." %}'
127
        }
128

129

130

131
        // building statuses
132
        var BUILDING_MESSAGES = {
133
            'INIT': '{% trans "Initializing..." %}',
134
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
135
            'FINAL': '{% trans "Finalizing..." %}'
136
        }
137

138
        var ERROR_OVERRIDES = {
139
            // error message header
140
            'HEADER' : '{% trans "Error" %}',
141
            // default
142
            'DEFAULT' : '{% trans "Could not contact the service. Please check your network connectivity and try again." %}',
143
            // bad request
144
            '400' : '{% trans "Malformed request." %}',
145
            // not found
146
            '404' : '{% trans "Your request has failed. Resource not found." %}',
147
            // internal server error
148
            '500' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
149
            // service unavailable
150
            '501' : '{% trans "This server has not been implemented yet." %}',
151
            // service unavailable
152
            '502' : '{% trans "Bad Gateway error." %}',
153
            // service unavailable
154
            '503' : '{% trans "This service is unavailable right now, please try again later." %}',
155
            // no server handshake
156
            '0' : '{% trans "Could not contact the server." %}',
157
            // no images found
158
            '-212' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
159
            // no flavors found
160
            '-213' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}',
161
            // error box title
162
            'GENERIC_POPUP_HEADER' : '{% trans "Something seems to have gone wrong :( Here is what happened:" %}',
163
            // no advanced details
164
            'NO_DETAILS' : '{% trans "Νο advanced details provided" %}',
165
            // timeout message
166
            'TIMEOUT' : '{% trans "It seems the server takes too long to respond, please check your network connectivity" %}'
167
        };
168

169
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
170
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
171

172
        var SUCCESS = {
173
            'HEADER' : '{% trans "Success" %}',
174
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
175
            'PASSWORD' : '{% trans "Password:" %}',
176
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
177
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
178
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
179
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
180
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
181
        };
182

183
        var VARIOUS = {
184
            'CONFIRM' : '{% trans "Confirm" %}',
185
            'CANCEL' : '{% trans "Cancel" %}',
186
            'APPLY' : '{% trans "Apply" %}',
187
            'OFF' : '{% trans "Off" %}',
188
            'ON' : '{% trans "On" %}'
189
        };
190

    
191
    </script>
192
</head>
193

    
194
<body id="app">
195
    <!--<img id="okeanos-image" src="{{ SYNNEFO_IMAGES_URL }}body-bg2.png" />-->
196
    <div id="container">
197
        <div id="header">
198
            <div id="user">
199
                <div class="usermenu">
200
                    <div class="username"></div>
201
                    <ul class="useractions">
202
                        <!--<li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>-->
203
                        <li class="api"><a class="action" href="#">{% trans "API access..." %}</a></li>
204
                        <li class="public_keys"><a class="action" href="#">{% trans "ssh public keys..." %}</a></li>
205
                        <!--<li class="custom_images"><a class="action" href="#">{% trans "custom images..." %}</a></li>-->
206
                        <!--<li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li>-->
207
                    </ul>
208
                </div>
209
                <div class="langmenu">
210
                    <a class="current_lang">en</a>
211
                    {% comment %}
212
                {% get_available_languages as LANGUAGES %}
213
                {% for lang in LANGUAGES %}
214
                <a {% if  == lang.0 %}
215
                    class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a>
216

    
217
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
218
                    {% endfor %}
219
                {% endcomment %}
220
                </div>
221
            </div>
222
            <div class="header-logo">
223
                <a href="/">
224
                    <img src="{{ SYNNEFO_IMAGES_URL }}okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
225
                </a>
226
            </div>
227
        </div>
228
        <div id="content">
229
            <div id="wrapper" class="clearfix">
230

    
231
                <div class="panes-menu clearfix">
232
                <!-- tabs -->
233
                <div class="tab-name">{% trans "machines" %}</div>
234
                <ul class="css-tabs">
235
                    <li><a href="machines" title="{% trans "manage  virtual " %}"
236
                        class="primary" id="machines_view_link">
237
                        <img src="{{ SYNNEFO_IMAGES_URL }}machines-icon.png" /></a></li>
238
                    <li><a href="networks" title="{% trans "configure " %}"
239
                        class="primary" id="networks_view_link">
240
                        <img src="{{ SYNNEFO_IMAGES_URL }}networks-icon.png" /></a></li>
241
                    <li class="hidden"><a href="disks" title="{% trans "manage  storage " %}"
242
                        class="primary" id="disks_view_link">
243
                        <img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li>
244
                </ul>
245
                </div>
246
                <div class="css-panes">
247
                    <div id="machines-pane" class="pane" style="display:block;">
248
                        {% include "partials/machines.html" %}
249
                    </div>
250
                    <div id="networks-pane" class="pane">
251
                        {% include "partials/networks.html" %}
252
                    </div>
253
                    <div id="disks-pane" class="pane"></div>
254

    
255
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
256
                        <div class="confirm_multiple_actions confirm-all-cont global hidden confirm_multiple_cont clearfix">
257
                            <div class="confirm-all msg">
258
                                <p>You requested multiple actions to execute (<span
259
                                    class"show">show all</span>)</p>
260
                                <button class="yes">Confirm all</button>
261
                                <button class="no">Cancel all</button>
262
                            </div>
263
                            <div class="details"></div>
264
                        </div>
265
                        <div class="ns-confirms-cont">
266
                            <div class="confirm_multiple_actions hidden confirm_multiple_cont
267
                                ns-confirm clearfix"
268
                                id="conirm_multiple_cont_template">
269
                                <div class="confirm-all msg">
270
                                    <p></p>
271
                                    <button class="yes"></button>
272
                                    <button class="no"></button>
273
                                </div>
274
                                <div class="details"></div>
275
                            </div>
276
                        </div>
277
                    </div>
278

    
279
                </div>
280
            </div>
281
        </div>
282
    </div>
283

    
284
    <!-- activate tabs with JavaScript -->
285
    <script>
286

287
        //load opera css fixes
288
        if ($.browser.opera) {
289
            $("<link/>", {
290
               rel: "stylesheet",
291
               type: "text/css",
292
               href: "{{ SYNNEFO_CSS_URL }}opera.css"
293
            }).appendTo("head");
294
        }
295

296
        $(document).ready(function(){
297

298
            {% if current_lang == "el" and not DEBUG %}
299
                window.location = "/lang/?l=en";
300
            {% endif %}
301

302
            // user menu interaction
303
            var resetUserMenu = function() {
304
                $(this).removeClass("hovered");
305
                $(this).removeClass("active");
306
            }
307

308
            $(".usermenu").live("click", function(){
309
                $(this).addClass("active");
310
            });
311
            $(".usermenu").bind('mouseleave', resetUserMenu);
312
            $(".usermenu").live("mouseover", function(){
313
                $(this).addClass("hovered");
314
            });
315

316
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
317
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
318

319
            // bind menu actions
320
            $(".usermenu .logout").click(function() {
321
                synnefo.auth_client.logout();
322
            });
323

324
            $(".usermenu .api").click(function(){
325
                synnefo.ui.main.api_info_view.show();
326
            });
327

328
        });
329
        
330
        function positionBottomMessages() {
331
            var el = $("#multiple_actions_container");
332
        }
333

334
        $(window).bind("load", function() { 
335
               var footerHeight = 0;
336
               var footerTop = 0;
337
               var $footer = $("#footer-container");
338

339
               positionFooter();
340
               function positionFooter() {
341
                   footerHeight = 80;
342
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
343
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
344

345
                       $footer.css({
346
                            position: "absolute"
347
                       }).css({
348
                            top: footerTop
349
                       })
350
                    } else {
351
                    
352
                       if ($footer.css("position") == "static") {
353
                           if ($(document.body).height() < $(window).height()) {    
354
                               $footer.css({
355
                                    position: "absolute"
356
                               }).css({
357
                                    top: footerTop
358
                                })
359
                            }
360
                        } else {
361

362
                           $footer.css({
363
                               position: "static"
364
                           })
365
                       }
366
                   }
367

368
                   }
369
               window.positionFooter = _.throttle(positionFooter, 100);
370
               $(window).scroll(positionFooter).resize(positionFooter)
371
        });
372
    </script>
373

    
374
    <!-- base notification for error/success reporting -->
375
    <a id="notification" rel="#error-success" href="#"></a>
376
    <a id="msgbox" rel="#notification-box" href="#"></a>
377
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
378

    
379
    <div class="overlay" id="generic-overlay-tpl">
380
        <div class="overlay-inner">
381
            <h3 class="overlay-header clearfix">
382
                <span class="subtitle"></span>
383
                <span class="title"></span>
384
                <span class="closeme">close</span></h3>
385
            <div class="container">
386
                <div class="content">
387
                </div>
388
            </div>
389
            <div class="footer"></div>
390
        </div>
391
    </div>
392

    
393
    <div id="error-overlay-content" class="hidden">
394
        <div class="error-nav hidden clearfix">
395
            <span class="indicator"><span class="num">1</span> <span
396
                    class="ind-msg">new error occured</span></span>
397
            <span class="show-next nav-btn">{% trans "next" %}</span>
398
            <span class="show-prev nav-btn">{% trans "previous" %}</span>
399
        </div>
400
        <div class="message"><p></p></div>
401
        <div class="error-details">
402
            <span class="key">{% trans "Module" %}</span>
403
            <span class="value error-module"></span>
404

    
405
            <span class="key">{% trans "Code" %}</span>
406
            <span class="value error-code"></span>
407

    
408
            <span class="key">{% trans "Type" %}</span>
409
            <span class="value error-type"></span>
410

    
411
            <span class="key details">{% trans "Details" %}</span>
412
            <div class="value error-more-details"><p></p></div>
413
        </div>
414
        
415
        <!--<div class="navigation">-->
416
            <!--<span class="next-error">{% trans "next error" %}</span>-->
417
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
418
        <!--</div>-->
419
        
420
        <!--<div class="date">-->
421
            <!--<span class="error-date"></span>-->
422
        <!--</div>-->
423

    
424
        <div class="actions">
425
            <span class="show-details">{% trans "Show details" %}</span>
426
            <span class="hide-details">{% trans "Hide details" %}</span>
427
            <span class="report-error">{% trans "Send report" %}</span>
428
            <span class="reload-app">{% trans "Reload" %}</span>
429
        </div>
430
    </div>
431
    <div id="feedback-overlay-content" class="hidden overlay-content feedback-form">
432
        <div class="description">
433
            <p>
434
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
435
                We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}
436
            </p>
437
        </div>
438
        <div class="description messages noborder">
439
            <p class="success-message hidden">
440
            {% trans "thank you for submiting your feedback" %}
441
            </p>
442
            <p class="error-message hidden">
443
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
444
            </p>
445
            <p class="sending-message hidden">
446
            {% blocktrans %}Sending feedback...{% endblocktrans %}
447
            </p>
448
        </div>
449
        <div class="form">
450
            <div class="form-field">
451
                <label for{% trans "Please  your  here, provide  many  as " %}</label
452
                <textarea ="feedback-message"> 
453
                </textarea>
454
            </div>
455
            <div class="form-actions clearfix noborder">
456
                <span class="form-action submit">{% trans "send feedback" %}</span>
457
            </div>
458
        </div>
459
    </div>
460
    <div class="modal" id="feedback-form" class="feedback notification-box">
461
        <h3 class="popup-header overlay-header">
462
            <span class="header-box">{% trans "Send feedback" %}</span>
463
        </h3>
464
        <div class="popup-body">
465
            <div class="popup-body-inner">
466
                <div class="form-container">
467
                <p class="feedback-intro">
468
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
469
We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}</p>
470
                <form id="feedback-form">
471
                    <label for="feedback-msg">{% trans "Please describe your problem here, provide as many details as possible" %}</label>
472
                    <div class="description"></div>
473
                    <div class="empty-error-msg">{% trans "Please provide some feedback" %}</div>
474
                    <textarea name="feedback-msg" class="feedback-text"></textarea>
475

    
476
                    <input type="checkbox" name="submit-submit-data" class='submit-data' />
477
                    <input type="submit" value="{% trans "submit " %}" class="submit" />
478
                    <textarea name="feedback-data" class="data-text"></textarea>
479
                </form>
480
            </div>
481

    
482
            <div class="message sending">{% trans "submiting your data....." %}</div>
483
            <div class="message success">
484
                {% trans "thank you for submiting your feedback" %}
485
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
486
            <div class="message errormsg">
487
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
488
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
489
            </div>
490
            </div>
491
        </div>
492
    </div>
493
    
494
    <div id="api-info-overlay" class="overlay-content overlay-info hidden">
495
        <div class="description">
496
            <p>{% blocktrans with EXTERNAL_CLIENT_URL as EXTERNAL_CLIENT_URL %}Use the following API key along with the <a
497
                href="{{ EXTERNAL_CLIENT_URL }}">./kamaki</a> client to manage
498
            your cloud resources from outside this page.{% endblocktrans %}</p>
499
        </div>
500
        <div class="copy-content">
501
            <p></p>
502
        </div>
503
        <div class="description subinfo">
504
            <p>
505
            {% trans "The API key provides full access to your <em>~okeanos</em> account, so always keep it private." %}
506
            </p>
507
        </div>
508
    </div>
509

    
510
    <div class="api_overlay_template">
511
        <div class="api_overlay_content">
512
            <p>Use the following API key along with the <a href="{{ EXTERNAL_CLIENT_URL }}">./kamaki</a> client to manage your cloud resources from outside this page.</p>
513
        </div>
514
    </div>
515

    
516
    <div class="modal" id="notification-box" class="notification-box">
517
        <h3 class="popup-header">
518
            <span class="header-box"></span>
519
        </h3>
520
        <div class="popup-body">
521
            <div class="popup-body-inner">
522
                <div class="machine-now-building"></div>
523
                <div class="popup-separator"></div>
524
                <div class="password-container">
525
                    <div class="password"></div>
526
                </div>
527
                <div class="sub-text"></div>
528
            </div>
529
        </div>
530
    </div>
531
    
532
    <div id="loading-view" class="hidden">
533
        <img src="{{ SYNNEFO_IMAGES_URL }}icons/indicators/small/progress.gif" />
534
        <div class="header">Loading <span>~okeanos</span></div>
535
        <div class="info hidden"></div>
536
    </div>
537
    <div id="user_public_keys" class="overlay-content overlay-content hidden">
538
        {% include "userdata/public_keys_view.html" %}
539
    </div>
540
    <div id="user_custom_images" class="overlay-content overlay-content hidden">
541
        {% include "partials/custom_images.html" %}
542
    </div>
543
    {% include "footer.html" %}
544

    
545
    <script>
546
        $(document).ready(function() {
547
            $(".css-panes").hide();
548

549
            // TODO: match <= 1.9.1
550
            if ($.browser.mozilla && $.browser.version.substr(0,3) == "1.9") {
551
                synnefo.config.overlay_speed = 0;
552
                $.fx.off = true;
553
            }
554
            
555
            // synnefo js config
556
            synnefo.VERSION = "{{ synnefo_version }}";
557
            synnefo.config.update_interval = {{ update_interval }};
558
            synnefo.config.update_interval_increase = {{ update_interval_increase }};
559
            synnefo.config.fast_interval = {{ update_interval_fast }};
560
            synnefo.config.update_interval_increase_after_calls = {{ update_interval_increase_after_calls }};
561
            synnefo.config.update_interval_max = {{ update_interval_max }};
562
            synnefo.config.delay_on_blur = {{ delay_on_blur }};
563
            synnefo.config.update_hidden_views = {{ update_hidden_views }};
564
            synnefo.config.handle_window_exceptions = {{ handle_window_exceptions }};
565
            synnefo.config.ajax_timeout = {{ timeout }};
566
            synnefo.config.skip_timeouts = {{ skip_timeouts }};
567
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
568
            synnefo.config.vm_name_template = {{ vm_name_template|safe }};
569
            synnefo.config.flavors_disk_templates_info = {{ flavors_disk_templates_info|safe }};
570
                           // TODO: make it dynamic
571
            synnefo.config.api_urls = {
572
                'compute':  {{ compute_api_url|safe }}, 
573
                'glance': {{ glance_api_url|safe }}
574
            };
575
            
576
            // TODO: configurable userdata urls in models.js
577
            synnefo.config.userdata_url = '/ui/userdata';
578
            synnefo.config.userdata_keys_url = '{% url ui_keys_collection %}';
579
            synnefo.config.userdata_keys_limit = {{ userdata_keys_limit }};
580
            
581
            // media config
582
            synnefo.config.media_url = '{{ UI_MEDIA_URL }}';
583
            synnefo.config.js_url = '{{ SYNNEFO_JS_URL }}';
584
            synnefo.config.images_url = '{{ SYNNEFO_IMAGES_URL }}';
585
            synnefo.config.image_deleted_title = {{ image_deleted_title|safe }};
586
            synnefo.config.image_deleted_size_title = {{ image_deleted_size_title|safe }};
587
            synnefo.config.use_glance = {{ use_glance }};
588
            synnefo.config.indicators_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/indicators/';
589
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
590
            synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
591
            synnefo.config.os_created_users = {{ os_created_users|safe }};
592
            
593
            synnefo.config.logout_redirect = '{{ logout_redirect }}';
594
            synnefo.config.login_redirect = '{{ login_redirect }}';
595
            synnefo.config.auth_cookie_name = '{{ auth_cookie_name }}';
596
            
597
            synnefo.auth_client = new synnefo.auth.AstakosClient({
598
                login_url: synnefo.config.login_redirect,
599
                logout_url: synnefo.config.logout_redirect,
600
                cookie_name: synnefo.config.auth_cookie_name,
601
                logout_callback: function(client) {
602
                    Backbone.history.navigate(client.config.logout_url);
603
                    window.location = client.config.logout_url; 
604
                }
605
            });
606

607
            // user config
608
            synnefo.user = synnefo.auth_client.get_user();
609
            if (!synnefo.user) { synnefo.auth_client.redirect_to_login(); }
610

611
            $(".usermenu .username").text("options");
612

613
            // images config
614
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
615
            synnefo.ui.init();
616
            synnefo.ui.main.bind("ready", function(){
617
            });
618

619
        })
620
    </script>
621
</body>
622
</html>