Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 8d08f18a

History | View | Annotate | Download (21.9 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
    <script src="static/snf/js/utils.js"></script>
41
    <script src="static/snf/js/sync.js"></script>
42
    <script src="static/snf/js/models.js"></script>
43
    <script src="static/snf/js/views.js"></script>
44

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

    
55
    <!-- the following views require refactor -->
56
    <!--<script src="static/snf/js/ui/create_view.js"></script>-->
57
    <script src="static/invitations.js"></script>
58
    <script src="static/synnefo.js"></script>
59
    
60
    <script>
61
        // empty object for console to avoid errors in browsers that don't support it
62
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
63
            window.console.error = function() {}};
64

65
        //populate available image icons array
66
        var os_icons = {{image_icons|safe}};
67
        
68

69

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

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

103

104

105
        // building statuses
106
        var BUILDING_MESSAGES = {
107
            'INIT': '{% trans "Initializing..." %}',
108
            'COPY': '{% trans "{0} of {1} ({2}%)" %}',
109
            'FINAL': '{% trans "Finalizing..." %}'
110
        }
111

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

122
        var TRANSITIONS = {
123
            'Shutting down' : '{% trans "Shutting down" %}',
124
            'Rebooting'     : '{% trans "Rebooting" %}',
125
            'Starting'      : '{% trans "Starting" %}',
126
            'Destroying'    : '{% trans "Destroying" %}',
127
            'Connecting'    : '{% trans "Connecting" %}',   // used only in networks
128
            'Disconnecting' : '{% trans "Disconnecting" %}' // used only in networks
129
        };
130

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

152
        var INACTIVE_STATES = [
153
            '{% trans "Unknown" %}',
154
            '{% trans "Stopped" %}',
155
            '{% trans "Error" %}',
156
            '{% trans "Starting" %}',
157
        ];
158

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

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

197
        var SUGGESTED_FLAVORS = {{ suggested_flavors|safe }};
198

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

210
        var VARIOUS = {
211
            'CONFIRM' : '{% trans "Confirm" %}',
212
            'CANCEL' : '{% trans "Cancel" %}',
213
            'APPLY' : '{% trans "Apply" %}',
214
            'OFF' : '{% trans "Off" %}',
215
            'ON' : '{% trans "On" %}'
216
        };
217

    
218
    </script>
219
</head>
220

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

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

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

    
281
                    <div class="confirm_multiple" id="multiple_actions_container">
282
                        <p>{% trans "Your actions will affect" %} <span class="actionLen">XX</span> {% trans "machines" %}</p>
283
                        <button class="yes">{% trans "Confirm All" %}</button>
284
                        <button class="no">{% trans "Cancel All" %}</button>
285
                    </div>
286

    
287
                </div>
288
            </div>
289
        </div>
290
    </div>
291

    
292
    <!-- activate tabs with JavaScript -->
293
    <script>
294

295
        //load opera css fixes
296
        if ($.browser.opera) {
297
            $("<link/>", {
298
               rel: "stylesheet",
299
               type: "text/css",
300
               href: "static/opera.css"
301
            }).appendTo("head");
302
        }
303

304
        $(document).ready(function(){
305

306
            {% if current_lang == "el" and not DEBUG %}
307
                window.location = "/lang/?l=en";
308
            {% endif %}
309

310
            // user menu interaction
311
            var resetUserMenu = function() {
312
                $(this).removeClass("hovered");
313
                $(this).removeClass("active");
314
            }
315
            $(".usermenu").live("click", function(){
316
                $(this).addClass("active");
317
            });
318
            $(".usermenu").bind('mouseleave', resetUserMenu);
319
            $(".usermenu").live("mouseover", function(){
320
                $(this).addClass("hovered");
321
            });
322

323
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
324
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
325

326
            // bind menu actions
327
            $(".usermenu .logout").click(function() {
328
                user_session_logout();
329
            });
330

331
            $(".usermenu .invitations").click(show_invitations);
332
            $(".usermenu .api").click(show_api_overlay);
333

334
        });
335
        
336
        function positionBottomMessages() {
337
            var el = $("#multiple_actions_container");
338
        }
339

340
        $(window).bind("load", function() { 
341
               var footerHeight = 0;
342
               var footerTop = 0;
343
               var $footer = $("#footer-container");
344

345
               positionFooter();
346
               function positionFooter() {
347
                   footerHeight = 80;
348
                   footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
349
                   if (($(document.body).height()+footerHeight) < $(window).height()) {
350

351
                       $footer.css({
352
                            position: "absolute"
353
                       }).css({
354
                            top: footerTop
355
                       })
356
                    } else {
357
                    
358
                       if ($footer.css("position") == "static") {
359
                           if ($(document.body).height() < $(window).height()) {    
360
                               $footer.css({
361
                                    position: "absolute"
362
                               }).css({
363
                                    top: footerTop
364
                                })
365
                            }
366
                        } else {
367

368
                           $footer.css({
369
                               position: "static"
370
                           })
371
                       }
372
                   }
373

374
                   }
375
               window.positionFooter = _.throttle(positionFooter, 40);
376
               $(window).scroll(positionFooter).resize(positionFooter)
377
        });
378
    </script>
379

    
380
    <!-- base notification for error/success reporting -->
381
    <a id="notification" rel="#error-success" href="#"></a>
382
    <a id="msgbox" rel="#notification-box" href="#"></a>
383
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
384

    
385
    <div class="overlay" id="generic-overlay-tpl">
386
        <h3 class="header clearfix">
387
            <span class="subtitle"></span>
388
            <span class="title"></span>
389
            <span class="closeme">close</span></h3>
390
        <div class="container">
391
            <div class="content">
392
            </div>
393
        </div>
394
        <div class="footer"></div>
395
    </div>
396

    
397
    <div id="error-overlay-content" class="hidden">
398
        <div class="message"><p></p></div>
399
        <div class="error-details">
400
            <span class="key">{% trans "Module" %}</span>
401
            <span class="value error-module"></span>
402

    
403
            <span class="key">{% trans "Code" %}</span>
404
            <span class="value error-code"></span>
405

    
406
            <span class="key">{% trans "Type" %}</span>
407
            <span class="value error-type"></span>
408

    
409
            <span class="key details">{% trans "Details" %}</span>
410
            <div class="value error-more-details"><p></p></div>
411
        </div>
412

    
413
        <div class="actions">
414
            <span class="show-details">{% trans "Show details" %}</span>
415
            <span class="hide-details">{% trans "Hide details" %}</span>
416
            <span class="report-error">{% trans "Send report" %}</span>
417
            <span class="reload-app">{% trans "Reload application" %}</span>
418
        </div>
419
    </div>
420

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

    
466
                    <input type="checkbox" name="submit-submit-data" class='submit-data' />
467
                    <input type="submit" value="{% trans "submit " %}" class="submit" />
468
                    <textarea name="feedback-data" class="data-text"></textarea>
469
                </form>
470
            </div>
471

    
472
            <div class="message sending">{% trans "submiting your data....." %}</div>
473
            <div class="message success">
474
                {% trans "thank you for submiting your feedback" %}
475
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
476
            <div class="message errormsg">
477
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
478
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
479
            </div>
480
            </div>
481
        </div>
482
    </div>
483
    
484
    <div class="api_overlay_template">
485
        <div class="api_overlay_content">
486
            <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>
487
        </div>
488
    </div>
489

    
490
    <div class="modal" id="notification-box" class="notification-box">
491
        <h3 class="popup-header">
492
            <span class="header-box"></span>
493
        </h3>
494
        <div class="popup-body">
495
            <div class="popup-body-inner">
496
                <div class="machine-now-building"></div>
497
                <div class="popup-separator"></div>
498
                <div class="password-container">
499
                    <div class="password"></div>
500
                </div>
501
                <div class="sub-text"></div>
502
            </div>
503
        </div>
504
    </div>
505
    
506
    <div id="loading-view" class="hidden">
507
        <img src="/static/icons/indicators/small/progress.gif" />
508
        <div class="header">Loading <span>~okeanos</span></div>
509
        <div class="info hidden"></div>
510
    </div>
511
    {% include "footer.html" %}
512

    
513
    <script>
514
        $(document).ready(function() {
515
            $(".css-panes").hide();
516
            
517
            synnefo.ui.main.bind("initial", function() {
518
                if (window.TEST) {
519
                    setTimeout(window.TEST, 60);
520
                }
521
            });
522
            
523
            synnefo.config.update_interval = 5000 || {{ update_interval }};
524
            synnefo.ui.init();
525

526
        })
527
    </script>
528
</body>
529
</html>