<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: 14pt;
            }
            table {
                border-collapse: collapse;
            }
            table, th, td {
                border: 1px solid black;
            }
            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>
        {% block content %}
            {{content}}
        {% endblock %}
    </body>
</html>
</h
