Statistics
| Branch: | Tag: | Revision:

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

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

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

126

127

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

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

166
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
167
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
168

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

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

    
188
    </script>
189
</head>
190

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

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

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

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

    
276
                </div>
277
            </div>
278
        </div>
279
    </div>
280

    
281
    <!-- activate tabs with JavaScript -->
282
    <script>
283

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

293
        $(document).ready(function(){
294

295
            {% if current_lang == "el" and not DEBUG %}
296
                window.location = "/lang/?l=en";
297
            {% endif %}
298

299
            // user menu interaction
300
            var resetUserMenu = function() {
301
                $(this).removeClass("hovered");
302
                $(this).removeClass("active");
303
            }
304

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

313
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
314
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
315

316
            // bind menu actions
317
            $(".usermenu .logout").click(function() {
318
                synnefo.auth_client.logout();
319
            });
320

321
            $(".usermenu .api").click(function(){
322
                synnefo.ui.main.api_info_view.show();
323
            });
324

325
        });
326
        
327
        function positionBottomMessages() {
328
            var el = $("#multiple_actions_container");
329
        }
330

331
        $(window).bind("load", function() { 
332
               var footerHeight = 0;
333
               var footerTop = 0;
334
               var $footer = $("#footer-container");
335

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

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

359
                           $footer.css({
360
                               position: "static"
361
                           })
362
                       }
363
                   }
364

365
                   }
366
               window.positionFooter = _.throttle(positionFooter, 100);
367
               $(window).scroll(positionFooter).resize(positionFooter)
368
        });
369
    </script>
370

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

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

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

    
402
            <span class="key">{% trans "Code" %}</span>
403
            <span class="value error-code"></span>
404

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

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

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

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

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

    
507
    <div class="api_overlay_template">
508
        <div class="api_overlay_content">
509
            <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>
510
        </div>
511
    </div>
512

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

    
542
    <script>
543
        $(document).ready(function() {
544
            $(".css-panes").hide();
545

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

602
            // user config
603
            synnefo.user = synnefo.auth_client.get_user();
604
            if (!synnefo.user) { synnefo.auth_client.redirect_to_login(); }
605

606
            $(".usermenu .username").text("options");
607

608
            // images config
609
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
610
            synnefo.ui.init();
611
            synnefo.ui.main.bind("ready", function(){
612
            });
613

614
        })
615
    </script>
616
</body>
617
</html>