diff -r 37a8c7ec9d3e -r 1750b6cae48e www/index.php
--- a/www/index.php Wed Aug 08 16:35:05 2018 +0200
+++ b/www/index.php Thu Aug 09 21:52:01 2018 +0200
@@ -1,121 +1,184 @@
+
+
+
'
+
+ Brewery Managment System v
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ' '.PHP_EOL;
-$outstr .= ''.PHP_EOL;
+ $("#jqxTree").on("select", function (event) {
+ /*
+ * Process the selected id from the left panel tree and show the correct page in the right panel.
+ */
+ var estr = event.args.element.id;
+ if (estr == "Root") {
+ $("#ContentPanel").html("RrrR
");
+ } else if (estr.indexOf("node-", 0) == 0) {
+ // Load and show a node.
+ // The parameter is: node-36d4d030-4d62-4f2f-a96b-472e643687f7
+ var uuid = estr.substr(5);
+ var url = "getnode.php?uuid='" + uuid + "'";
+ var source = {
+ datatype: "json",
+ datafields: [
+ { name: 'record', type: 'int' },
+ { name: 'uuid', type: 'string' },
+ { name: 'node', type: 'string' },
+ { name: 'online', type: 'string' },
+ { name: 'group_id', type: 'string' },
+ { name: 'hardwaremake', type: 'string' },
+ { name: 'hardwaremodel', type: 'string' },
+ { name: 'os', type: 'string' },
+ { name: 'os_version', type: 'string' },
+ { name: 'firmware', type: 'string' },
+ { name: 'firstseen', type: 'string' },
+ { name: 'lastseen', type: 'string' },
+ { name: 'temperature', type: 'float' },
+ { name: 'humidity', type: 'float' },
+ { name: 'barometer', type: 'float' },
+ { name: 'gps_latitude', type: 'float' },
+ { name: 'gps_longitude', type: 'float' },
+ { name: 'gps_altitude', type: 'float' },
+ { name: 'net_address', type: 'string' },
+ { name: 'net_ifname', type: 'string' },
+ { name: 'net_rssi', type: 'int' }
+ ],
+ id: 'record',
+ url: url
+ };
+ var dataAdapter = new $.jqx.dataAdapter(source, {
+ loadComplete: function (records) {
+ var record = dataAdapter.records[0];
+ var html = "";
+ html += "
";
+ html += "Systeem overzicht ";
+ html += "Uuid " + record.uuid + " ";
+ html += "Systeem " + record.node + " ";
+ html += "Online " + record.online + " ";
+ html += "Type " + record.group_id + " ";
+ html += "Hardware maker " + record.hardwaremake+ " ";
+ html += "Hardware model " + record.harwaremodel+ " ";
+ html += "OS " + record.os + " versie: " + record.os_version + " ";
+ html += "Firmware " + record.firmware + " ";
+ html += "Temperatuur " + record.temperature + "°C ";
+ html += "Vochtigheid " + record.humidity + "% ";
+ html += "Luchtdruk " + record.barometer + " ";
+ html += "GPS "+ record.gps_latitude + " " + record.gps_longitude + " " + record.gps_altitude + " ";
+ html += "Netwerk "+ record.net_ifname + " " + record.net_address + " ";
+ html += "";
+ html += "";
+ $("#ContentPanel").html(html);
+ }
+ /* Data formatteren etc. Zie https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdataadapter/index.htm#demos/jqxdataadapter/bindingtojson.htm */
+ });
+ dataAdapter.dataBind();
-echo $outstr;
-?>
+ } else if (estr.indexOf("fermenter-", 0) == 0) {
+ var uuid = estr.substr(10);
+ $("#ContentPanel").html("" + uuid + "
");
+ } else if (event.args.element.id == "Nodes") {
+ $("#ContentPanel").html(aNode);
+ } else {
+ $("#ContentPanel").html("" + event.args.element.id + "
");
+ }
+ });
+ });
+
+
+
+
+
+
+