Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ dc020cf6

History | View | Annotate | Download (22.8 kB)

1
<!doctype html>
2
<html>
3

    
4
{% load i18n %}
5
<head>
6
    <title>~okeanos</title>
7

    
8
    <!--<meta http-equiv="X-UA-Compatible" content="IE=7">-->
9
    <link href="http://fonts.googleapis.com/css?family=Ubuntu&subset=latin,greek" rel="stylesheet" type="text/css" >
10
    <link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,greek' rel='stylesheet' type='text/css'>
11

    
12
    {% comment %}
13
    <script type="text/javascript" src="{% url javascript_catalog %}"></script> 
14
    {% endcomment %}
15

    
16
    <link rel="stylesheet" type="text/css" href="static/main.css"/>
17
    <!--[if IE]>
18
        <style type="text/css" media="all">@import url(static/ie.css);</style>
19
    <![endif]-->
20

    
21
    <script src="static/snf/js/lib/jquery.js"></script>
22
    <script src="static/snf/js/lib/jquery.cookie.js"></script>
23
    <script src="static/snf/js/lib/jquery.client.js"></script>
24
    <script src="static/snf/js/lib/jquery.tools.min.js"></script>
25
    <script src="static/snf/js/lib/jquery.dataTables.min.js"></script>
26

    
27
    <script src="static/snf/js/lib/underscore.js"></script>
28
    <script src="static/snf/js/lib/underscore.string.js"></script>
29
    <script src="static/snf/js/lib/backbone.js"></script>
30
    <script src="static/snf/js/lib/json2.js"></script>
31
    <script src="static/snf/js/lib/stacktrace.js"></script>
32
    <!--[if (gte IE 6)&(lte IE 7)]>
33
        <script src="static/snf/js/lib/selectivizr.js"></script>
34
    <! [endif] -->
35

    
36
    <!--[if IE]>
37
        <script src="static/snf/js/ui/ie_fixes.js"></script>
38
    <![endif]-->
39

    
40

    
41
    
42
    <script src="static/snf/js/utils.js"></script>
43
    <script src="static/snf/js/sync.js"></script>
44
    <script src="static/snf/js/models.js"></script>
45
    <script src="static/snf/js/views.js"></script>
46

    
47
    <script src="static/snf/js/ui/web/ui_vms_base_view.js"></script>
48
    <script src="static/snf/js/ui/web/ui_error_view.js"></script>
49
    <script src="static/snf/js/ui/web/ui_icon_view.js"></script>
50
    <script src="static/snf/js/ui/web/ui_single_view.js"></script>
51
    <script src="static/snf/js/ui/web/ui_list_view.js"></script>
52
    <script src="static/snf/js/ui/web/ui_networks_view.js"></script>
53
    <script src="static/snf/js/ui/web/ui_main_view.js"></script>
54
    <script src="static/snf/js/ui/web/ui_metadata_view.js"></script>
55
    <script src="static/snf/js/ui/web/ui_feedback_view.js"></script>
56
    <script src="static/snf/js/ui/web/ui_create_view.js"></script>
57

    
58
    <!-- the following views require refactor -->
59
    <!--<script src="static/snf/js/ui/create_view.js"></script>-->
60
    <script src="static/invitations.js"></script>
61
    <script src="static/synnefo.js"></script>
62

    
63
    {% if DEBUG %}
64
        <script src="static/snf/js/tests/functional.js"></script>
65
    {% endif %}
66
    
67
    <script>
68
        // empty object for console to avoid errors in browsers that don't support it
69
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
70
            window.console.error = function() {}};
71

72
        //populate available image icons array
73
        var os_icons = {{image_icons|safe}};
74
        
75
        // timeout value from settings.py
76
        var TIMEOUT = {{ timeout }};
77
        var TIMEOUTS_OCCURED = 0;
78
        var SKIP_TIMEOUTS = 1;
79
        var UPDATE_INTERVAL = {{ update_interval }};
80
        var LOGOUT_REDIRECT = '{{ logout_redirect }}';
81
        var INVITATIONS_URL = "{% url invitations %}";
82
        var INVITATIONS_TITLE = "{% trans "Invite people" %}";
83
        var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %};
84
        var FEEDBACK_URL = "{% url feedback %}";
85
        var FEEDBACK_TITLE = "{% trans "Send feedback" %}";
86
        var API_OVERLAY_TITLE = "{% trans "API access" %}";
87
        var API_OVERLAY_SUBCONTENT = "{% trans "The API key provides full access to your <em>~okeanos</em> account, so always keep it private." %}";
88

89
        STATE_TEXTS = {
90
            'UNKNOWN': '{% trans "Unknown" %}',
91
            'BUILD':  '{% trans "Building..." %}',
92
            'FIREWALL':  '{% trans "Firewall change..." %}',
93
            'REBOOT': '{% trans "Rebooting..." %}',
94
            'STOPPED':'{% trans "Stopped" %}',
95
            'ACTIVE': '{% trans "Running" %}',
96
            'ERROR':  '{% trans "Error" %}',
97
            'DELETE': '',
98
            'DESTROY': '{% trans "Destroying..." %}',
99
            'BUILD_INIT':  '{% trans "Building..." %}',
100
            'BUILD_COPY':  '{% trans "Building..." %}',
101
            'BUILD_FINAL':  '{% trans "Building..." %}',
102
            'SHUTDOWN': '{% trans "Shutting down..." %}',
103
            'START': '{% trans "Starting..." %}',
104
            'CONNECT': '{% trans "Connecting..." %}',
105
            'DISCONNECT': '{% trans "Disconnecting..." %}'
106
        }
107

108

109

110
        // building statuses
111
        var BUILDING_MESSAGES = {
112
            'INIT': '{% trans "Initializing..." %}',
113
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
114
            'FINAL': '{% trans "Finalizing..." %}'
115
        }
116

117
        // server statuses and transitions
118
        var STATUSES = {
119
            'UNKNOWN'   : '{% trans "Unknown" %}',
120
            'BUILD'     : '{% trans "Building" %}',
121
            'REBOOT'    : '{% trans "Rebooting" %}',
122
            'STOPPED'   : '{% trans "Stopped" %}',
123
            'ACTIVE'    : '{% trans "Running" %}',
124
            'ERROR'     : '{% trans "Error" %}'
125
        };
126

127
        var TRANSITIONS = {
128
            'Shutting down' : '{% trans "Shutting down" %}',
129
            'Rebooting'     : '{% trans "Rebooting" %}',
130
            'Starting'      : '{% trans "Starting" %}',
131
            'Destroying'    : '{% trans "Destroying" %}',
132
            'Connecting'    : '{% trans "Connecting" %}',   // used only in networks
133
            'Disconnecting' : '{% trans "Disconnecting" %}' // used only in networks
134
        };
135

136
        // Server statuses and transitions that should be displayed as active or inactive
137
        var ACTIVE_STATES = [
138
            '{% trans "Building" %}',
139
            '{% trans "Rebooting" %}',
140
            '{% trans "Running" %}',
141
            '{% trans "Shutting down" %}',
142
            '{% trans "Rebooting" %}',
143
            '{% trans "Destroying" %}'
144
        ];
145
        
146
        var TRANSITION_STATES = [
147
            '{% trans "Building" %}',
148
            '{% trans "Rebooting" %}',
149
            '{% trans "Starting" %}',
150
            '{% trans "Shutting down" %}',
151
            '{% trans "Destroying" %}',
152
            '{% trans "Connecting" %}',
153
            '{% trans "Disconnectig" %}'
154
        ]
155
        var TRANSITION_STATE_APPEND = "...";
156

157
        var INACTIVE_STATES = [
158
            '{% trans "Unknown" %}',
159
            '{% trans "Stopped" %}',
160
            '{% trans "Error" %}',
161
            '{% trans "Starting" %}',
162
        ];
163

164
        // Network statuses and transitions
165
        var NET_STATES = {
166
            'ACTIVE'        : '{% trans "Private network" %}',  // this comes from the API
167
            'DELETED'       : '{% trans "Deleted" %}',          // this comes from the API
168
            'Destroying'    : '{% trans "Destroying" %}',
169
            'Connecting'    : '{% trans "Connecting" %}',
170
            'Disconnecting' : '{% trans "Disconnecting" %}'
171
        };
172

173
        var ERROR_OVERRIDES = {
174
            // error message header
175
            'HEADER' : '{% trans "Error" %}',
176
            // default
177
            'DEFAULT' : '{% trans "Could not contact the service. Please check your network connectivity and try again." %}',
178
            // bad request
179
            '400' : '{% trans "Malformed request." %}',
180
            // not found
181
            '404' : '{% trans "Your request has failed. Resource not found." %}',
182
            // internal server error
183
            '500' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
184
            // service unavailable
185
            '501' : '{% trans "This server has not been implemented yet." %}',
186
            // service unavailable
187
            '502' : '{% trans "Bad Gateway error." %}',
188
            // service unavailable
189
            '503' : '{% trans "This service is unavailable right now, please try again later." %}',
190
            // no server handshake
191
            '0' : '{% trans "Could not contact the server." %}',
192
            // no images found
193
            '-212' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
194
            // no flavors found
195
            '-213' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}',
196
            // error box title
197
            'GENERIC_POPUP_HEADER' : '{% trans "Something seems to have gone wrong :( Here is what happened:" %}',
198
            // no advanced details
199
            'NO_DETAILS' : '{% trans "Νο advanced details provided" %}'
200
        };
201

202
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
203
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
204

205
        var SUCCESS = {
206
            'HEADER' : '{% trans "Success" %}',
207
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
208
            'PASSWORD' : '{% trans "Password:" %}',
209
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
210
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
211
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
212
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
213
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
214
        };
215

216
        var VARIOUS = {
217
            'CONFIRM' : '{% trans "Confirm" %}',
218
            'CANCEL' : '{% trans "Cancel" %}',
219
            'APPLY' : '{% trans "Apply" %}',
220
            'OFF' : '{% trans "Off" %}',
221
            'ON' : '{% trans "On" %}'
222
        };
223

    
224
    </script>
225
</head>
226

    
227
<body>
228
    <!--<img id="okeanos-image" src="/static/body-bg2.png" />-->
229
    <div id="container">
230
        <div id="header">
231
            <div id="user">
232
                <div class="usermenu">
233
                    <div class="username">{{ request.user.uniq }}</div>
234
                    <ul class="useractions">
235
                        <li class="invitations"><a class="action" href="#">{% trans "invite friends..." %}</a></li>
236
                        <li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>
237
                        <li class="api"><a class="action" href="#">{% trans "API access..." %}</a></li>
238
                        <li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li>
239
                    </ul>
240
                </div>
241
                <div class="langmenu">
242
                    <a class="current_lang">en</a>
243
                    {% comment %}
244
                {% get_available_languages as LANGUAGES %}
245
                {% for lang in LANGUAGES %}
246
                <a {% if  == lang.0 %}
247
                    class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a>
248

    
249
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
250
                    {% endfor %}
251
                {% endcomment %}
252
                </div>
253
            </div>
254
            <div class="header-logo">
255
                <a href="/">
256
                    <img src="static/okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
257
                </a>
258
            </div>
259
        </div>
260
        <div id="content">
261
            <div id="wrapper" class="clearfix">
262

    
263
                <div class="panes-menu clearfix">
264
                <!-- tabs -->
265
                <div class="tab-name">{% trans "machines" %}</div>
266
                <ul class="css-tabs">
267
                    <li><a href="machines" title="{% trans "manage  virtual " %}"
268
                        class="primary" id="machines_view_link">
269
                        <img src="static/machines-icon.png" /></a></li>
270
                    <li><a href="networks" title="{% trans "configure " %}"
271
                        class="primary" id="networks_view_link">
272
                        <img src="static/networks-icon.png" /></a></li>
273
                    <li><a href="disks" title="{% trans "manage  storage " %}"
274
                        class="primary" id="disks_view_link">
275
                        <img src="static/disks-icon.png" /></a></li>
276
                </ul>
277
                </div>
278
                <div class="css-panes">
279
                    <div id="machines-pane" class="pane" style="display:block;">
280
                        {% include "partials/machines.html" %}
281
                    </div>
282
                    <div id="networks-pane" class="pane">
283
                        {% include "partials/networks.html" %}
284
                    </div>
285
                    <div id="disks-pane" class="pane"></div>
286

    
287
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
288
                        <div class="confirm_multiple_actions confirm_multiple_cont clearfix">
289
                            <p>{% trans "Your actions will affect" %} <span class="actionLen">XX</span> {% trans "machines" %}</p>
290
                            <button class="yes">{% trans "Confirm All" %}</button>
291
                            <button class="no">{% trans "Cancel All" %}</button>
292
                        </div>
293
                        <div class="confirm_reboot_required confirm_multiple_cont clearfix">
294
                            <p><span class="actionLen"></span> {% trans "machines needs to be rebooted for changes to apply" %}</p>
295
                            <button class="yes">{% trans "Reboot All" %}</button>
296
                            <button class="no">{% trans "Cancel All" %}</button>
297
                            <div class="reboot-machines-list"></div>
298
                        </div>
299
                    </div>
300

    
301
                </div>
302
            </div>
303
        </div>
304
    </div>
305

    
306
    <!-- activate tabs with JavaScript -->
307
    <script>
308

309
        //load opera css fixes
310
        if ($.browser.opera) {
311
            $("<link/>", {
312
               rel: "stylesheet",
313
               type: "text/css",
314
               href: "static/opera.css"
315
            }).appendTo("head");
316
        }
317

318
        $(document).ready(function(){
319

320
            {% if current_lang == "el" and not DEBUG %}
321
                window.location = "/lang/?l=en";
322
            {% endif %}
323

324
            // user menu interaction
325
            var resetUserMenu = function() {
326
                $(this).removeClass("hovered");
327
                $(this).removeClass("active");
328
            }
329

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

338
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
339
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
340

341
            // bind menu actions
342
            $(".usermenu .logout").click(function() {
343
                user_session_logout();
344
            });
345

346
            $(".usermenu .invitations").click(show_invitations);
347
            $(".usermenu .api").click(show_api_overlay);
348

349
        });
350
        
351
        function positionBottomMessages() {
352
            var el = $("#multiple_actions_container");
353
        }
354

355
        $(window).bind("load", function() { 
356
               var footerHeight = 0;
357
               var footerTop = 0;
358
               var $footer = $("#footer-container");
359

360
               positionFooter();
361
               function positionFooter() {
362
                   footerHeight = 80;
363
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
364
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
365

366
                       $footer.css({
367
                            position: "absolute"
368
                       }).css({
369
                            top: footerTop
370
                       })
371
                    } else {
372
                    
373
                       if ($footer.css("position") == "static") {
374
                           if ($(document.body).height() < $(window).height()) {    
375
                               $footer.css({
376
                                    position: "absolute"
377
                               }).css({
378
                                    top: footerTop
379
                                })
380
                            }
381
                        } else {
382

383
                           $footer.css({
384
                               position: "static"
385
                           })
386
                       }
387
                   }
388

389
                   }
390
               window.positionFooter = _.throttle(positionFooter, 100);
391
               $(window).scroll(positionFooter).resize(positionFooter)
392
        });
393
    </script>
394

    
395
    <!-- base notification for error/success reporting -->
396
    <a id="notification" rel="#error-success" href="#"></a>
397
    <a id="msgbox" rel="#notification-box" href="#"></a>
398
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
399

    
400
    <div class="overlay" id="generic-overlay-tpl">
401
        <h3 class="header clearfix">
402
            <span class="subtitle"></span>
403
            <span class="title"></span>
404
            <span class="closeme">close</span></h3>
405
        <div class="container">
406
            <div class="content">
407
            </div>
408
        </div>
409
        <div class="footer"></div>
410
    </div>
411

    
412
    <div id="error-overlay-content" class="hidden">
413
        <div class="message"><p></p></div>
414
        <div class="error-details">
415
            <span class="key">{% trans "Module" %}</span>
416
            <span class="value error-module"></span>
417

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

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

    
424
            <span class="key details">{% trans "Details" %}</span>
425
            <div class="value error-more-details"><p></p></div>
426
        </div>
427

    
428
        <div class="actions">
429
            <span class="show-details">{% trans "Show details" %}</span>
430
            <span class="hide-details">{% trans "Hide details" %}</span>
431
            <span class="report-error">{% trans "Send report" %}</span>
432
            <span class="reload-app">{% trans "Reload application" %}</span>
433
        </div>
434
    </div>
435

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

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

    
487
            <div class="message sending">{% trans "submiting your data....." %}</div>
488
            <div class="message success">
489
                {% trans "thank you for submiting your feedback" %}
490
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
491
            <div class="message errormsg">
492
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
493
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
494
            </div>
495
            </div>
496
        </div>
497
    </div>
498
    
499
    <div class="api_overlay_template">
500
        <div class="api_overlay_content">
501
            <p>Use the following API key along with the <a href="{{ EXTERNAL_CLIENT_URL }}">./kamaki</a> client to manage your cloud resources from outside this page.</p>
502
        </div>
503
    </div>
504

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

    
528
    <script>
529
        $(document).ready(function() {
530
            $(".css-panes").hide();
531

532
            {% if DEBUG %}
533
            synnefo.ui.main.bind("initial", function() {
534
                if (window.TEST) {
535
                    setTimeout(window.TEST, 60);
536
                }
537
            });
538
            {% endif %}
539
            
540
            synnefo.config.update_interval = 5000 || {{ update_interval }};
541
            synnefo.ui.init();
542

543
        })
544
    </script>
545
</body>
546
</html>