Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ b15a0cc4

History | View | Annotate | Download (23.5 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
    <script src="static/snf/js/lib/ZeroClipboard.js"></script>
27

    
28

    
29
    <script src="static/snf/js/lib/underscore.js"></script>
30
    <script src="static/snf/js/lib/underscore.string.js"></script>
31
    <script src="static/snf/js/lib/backbone.js"></script>
32
    <script src="static/snf/js/lib/json2.js"></script>
33
    <script src="static/snf/js/lib/stacktrace.js"></script>
34

    
35
    <!--[if (gte IE 6)&(lte IE 7)]>
36
        <script src="static/snf/js/lib/selectivizr.js"></script>
37
    <! [endif] -->
38

    
39
    <!--[if IE]>
40
        <script src="static/snf/js/ui/ie_fixes.js"></script>
41
    <![endif]-->
42
    
43
    <script src="static/snf/js/utils.js"></script>
44
    <script src="static/snf/js/sync.js"></script>
45
    <script src="static/snf/js/models.js"></script>
46
    <script src="static/snf/js/views.js"></script>
47

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

    
60
    <!-- the following views require refactor -->
61
    <script src="static/invitations.js"></script>
62
    <script src="static/synnefo.js"></script>
63

    
64
    {% if DEBUG %}
65
        <script src="static/snf/js/tests/jquery.profile.js"></script>
66
        <script src="static/snf/js/tests/functional.js"></script>
67
    {% endif %}
68
    
69
    <script>
70
        // empty object for console to avoid errors in browsers that don't support it
71
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
72
            window.console.error = function() {}};
73
        
74
        // initialize zero clipboard
75
        ZeroClipboard.setMoviePath( 'static/snf/js/lib/ZeroClipboard.swf' );
76

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

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

113

114

115
        // building statuses
116
        var BUILDING_MESSAGES = {
117
            'INIT': '{% trans "Initializing..." %}',
118
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
119
            'FINAL': '{% trans "Finalizing..." %}'
120
        }
121

122
        // server statuses and transitions
123
        var STATUSES = {
124
            'UNKNOWN'   : '{% trans "Unknown" %}',
125
            'BUILD'     : '{% trans "Building" %}',
126
            'REBOOT'    : '{% trans "Rebooting" %}',
127
            'STOPPED'   : '{% trans "Stopped" %}',
128
            'ACTIVE'    : '{% trans "Running" %}',
129
            'ERROR'     : '{% trans "Error" %}'
130
        };
131

132
        var TRANSITIONS = {
133
            'Shutting down' : '{% trans "Shutting down" %}',
134
            'Rebooting'     : '{% trans "Rebooting" %}',
135
            'Starting'      : '{% trans "Starting" %}',
136
            'Destroying'    : '{% trans "Destroying" %}',
137
            'Connecting'    : '{% trans "Connecting" %}',   // used only in networks
138
            'Disconnecting' : '{% trans "Disconnecting" %}' // used only in networks
139
        };
140

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

162
        var INACTIVE_STATES = [
163
            '{% trans "Unknown" %}',
164
            '{% trans "Stopped" %}',
165
            '{% trans "Error" %}',
166
            '{% trans "Starting" %}',
167
        ];
168

169
        // Network statuses and transitions
170
        var NET_STATES = {
171
            'ACTIVE'        : '{% trans "Private network" %}',  // this comes from the API
172
            'DELETED'       : '{% trans "Deleted" %}',          // this comes from the API
173
            'Destroying'    : '{% trans "Destroying" %}',
174
            'Connecting'    : '{% trans "Connecting" %}',
175
            'Disconnecting' : '{% trans "Disconnecting" %}'
176
        };
177

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

209
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
210
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
211

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

223
        var VARIOUS = {
224
            'CONFIRM' : '{% trans "Confirm" %}',
225
            'CANCEL' : '{% trans "Cancel" %}',
226
            'APPLY' : '{% trans "Apply" %}',
227
            'OFF' : '{% trans "Off" %}',
228
            'ON' : '{% trans "On" %}'
229
        };
230

    
231
    </script>
232
</head>
233

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

    
256
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
257
                    {% endfor %}
258
                {% endcomment %}
259
                </div>
260
            </div>
261
            <div class="header-logo">
262
                <a href="/">
263
                    <img src="static/okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
264
                </a>
265
            </div>
266
        </div>
267
        <div id="content">
268
            <div id="wrapper" class="clearfix">
269

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

    
294
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
295
                        <div class="confirm_multiple_actions confirm_multiple_cont clearfix">
296
                            <p>{% trans "Your actions will affect" %} <span class="actionLen">XX</span> {% trans "machines" %}</p>
297
                            <button class="yes">{% trans "Confirm All" %}</button>
298
                            <button class="no">{% trans "Cancel All" %}</button>
299
                        </div>
300
                        <div class="confirm_reboot_required confirm_multiple_cont clearfix">
301
                            <p><span class="actionLen"></span> {% trans "machines needs to be rebooted for changes to apply" %}</p>
302
                            <button class="yes">{% trans "Reboot All" %}</button>
303
                            <button class="no">{% trans "Cancel All" %}</button>
304
                            <div class="reboot-machines-list"></div>
305
                        </div>
306
                    </div>
307

    
308
                </div>
309
            </div>
310
        </div>
311
    </div>
312

    
313
    <!-- activate tabs with JavaScript -->
314
    <script>
315

316
        //load opera css fixes
317
        if ($.browser.opera) {
318
            $("<link/>", {
319
               rel: "stylesheet",
320
               type: "text/css",
321
               href: "static/opera.css"
322
            }).appendTo("head");
323
        }
324

325
        $(document).ready(function(){
326

327
            {% if current_lang == "el" and not DEBUG %}
328
                window.location = "/lang/?l=en";
329
            {% endif %}
330

331
            // user menu interaction
332
            var resetUserMenu = function() {
333
                $(this).removeClass("hovered");
334
                $(this).removeClass("active");
335
            }
336

337
            $(".usermenu").live("click", function(){
338
                $(this).addClass("active");
339
            });
340
            $(".usermenu").bind('mouseleave', resetUserMenu);
341
            $(".usermenu").live("mouseover", function(){
342
                $(this).addClass("hovered");
343
            });
344

345
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
346
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
347

348
            // bind menu actions
349
            $(".usermenu .logout").click(function() {
350
                snf.ui.logout();
351
            });
352

353
            $(".usermenu .invitations").click(show_invitations);
354
            $(".usermenu .api").click(show_api_overlay);
355

356
        });
357
        
358
        function positionBottomMessages() {
359
            var el = $("#multiple_actions_container");
360
        }
361

362
        $(window).bind("load", function() { 
363
               var footerHeight = 0;
364
               var footerTop = 0;
365
               var $footer = $("#footer-container");
366

367
               positionFooter();
368
               function positionFooter() {
369
                   footerHeight = 80;
370
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
371
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
372

373
                       $footer.css({
374
                            position: "absolute"
375
                       }).css({
376
                            top: footerTop
377
                       })
378
                    } else {
379
                    
380
                       if ($footer.css("position") == "static") {
381
                           if ($(document.body).height() < $(window).height()) {    
382
                               $footer.css({
383
                                    position: "absolute"
384
                               }).css({
385
                                    top: footerTop
386
                                })
387
                            }
388
                        } else {
389

390
                           $footer.css({
391
                               position: "static"
392
                           })
393
                       }
394
                   }
395

396
                   }
397
               window.positionFooter = _.throttle(positionFooter, 100);
398
               $(window).scroll(positionFooter).resize(positionFooter)
399
        });
400
    </script>
401

    
402
    <!-- base notification for error/success reporting -->
403
    <a id="notification" rel="#error-success" href="#"></a>
404
    <a id="msgbox" rel="#notification-box" href="#"></a>
405
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
406

    
407
    <div class="overlay" id="generic-overlay-tpl">
408
        <h3 class="header clearfix">
409
            <span class="subtitle"></span>
410
            <span class="title"></span>
411
            <span class="closeme">close</span></h3>
412
        <div class="container">
413
            <div class="content">
414
            </div>
415
        </div>
416
        <div class="footer"></div>
417
    </div>
418

    
419
    <div id="error-overlay-content" class="hidden">
420
        <div class="message"><p></p></div>
421
        <div class="error-details">
422
            <span class="key">{% trans "Module" %}</span>
423
            <span class="value error-module"></span>
424

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

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

    
431
            <span class="key details">{% trans "Details" %}</span>
432
            <div class="value error-more-details"><p></p></div>
433
        </div>
434
        
435
        <!--<div class="navigation">-->
436
            <!--<span class="next-error">{% trans "next error" %}</span>-->
437
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
438
        <!--</div>-->
439
        
440
        <!--<div class="date">-->
441
            <!--<span class="error-date"></span>-->
442
        <!--</div>-->
443

    
444
        <div class="actions">
445
            <span class="show-details">{% trans "Show details" %}</span>
446
            <span class="hide-details">{% trans "Hide details" %}</span>
447
            <span class="report-error">{% trans "Send report" %}</span>
448
            <span class="reload-app">{% trans "Reload application" %}</span>
449
        </div>
450
    </div>
451

    
452
    <div id="feedback-overlay-content" class="hidden overlay-content feedback-form">
453
        <div class="description">
454
            <p>
455
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
456
                We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}
457
            </p>
458
        </div>
459
        <div class="description messages noborder">
460
            <p class="success-message hidden">
461
            {% trans "thank you for submiting your feedback" %}
462
            </p>
463
            <p class="error-message hidden">
464
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
465
            </p>
466
            <p class="sending-message hidden">
467
            {% blocktrans %}Sending feedback...{% endblocktrans %}
468
            </p>
469
        </div>
470
        <div class="form">
471
            <div class="form-field">
472
                <label for{% trans "Please  your  here, provide  many  as " %}</label
473
                <textarea ="feedback-message"> 
474
                </textarea>
475
            </div>
476
            <div class="form-actions clearfix noborder">
477
                <span class="form-action submit">{% trans "send feedback" %}</span>
478
            </div>
479
        </div>
480
    </div>
481
    <div class="modal" id="feedback-form" class="feedback notification-box">
482
        <h3 class="popup-header">
483
            <span class="header-box">{% trans "Send feedback" %}</span>
484
        </h3>
485
        <div class="popup-body">
486
            <div class="popup-body-inner">
487
                <div class="form-container">
488
                <p class="feedback-intro">
489
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
490
We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}</p>
491
                <form id="feedback-form">
492
                    <label for="feedback-msg">{% trans "Please describe your problem here, provide as many details as possible" %}</label>
493
                    <div class="description"></div>
494
                    <div class="empty-error-msg">{% trans "Please provide some feedback" %}</div>
495
                    <textarea name="feedback-msg" class="feedback-text"></textarea>
496

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

    
503
            <div class="message sending">{% trans "submiting your data....." %}</div>
504
            <div class="message success">
505
                {% trans "thank you for submiting your feedback" %}
506
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
507
            <div class="message errormsg">
508
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
509
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
510
            </div>
511
            </div>
512
        </div>
513
    </div>
514
    
515
    <div class="api_overlay_template">
516
        <div class="api_overlay_content">
517
            <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>
518
        </div>
519
    </div>
520

    
521
    <div class="modal" id="notification-box" class="notification-box">
522
        <h3 class="popup-header">
523
            <span class="header-box"></span>
524
        </h3>
525
        <div class="popup-body">
526
            <div class="popup-body-inner">
527
                <div class="machine-now-building"></div>
528
                <div class="popup-separator"></div>
529
                <div class="password-container">
530
                    <div class="password"></div>
531
                </div>
532
                <div class="sub-text"></div>
533
            </div>
534
        </div>
535
    </div>
536
    
537
    <div id="loading-view" class="hidden">
538
        <img src="/static/icons/indicators/small/progress.gif" />
539
        <div class="header">Loading <span>~okeanos</span></div>
540
        <div class="info hidden"></div>
541
    </div>
542
    {% include "footer.html" %}
543

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

548
            {% if DEBUG %}
549
            synnefo.ui.main.bind("initial", function() {
550
                if (window.TEST) {
551
                    setTimeout(window.TEST, 60);
552
                }
553
            });
554
            {% endif %}
555
            
556
            synnefo.config.update_interval = 5000 || {{ update_interval }};
557
            synnefo.ui.init();
558

559
        })
560
    </script>
561
</body>
562
</html>