Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.

Tue, 26 Feb 2019 16:18:16 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 26 Feb 2019 16:18:16 +0100
changeset 296
69fadd1aded2
parent 295
cbace196bdbf
child 297
5e2424bfbc4a

Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.

README.design file | annotate | diff | comparison | revisions
www/getbrewlog.php file | annotate | diff | comparison | revisions
www/getfermentablesources.php file | annotate | diff | comparison | revisions
www/getfermenter.php file | annotate | diff | comparison | revisions
www/getfermentlog.php file | annotate | diff | comparison | revisions
www/gethopsources.php file | annotate | diff | comparison | revisions
www/getmiscsources.php file | annotate | diff | comparison | revisions
www/getnode.php file | annotate | diff | comparison | revisions
www/getwatersources.php file | annotate | diff | comparison | revisions
www/getyeastsources.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_equipments.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_fermentables.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_hops.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_miscs.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_suppliers.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_water.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_yeasts.php file | annotate | diff | comparison | revisions
www/includes/db_product.php file | annotate | diff | comparison | revisions
www/includes/db_profile_styles.php file | annotate | diff | comparison | revisions
www/includes/db_profile_water.php file | annotate | diff | comparison | revisions
www/js/log_brew.js file | annotate | diff | comparison | revisions
www/js/log_fermentation.js file | annotate | diff | comparison | revisions
--- a/README.design	Mon Feb 25 22:53:41 2019 +0100
+++ b/README.design	Tue Feb 26 16:18:16 2019 +0100
@@ -142,8 +142,6 @@
 TODO:
 
 Copieren recepten tussen products en recipes, maar ook dupliceren. Import.
-Cron uitbreiden met test op nieuw verschenen logfiles. Of nog slimmer, zet de
-logfile aan zodra een product in een gistkast geladen is.
 Download gist temperatuur grenzen naar thermferm zodat die opgevraagd kunnen
 worden door de monitor. Die kan dan de kleuren op de thermometers aanpassen.
 Download en import brouw logs van de brouwcontroller.
--- a/www/getbrewlog.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getbrewlog.php	Tue Feb 26 16:18:16 2019 +0100
@@ -32,5 +32,5 @@
 		'event' => $row['event']
 	);
 }
-
+header("Content-type: application/json");
 echo json_encode($lines);
--- a/www/getfermentablesources.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getfermentablesources.php	Tue Feb 26 16:18:16 2019 +0100
@@ -32,4 +32,5 @@
 		'cost' => $row['cost']
 	);
 }
+header("Content-type: application/json");
 echo json_encode($fermentables, JSON_UNESCAPED_UNICODE);
--- a/www/getfermenter.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getfermenter.php	Tue Feb 26 16:18:16 2019 +0100
@@ -17,4 +17,5 @@
 } else {
   $resultArray['online'] = 0;
 }
+header("Content-type: application/json");
 echo json_encode($resultArray);
--- a/www/getfermentlog.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getfermentlog.php	Tue Feb 26 16:18:16 2019 +0100
@@ -113,6 +113,6 @@
 	}
 	fclose($handle);
 }
-
+header("Content-type: application/json");
 echo json_encode($logs);
 //echo $lines . ' lines' . PHP_EOL;
--- a/www/gethopsources.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/gethopsources.php	Tue Feb 26 16:18:16 2019 +0100
@@ -27,4 +27,5 @@
 		'cost' => $row['cost']
 	);
 }
+header("Content-type: application/json");
 echo json_encode($hops);
--- a/www/getmiscsources.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getmiscsources.php	Tue Feb 26 16:18:16 2019 +0100
@@ -20,4 +20,5 @@
 		'cost' => $row['cost']
 	);
 }
+header("Content-type: application/json");
 echo json_encode($miscs);
--- a/www/getnode.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getnode.php	Tue Feb 26 16:18:16 2019 +0100
@@ -18,4 +18,5 @@
 } else {
     $resultArray['online'] = 0;
 }
+header("Content-type: application/json");
 echo json_encode($resultArray);
--- a/www/getwatersources.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getwatersources.php	Tue Feb 26 16:18:16 2019 +0100
@@ -24,4 +24,5 @@
 		'cost' => $row['cost']
 	);
 }
+header("Content-type: application/json");
 echo json_encode($waters);
--- a/www/getyeastsources.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/getyeastsources.php	Tue Feb 26 16:18:16 2019 +0100
@@ -25,4 +25,5 @@
 		'cost' => $row['cost']
 	);
 }
+header("Content-type: application/json");
 echo json_encode($yeasts);
--- a/www/includes/db_inventory_equipments.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_equipments.php	Tue Feb 26 16:18:16 2019 +0100
@@ -106,6 +106,7 @@
 			'efficiency' => $row['efficiency']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($equipments);
 }
 ?>
--- a/www/includes/db_inventory_fermentables.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_fermentables.php	Tue Feb 26 16:18:16 2019 +0100
@@ -115,6 +115,7 @@
 			'tht_date' => $row['tht_date']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($fermentables);
 }
 ?>
--- a/www/includes/db_inventory_hops.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_hops.php	Tue Feb 26 16:18:16 2019 +0100
@@ -104,6 +104,7 @@
 			'total_oil' => $row['total_oil']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($hops);
 }
 ?>
--- a/www/includes/db_inventory_miscs.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_miscs.php	Tue Feb 26 16:18:16 2019 +0100
@@ -90,6 +90,7 @@
 			'tht_date' => $row['tht_date']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($miscs);
 }
 ?>
--- a/www/includes/db_inventory_suppliers.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_suppliers.php	Tue Feb 26 16:18:16 2019 +0100
@@ -81,6 +81,7 @@
 			'notes' => $row['notes']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($suppliers);
 }
 ?>
--- a/www/includes/db_inventory_water.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_water.php	Tue Feb 26 16:18:16 2019 +0100
@@ -86,6 +86,7 @@
 			'cost' => $row['cost']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($waters);
 }
 ?>
--- a/www/includes/db_inventory_yeasts.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_inventory_yeasts.php	Tue Feb 26 16:18:16 2019 +0100
@@ -100,6 +100,7 @@
 			'cells' => floatval($row['cells']) / 1000000000.0
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($yeasts);
 }
 ?>
--- a/www/includes/db_product.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_product.php	Tue Feb 26 16:18:16 2019 +0100
@@ -432,6 +432,7 @@
 				'stage' => $row['stage']
 			);
 		}
+		header("Content-type: application/json");
 		echo json_encode($brews, JSON_UNESCAPED_UNICODE);
 		return;
 	}
@@ -451,7 +452,7 @@
 				'batch_size' => $row['batch_size']
 			);
 		}
-		syslog(LOG_NOTICE, json_encode($brews, JSON_UNESCAPED_UNICODE));
+		header("Content-type: application/json");
 	        echo json_encode($brews, JSON_UNESCAPED_UNICODE);
 	        return;
 	}
@@ -471,6 +472,7 @@
 				'batch_size' => $row['batch_size']
 			);
 		}
+		header("Content-type: application/json");
 		echo json_encode($brews, JSON_UNESCAPED_UNICODE);
 		return;
 	}
@@ -491,6 +493,7 @@
 				'batch_size' => $row['batch_size']
 			);
 		}
+		header("Content-type: application/json");
 		echo json_encode($brews, JSON_UNESCAPED_UNICODE);
 		return;
 	}
@@ -510,6 +513,7 @@
 				'stage' => $row['stage']
 			);
 		}
+		header("Content-type: application/json");
 		echo json_encode($brews, JSON_UNESCAPED_UNICODE);
 		return;
 	}
--- a/www/includes/db_profile_styles.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_profile_styles.php	Tue Feb 26 16:18:16 2019 +0100
@@ -102,6 +102,7 @@
 			'examples' => $row['examples']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($styles);
 }
 ?>
--- a/www/includes/db_profile_water.php	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/includes/db_profile_water.php	Tue Feb 26 16:18:16 2019 +0100
@@ -79,6 +79,7 @@
 			'total_alkalinity' => $row['total_alkalinity']
 		);
 	}
+	header("Content-type: application/json");
 	echo json_encode($waters);
 }
 ?>
--- a/www/js/log_brew.js	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/js/log_brew.js	Tue Feb 26 16:18:16 2019 +0100
@@ -23,6 +23,8 @@
 
 $(document).ready(function () {
 
+	$('#jqxMenu').jqxMenu('destroy');
+
 	$("#jqxLoader").jqxLoader({
 		width: 250,
 		height: 150,
@@ -114,7 +116,7 @@
 			'<head>' +
 			'<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />' +
 			'<meta charset="utf-8" />' +
-			'<title>jQWidgets Chart</title>' +
+			'<title>' + my_code + ' ' + my_name + ' brouwdag</title>' +
 			'</head>' +
 			'<body>' + content + '</body></html>';
 		document.write(pageContent);
--- a/www/js/log_fermentation.js	Mon Feb 25 22:53:41 2019 +0100
+++ b/www/js/log_fermentation.js	Tue Feb 26 16:18:16 2019 +0100
@@ -23,6 +23,8 @@
 
 $(document).ready(function () {
 
+	$('#jqxMenu').jqxMenu('destroy');
+
 	$("#jqxLoader").jqxLoader({
 		width: 250,
 		height: 150,
@@ -131,7 +133,7 @@
 			'<head>' +
 			'<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />' +
 			'<meta charset="utf-8" />' +
-			'<title>jQWidgets Chart</title>' +
+			'<title>' + my_code + ' ' + my_name + ' vergisting</title>' +
 			'</head>' +
 			'<body>' + content + '</body></html>';
 		document.write(pageContent);

mercurial