<html>
	<head>
    	<title>3DPrinterOS Client</title>
		<link rel="stylesheet" type="text/css" href="/static/styles/style.css">
		<meta charset="UTF-8">
	</head>
	<body bgcolor=#003333>
	<div id='url_and_version' align='right' style='align: right; color: #006666'></div>
		<div class="block1">
			<div class="block2">
				3DPrinterOS Client
			</div>

            <br /><br /><div id="closing_client_info"></div><br />

		</div>
	<script src="/static/scripts/jquery.js"></script>
    <script src="/static/scripts/update_element.js"></script>
    <script>
        function check_reconnection() {
            $.get("/", function() {
                <!--if (interval_id !== undefined) {-->
                <!--    clearInterval(interval_id)-->
                <!--};-->
                window.location.href="/";
            });
        };
        function setup_checking_interval() {
            console.log('Reconnection check initiated');
            var interval_id = setInterval(check_reconnection, 2000);
        };
        $(document).ready(function(){
            $.ajaxSetup({
                cache: false,
                timeout: 100,
            });
            var errors_count = 0;
            update_element('/ajax/get_closing_client_info', 'closing_client_info', '<font color="black">3DPrinterOS Client closed<br />Goodbye</font>');
            setInterval(update_element, 100, '/ajax/get_closing_client_info', 'closing_client_info', '<font color="black">3DPrinterOS Client closed<br />Goodbye</font>', 1, setup_checking_interval);
        });
    </script>
	</body>
</html>
