Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (31.3 kB)

1
<!doctype html>
2
<html>
3

    
4
{% load i18n %}
5
<head>
6
    <title>{{ BRANDING_SERVICE_NAME }}</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="{{ BRANDING_FAVICON_URL }}" />
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.2.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 }}quota.js"></script>
59
    <script src="{{ SYNNEFO_JS_URL }}sync.js"></script>
60
    <script src="{{ SYNNEFO_JS_URL }}models.js"></script>
61
    <script src="{{ SYNNEFO_JS_URL }}glance_models.js"></script>
62
    <script src="{{ SYNNEFO_JS_URL }}views.js"></script>
63

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

    
81
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_router.js"></script>
82
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_main_view.js"></script>
83

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

112
        STATE_TEXTS = {
113
            'UNKNOWN': '{% trans "Unknown" %}',
114
            'BUILD':  '{% trans "Building..." %}',
115
            'FIREWALL':  '{% trans "Firewall change..." %}',
116
            'REBOOT': '{% trans "Rebooting..." %}',
117
            'STOPPED':'{% trans "Stopped" %}',
118
            'ACTIVE': '{% trans "Running" %}',
119
            'ERROR':  '{% trans "Error" %}',
120
            'DELETE': '',
121
            'DESTROY': '{% trans "Destroying..." %}',
122
            'SHUTDOWN': '{% trans "Shutting down..." %}',
123
            'START': '{% trans "Starting..." %}',
124
            'CONNECT': '{% trans "Connecting..." %}',
125
            'DISCONNECT': '{% trans "Disconnecting..." %}',
126
            'RESIZE': '{% trans "Resizing..." %}'
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 "Bulding image..." %}'
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
    <div id="container">
196
        <div id="header">
197
            <div id="user">
198
                <div class="usermenu">
199
                    <div class="username"></div>
200
                    <ul class="useractions">
201
                        <!--<li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>-->
202
                        <li class="api"><a class="action" href="#">{% trans "API access..." %}</a></li>
203
                        <li class="public_ips"><a class="action" href="#">{% trans "public ips..." %}</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="/" title="{{ BRANDING_SERVICE_NAME }} Compute">
224
                     <img src="{{ BRANDING_COMPUTE_LOGO_URL }}" alt="{{ BRANDING_SERVICE_NAME }}"/>  
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
                    {% comment %}
242
                    <li><a href="disks" title="{% trans "manage  storage " %}"
243
                        class="primary" id="disks_view_link">
244
                        <img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li>
245
                    {% endcomment %}
246
                </ul>
247
                </div>
248
                <div class="css-panes">
249
                    <div id="machines-pane" class="pane" style="display:block;">
250
                        {% include "partials/machines.html" %}
251
                    </div>
252
                    <div id="networks-pane" class="pane">
253
                        {% include "partials/networks.html" %}
254
                    </div>
255
                    <div id="disks-pane" class="pane">
256
                            {% include "partials/disks.html" %}
257
                    </div>
258

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

    
282
                </div>
283
            </div>
284
        </div>
285
    </div>
286

    
287
    <!-- activate tabs with JavaScript -->
288
    <script>
289

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

299
        $(document).ready(function(){
300

301
            {% if current_lang == "el" and not DEBUG %}
302
                window.location = "/lang/?l=en";
303
            {% endif %}
304

305
            // user menu interaction
306
            var resetUserMenu = function() {
307
                $(this).removeClass("hovered");
308
                $(this).removeClass("active");
309
            }
310

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

319
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
320
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
321

322
            // bind menu actions
323
            $(".usermenu .logout").click(function() {
324
                synnefo.auth_client.logout();
325
            });
326

327
            $(".usermenu .api").click(function(){
328
                synnefo.ui.main.api_info_view.show();
329
            });
330

331
        });
332
        
333
        function positionBottomMessages() {
334
            var el = $("#multiple_actions_container");
335
        }
336
        
337
        
338
        $(document).ready(function() {
339
          // Footer position handlers
340
          var footerHeight = 0;
341
          var footerTop = 0;
342
          var $footer = $("#footer-container");
343
          function _positionFooter() {
344

345
              footerHeight = 80;
346
              footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
347
              if (($(document.body).height()+footerHeight) < $(window).height()) {
348

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

366
                      $footer.css({
367
                          position: "static"
368
                      })
369
                  }
370
              }
371

372
          }
373
          _positionFooter();
374
          window.positionFooter = _.throttle(_positionFooter, 100);
375
          window.forcePositionFooter = _positionFooter;
376
          $(window).scroll(window.positionFooter).resize(window.positionFooter)
377

378
          $(window).bind("load", function() { 
379
            _positionFooter();
380
          });
381
        
382
        })
383
    </script>
384

    
385
    <!-- base notification for error/success reporting -->
386
    <a id="notification" rel="#error-success" href="#"></a>
387
    <a id="msgbox" rel="#notification-box" href="#"></a>
388
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
389

    
390
    <div class="overlay" id="generic-overlay-tpl">
391
        <div class="overlay-inner">
392
            <h3 class="overlay-header clearfix">
393
                <span class="subtitle"></span>
394
                <span class="title"></span>
395
                <span class="closeme">close</span></h3>
396
            <div class="container">
397
                <div class="content">
398
                </div>
399
            </div>
400
            <div class="footer"></div>
401
        </div>
402
    </div>
403

    
404
    <div id="error-overlay-content" class="hidden">
405
        <div class="error-nav hidden clearfix">
406
            <span class="indicator"><span class="num">1</span> <span
407
                    class="ind-msg">new error occured</span></span>
408
            <span class="show-next nav-btn">{% trans "next" %}</span>
409
            <span class="show-prev nav-btn">{% trans "previous" %}</span>
410
        </div>
411
        <div class="message"><p></p></div>
412
        <div class="error-details">
413
            <span class="key">{% trans "Module" %}</span>
414
            <span class="value error-module"></span>
415

    
416
            <span class="key">{% trans "Code" %}</span>
417
            <span class="value error-code"></span>
418

    
419
            <span class="key">{% trans "Type" %}</span>
420
            <span class="value error-type"></span>
421

    
422
            <span class="key details">{% trans "Details" %}</span>
423
            <div class="value error-more-details"><p></p></div>
424
        </div>
425
        
426
        <!--<div class="navigation">-->
427
            <!--<span class="next-error">{% trans "next error" %}</span>-->
428
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
429
        <!--</div>-->
430
        
431
        <!--<div class="date">-->
432
            <!--<span class="error-date"></span>-->
433
        <!--</div>-->
434

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

    
487
              <input type="checkbox" name="submit-submit-data" class='submit-data' />
488
              <input type="submit" value="{% trans "submit " %}" class="submit" />
489
              <textarea name="feedback-data" class="data-text"></textarea>
490
            </form>
491
          </div>
492

    
493
          <div class="message sending">{% trans "submiting your data....." %}</div>
494
          <div class="message success">
495
            {% trans "thank you for submiting your feedback" %}
496
            <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
497
          <div class="message errormsg">
498
            {% trans "some error occured submiting submiting your feedback, please try again later" %}
499
            <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
500
        </div>
501
      </div>
502
    </div>
503
    
504
    <div id="details-overlay" class="overlay-content overlay-info hidden">
505
        <div class="description intro">
506
            <p></p>
507
        </div>
508
        <div class="description subinfo">
509
            <p></p>
510
        </div>
511
    </div>
512

    
513
    <div id="suspended-vm-overlay" class="overlay-content overlay-info hidden">
514
        <div class="description noborder">
515
          You VM has been suspended, please contact us for more details.
516
        </div>
517
    </div>
518

    
519
    <div id="api-info-overlay" class="overlay-content overlay-info hidden">
520
        <div class="description">
521
            <p>{% blocktrans with EXTERNAL_CLIENT_URL as EXTERNAL_CLIENT_URL %}Use the following API key along with the <a
522
                href="{{ EXTERNAL_CLIENT_URL }}">./kamaki</a> client to manage
523
            your cloud resources from outside this page.{% endblocktrans %}</p>
524
        </div>
525
        <div class="copy-content">
526
            <p></p>
527
        </div>
528
        <div class="description subinfo">
529
            <p>
530
            {% blocktrans %} The API key provides full access to your <em>{{ BRANDING_SERVICE_NAME }}</em> account, so always keep it private.{% endblocktrans %}
531
            </p>
532
        </div>
533
    </div>
534

    
535
    <div class="api_overlay_template">
536
        <div class="api_overlay_content">
537
            <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>
538
        </div>
539
    </div>
540

    
541
    <div class="modal" id="notification-box" class="notification-box">
542
        <h3 class="popup-header">
543
            <span class="header-box"></span>
544
        </h3>
545
        <div class="popup-body">
546
            <div class="popup-body-inner">
547
                <div class="machine-now-building"></div>
548
                <div class="popup-separator"></div>
549
                <div class="password-container">
550
                    <div class="password"></div>
551
                </div>
552
                <div class="sub-text"></div>
553
            </div>
554
        </div>
555
    </div>
556
    
557
    <div id="loading-view" class="hidden clearfix">
558
        <div class="header clearfix images off">Loading images...<span></span></div>
559
        <div class="header clearfix flavors off">Loading flavors...<span></span></div>
560
        <div class="header clearfix resources off">Loading resources...<span></span></div>
561
        <div class="header clearfix quotas off">Loading quotas...<span></span></div>
562
        <div class="header clearfix vms off">Loading machines...<span></span></div>
563
        <div class="header clearfix networks off">Loading networks...<span></span></div>
564
        <div class="header clearfix layout off">Rendering layout...<span></span></div>
565
    </div>
566
    <div id="user_public_keys" class="overlay-content overlay-content hidden">
567
        {% include "userdata/public_keys_view.html" %}
568
    </div>
569
    <div id="user_public_ips" class="overlay-content overlay-content hidden">
570
        {% include "partials/ips.html" %}
571
    </div>
572
    <div id="user_custom_images" class="overlay-content overlay-content hidden">
573
        {% include "partials/custom_images.html" %}
574
    </div>
575
    {% include "partials/vm_resize.html" %}
576
    {% include "footer.html" %}
577

    
578
    <script>
579
        $(document).ready(function() {
580
            $(".css-panes").hide();
581

582
            // TODO: match <= 1.9.1
583
            if ($.browser.mozilla && $.browser.version.substr(0,3) == "1.9") {
584
                synnefo.config.overlay_speed = 0;
585
                $.fx.off = true;
586
            }
587
            
588
            // synnefo js config
589
            synnefo.VERSION = "{{ synnefo_version }}";
590
            synnefo.config.update_interval = {{ update_interval }};
591
            synnefo.config.update_interval_increase = {{ update_interval_increase }};
592
            synnefo.config.fast_interval = {{ update_interval_fast }};
593
            synnefo.config.update_interval_increase_after_calls = {{ update_interval_increase_after_calls }};
594
            synnefo.config.update_interval_max = {{ update_interval_max }};
595
            synnefo.config.delay_on_blur = {{ delay_on_blur }};
596
            synnefo.config.update_hidden_views = {{ update_hidden_views }};
597
            synnefo.config.handle_window_exceptions = {{ handle_window_exceptions }};
598
            synnefo.config.ajax_timeout = {{ timeout }};
599
            synnefo.config.skip_timeouts = {{ skip_timeouts }};
600
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
601
            synnefo.config.vm_name_template = {{ vm_name_template|safe }};
602
            synnefo.config.flavors_disk_templates_info = {{ flavors_disk_templates_info|safe }};
603
            synnefo.config.vm_image_common_metadata = {{ vm_image_common_metadata|safe }};
604

605
            synnefo.config.diagnostics_update_interval = {{ diagnostics_update_interval }};
606
            // override diagnostic messages display
607
            synnefo.config.diagnostic_messages_tpls = {
608
              'image-helper-task-start': "{% trans "Running task 'MESSAGE'" %}"
609
            };
610
            // what messages to display based on vm status
611
            synnefo.config.diagnostics_status_messages_map = {
612
                'BUILD': ['image-helper-task-start', 'image-info'],
613
                'ERROR': ['image-error']
614
            };
615

616
            synnefo.config.api_urls = {
617
                'userdata': '{% url ui_userdata %}', 
618
                'compute':  {{ compute_api_url|safe }}, 
619
                'glance': {{ glance_api_url|safe }},
620
                'accounts': {{ accounts_api_url|safe }},
621
            };
622
            
623
            // TODO: configurable userdata urls in models.js
624
            synnefo.config.userdata_keys_url = '{% url ui_keys_collection %}';
625
            synnefo.config.userdata_keys_limit = {{ userdata_keys_limit }};
626
            
627
            // media config
628
            synnefo.config.media_url = '{{ UI_MEDIA_URL }}';
629
            synnefo.config.js_url = '{{ SYNNEFO_JS_URL }}';
630
            synnefo.config.images_url = '{{ SYNNEFO_IMAGES_URL }}';
631
            synnefo.config.image_deleted_title = {{ image_deleted_title|safe }};
632
            synnefo.config.changes_since_alignment = {{ changes_since_alignment }};
633
            synnefo.config.image_deleted_size_title = {{ image_deleted_size_title|safe }};
634
            synnefo.config.use_glance = {{ use_glance }};
635
            synnefo.config.indicators_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/indicators/';
636
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
637
            synnefo.config.ui_console_url = '{% url ui_machines_console %}';
638
            synnefo.config.ui_connect_url = '{% url ui_machines_connect %}';
639
            synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
640
            synnefo.config.unknown_os = {{ unknown_os|safe }};
641
            synnefo.config.os_created_users = {{ os_created_users|safe }};
642
            synnefo.config.feedback_post_url = {{ feedback_post_url|safe }};
643
            
644
            synnefo.config.logout_redirect = {{ logout_redirect|safe }};
645
            synnefo.config.login_redirect = {{ login_redirect|safe }};
646
            synnefo.config.auth_cookie_name = '{{ auth_cookie_name }}';
647

648
            synnefo.config.translate_uuids = {{ translate_uuids|safe }};
649
            synnefo.config.user_catalog_url = {{ user_catalog_url|safe }};
650

651
            synnefo.config.network_suggested_subnets = {{ network_suggested_subnets|safe }};
652
            synnefo.config.network_available_types = {{ network_available_types|safe }};
653
            synnefo.config.network_allow_duplicate_vm_nics = {{ network_allow_duplicate_vm_nics }};
654
            synnefo.config.network_strict_destroy = {{ network_strict_destroy }};
655
            synnefo.config.network_allow_multiple_destory = {{ network_allow_multiple_destroy }};
656
            synnefo.config.group_public_networks = {{ group_public_networks }};
657
            synnefo.config.grouped_public_network_name = {{ grouped_public_network_name|safe }};
658
            synnefo.config.vm_hostname_format = {{ vm_hostname_format|safe }};
659
            synnefo.config.automatic_network_range_format = {{ automatic_network_range_format|safe }};
660
            synnefo.config.custom_image_help_url = '{{ custom_image_help_url|safe }}';
661
            
662
            synnefo.auth_client = new synnefo.auth.AstakosClient({
663
                login_url: synnefo.config.login_redirect,
664
                logout_url: synnefo.config.logout_redirect,
665
                cookie_name: synnefo.config.auth_cookie_name,
666
                skip_redirects: {{ auth_skip_redirects|safe }},
667
                logout_callback: function(client) {
668
                    Backbone.history.navigate(client.config.logout_url);
669
                    window.location = client.config.logout_url; 
670
                }
671
            });
672

673
            // user config
674
            synnefo.user = synnefo.auth_client;
675
            if (!synnefo.user.get_token()) { 
676
              synnefo.auth_client.redirect_to_login(); 
677
            }
678

679
            $(".usermenu .username").text("options");
680

681
            // images config
682
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
683
            synnefo.ui.init();
684
            synnefo.ui.main.bind("ready", function(){
685
            });
686
            window.setTimeout(function(){
687
              $("#create").click();
688
              window.setTimeout(function() {
689
                //synnefo.ui.main.create_vm_view.show_step(3);
690
              }, 100)
691
            }, 800);
692
        })
693
    </script>
694
</body>
695
</html>