<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>VSCP HTML5 websocket inode discovery</title>
<!--
<link rel="stylesheet" type="text/css" href="../css/vscpdemo.css" />
-->
<script type="text/javascript" src="../lib/vscpwslib.js"></script>
<script src="../lib/jquery.js"></script>
</head>

<body>
<h1>Node discovery</h1>
<div id="id3">Wait...</div>
<div id="NodeCount">0</div>
<select id="NodeList" class="select">
	<option>Nodes</option>
</select>

<script type="text/javascript" >

	var idArray = new Array();
	var node_list = $("#NodeList");

	var newnode = function(value,unit,event) {
        //alert("Heartbeat:" + event);
	console.log("value = " + value + " , unit = " + unit + " , event = " + event);
	var guid = event[5];
	console.log("guid = " + guid);
        var bFound = false;

        for (i=0;i<idArray.length;i++) {
            if ( guid == idArray[i]) {
                bFound = true;
                break;
            }
        }

	if (!bFound) {
		idArray.push(guid);
		idArray.sort();
		// clear old options if any
		$('#NodeList').empty();
		$("#NodeList").css('backgroundColor', '#00FF00');
		$("#id3").text("Found");
		$("#NodeCount").text(idArray.length);
		$.each(idArray, function(index, item) {
		    node_list.append($("<option></option>").text(item).val(item));
		});
        }

        return null;
    };
    new vscpws_simpleTextEvent( "ws://geomi.org:7681",
                                            null,
                                            VSCP_CLASS1_INFORMATION,
                                            VSCP_TYPE_INFORMATION_NODE_HEARTBEAT,
                                            -1,
                                            -1,
                                            "",
                                            "",
                                            newnode );
</script>

</body>
</html>

Add simple node discovery page
Add simple node discovery page

Signed-off-by: Kiril Petrov <3cebbf7d784a401d8793ad6c548d6ae50bebe1ef@geomi.org>
