base.html 1.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html lang="en">
<head>
    {% block head %}
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %} - CAAAS</title>
    <script src="/static/jquery-2.1.4.min.js" type="application/javascript"></script>
    <script type="application/javascript">
        var api_endpoint = "/api";
    </script>
11
    <link rel="stylesheet" href="/static/caaas.css" type="text/css">
12 13 14 15 16
    {% endblock %}
</head>
<body>
    <script>
        function update_status() {
17
            $.getJSON("{{ url_for("api_status") }}")
18 19 20
                .done(function( data ) {
                    $("#num_nodes").text(data.num_nodes);
                    $("#num_containers").text(data.num_containers);
Daniele Venzano's avatar
Daniele Venzano committed
21 22 23
                }).error(function( data ) {
                    $("#num_nodes").text("N/A");
                    $("#num_containers").text("N/A");
24 25 26 27 28
                });
        }
        update_status();
        window.setInterval(update_status, 5000);
    </script>
Daniele Venzano's avatar
Daniele Venzano committed
29
    <h1>DSG CAaaS system - Analytics on demand</h1>
30 31 32
    <div id="content">{% block content %}{% endblock %}</div>
    <div id="footer">
        {% block footer %}
33 34 35 36 37 38 39 40 41 42 43
            <div class="caaas_status_line">
                <p>
                    <span id="app_name"><a href="{{ url_for("web_status") }}">CAaaS</a></span>
                    <span id="status">
                        [<span id="num_nodes">N/A</span> swarm nodes, <span id="num_containers">N/A</span> active containers]
                    </span>
                </p>
            </div>
            <div class="copyright">
                <h6>&copy; Copyright 2015 by <a href="http://distsysgroup.wordpress.com/">DSG</a></h6>
            </div>
44 45 46 47
        {% endblock %}
    </div>
</body>
</html>