Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 66be390b

History | View | Annotate | Download (22.3 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
        var ERROR_OVERRIDES = {
123
            // error message header
124
            'HEADER' : '{% trans "Error" %}',
125
            // default
126
            'DEFAULT' : '{% trans "Could not contact the service. Please check your network connectivity and try again." %}',
127
            // bad request
128
            '400' : '{% trans "Malformed request." %}',
129
            // not found
130
            '404' : '{% trans "Your request has failed. Resource not found." %}',
131
            // internal server error
132
            '500' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
133
            // service unavailable
134
            '501' : '{% trans "This server has not been implemented yet." %}',
135
            // service unavailable
136
            '502' : '{% trans "Bad Gateway error." %}',
137
            // service unavailable
138
            '503' : '{% trans "This service is unavailable right now, please try again later." %}',
139
            // no server handshake
140
            '0' : '{% trans "Could not contact the server." %}',
141
            // no images found
142
            '-212' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
143
            // no flavors found
144
            '-213' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}',
145
            // error box title
146
            'GENERIC_POPUP_HEADER' : '{% trans "Something seems to have gone wrong :( Here is what happened:" %}',
147
            // no advanced details
148
            'NO_DETAILS' : '{% trans "Νο advanced details provided" %}',
149
            // timeout message
150
            'TIMEOUT' : '{% trans "It seems the server takes too long to respond, please check your network connectivity" %}'
151
        };
152

153
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
154
        var SUGGESTED_ROLES = {{ suggested_roles|safe }}
155

156
        var SUCCESS = {
157
            'HEADER' : '{% trans "Success" %}',
158
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
159
            'PASSWORD' : '{% trans "Password:" %}',
160
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
161
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
162
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
163
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
164
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
165
        };
166

167
        var VARIOUS = {
168
            'CONFIRM' : '{% trans "Confirm" %}',
169
            'CANCEL' : '{% trans "Cancel" %}',
170
            'APPLY' : '{% trans "Apply" %}',
171
            'OFF' : '{% trans "Off" %}',
172
            'ON' : '{% trans "On" %}'
173
        };
174

    
175
    </script>
176
</head>
177

    
178
<body id="app">
179
    <!--<img id="okeanos-image" src="/static/body-bg2.png" />-->
180
    <div id="container">
181
        <div id="header">
182
            <div id="user">
183
                <div class="usermenu">
184
                    <div class="username">{{ request.user.uniq }}</div>
185
                    <ul class="useractions">
186
                        <li class="invitations"><a class="action" href="#">{% trans "invite friends..." %}</a></li>
187
                        <li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>
188
                        <li class="api"><a class="action" href="#">{% trans "API access..." %}</a></li>
189
                        <li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li>
190
                    </ul>
191
                </div>
192
                <div class="langmenu">
193
                    <a class="current_lang">en</a>
194
                    {% comment %}
195
                {% get_available_languages as LANGUAGES %}
196
                {% for lang in LANGUAGES %}
197
                <a {% if  == lang.0 %}
198
                    class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a>
199

    
200
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
201
                    {% endfor %}
202
                {% endcomment %}
203
                </div>
204
            </div>
205
            <div class="header-logo">
206
                <a href="/">
207
                    <img src="static/okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
208
                </a>
209
            </div>
210
        </div>
211
        <div id="content">
212
            <div id="wrapper" class="clearfix">
213

    
214
                <div class="panes-menu clearfix">
215
                <!-- tabs -->
216
                <div class="tab-name">{% trans "machines" %}</div>
217
                <ul class="css-tabs">
218
                    <li><a href="machines" title="{% trans "manage  virtual " %}"
219
                        class="primary" id="machines_view_link">
220
                        <img src="static/machines-icon.png" /></a></li>
221
                    <li><a href="networks" title="{% trans "configure " %}"
222
                        class="primary" id="networks_view_link">
223
                        <img src="static/networks-icon.png" /></a></li>
224
                    <li class="hidden"><a href="disks" title="{% trans "manage  storage " %}"
225
                        class="primary" id="disks_view_link">
226
                        <img src="static/disks-icon.png" /></a></li>
227
                </ul>
228
                </div>
229
                <div class="css-panes">
230
                    <div id="machines-pane" class="pane" style="display:block;">
231
                        {% include "partials/machines.html" %}
232
                    </div>
233
                    <div id="networks-pane" class="pane">
234
                        {% include "partials/networks.html" %}
235
                    </div>
236
                    <div id="disks-pane" class="pane"></div>
237

    
238
                    <div class="confirm_multiple clearfix" id="multiple_actions_container">
239
                        <div class="confirm_multiple_actions confirm_multiple_cont clearfix">
240
                            <p>{% trans "Your actions will affect" %} <span class="actionLen">XX</span> {% trans "machines" %}</p>
241
                            <button class="yes">{% trans "Confirm All" %}</button>
242
                            <button class="no">{% trans "Cancel All" %}</button>
243
                        </div>
244
                        <div class="confirm_reboot_required confirm_multiple_cont clearfix">
245
                            <p><span class="actionLen"></span> {% trans "machines needs to be rebooted for changes to apply" %}</p>
246
                            <button class="yes">{% trans "Reboot All" %}</button>
247
                            <button class="no">{% trans "Cancel All" %}</button>
248
                            <div class="reboot-machines-list"></div>
249
                        </div>
250
                    </div>
251

    
252
                </div>
253
            </div>
254
        </div>
255
    </div>
256

    
257
    <!-- activate tabs with JavaScript -->
258
    <script>
259

260
        //load opera css fixes
261
        if ($.browser.opera) {
262
            $("<link/>", {
263
               rel: "stylesheet",
264
               type: "text/css",
265
               href: "static/opera.css"
266
            }).appendTo("head");
267
        }
268

269
        $(document).ready(function(){
270

271
            {% if current_lang == "el" and not DEBUG %}
272
                window.location = "/lang/?l=en";
273
            {% endif %}
274

275
            // user menu interaction
276
            var resetUserMenu = function() {
277
                $(this).removeClass("hovered");
278
                $(this).removeClass("active");
279
            }
280

281
            $(".usermenu").live("click", function(){
282
                $(this).addClass("active");
283
            });
284
            $(".usermenu").bind('mouseleave', resetUserMenu);
285
            $(".usermenu").live("mouseover", function(){
286
                $(this).addClass("hovered");
287
            });
288

289
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
290
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
291

292
            // bind menu actions
293
            $(".usermenu .logout").click(function() {
294
                snf.ui.logout();
295
            });
296

297
            $(".usermenu .invitations").click(show_invitations);
298
            $(".usermenu .api").click(show_api_overlay);
299

300
        });
301
        
302
        function positionBottomMessages() {
303
            var el = $("#multiple_actions_container");
304
        }
305

306
        $(window).bind("load", function() { 
307
               var footerHeight = 0;
308
               var footerTop = 0;
309
               var $footer = $("#footer-container");
310

311
               positionFooter();
312
               function positionFooter() {
313
                   footerHeight = 80;
314
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
315
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
316

317
                       $footer.css({
318
                            position: "absolute"
319
                       }).css({
320
                            top: footerTop
321
                       })
322
                    } else {
323
                    
324
                       if ($footer.css("position") == "static") {
325
                           if ($(document.body).height() < $(window).height()) {    
326
                               $footer.css({
327
                                    position: "absolute"
328
                               }).css({
329
                                    top: footerTop
330
                                })
331
                            }
332
                        } else {
333

334
                           $footer.css({
335
                               position: "static"
336
                           })
337
                       }
338
                   }
339

340
                   }
341
               window.positionFooter = _.throttle(positionFooter, 100);
342
               $(window).scroll(positionFooter).resize(positionFooter)
343
        });
344
    </script>
345

    
346
    <!-- base notification for error/success reporting -->
347
    <a id="notification" rel="#error-success" href="#"></a>
348
    <a id="msgbox" rel="#notification-box" href="#"></a>
349
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
350

    
351
    <div class="overlay" id="generic-overlay-tpl">
352
        <div class="overlay-inner">
353
            <h3 class="header clearfix">
354
                <span class="subtitle"></span>
355
                <span class="title"></span>
356
                <span class="closeme">close</span></h3>
357
            <div class="container">
358
                <div class="content">
359
                </div>
360
            </div>
361
            <div class="footer"></div>
362
        </div>
363
    </div>
364

    
365
    <div id="error-overlay-content" class="hidden">
366
        <div class="error-nav hidden clearfix">
367
            <span class="indicator"><span class="num">1</span> <span
368
                    class="ind-msg">new error occured</span></span>
369
            <span class="show-next nav-btn">{% trans "next" %}</span>
370
            <span class="show-prev nav-btn">{% trans "previous" %}</span>
371
        </div>
372
        <div class="message"><p></p></div>
373
        <div class="error-details">
374
            <span class="key">{% trans "Module" %}</span>
375
            <span class="value error-module"></span>
376

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

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

    
383
            <span class="key details">{% trans "Details" %}</span>
384
            <div class="value error-more-details"><p></p></div>
385
        </div>
386
        
387
        <!--<div class="navigation">-->
388
            <!--<span class="next-error">{% trans "next error" %}</span>-->
389
            <!--<span class="previous-error">{% trans "previous error" %}</span>-->
390
        <!--</div>-->
391
        
392
        <!--<div class="date">-->
393
            <!--<span class="error-date"></span>-->
394
        <!--</div>-->
395

    
396
        <div class="actions">
397
            <span class="show-details">{% trans "Show details" %}</span>
398
            <span class="hide-details">{% trans "Hide details" %}</span>
399
            <span class="report-error">{% trans "Send report" %}</span>
400
            <span class="reload-app">{% trans "Reload" %}</span>
401
        </div>
402
    </div>
403

    
404
    <div id="feedback-overlay-content" class="hidden overlay-content feedback-form">
405
        <div class="description">
406
            <p>
407
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
408
                We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}
409
            </p>
410
        </div>
411
        <div class="description messages noborder">
412
            <p class="success-message hidden">
413
            {% trans "thank you for submiting your feedback" %}
414
            </p>
415
            <p class="error-message hidden">
416
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
417
            </p>
418
            <p class="sending-message hidden">
419
            {% blocktrans %}Sending feedback...{% endblocktrans %}
420
            </p>
421
        </div>
422
        <div class="form">
423
            <div class="form-field">
424
                <label for{% trans "Please  your  here, provide  many  as " %}</label
425
                <textarea ="feedback-message"> 
426
                </textarea>
427
            </div>
428
            <div class="form-actions clearfix noborder">
429
                <span class="form-action submit">{% trans "send feedback" %}</span>
430
            </div>
431
        </div>
432
    </div>
433
    <div class="modal" id="feedback-form" class="feedback notification-box">
434
        <h3 class="popup-header">
435
            <span class="header-box">{% trans "Send feedback" %}</span>
436
        </h3>
437
        <div class="popup-body">
438
            <div class="popup-body-inner">
439
                <div class="form-container">
440
                <p class="feedback-intro">
441
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
442
We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}</p>
443
                <form id="feedback-form">
444
                    <label for="feedback-msg">{% trans "Please describe your problem here, provide as many details as possible" %}</label>
445
                    <div class="description"></div>
446
                    <div class="empty-error-msg">{% trans "Please provide some feedback" %}</div>
447
                    <textarea name="feedback-msg" class="feedback-text"></textarea>
448

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

    
455
            <div class="message sending">{% trans "submiting your data....." %}</div>
456
            <div class="message success">
457
                {% trans "thank you for submiting your feedback" %}
458
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
459
            <div class="message errormsg">
460
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
461
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
462
            </div>
463
            </div>
464
        </div>
465
    </div>
466
    
467
    <div class="api_overlay_template">
468
        <div class="api_overlay_content">
469
            <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>
470
        </div>
471
    </div>
472

    
473
    <div class="modal" id="notification-box" class="notification-box">
474
        <h3 class="popup-header">
475
            <span class="header-box"></span>
476
        </h3>
477
        <div class="popup-body">
478
            <div class="popup-body-inner">
479
                <div class="machine-now-building"></div>
480
                <div class="popup-separator"></div>
481
                <div class="password-container">
482
                    <div class="password"></div>
483
                </div>
484
                <div class="sub-text"></div>
485
            </div>
486
        </div>
487
    </div>
488
    
489
    <div id="loading-view" class="hidden">
490
        <img src="/static/icons/indicators/small/progress.gif" />
491
        <div class="header">Loading <span>~okeanos</span></div>
492
        <div class="info hidden"></div>
493
    </div>
494
    {% include "footer.html" %}
495

    
496
    <script>
497
        $(document).ready(function() {
498
            $(".css-panes").hide();
499

500

501
            // TODO: match <= 1.9.1
502
            if ($.browser.mozilla && $.browser.version.substr(0,3) == "1.9") {
503
                synnefo.config.overlay_speed = 0;
504
                $.fx.off = true;
505
            }
506
            
507
            // synnefo js config
508
            synnefo.config.update_interval = {{ update_interval }};
509
            synnefo.config.delay_on_blur = {{ delay_on_blur }};
510
            synnefo.config.blur_delay = {{ blur_delay }};
511
            synnefo.config.update_hidden_views = {{ update_hidden_views }};
512
            synnefo.config.handle_window_exceptions = {{ handle_window_exceptions }};
513
            synnefo.config.ajax_timeout = {{ timeout }};
514
            synnefo.config.skip_timeouts = {{ skip_timeouts }};
515

516
            // TODO: make it dynamic
517
            synnefo.config.api_url = '/api/v1.1';
518
            synnefo.config.logout_url = '{{ logout_redirect }}';
519

520
            synnefo.ui.init();
521

522
        })
523
    </script>
524
</body>
525
</html>