Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 73e25ce2

History | View | Annotate | Download (22.7 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
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
203

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

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

    
223
    </script>
224
</head>
225

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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