home.html 33.9 KB
Newer Older
1
<!doctype html>
Mike Muzurakis's avatar
Mike Muzurakis committed
2
3
<html>

Markos Gogoulos's avatar
Markos Gogoulos committed
4
{% load i18n %}
Dimitris Moraitis's avatar
Dimitris Moraitis committed
5
<head>
6
    <title>{{ BRANDING_SERVICE_NAME }}</title>
7
    
8
    <!--<meta http-equiv="X-UA-Compatible" content="IE=7">-->
9
10
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

11
12
    <link href="https://fonts.googleapis.com/css?family=Ubuntu&subset=latin,greek" rel="stylesheet" type="text/css" >
    <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 }}" />
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
15

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

20
21
    <link rel="stylesheet" type="text/css" 
          href="{{ SYNNEFO_CSS_URL }}main.css?v={{ SYNNEFO_JS_LIB_VERSION }}"/>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
22

23
    <!--[if IE]>
24
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie.css?v={{ SYNNEFO_JS_LIB_VERSION }});</style>
25
    <![endif]-->
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
26
    <!--[if (lte IE 8)]>
27
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie8.css?v={{ SYNNEFO_JS_LIB_VERSION }});</style>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
28
    <![endif]-->
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
29
    <!--[if (lte IE 7)]>
30
        <style type="text/css" media="all">@import url({{ SYNNEFO_CSS_URL }}ie7.css?v={{ SYNNEFO_JS_LIB_VERSION }});</style>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
31
    <![endif]-->
32

33
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery-1.7.2.js"></script>
34
35
36
37
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.cookie.js"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.client.js"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.tools.min.js"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.dataTables.min.js"></script>
38
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.pagination.js"></script>
39
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.zclip.js"></script>
40
    <script src="{{ SYNNEFO_JS_LIB_URL}}jquery.base64.js"></script>
41
42
43
    <script src="{{ SYNNEFO_JS_LIB_URL}}rivets.js"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}filereader.js"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}filesaver.js"></script>
44

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
45

46
47
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}underscore.string.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
48
    <script src="{{ SYNNEFO_JS_LIB_URL}}rivets.conf.js"></script>
49
50
51
    <script src="{{ SYNNEFO_JS_LIB_URL}}backbone.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}json2.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_LIB_URL}}stacktrace.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
52
    <script src="{{ SYNNEFO_JS_LIB_URL}}backbone-filtered-collection.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
53

54
    <!--[if (lt IE 7)]>
55
        <script src="{{ SYNNEFO_JS_LIB_URL }}selectivizr.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
56
57
58
    <! [endif] -->

    <!--[if IE]>
59
        <script src="{{ SYNNEFO_JS_URL }}ui/ie_fixes.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
60
    <![endif]-->
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
61
    
62
63
64
65
66
    <script src="{{ SYNNEFO_JS_URL }}utils.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_URL }}auth.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_URL }}quota.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_URL }}sync.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_URL }}models.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
67
    <script src="{{ SYNNEFO_JS_URL }}neutron.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
68
69
    <script src="{{ SYNNEFO_JS_URL }}glance_models.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_URL }}views.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
70
    <script src="{{ SYNNEFO_JS_URL }}views_ext.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
71
72
73
74
75
76
77
78

    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_vms_base_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_model_views.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_error_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_icon_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_single_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_list_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_networks_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
79
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_public_keys_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
80
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_disks_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
81
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_ips_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
82
83
84
85
86
87
88
89
90
91
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_metadata_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_feedback_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_create_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_connect_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_vm_resize_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_public_keys_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_custom_images.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>

    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_router.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
    <script src="{{ SYNNEFO_JS_WEB_URL }}ui_main_view.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
92
93

    <!-- the following views require refactor -->
94
    <script src="{{ SYNNEFO_JS_URL }}synnefo.js?v={{ SYNNEFO_JS_LIB_VERSION }}"></script>
95
96
97
    <script>
        tmp_auth_client = new synnefo.auth.AstakosClient({
            cookie_name: '{{ auth_cookie_name }}',
98
            login_url: {{ login_redirect|safe }}
99
        });
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
100
        if (!tmp_auth_client.get_token()) { tmp_auth_client.redirect_to_login(); }
101
    </script>
102
    {{ CLOUDBAR_CODE }}
103
    
104
    <script>
105
        // empty object for console to avoid errors in browsers that don't support it
106
107
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
            window.console.error = function() {}};
108
        
109
110
        //populate available image icons array
        var os_icons = {{image_icons|safe}};
111
        
Dimitris Moraitis's avatar
Dimitris Moraitis committed
112
        // timeout value from settings.py
113
        var TIMEOUT = {{ timeout }};
114
        var TIMEOUTS_OCCURED = 0;
115
        var SKIP_TIMEOUTS = {{ skip_timeouts }};
116
        var UPDATE_INTERVAL = {{ update_interval }};
117
        var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %};
118
        var API_OVERLAY_TITLE = "{% trans "API access" %}";
119
        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 %}";
120
121
122
123
124
125
126
127
128
129
130
131
132
133

        STATE_TEXTS = {
            'UNKNOWN': '{% trans "Unknown" %}',
            'BUILD':  '{% trans "Building..." %}',
            'FIREWALL':  '{% trans "Firewall change..." %}',
            'REBOOT': '{% trans "Rebooting..." %}',
            'STOPPED':'{% trans "Stopped" %}',
            'ACTIVE': '{% trans "Running" %}',
            'ERROR':  '{% trans "Error" %}',
            'DELETE': '',
            'DESTROY': '{% trans "Destroying..." %}',
            'SHUTDOWN': '{% trans "Shutting down..." %}',
            'START': '{% trans "Starting..." %}',
            'CONNECT': '{% trans "Connecting..." %}',
134
135
            'DISCONNECT': '{% trans "Disconnecting..." %}',
            'RESIZE': '{% trans "Resizing..." %}'
136
137
138
139
        }



140
        // building statuses
141
        var BUILDING_MESSAGES = {
142
            'INIT': '{% trans "Initializing..." %}',
143
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
144
            'FINAL': '{% trans "Bulding image..." %}'
145
        }
146

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

178
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
179
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
180

Dimitris Moraitis's avatar
Dimitris Moraitis committed
181
        var SUCCESS = {
182
            'HEADER' : '{% trans "Success" %}',
183
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
184
            'PASSWORD' : '{% trans "Password:" %}',
Markos Gogoulos's avatar
ui css    
Markos Gogoulos committed
185
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
186
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
Markos Gogoulos's avatar
Markos Gogoulos committed
187
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
188
189
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
Dimitris Moraitis's avatar
Dimitris Moraitis committed
190
        };
191

192
193
        var VARIOUS = {
            'CONFIRM' : '{% trans "Confirm" %}',
194
            'CANCEL' : '{% trans "Cancel" %}',
195
196
197
            'APPLY' : '{% trans "Apply" %}',
            'OFF' : '{% trans "Off" %}',
            'ON' : '{% trans "On" %}'
198
199
        };

200
    </script>
Dimitris Moraitis's avatar
Dimitris Moraitis committed
201
</head>
202

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
203
<body id="app">
204
    <div id="container">
205
206
        <div id="header">
            <div id="user">
207
                <div class="usermenu">
208
                    <div class="username"></div>
209
                    <ul class="useractions">
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
210
                        <!--<li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>-->
211
                        <li class="api"><a class="action" href="#">{% trans "API access..." %}</a></li>
212
                        <li class="public_ips"><a class="action" href="#">{% trans "IP addresses..." %}</a></li>
213
                        <li class="public_keys"><a class="action" href="#">{% trans "ssh public keys..." %}</a></li>
214
                        <!--<li class="custom_images"><a class="action" href="#">{% trans "custom images..." %}</a></li>-->
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
215
                        <!--<li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li>-->
216
217
218
                    </ul>
                </div>
                <div class="langmenu">
219
220
                    <a class="current_lang">en</a>
                    {% comment %}
221
222
                {% get_available_languages as LANGUAGES %}
                {% for lang in LANGUAGES %}
223
224
225
                <a {% if current_lang == lang.0 %}
                    class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a>

226
227
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
                    {% endfor %}
228
                {% endcomment %}
229
                </div>
230
231
            </div>
            <div class="header-logo">
232
                <a href="/" title="{{ BRANDING_SERVICE_NAME }} Compute">
233
                     <img src="{{ BRANDING_COMPUTE_LOGO_URL }}" alt="{{ BRANDING_SERVICE_NAME }}"/>  
234
235
                </a>
            </div>
Dimitris Moraitis's avatar
Dimitris Moraitis committed
236
        </div>
237
        <div id="content">
238
239
240
            <div id="wrapper" class="clearfix">

                <div class="panes-menu clearfix">
241
242
243
                <!-- tabs -->
                <div class="tab-name">{% trans "machines" %}</div>
                <ul class="css-tabs">
244
                    <li><a href="machines" title="{% trans "manage your virtual machines" %}"
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
245
                        data-hover-title="machines" class="primary" id="machines_view_link">
246
                        <img src="{{ SYNNEFO_IMAGES_URL }}machines-icon.png" /></a></li>
247
                    <li><a href="networks" title="{% trans "configure networking" %}"
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
248
                        data-hover-title="networks" class="primary" id="networks_view_link">
249
                        <img src="{{ SYNNEFO_IMAGES_URL }}networks-icon.png" /></a></li>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
250
251
                    <li><a href="ips" title="{% trans "manage your IP addresses" %}"
                        data-hover-title="ips" class="primary" id="ips_view_link">
252
                        <img src="{{ SYNNEFO_IMAGES_URL }}disks-icon.png" /></a></li>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
253
254
255
                    <li><a href="public-keys" title="{% trans "manage your public keys" %}"
                        data-hover-title="public keys" class="primary" id="public_keys_view_link">
                        <img src="{{ SYNNEFO_IMAGES_URL }}machines-icon.png" /></a></li>
256
                </ul>
257
                </div>
258
                <div class="css-panes">
259
260
261
                    <div id="machines-pane" class="pane" style="display:block;">
                        {% include "partials/machines.html" %}
                    </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
262
                    <div id="networks-pane" class="pane-view">
263
264
                        {% include "partials/networks.html" %}
                    </div>
265
266
267
                    <div id="disks-pane" class="pane">
                    	{% include "partials/disks.html" %}
                    </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
268
269
270
271
272
273
                    <div id="ips-pane" class="pane-view">
                    	{% include "partials/ips.html" %}
                    </div>
                    <div id="public-keys-pane" class="pane-view">
                    	{% include "partials/public_keys.html" %}
                    </div>
274

275
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
276
277
                        <div class="confirm_multiple_actions confirm-all-cont global hidden confirm_multiple_cont clearfix">
                            <div class="confirm-all msg">
278
                                <p>You requested multiple actions to execute (<span class="show">show all</span>)</p>
279
280
281
282
                                <button class="yes">Confirm all</button>
                                <button class="no">Cancel all</button>
                            </div>
                            <div class="details"></div>
283
                        </div>
284
285
286
287
288
289
290
291
292
293
294
                        <div class="ns-confirms-cont">
                            <div class="confirm_multiple_actions hidden confirm_multiple_cont
                                ns-confirm clearfix"
                                id="conirm_multiple_cont_template">
                                <div class="confirm-all msg">
                                    <p></p>
                                    <button class="yes"></button>
                                    <button class="no"></button>
                                </div>
                                <div class="details"></div>
                            </div>
295
                        </div>
296
297
                    </div>

298
299
                </div>
            </div>
Dimitris Moraitis's avatar
Dimitris Moraitis committed
300
301
        </div>
    </div>
302

Dimitris Moraitis's avatar
Dimitris Moraitis committed
303
304
    <!-- activate tabs with JavaScript -->
    <script>
305

306
307
308
309
310
        //load opera css fixes
        if ($.browser.opera) {
            $("<link/>", {
               rel: "stylesheet",
               type: "text/css",
311
               href: "{{ SYNNEFO_CSS_URL }}opera.css?v={{ SYNNEFO_JS_LIB_VERSION }}"
312
313
            }).appendTo("head");
        }
314
315

        $(document).ready(function(){
316

317
318
319
320
            {% if current_lang == "el" and not DEBUG %}
                window.location = "/lang/?l=en";
            {% endif %}

321
            // user menu interaction
322
323
324
325
            var resetUserMenu = function() {
                $(this).removeClass("hovered");
                $(this).removeClass("active");
            }
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
326

327
328
329
330
331
332
333
            $(".usermenu").live("click", function(){
                $(this).addClass("active");
            });
            $(".usermenu").bind('mouseleave', resetUserMenu);
            $(".usermenu").live("mouseover", function(){
                $(this).addClass("hovered");
            });
334

335
336
337
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});

338
339
            // bind menu actions
            $(".usermenu .logout").click(function() {
340
                synnefo.auth_client.logout();
341
            });
342

343
344
345
            $(".usermenu .api").click(function(){
                synnefo.ui.main.api_info_view.show();
            });
346
347
348
349
350
351

        });
        
        function positionBottomMessages() {
            var el = $("#multiple_actions_container");
        }
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
        
        
        $(document).ready(function() {
          // Footer position handlers
          var footerHeight = 0;
          var footerTop = 0;
          var $footer = $("#footer-container");
          function _positionFooter() {

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

                  $footer.css({
                       position: "absolute"
                  }).css({
                       top: footerTop
                  })
               } else {
               
                  if ($footer.css("position") == "static") {
                      if ($(document.body).height() < $(window).height()) {    
                          $footer.css({
                               position: "absolute"
                          }).css({
                               top: footerTop
378
379
                           })
                       }
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
                   } else {

                      $footer.css({
                          position: "static"
                      })
                  }
              }

          }
          _positionFooter();
          window.positionFooter = _.throttle(_positionFooter, 100);
          window.forcePositionFooter = _positionFooter;
          $(window).scroll(window.positionFooter).resize(window.positionFooter)

          $(window).bind("load", function() { 
            _positionFooter();
          });
        
        })
Dimitris Moraitis's avatar
Dimitris Moraitis committed
399
    </script>
400

401
402
    <!-- base notification for error/success reporting -->
    <a id="notification" rel="#error-success" href="#"></a>
403
    <a id="msgbox" rel="#notification-box" href="#"></a>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
404
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
    
    <!-- rename view tpl -->
    <div id="rename-view-tpl" class="hidden model-rename-view">
      <div class="model-name">
        <h3>
          <span data-rv-text="model.name" class="value"></span>
          <span class="edit-btn" data-rv-on-click="view.set_edit"></span>
        </h3>
      </div>
      <div class="edit">
        <input type="text" class="rename-input" />
        <div class="rename-actions">
          <div class="btn confirm" data-rv-on-click="view.rename"></div>
          <div class="btn cancel" data-rv-on-click="view.unset_edit"></div>
        </div>
      </div>
    </div>
422

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
423
    <!-- generic overlay tpl -->
424
    <div class="overlay" id="generic-overlay-tpl">
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
425
        <div class="overlay-inner">
426
            <h3 class="overlay-header clearfix">
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
427
428
429
430
431
432
                <span class="subtitle"></span>
                <span class="title"></span>
                <span class="closeme">close</span></h3>
            <div class="container">
                <div class="content">
                </div>
433
            </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
434
            <div class="footer"></div>
435
436
        </div>
    </div>
437

438
    <div id="error-overlay-content" class="hidden">
439
440
441
442
443
444
        <div class="error-nav hidden clearfix">
            <span class="indicator"><span class="num">1</span> <span
                    class="ind-msg">new error occured</span></span>
            <span class="show-next nav-btn">{% trans "next" %}</span>
            <span class="show-prev nav-btn">{% trans "previous" %}</span>
        </div>
445
446
447
448
449
450
451
452
453
454
455
456
457
458
        <div class="message"><p></p></div>
        <div class="error-details">
            <span class="key">{% trans "Module" %}</span>
            <span class="value error-module"></span>

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

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

            <span class="key details">{% trans "Details" %}</span>
            <div class="value error-more-details"><p></p></div>
        </div>
459
460
461
462
463
464
465
466
467
        
        <!--<div class="navigation">-->
            <!--<span class="next-error">{% trans "next error" %}</span>-->
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
        <!--</div>-->
        
        <!--<div class="date">-->
            <!--<span class="error-date"></span>-->
        <!--</div>-->
468
469
470
471
472

        <div class="actions">
            <span class="show-details">{% trans "Show details" %}</span>
            <span class="hide-details">{% trans "Hide details" %}</span>
            <span class="report-error">{% trans "Send report" %}</span>
473
            <span class="reload-app">{% trans "Reload" %}</span>
474
475
476
477
478
        </div>
    </div>
    <div id="feedback-overlay-content" class="hidden overlay-content feedback-form">
        <div class="description">
            <p>
479
                {% blocktrans %}{{ BRANDING_SERVICE_NAME }} is currently in alpha test and we would appreciate any kind of feedback.
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
                We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}
            </p>
        </div>
        <div class="description messages noborder">
            <p class="success-message hidden">
            {% trans "thank you for submiting your feedback" %}
            </p>
            <p class="error-message hidden">
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
            </p>
            <p class="sending-message hidden">
            {% blocktrans %}Sending feedback...{% endblocktrans %}
            </p>
        </div>
        <div class="form">
            <div class="form-field">
                <label for>{% trans "Please describe your problem here, provide as many details as possible" %}</label>
                <textarea class="feedback-message"> 
                </textarea>
            </div>
            <div class="form-actions clearfix noborder">
                <span class="form-action submit">{% trans "send feedback" %}</span>
            </div>
        </div>
    </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
505
    <div class="modal" id="feedback-form" class="feedback notification-box">
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
506
507
508
509
510
511
512
      <h3 class="popup-header overlay-header">
        <span class="header-box">{% trans "Send feedback" %}</span>
      </h3>
      <div class="popup-body">
        <div class="popup-body-inner">
          <div class="form-container">
            <p class="feedback-intro">
513
            {% blocktrans %}Synnefo is currently in alpha test and we would appreciate any kind of feedback.
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
            We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}</p>
            <form id="feedback-form">
              <label for="feedback-msg">{% trans "Please describe your problem here, provide as many details as possible" %}</label>
              <div class="description"></div>
              <div class="empty-error-msg">{% trans "Please provide some feedback" %}</div>
              <textarea name="feedback-msg" class="feedback-text"></textarea>

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

          <div class="message sending">{% trans "submiting your data....." %}</div>
          <div class="message success">
            {% trans "thank you for submiting your feedback" %}
            <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
          <div class="message errormsg">
            {% trans "some error occured submiting submiting your feedback, please try again later" %}
            <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
534
        </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
535
      </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
536
    </div>
537
    
538
539
540
541
542
543
544
545
546
    <div id="details-overlay" class="overlay-content overlay-info hidden">
        <div class="description intro">
            <p></p>
        </div>
        <div class="description subinfo">
            <p></p>
        </div>
    </div>

547
548
549
550
551
552
    <div id="suspended-vm-overlay" class="overlay-content overlay-info hidden">
        <div class="description noborder">
          You VM has been suspended, please contact us for more details.
        </div>
    </div>

553
554
555
556
557
558
559
560
561
562
563
    <div id="api-info-overlay" class="overlay-content overlay-info hidden">
        <div class="description">
            <p>{% blocktrans with EXTERNAL_CLIENT_URL as EXTERNAL_CLIENT_URL %}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.{% endblocktrans %}</p>
        </div>
        <div class="copy-content">
            <p></p>
        </div>
        <div class="description subinfo">
            <p>
564
            {% blocktrans %} The API key provides full access to your <em>{{ BRANDING_SERVICE_NAME }}</em> account, so always keep it private.{% endblocktrans %}
565
566
567
568
            </p>
        </div>
    </div>

569
570
    <div class="api_overlay_template">
        <div class="api_overlay_content">
571
            <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>
572
573
        </div>
    </div>
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
574
575

    <div class="modal" id="notification-box" class="notification-box">
576
577
578
579
580
581
582
583
584
585
        <h3 class="popup-header">
            <span class="header-box"></span>
        </h3>
        <div class="popup-body">
            <div class="popup-body-inner">
                <div class="machine-now-building"></div>
                <div class="popup-separator"></div>
                <div class="password-container">
                    <div class="password"></div>
                </div>
586
                <div class="sub-text"></div>
587
588
589
            </div>
        </div>
    </div>
590
    
591
592
593
    <div id="loading-view" class="hidden clearfix">
        <div class="header clearfix images off">Loading images...<span></span></div>
        <div class="header clearfix flavors off">Loading flavors...<span></span></div>
594
595
        <div class="header clearfix resources off">Loading resources...<span></span></div>
        <div class="header clearfix quotas off">Loading quotas...<span></span></div>
596
597
598
        <div class="header clearfix vms off">Loading machines...<span></span></div>
        <div class="header clearfix networks off">Loading networks...<span></span></div>
        <div class="header clearfix layout off">Rendering layout...<span></span></div>
599
    </div>
600
601
602
    <div id="user_custom_images" class="overlay-content overlay-content hidden">
        {% include "partials/custom_images.html" %}
    </div>
603
    {% include "partials/vm_resize.html" %}
604
605
606
607
608
    {% include "footer.html" %}

    <script>
        $(document).ready(function() {
            $(".css-panes").hide();
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
609

610
            // TODO: match <= 1.9.1
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
611
            if ($.browser.mozilla && $.browser.version.substr(0,3) == "1.9") {
612
                synnefo.config.overlay_speed = 0;
613
                $.fx.off = true;
614
            }
615
616
            
            // synnefo js config
617
            synnefo.VERSION = "{{ synnefo_version }}";
618
            synnefo.config.update_interval = {{ update_interval }};
619
620
621
622
            synnefo.config.update_interval_increase = {{ update_interval_increase }};
            synnefo.config.fast_interval = {{ update_interval_fast }};
            synnefo.config.update_interval_increase_after_calls = {{ update_interval_increase_after_calls }};
            synnefo.config.update_interval_max = {{ update_interval_max }};
623
624
625
626
627
            synnefo.config.delay_on_blur = {{ delay_on_blur }};
            synnefo.config.update_hidden_views = {{ update_hidden_views }};
            synnefo.config.handle_window_exceptions = {{ handle_window_exceptions }};
            synnefo.config.ajax_timeout = {{ timeout }};
            synnefo.config.skip_timeouts = {{ skip_timeouts }};
628
629
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
            synnefo.config.vm_name_template = {{ vm_name_template|safe }};
630
            synnefo.config.flavors_disk_templates_info = {{ flavors_disk_templates_info|safe }};
631
            synnefo.config.vm_image_common_metadata = {{ vm_image_common_metadata|safe }};
632
            synnefo.config.private_networks_nic_hotplug = {{ private_networks_nic_hotplug|safe }};
633
634
635
636
637
638
639
640
641
642
643
644

            synnefo.config.diagnostics_update_interval = {{ diagnostics_update_interval }};
            // override diagnostic messages display
            synnefo.config.diagnostic_messages_tpls = {
              'image-helper-task-start': "{% trans "Running task 'MESSAGE'" %}"
            };
            // what messages to display based on vm status
            synnefo.config.diagnostics_status_messages_map = {
                'BUILD': ['image-helper-task-start', 'image-info'],
                'ERROR': ['image-error']
            };

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
645
            synnefo.config.api_urls = {
646
                'userdata': '{% url ui_userdata %}', 
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
647
                'compute':  {{ compute_api_url|safe }}, 
648
                'network':  {{ network_api_url|safe }}, 
649
650
                'glance': {{ glance_api_url|safe }},
                'accounts': {{ accounts_api_url|safe }},
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
651
            };
652
            
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
653
            // TODO: configurable userdata urls in models.js
654
            synnefo.config.userdata_keys_url = '{% url ui_keys_collection %}';
655
            synnefo.config.userdata_keys_limit = {{ userdata_keys_limit }};
656
            
657
            // media config
658
659
            synnefo.config.media_url = '{{ UI_MEDIA_URL }}';
            synnefo.config.js_url = '{{ SYNNEFO_JS_URL }}';
660
            synnefo.config.images_url = '{{ SYNNEFO_IMAGES_URL }}';
661
            synnefo.config.image_deleted_title = {{ image_deleted_title|safe }};
662
            synnefo.config.changes_since_alignment = {{ changes_since_alignment }};
663
            synnefo.config.image_deleted_size_title = {{ image_deleted_size_title|safe }};
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
664
            synnefo.config.use_glance = {{ use_glance }};
665
666
            synnefo.config.indicators_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/indicators/';
            synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
667
668
            synnefo.config.ui_console_url = '{% url ui_machines_console %}';
            synnefo.config.ui_connect_url = '{% url ui_machines_connect %}';
669
            synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
670
            synnefo.config.unknown_os = {{ unknown_os|safe }};
671
            synnefo.config.os_created_users = {{ os_created_users|safe }};
672
            synnefo.config.feedback_post_url = {{ feedback_post_url|safe }};
673
            
674
675
            synnefo.config.logout_redirect = {{ logout_redirect|safe }};
            synnefo.config.login_redirect = {{ login_redirect|safe }};
676
            synnefo.config.auth_cookie_name = '{{ auth_cookie_name }}';
677

678
679
680
            synnefo.config.translate_uuids = {{ translate_uuids|safe }};
            synnefo.config.user_catalog_url = {{ user_catalog_url|safe }};

681
682
683
684
685
            synnefo.config.network_suggested_subnets = {{ network_suggested_subnets|safe }};
            synnefo.config.network_available_types = {{ network_available_types|safe }};
            synnefo.config.network_allow_duplicate_vm_nics = {{ network_allow_duplicate_vm_nics }};
            synnefo.config.network_strict_destroy = {{ network_strict_destroy }};
            synnefo.config.network_allow_multiple_destory = {{ network_allow_multiple_destroy }};
686
            synnefo.config.group_public_networks = {{ group_public_networks }};
687
            synnefo.config.grouped_public_network_name = {{ grouped_public_network_name|safe }};
688
            synnefo.config.vm_hostname_format = {{ vm_hostname_format|safe }};
689
            synnefo.config.automatic_network_range_format = {{ automatic_network_range_format|safe }};
690
            synnefo.config.custom_image_help_url = '{{ custom_image_help_url|safe }}';
691
692
693
694
            
            synnefo.auth_client = new synnefo.auth.AstakosClient({
                login_url: synnefo.config.login_redirect,
                logout_url: synnefo.config.logout_redirect,
695
                cookie_name: synnefo.config.auth_cookie_name,
696
                skip_redirects: {{ auth_skip_redirects|safe }},
697
698
699
700
                logout_callback: function(client) {
                    Backbone.history.navigate(client.config.logout_url);
                    window.location = client.config.logout_url; 
                }
701
702
            });

703
            // user config
704
705
706
707
            synnefo.user = synnefo.auth_client;
            if (!synnefo.user.get_token()) { 
              synnefo.auth_client.redirect_to_login(); 
            }
708

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
709
            $(".usermenu .username").text("options");
710

711
            // images config
712
            synnefo.config.system_images_owners = {{ system_images_owners|safe }};
713
            synnefo.ui.init();
714
            synnefo.ui.main.bind("ready", function(){
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
715
            });
716
        });
717
    </script>
Dimitris Moraitis's avatar
Dimitris Moraitis committed
718
719
</body>
</html>