<%#
 Module for providing data from a mobile satellite navigation system ( mobile modems, etc.)
 -= Design and Development 2021-2022 =-
 Licensed to the public under the Apache License 2.0.
-%>

<%+cbi/valueheader%>

<div class="boof" id="boof"></div>

<script type="text/javascript">
//<![CDATA[
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "gpoint", "blackbox")%>', null,
	// x - luci json header, geopoint - payload;
	function (x, blackbox) {
                var e = document.getElementById("boof");
                if (blackbox && e) {
                var s = (blackbox.size / blackbox.max) * 100;
                var c = "green";
                if(s === blackbox.max) { c = "red"; }
                e.innerHTML = String.format('<div style="width:21em; position:relative; border:1px solid #999999">'+
                                                '<div style="animation-direction: reverse; background-color:#90c0e0; width:%d%%; height:20px">'+
                                                        '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:%s">'+
                                                                '<small>%s</small>' +
                                                        '</div>' +
                                                '</div>' +
                                        '</div>', s, c, "<b>BlackBox status: "+blackbox.size+" / "+blackbox.max+"</b>"
                );
   	}});
//]]>
</script>

<%+cbi/valuefooter%>
