<html>
    <head>
        <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 
        <style type="text/css">
            body {
                font-family: sans-serif;
                font-size: 14px;
                line-height: 20px;
                font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif
            }
            div.content {
                width: 750px;
                padding: 10px;
                margin: 0 auto;
                position: relative;
                overflow: auto;
            }
            pre {
                white-space: pre-wrap;
                overflow: auto;
                max-height: 30em;
            }
            pre.traceback {
                background-color: #fee;
                padding: 9px 12px;
                border-radius: 3px;
            }
            .preformatted, .code {
                font-family: monospace;
                border: 1px solid #ccc;
                background: #f5f5f5;
                font-size: 12px;
                line-height: 1.3;
            }
            .panel {
                border: 1px solid #ccc;
                border-radius: 3px;
                margin: 9px 0;
            }
            .panelContent {
                padding: 9px 12px;
            }
            table {
                border-collapse: collapse;
                margin: 5px 0 5px 2px;
                width: auto;
                display: table;
                border-spacing: 2px;
                border-color: grey;
            }
            tbody {
                display: table-row-group;
                vertical-align: middle;
                border-color: inherit;
            }
            th {
                color: #5e6c84;
                font-size: 12px;
                font-weight: 600;
                line-height: 16px;
                text-align: left;
                border: 1px solid #ccc;
                background: #f5f5f5;
                padding: 3px 4px;
            }
            td {
                border: 1px solid #ccc;
                padding: 3px 4px;
            }
            h1, h2, h3 {
                clear: both;
            }
        </style>
        <script type="text/javascript">
            if(window.EventSource) {
                let counter = -1;
                const source = new EventSource("/eventsource/");

                source.addEventListener("counter", function (event) { 
                    if (counter > -1 && parseInt(event.data) > counter) {
                        window.location.reload();
                    } else {
                        counter = parseInt(event.data);
                    }
                });

                source.onmessage = function (event) {  
                    console.log(event)
                    if (event.id == "CLOSE") {
                        source.close(); 
                    }
                }
            }
        </script>
        {% block head %}
        {% endblock %}
    </head>
    <body>
        <div class="content">
            {% block content %}
                {{content}}
            {% endblock %}
        </div>
    </body>
</html>
</h
