Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 1956fd41

History | View | Annotate | Download (22.6 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_icon_view.js"></script>
49
    <script src="static/snf/js/ui/web/ui_single_view.js"></script>
50
    <script src="static/snf/js/ui/web/ui_list_view.js"></script>
51
    <script src="static/snf/js/ui/web/ui_networks_view.js"></script>
52
    <script src="static/snf/js/ui/web/ui_main_view.js"></script>
53
    <script src="static/snf/js/ui/web/ui_metadata_view.js"></script>
54
    <script src="static/snf/js/ui/web/ui_feedback_view.js"></script>
55
    <script src="static/snf/js/ui/web/ui_create_view.js"></script>
56

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

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

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

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

107

108

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

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

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

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

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

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

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

201
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
202

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

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

    
222
    </script>
223
</head>
224

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

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

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

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

    
299
                </div>
300
            </div>
301
        </div>
302
    </div>
303

    
304
    <!-- activate tabs with JavaScript -->
305
    <script>
306

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

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

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

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

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

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

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

344
            $(".usermenu .invitations").click(show_invitations);
345
            $(".usermenu .api").click(show_api_overlay);
346

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

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

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

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

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

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

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

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

    
410
    <div id="error-overlay-content" class="hidden">
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="actions">
427
            <span class="show-details">{% trans "Show details" %}</span>
428
            <span class="hide-details">{% trans "Hide details" %}</span>
429
            <span class="report-error">{% trans "Send report" %}</span>
430
            <span class="reload-app">{% trans "Reload application" %}</span>
431
        </div>
432
    </div>
433

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

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

    
485
            <div class="message sending">{% trans "submiting your data....." %}</div>
486
            <div class="message success">
487
                {% trans "thank you for submiting your feedback" %}
488
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
489
            <div class="message errormsg">
490
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
491
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
492
            </div>
493
            </div>
494
        </div>
495
    </div>
496
    
497
    <div class="api_overlay_template">
498
        <div class="api_overlay_content">
499
            <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>
500
        </div>
501
    </div>
502

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

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

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

541
        })
542
    </script>
543
</body>
544
</html>