# HG changeset patch # User Michiel Broek # Date 1551194296 -3600 # Node ID 69fadd1aded2eaff13faf68aeca1abc409e5399d # Parent cbace196bdbf80056b17d381ccfc0eb8c13318b7 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. diff -r cbace196bdbf -r 69fadd1aded2 README.design --- 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. diff -r cbace196bdbf -r 69fadd1aded2 www/getbrewlog.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getfermentablesources.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getfermenter.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getfermentlog.php --- 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; diff -r cbace196bdbf -r 69fadd1aded2 www/gethopsources.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getmiscsources.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getnode.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getwatersources.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/getyeastsources.php --- 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); diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_equipments.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_fermentables.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_hops.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_miscs.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_suppliers.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_water.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_inventory_yeasts.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_product.php --- 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; } diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_profile_styles.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/includes/db_profile_water.php --- 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); } ?> diff -r cbace196bdbf -r 69fadd1aded2 www/js/log_brew.js --- 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 @@ '' + '' + '' + - 'jQWidgets Chart' + + '' + my_code + ' ' + my_name + ' brouwdag' + '' + '' + content + ''; document.write(pageContent); diff -r cbace196bdbf -r 69fadd1aded2 www/js/log_fermentation.js --- 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 @@ '' + '' + '' + - 'jQWidgets Chart' + + '' + my_code + ' ' + my_name + ' vergisting' + '' + '' + content + ''; document.write(pageContent);