Statistics
| Branch: | Tag: | Revision:

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

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

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

118

119

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

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

158
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
159
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
160

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

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

    
180
    </script>
181
</head>
182

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

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

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

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

    
268
                </div>
269
            </div>
270
        </div>
271
    </div>
272

    
273
    <!-- activate tabs with JavaScript -->
274
    <script>
275

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

285
        $(document).ready(function(){
286

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

590
            // user config
591
            synnefo.user = synnefo.auth_client.get_user();
592
            if (!synnefo.user) { synnefo.auth_client.redirect_to_login(); }
593

594
            $(".usermenu .username").text(synnefo.user.username);
595

596
            // images config
597
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
598
            synnefo.ui.init();
599
            synnefo.ui.main.bind("ready", function(){
600
            });
601

602
        })
603
    </script>
604
</body>
605
</html>