Thu, 14 Mar 2024 19:37:53 +0100
Create installation directories
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | /***************************************************************************** |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
3 | * Copyright (C) 2014-2018 |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * Michiel Broek <mbroek at mbse dot eu> |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * This file is part of ThermFerm |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * This is free software; you can redistribute it and/or modify it |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * Free Software Foundation; either version 2, or (at your option) any |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * later version. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * ThermFerm is distributed in the hope that it will be useful, but |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * General Public License for more details. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | *****************************************************************************/ |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
173 | 24 | require_once('utilities.php'); |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
207 | 26 | |
27 | if (isset($_POST['action'])) { | |
28 | if ($_POST['action'] == "testdata") | |
29 | testdata(); | |
30 | } else { | |
31 | edit_screen(""); | |
32 | } | |
33 | ||
34 | ||
35 | exit; | |
36 | ||
37 | ||
38 | /***************************************************************************** | |
39 | * | |
40 | */ | |
41 | ||
42 | ||
43 | function global_update() { | |
44 | ||
45 | if ($_POST['key'] == 'Save') { | |
253
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
46 | $cmd = array("GLOBAL PUT"); |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
47 | $cmd[] = "NAME,".$_POST['Name']; |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
48 | $cmd[] = "PORT,".$_POST['Port']; |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
49 | $cmd[] = "TEMP_ADDRESS,".$_POST['TempAddress']; |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
50 | $cmd[] = "HUM_ADDRESS,".$_POST['HumAddress']; |
513
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
51 | $cmd[] = "TEMP_HUM_IDX,".$_POST['TempHumIdx']; |
253
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
52 | if (isset($_POST['LCDcols'])) |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
53 | $cmd[] = "LCD_COLS,".$_POST['LCDcols']; |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
54 | if (isset($_POST['LCDrows'])) |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
55 | $cmd[] = "LCD_ROWS,".$_POST['LCDrows']; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
56 | $cmd[] = "MQTT_HOST,".$_POST['MQTThost']; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
57 | $cmd[] = "MQTT_POST,".$_POST['MQTTport']; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
58 | $cmd[] = "MQTT_USER,".$_POST['MQTTuser']; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
59 | $cmd[] = "MQTT_PASS,".$_POST['MQTTpass']; |
253
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
60 | $cmd[] = "."; |
7b6abc0dd1c6
Global and profile editor use array commands
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
61 | send_array($cmd); |
207 | 62 | } |
63 | ||
64 | unset($_POST['Name']); | |
65 | unset($_POST['Port']); | |
66 | unset($_POST['TempAddress']); | |
67 | unset($_POST['HumAddress']); | |
513
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
68 | unset($_POST['TempHumIdx']); |
207 | 69 | unset($_POST['LCDcols']); |
70 | unset($_POST['LCDrows']); | |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
71 | unset($_POST['MQTThost']); |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
72 | unset($_POST['MQTTport']); |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
73 | unset($_POST['MQTTuser']); |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
74 | unset($_POST['MQTTpass']); |
207 | 75 | unset($_POST['key']); |
506 | 76 | load('maintenance.php'); |
207 | 77 | } |
78 | ||
79 | ||
80 | ||
81 | function test_thedata() { | |
82 | ||
83 | if (isset($_POST['Name']) && isset($_POST['Port']) && | |
84 | isset($_POST['TempAddress']) && isset($_POST['HumAddress']) && | |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
85 | isset($_POST['TempHumIdx']) && isset($_POST['key']) && |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
86 | isset($_POST['MQTThost']) && isset($_POST['MQTTport']) && |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
87 | isset($_POST['MQTTuser']) && isset($_POST['MQTTpass'])) { |
207 | 88 | |
89 | if ($_POST['key'] == 'Cancel') | |
90 | return 99; | |
91 | ||
92 | if (isset($_POST['LCDcols']) && (($_POST['LCDcols'] != 16) && ($_POST['LCDcols'] != 20))) | |
93 | return 2; | |
94 | ||
95 | if (isset($_POST['LCDrows']) && (($_POST['LCDrows'] != 2) && ($_POST['LCDrows'] != 4))) | |
96 | return 3; | |
97 | ||
98 | } else { | |
99 | return 1; | |
100 | } | |
101 | ||
102 | return 0; | |
103 | } | |
104 | ||
105 | ||
106 | ||
107 | function testdata() | |
108 | { | |
109 | $result = test_thedata(); | |
110 | $error = ''; | |
111 | ||
112 | switch ($result) { | |
113 | case 0: global_update(); | |
114 | return; | |
115 | break; | |
116 | case 1: $error = 'Missing data'; | |
117 | break; | |
118 | case 2: $error = 'LCD columns must be 16 or 20'; | |
119 | break; | |
120 | case 3: $error = 'LCD rows must be 2 or 4'; | |
121 | break; | |
122 | case 99: | |
506 | 123 | load('maintenance.php'); |
207 | 124 | break; |
125 | } | |
126 | ||
127 | edit_screen($error); | |
128 | } | |
129 | ||
130 | ||
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | |
207 | 132 | function edit_screen($error_message) |
133 | { | |
134 | /* | |
135 | * Get list of devices, we need it later | |
136 | */ | |
137 | $answer = send_cmd("DEVICE LIST"); | |
138 | $devices = explode("\r\n", $answer); | |
139 | ||
140 | /* | |
141 | * Get current global data | |
142 | */ | |
143 | $answer = send_cmd("GLOBAL GET"); | |
144 | $reply = explode("\r\n", $answer); | |
145 | ||
146 | $outstr = build_header("ThermFerm - Global Setup"); | |
147 | $outstr .= ' <div id="errors">'.PHP_EOL; | |
148 | $outstr .= ' '.$error_message.PHP_EOL; | |
149 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; | |
150 | $outstr .= ' <div id="etable">'.PHP_EOL; | |
151 | $outstr .= ' <form method="POST" action="global.php">'.PHP_EOL; | |
152 | $outstr .= ' <table class="editor">'.PHP_EOL; | |
153 | $outstr .= ' <tr class="trhead">'.PHP_EOL; | |
154 | $outstr .= ' <td class="setup" colspan="2" style="text-align: center; height: 20px; padding-top: 5px;">Global Setup</td>'.PHP_EOL; | |
155 | $outstr .= ' </tr>'.PHP_EOL; | |
156 | ||
157 | if (startsWith($reply[0], "213")) { | |
158 | $i = 1; | |
159 | while (1) { | |
160 | if (strcmp($reply[$i], ".") == 0) | |
161 | break; | |
162 | $f = explode(",", $reply[$i]); | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
163 | |
207 | 164 | if ($f[0] == "NAME") { |
165 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
166 | $outstr .= ' <td class="editname">System Name</td>'.PHP_EOL; | |
167 | $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value="'.$f[1].'"></td>'.PHP_EOL; | |
168 | $outstr .= ' </tr>'.PHP_EOL; | |
169 | } | |
170 | if ($f[0] == "PORT") { | |
171 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
172 | $outstr .= ' <td class="editname">Telnet port</td>'.PHP_EOL; | |
173 | $outstr .= ' <td class="editfield"><input type="text" name="Port" size="5" value="'.$f[1].'"></td>'.PHP_EOL; | |
174 | $outstr .= ' </tr>'.PHP_EOL; | |
175 | } | |
176 | if ($f[0] == "TEMP_ADDRESS") { | |
177 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
178 | $outstr .= ' <td class="editname">Room temperature sensor</td>'.PHP_EOL; | |
179 | $outstr .= ' <td class="editfield"><select name="TempAddress">'.PHP_EOL; | |
180 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; | |
181 | if (startsWith($devices[0], "212")) { | |
182 | $j = 1; | |
183 | while (1) { | |
184 | if (strcmp($devices[$j], ".") == 0) | |
185 | break; | |
186 | $g = explode(",", $devices[$j]); | |
187 | if ($g[5] == "IN_ANALOG") { | |
188 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; | |
189 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; | |
190 | } | |
191 | $j++; | |
192 | } | |
193 | } | |
194 | $outstr .= ' </select></td>'.PHP_EOL; | |
195 | $outstr .= ' </tr>'.PHP_EOL; | |
196 | } | |
197 | if ($f[0] == "HUM_ADDRESS") { | |
198 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
199 | $outstr .= ' <td class="editname">Room humidity sensor</td>'.PHP_EOL; | |
200 | $outstr .= ' <td class="editfield"><select name="HumAddress">'.PHP_EOL; | |
201 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; | |
202 | if (startsWith($devices[0], "212")) { | |
203 | $j = 1; | |
204 | while (1) { | |
205 | if (strcmp($devices[$j], ".") == 0) | |
206 | break; | |
207 | $g = explode(",", $devices[$j]); | |
208 | if ($g[5] == "IN_ANALOG") { | |
209 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; | |
210 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; | |
211 | } | |
212 | $j++; | |
213 | } | |
214 | } | |
215 | $outstr .= ' </select></td>'.PHP_EOL; | |
216 | $outstr .= ' </tr>'.PHP_EOL; | |
217 | } | |
513
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
218 | if ($f[0] == "TEMP_HUM_IDX") { |
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
219 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
220 | $outstr .= ' <td class="editname">Domoticz TH index</td>'.PHP_EOL; |
513
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
221 | $outstr .= ' <td class="editfield"><input type="text" name="TempHumIdx" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
222 | $outstr .= ' </tr>'.PHP_EOL; |
a2732027afb3
Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
223 | } |
207 | 224 | if ($f[0] == "LCD_COLS") { |
225 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
226 | $outstr .= ' <td class="editname">LCD columns</td>'.PHP_EOL; | |
227 | $outstr .= ' <td class="editfield"><input type="text" name="LCDcols" size="5" value="'.$f[1].'"></td>'.PHP_EOL; | |
228 | $outstr .= ' </tr>'.PHP_EOL; | |
229 | } | |
230 | if ($f[0] == "LCD_ROWS") { | |
231 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
232 | $outstr .= ' <td class="editname">LCD rows</td>'.PHP_EOL; | |
233 | $outstr .= ' <td class="editfield"><input type="text" name="LCDrows" size="5" value="'.$f[1].'"></td>'.PHP_EOL; | |
234 | $outstr .= ' </tr>'.PHP_EOL; | |
235 | } | |
534
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
236 | if ($f[0] == "MQTT_HOST") { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
237 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
238 | $outstr .= ' <td class="editname">MQTT host</td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
239 | $outstr .= ' <td class="editfield"><input type="text" name="MQTThost" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
240 | $outstr .= ' </tr>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
241 | } |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
242 | if ($f[0] == "MQTT_PORT") { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
243 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
244 | $outstr .= ' <td class="editname">MQTT port</td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
245 | $outstr .= ' <td class="editfield"><input type="text" name="MQTTport" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
246 | $outstr .= ' </tr>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
247 | } |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
248 | if ($f[0] == "MQTT_USER") { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
249 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
250 | $outstr .= ' <td class="editname">MQTT username</td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
251 | if (strcmp($f[1], "(null)") == 0) { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
252 | $f[1] = ""; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
253 | } |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
254 | $outstr .= ' <td class="editfield"><input type="text" name="MQTTuser" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
255 | $outstr .= ' </tr>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
256 | } |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
257 | if ($f[0] == "MQTT_PASS") { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
258 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
259 | $outstr .= ' <td class="editname">MQTT password</td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
260 | if (strcmp($f[1], "(null)") == 0) { |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
261 | $f[1] = ""; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
262 | } |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
263 | $outstr .= ' <td class="editfield"><input type="text" name="MQTTpass" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
264 | $outstr .= ' </tr>'.PHP_EOL; |
92b546d4a839
Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents:
513
diff
changeset
|
265 | } |
207 | 266 | $i++; |
267 | } | |
268 | } | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
269 | |
207 | 270 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
271 | $outstr .= ' <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL; | |
272 | $outstr .= ' <td class="editfield"><input type="submit" value="Cancel" name="key">'; | |
273 | $outstr .= '<input type="hidden" value="testdata" name="action">'; | |
274 | $outstr .= ' </tr>'.PHP_EOL; | |
275 | $outstr .= ' </table>'.PHP_EOL; | |
276 | $outstr .= ' </form>'.PHP_EOL; | |
277 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; | |
397
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
253
diff
changeset
|
278 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
253
diff
changeset
|
279 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
253
diff
changeset
|
280 | $outstr .= ' $("#maintenance").jqxButton({ width: 150, height: 25, theme: \'ui-redmond\' });'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
253
diff
changeset
|
281 | $outstr .= ' });'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
253
diff
changeset
|
282 | $outstr .= ' </script>'.PHP_EOL; |
207 | 283 | $outstr .= build_footer(); |
284 | ||
285 | echo $outstr; | |
286 | } | |
287 | ||
288 |