Sat, 25 Oct 2014 21:16:25 +0200
Bumped to version 0.2.3
100 | 1 | <?php |
2 | /***************************************************************************** | |
3 | * Copyright (C) 2014 | |
4 | * | |
5 | * Michiel Broek <mbroek at mbse dot eu> | |
6 | * | |
7 | * This file is part of ThermFerm | |
8 | * | |
9 | * This is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by the | |
11 | * Free Software Foundation; either version 2, or (at your option) any | |
12 | * later version. | |
13 | * | |
14 | * ThermFerm is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
22 | *****************************************************************************/ | |
23 | ||
24 | ||
25 | function open_socket() | |
26 | { | |
27 | $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
28 | ||
29 | if (!($sock === false)) { | |
30 | if (socket_connect($sock, "localhost", 6554)) { | |
31 | socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 15, 'usec' => 0)); | |
32 | } else { | |
33 | socket_close($sock); | |
34 | } | |
35 | } | |
36 | return $sock; | |
37 | } | |
38 | ||
39 | ||
40 | ||
196 | 41 | /* |
42 | * @param string $command to send to the server. | |
43 | * Return: string with the complete reply from the | |
44 | * server. This can be a multiline reply. | |
45 | */ | |
46 | function send_cmd($command) | |
47 | { | |
48 | $sock = open_socket(); | |
49 | if ($sock == false) { | |
50 | return ""; | |
51 | } | |
52 | socket_write($sock, $command, 4096); | |
53 | ||
54 | $answer = ""; | |
55 | while (1) { | |
56 | $line = socket_read($sock, 4096); | |
57 | if ($line === '') | |
58 | break; | |
59 | $answer .= $line; | |
60 | } | |
61 | socket_close($sock); | |
62 | ||
63 | return $answer; | |
64 | } | |
65 | ||
66 | ||
67 | ||
68 | /* | |
251
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
69 | * @param string array of $commands to send to the server. |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
70 | * Return: string with the complete reply from the |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
71 | * server. This can be a multiline reply. |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
72 | */ |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
73 | function send_array($command) |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
74 | { |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
75 | $sock = open_socket(); |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
76 | if ($sock == false) { |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
77 | return ""; |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
78 | } |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
79 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
80 | foreach($command as $cmd) { |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
81 | socket_write($sock, $cmd, 4096); |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
82 | usleep(20000); /* Give server time to recognize lines */ |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
83 | } |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
84 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
85 | $answer = ""; |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
86 | while (1) { |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
87 | $line = socket_read($sock, 4096); |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
88 | if ($line === '') |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
89 | break; |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
90 | $answer .= $line; |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
91 | } |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
92 | socket_close($sock); |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
93 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
94 | return $answer; |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
95 | } |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
96 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
97 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
98 | |
173b4480c4a0
Made a function to send arrays to the server. The room temperature and humidity are now displayed at once when the dashboard is loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
99 | /* |
196 | 100 | * @param string $command to send to the server. |
101 | * Return: 0 = Ok. | |
102 | * 1 = Server responden with an error. | |
103 | */ | |
104 | function send_cmd_check($command) | |
105 | { | |
106 | $answer = send_cmd($command); | |
107 | ||
108 | if (strlen($answer) && (($answer[0] == '1') || ($answer[0] == '2'))) | |
109 | return 0; | |
110 | ||
111 | return 1; | |
112 | } | |
113 | ||
114 | ||
115 | ||
255
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
116 | /* |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
117 | * @param array $command to send to the server. |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
118 | * Return: 0 = Ok. |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
119 | * 1 = Server responden with an error. |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
120 | */ |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
121 | function send_array_check($command) |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
122 | { |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
123 | $answer = send_array($command); |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
124 | |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
125 | if (strlen($answer) && (($answer[0] == '1') || ($answer[0] == '2'))) |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
126 | return 0; |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
127 | |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
128 | return 1; |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
129 | } |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
130 | |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
131 | |
fb930d1db5a6
Added function send_array_check
Michiel Broek <mbroek@mbse.eu>
parents:
251
diff
changeset
|
132 | |
100 | 133 | function startsWith($haystack, $needle) |
134 | { | |
135 | return !strncmp($haystack, $needle, strlen($needle)); | |
136 | } | |
137 | ||
138 | ||
137
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
139 | function build_header($heading) |
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:
127
diff
changeset
|
140 | { |
269
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
141 | $answer = send_cmd('GLOBAL GET'); |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
142 | $arr = explode("\r\n", $answer); |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
143 | $version = "?"; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
144 | |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
145 | if (startsWith($arr[0], "213")) { |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
146 | $j = 1; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
147 | while (1) { |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
148 | if (strcmp($arr[$j], ".") == 0) |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
149 | break; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
150 | $f = explode(",", $arr[$j]); |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
151 | |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
152 | if ($f[0] == "RELEASE") |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
153 | $version = $f[1]; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
154 | $j++; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
155 | } |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
156 | } |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
157 | |
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:
127
diff
changeset
|
158 | $outstr = '<!DOCTYPE html>'.PHP_EOL; |
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:
127
diff
changeset
|
159 | $outstr .= '<html>'.PHP_EOL; |
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:
127
diff
changeset
|
160 | $outstr .= ' <head>'.PHP_EOL; |
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:
127
diff
changeset
|
161 | $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; |
137
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
162 | $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL; |
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:
127
diff
changeset
|
163 | $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; |
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:
127
diff
changeset
|
164 | $outstr .= ' </head>'.PHP_EOL; |
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:
127
diff
changeset
|
165 | $outstr .= ' <body class="default">'.PHP_EOL; |
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:
127
diff
changeset
|
166 | $outstr .= ' <div id="jqxWidget">'.PHP_EOL; |
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:
127
diff
changeset
|
167 | $outstr .= ' <div id="header">'.PHP_EOL; |
269
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
168 | $outstr .= ' <div id="title">'.PHP_EOL; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
169 | $outstr .= ' ThermFerm '.$version.PHP_EOL; |
dc88583a068d
All web screens now show the program name and version
Michiel Broek <mbroek@mbse.eu>
parents:
255
diff
changeset
|
170 | $outstr .= ' </div>'.PHP_EOL; |
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:
127
diff
changeset
|
171 | $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL; |
173 | 172 | $outstr .= ' <input type="submit" style="width: 150px; height: 25px;" value="Maintenance Panel" />'.PHP_EOL; |
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:
127
diff
changeset
|
173 | $outstr .= ' </form>'.PHP_EOL; |
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:
127
diff
changeset
|
174 | $outstr .= ' </div> <!-- header -->'.PHP_EOL; |
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:
127
diff
changeset
|
175 | $outstr .= ' <div id="content">'.PHP_EOL; |
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:
127
diff
changeset
|
176 | |
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:
127
diff
changeset
|
177 | return $outstr; |
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:
127
diff
changeset
|
178 | } |
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:
127
diff
changeset
|
179 | |
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:
127
diff
changeset
|
180 | |
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:
127
diff
changeset
|
181 | |
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:
127
diff
changeset
|
182 | function build_footer() |
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:
127
diff
changeset
|
183 | { |
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:
127
diff
changeset
|
184 | $outstr = ' </div> <!-- content -->'.PHP_EOL; |
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:
127
diff
changeset
|
185 | $outstr .= ' </div> <!-- jqxWidget -->'.PHP_EOL; |
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:
127
diff
changeset
|
186 | $outstr .= ' </body>'.PHP_EOL; |
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:
127
diff
changeset
|
187 | $outstr .= '</html>'.PHP_EOL; |
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:
127
diff
changeset
|
188 | |
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:
127
diff
changeset
|
189 | return $outstr; |
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:
127
diff
changeset
|
190 | } |
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:
127
diff
changeset
|
191 | |
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:
127
diff
changeset
|
192 | |
137
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
193 | |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
194 | /* |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
195 | * Goto URL. Works also after headers have been sent. |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
196 | */ |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
197 | function load($url) { |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
198 | echo' |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
199 | <script> |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
200 | if (top.location != self.location) { |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
201 | top.location = "'.$url.'" |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
202 | } |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
203 | {location.href="'.$url.'";} |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
204 | </script>'; |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
205 | } |
e4518fd9b626
Profiles can be managed via the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
206 | |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
137
diff
changeset
|
207 |