Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (27 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 7)]>
26
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie7.css);</style>
27
    <![endif]-->
28

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

    
38

    
39
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.js"></script>
40
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.string.js"></script>
41
    <script src="{{ SYNNEFO_JS_LIB_URL}}backbone.js"></script>
42
    <script src="{{ SYNNEFO_JS_LIB_URL}}json2.js"></script>
43
    <script src="{{ SYNNEFO_JS_LIB_URL}}stacktrace.js"></script>
44

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

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

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

    
74
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_router.js"></script>
75
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_main_view.js"></script>
76

    
77
    <!-- the following views require refactor -->
78
    <script src="{{ SYNNEFO_JS_URL }}synnefo.js"></script>
79

    
80
    {{ CLOUDBAR_CODE }}
81
    
82
    <script>
83
        // empty object for console to avoid errors in browsers that don't support it
84
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
85
            window.console.error = function() {}};
86
        
87
        //populate available image icons array
88
        var os_icons = {{image_icons|safe}};
89
        
90
        // timeout value from settings.py
91
        var TIMEOUT = {{ timeout }};
92
        var TIMEOUTS_OCCURED = 0;
93
        var SKIP_TIMEOUTS = 1;
94
        var UPDATE_INTERVAL = {{ update_interval }};
95
        var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %};
96
        var FEEDBACK_URL = "{% url feedback %}";
97
        var FEEDBACK_TITLE = "{% trans "Send feedback" %}";
98
        var API_OVERLAY_TITLE = "{% trans "API access" %}";
99
        var API_OVERLAY_SUBCONTENT = "{% trans "The API key provides full access to your <em>~okeanos</em> account, so always keep it private." %}";
100

101
        STATE_TEXTS = {
102
            'UNKNOWN': '{% trans "Unknown" %}',
103
            'BUILD':  '{% trans "Building..." %}',
104
            'FIREWALL':  '{% trans "Firewall change..." %}',
105
            'REBOOT': '{% trans "Rebooting..." %}',
106
            'STOPPED':'{% trans "Stopped" %}',
107
            'ACTIVE': '{% trans "Running" %}',
108
            'ERROR':  '{% trans "Error" %}',
109
            'DELETE': '',
110
            'DESTROY': '{% trans "Destroying..." %}',
111
            'BUILD_INIT':  '{% trans "Building..." %}',
112
            'BUILD_COPY':  '{% trans "Building..." %}',
113
            'BUILD_FINAL':  '{% trans "Building..." %}',
114
            'SHUTDOWN': '{% trans "Shutting down..." %}',
115
            'START': '{% trans "Starting..." %}',
116
            'CONNECT': '{% trans "Connecting..." %}',
117
            'DISCONNECT': '{% trans "Disconnecting..." %}'
118
        }
119

120

121

122
        // building statuses
123
        var BUILDING_MESSAGES = {
124
            'INIT': '{% trans "Initializing..." %}',
125
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
126
            'FINAL': '{% trans "Finalizing..." %}'
127
        }
128

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

160
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
161
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
162

163
        var SUCCESS = {
164
            'HEADER' : '{% trans "Success" %}',
165
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
166
            'PASSWORD' : '{% trans "Password:" %}',
167
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
168
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
169
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
170
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
171
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
172
        };
173

174
        var VARIOUS = {
175
            'CONFIRM' : '{% trans "Confirm" %}',
176
            'CANCEL' : '{% trans "Cancel" %}',
177
            'APPLY' : '{% trans "Apply" %}',
178
            'OFF' : '{% trans "Off" %}',
179
            'ON' : '{% trans "On" %}'
180
        };
181

    
182
    </script>
183
</head>
184

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

    
208
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
209
                    {% endfor %}
210
                {% endcomment %}
211
                </div>
212
            </div>
213
            <div class="header-logo">
214
                <a href="/">
215
                    <img src="{{ SYNNEFO_IMAGES_URL }}okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
216
                </a>
217
            </div>
218
        </div>
219
        <div id="content">
220
            <div id="wrapper" class="clearfix">
221

    
222
                <div class="panes-menu clearfix">
223
                <!-- tabs -->
224
                <div class="tab-name">{% trans "machines" %}</div>
225
                <ul class="css-tabs">
226
                    <li><a href="machines" title="{% trans "manage  virtual " %}"
227
                        class="primary" id="machines_view_link">
228
                        <img src="{{ SYNNEFO_IMAGES_URL }}machines-icon.png" /></a></li>
229
                    <li><a href="networks" title="{% trans "configure " %}"
230
                        class="primary" id="networks_view_link">
231
                        <img src="{{ SYNNEFO_IMAGES_URL }}networks-icon.png" /></a></li>
232
                    <li class="hidden"><a href="disks" title="{% trans "manage  storage " %}"
233
                        class="primary" id="disks_view_link">
234
                        <img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li>
235
                </ul>
236
                </div>
237
                <div class="css-panes">
238
                    <div id="machines-pane" class="pane" style="display:block;">
239
                        {% include "partials/machines.html" %}
240
                    </div>
241
                    <div id="networks-pane" class="pane">
242
                        {% include "partials/networks.html" %}
243
                    </div>
244
                    <div id="disks-pane" class="pane"></div>
245

    
246
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
247
                        <div class="confirm_multiple_actions confirm-all-cont global hidden confirm_multiple_cont clearfix">
248
                            <div class="confirm-all msg">
249
                                <p>You requested multiple actions to execute (<span
250
                                    class"show">show all</span>)</p>
251
                                <button class="yes">Confirm all</button>
252
                                <button class="no">Cancel all</button>
253
                            </div>
254
                            <div class="details"></div>
255
                        </div>
256
                        <div class="ns-confirms-cont">
257
                            <div class="confirm_multiple_actions hidden confirm_multiple_cont
258
                                ns-confirm clearfix"
259
                                id="conirm_multiple_cont_template">
260
                                <div class="confirm-all msg">
261
                                    <p></p>
262
                                    <button class="yes"></button>
263
                                    <button class="no"></button>
264
                                </div>
265
                                <div class="details"></div>
266
                            </div>
267
                        </div>
268
                    </div>
269

    
270
                </div>
271
            </div>
272
        </div>
273
    </div>
274

    
275
    <!-- activate tabs with JavaScript -->
276
    <script>
277

278
        //load opera css fixes
279
        if ($.browser.opera) {
280
            $("<link/>", {
281
               rel: "stylesheet",
282
               type: "text/css",
283
               href: "{{ SYNNEFO_CSS_URL }}opera.css"
284
            }).appendTo("head");
285
        }
286

287
        $(document).ready(function(){
288

289
            {% if current_lang == "el" and not DEBUG %}
290
                window.location = "/lang/?l=en";
291
            {% endif %}
292

293
            // user menu interaction
294
            var resetUserMenu = function() {
295
                $(this).removeClass("hovered");
296
                $(this).removeClass("active");
297
            }
298

299
            $(".usermenu").live("click", function(){
300
                $(this).addClass("active");
301
            });
302
            $(".usermenu").bind('mouseleave', resetUserMenu);
303
            $(".usermenu").live("mouseover", function(){
304
                $(this).addClass("hovered");
305
            });
306

307
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
308
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
309

310
            // bind menu actions
311
            $(".usermenu .logout").click(function() {
312
                synnefo.auth_client.logout();
313
            });
314

315
            $(".usermenu .api").click(function(){
316
                synnefo.ui.main.api_info_view.show();
317
            });
318

319
        });
320
        
321
        function positionBottomMessages() {
322
            var el = $("#multiple_actions_container");
323
        }
324

325
        $(window).bind("load", function() { 
326
               var footerHeight = 0;
327
               var footerTop = 0;
328
               var $footer = $("#footer-container");
329

330
               positionFooter();
331
               function positionFooter() {
332
                   footerHeight = 80;
333
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
334
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
335

336
                       $footer.css({
337
                            position: "absolute"
338
                       }).css({
339
                            top: footerTop
340
                       })
341
                    } else {
342
                    
343
                       if ($footer.css("position") == "static") {
344
                           if ($(document.body).height() < $(window).height()) {    
345
                               $footer.css({
346
                                    position: "absolute"
347
                               }).css({
348
                                    top: footerTop
349
                                })
350
                            }
351
                        } else {
352

353
                           $footer.css({
354
                               position: "static"
355
                           })
356
                       }
357
                   }
358

359
                   }
360
               window.positionFooter = _.throttle(positionFooter, 100);
361
               $(window).scroll(positionFooter).resize(positionFooter)
362
        });
363
    </script>
364

    
365
    <!-- base notification for error/success reporting -->
366
    <a id="notification" rel="#error-success" href="#"></a>
367
    <a id="msgbox" rel="#notification-box" href="#"></a>
368
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
369

    
370
    <div class="overlay" id="generic-overlay-tpl">
371
        <div class="overlay-inner">
372
            <h3 class="overlay-header clearfix">
373
                <span class="subtitle"></span>
374
                <span class="title"></span>
375
                <span class="closeme">close</span></h3>
376
            <div class="container">
377
                <div class="content">
378
                </div>
379
            </div>
380
            <div class="footer"></div>
381
        </div>
382
    </div>
383

    
384
    <div id="error-overlay-content" class="hidden">
385
        <div class="error-nav hidden clearfix">
386
            <span class="indicator"><span class="num">1</span> <span
387
                    class="ind-msg">new error occured</span></span>
388
            <span class="show-next nav-btn">{% trans "next" %}</span>
389
            <span class="show-prev nav-btn">{% trans "previous" %}</span>
390
        </div>
391
        <div class="message"><p></p></div>
392
        <div class="error-details">
393
            <span class="key">{% trans "Module" %}</span>
394
            <span class="value error-module"></span>
395

    
396
            <span class="key">{% trans "Code" %}</span>
397
            <span class="value error-code"></span>
398

    
399
            <span class="key">{% trans "Type" %}</span>
400
            <span class="value error-type"></span>
401

    
402
            <span class="key details">{% trans "Details" %}</span>
403
            <div class="value error-more-details"><p></p></div>
404
        </div>
405
        
406
        <!--<div class="navigation">-->
407
            <!--<span class="next-error">{% trans "next error" %}</span>-->
408
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
409
        <!--</div>-->
410
        
411
        <!--<div class="date">-->
412
            <!--<span class="error-date"></span>-->
413
        <!--</div>-->
414

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

    
467
                    <input type="checkbox" name="submit-submit-data" class='submit-data' />
468
                    <input type="submit" value="{% trans "submit " %}" class="submit" />
469
                    <textarea name="feedback-data" class="data-text"></textarea>
470
                </form>
471
            </div>
472

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

    
501
    <div class="api_overlay_template">
502
        <div class="api_overlay_content">
503
            <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>
504
        </div>
505
    </div>
506

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

    
536
    <script>
537
        $(document).ready(function() {
538
            $(".css-panes").hide();
539

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

596
            // user config
597
            synnefo.user = synnefo.auth_client.get_user();
598
            if (!synnefo.user) { synnefo.auth_client.redirect_to_login(); }
599

600
            $(".usermenu .username").text(synnefo.user.username);
601

602
            // images config
603
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
604
            synnefo.ui.init();
605
            synnefo.ui.main.bind("ready", function(){
606
            });
607

608
        })
609
    </script>
610
</body>
611
</html>