www/js/mon_fermenter.js

changeset 334
26c6f8e5d58e
parent 325
9a8c650972ca
child 337
faedcfa0610f
--- a/www/js/mon_fermenter.js	Mon Mar 25 20:47:25 2019 +0100
+++ b/www/js/mon_fermenter.js	Wed Mar 27 12:50:57 2019 +0100
@@ -334,7 +334,9 @@
 			{ name: 'stage', type: 'string' },
 			{ name: 'beeruuid', type: 'string' },
 			{ name: 'yeast_lo', type: 'float' },
-			{ name: 'yeast_hi', type: 'float' }
+			{ name: 'yeast_hi', type: 'float' },
+			{ name: 'webcam_url', type: 'string' },
+			{ name: 'webcam_light', type: 'int' }
 		],
 		id: 'record',
 		url: url
@@ -467,6 +469,11 @@
 				$("#Profile2").hide();
 				$("#status_profile").html('');
 			}
+			if (record.online && (record.webcam_url != "")) {
+				$("#Camera").show();
+			} else {
+				$("#Camera").hide();
+			}
 
 			yl = record.yeast_lo;
 			yh = record.yeast_hi;
@@ -675,5 +682,10 @@
 		var url="log_fermentation.php?code=" + record.beercode + "&name=" + record.beername;
 		window.open(url);
 	});
+	$("#Camera").jqxButton({ template: "primary", width: '150px', theme: theme });
+	$("#Camera").click(function () {
+		var url=record.webcam_url;
+		window.open(url);
+	});
 	createAbortElements();
 });

mercurial