//Validate!
return false;
});
- $("#cam1").setCamera();
- $("#strain-graphs").setStrainGraphs();
+ //$("#cam1").setCamera();
+ //$("#strain-graphs").setStrainGraphs();
+ $("#errorlog").setErrorLog();
});
</script>
</head>
</tr>
<tr>
<td>
-
</td>
<td align="right">
<input type="submit" value="Start">
</tr>
</table>
</form>
+ <b>Error and warning messages</b><br>
+ <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
</div>
<div class="widget">
<div class="widget">
<div class="title">Camera Feed</div>
- <img src="#" alt="Camera 1" id="cam1" class="centre">
+ <img src="" alt="Camera 1" id="cam1" class="centre">
</div>
</div>
<!-- End main content -->
var submenuHeader = $("<li/>").append($("<a/>", {text : header, href : "#"}));
var submenu = $("<ul/>", {"class" : "submenu"});
- for (item in items) {
+ for (var item in items) {
var info = translator(item, items);
submenu.append($("<li/>").append(
$("<a/>", {text : info.text,
* @returns {$.fn}
*/
$.fn.setCamera = function () {
- var url = mctx.api + "image";
+ var url = mctx.api + "image"; //http://beaglebone/api/image
var update = true;
//Stop updating if we can't retrieve an image!
mctx.has_control = false;
alert("no");
});
+};
+
+$.fn.setErrorLog = function () {
+ var url = mctx.api + "errorlog";
+ var outdiv = this;
+
+ var updater = function () {
+ $.ajax({url : url}).done(function (data) {
+ outdiv.text(data);
+ setTimeout(updater, 1000);
+ }).fail(function (jqXHR) {
+ outdiv.text("Failed to retrieve the error log.");
+ });
+ };
+
+ updater();
};
\ No newline at end of file