summaryrefslogtreecommitdiffstats
path: root/htdocs
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-12-26 02:09:17 +0100
committermanuel <manuel@mausz.at>2013-12-26 02:09:17 +0100
commita9a8e14f895403b2bbdeeabd0255610c51d0166c (patch)
treeb2aa2a6881d55cc10fdc605cd6f0f10b85940012 /htdocs
parent5b3b6e88542d811a2799320c4d0da2e4ea040b77 (diff)
downloadwebiopi-a9a8e14f895403b2bbdeeabd0255610c51d0166c.tar.gz
webiopi-a9a8e14f895403b2bbdeeabd0255610c51d0166c.tar.bz2
webiopi-a9a8e14f895403b2bbdeeabd0255610c51d0166c.zip
add gas-control app
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/app/gas-control/index.html120
-rw-r--r--htdocs/dev.html25
-rw-r--r--htdocs/index.html15
3 files changed, 150 insertions, 10 deletions
diff --git a/htdocs/app/gas-control/index.html b/htdocs/app/gas-control/index.html
new file mode 100644
index 0000000..0e9b3a1
--- /dev/null
+++ b/htdocs/app/gas-control/index.html
@@ -0,0 +1,120 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" />
6 <title>WebIOPi | Gas Control</title>
7 <script type="text/javascript" src="/webiopi.js"></script>
8 <script type="text/javascript">
9 webiopi().ready(function() {
10 var GAS_PORT = 0;
11 webiopi().callMacro("gas_getPort", [ ], function(macro, args, data) {
12 GAS_PORT = parseInt(data)
13 });
14
15
16 var valveButton = w().createGPIOButton(GAS_PORT, "Gas Ventil: unbekannt");
17 valveButton.unbind("click");
18 valve_old_value = -1
19 valveButton.on("updateValue", function(event, gpio, old_value, value) {
20 if (valve_old_value != value) {
21 valveButton.text(value == 0 ? "Gas Ventil auf" : "Gas Ventil zu");
22 valve_old_value = value
23 }
24 });
25 $("#valve").html(valveButton);
26
27
28 var forceModes = [ "", "Online", "Offline" ];
29 var forceMode = forceModes[0];
30 var forceButton;
31 var onForce = function(macro, args, data) {
32 forceMode = data;
33
34 var style = (forceMode == "") ? "automatic" : forceMode;
35 var text = "Automatisch";
36 switch(forceMode)
37 {
38 case forceModes[0]:
39 break;
40 case forceModes[1]:
41 text = "Gas Ventil auf";
42 break;
43 case forceModes[2]:
44 text = "Gas Ventil zu";
45 break;
46 }
47
48 forceButton.attr("class", style.toUpperCase());
49 forceButton.text(text);
50 }
51
52 forceButton = webiopi().createButton("force", "Unbekannt", function() {
53 var i;
54 for (i = 0; i < forceModes.length; i++) {
55 if (forceModes[i] == forceMode)
56 break;
57 }
58 i = (i == forceModes.length - 1) ? 0 : i + 1;
59 webiopi().callMacro("gas_setForce", [ forceModes[i] ], onForce);
60 });
61 $("#force").html(forceButton);
62
63
64 w().refreshGPIO(true);
65
66 var forceRefresh = function() {
67 webiopi().callMacro("gas_getForce", [ ], onForce);
68 setTimeout(function() { forceRefresh() }, 1000);
69 };
70 forceRefresh();
71 });
72 </script>
73 <style type="text/css">
74 body {
75 margin: 50px 0px;
76 padding: 0px;
77 }
78
79 #content {
80 width: 300pt;
81 margin: 0px auto;
82 text-align: left;
83 padding: 15px;
84 border: 1px dashed #333;
85 background-color: #eee;
86 line-height: 35pt;
87 }
88
89 button {
90 width: auto;
91 }
92
93 .LOW {
94 background-color: red;
95 }
96
97 .HIGH {
98 background-color: green;
99 }
100
101 .ONLINE {
102 background-color: red;
103 }
104
105 .OFFLINE {
106 background-color: green;
107 }
108
109 .AUTOMATIC {
110 background-color: gray;
111 }
112 </style>
113</head>
114<body>
115 <div id="content">
116 Ventil: <span id="valve"></span><br />
117 Automatik: <span id="force"></span<br />
118 </div>
119</body>
120</html>
diff --git a/htdocs/dev.html b/htdocs/dev.html
new file mode 100644
index 0000000..68c49c9
--- /dev/null
+++ b/htdocs/dev.html
@@ -0,0 +1,25 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" />
6 <title>WebIOPi | Raspberry Pi IoT Framework</title>
7</head>
8<body>
9
10<h1>WebIOPi Main Menu</h1>
11
12<h2><a href="/app/gpio-header">GPIO Header</a></h2>
13<p>Control and Debug the Raspberry Pi GPIO with a display which looks like the physical header.</p>
14
15<h2><a href="/app/gpio-list">GPIO List</a></h2>
16<p>Control and Debug the Raspberry Pi GPIO ordered in a single column.</p>
17
18<h2><a href="/app/serial-monitor">Serial Monitor</a></h2>
19<p>Use the browser to play with Serial interfaces configured in WebIOPi.</p>
20
21<h2><a href="/app/devices-monitor">Devices Monitor</a></h2>
22<p>Control and Debug devices and circuits wired to your Pi and configured in WebIOPi.</p>
23
24</body>
25</html>
diff --git a/htdocs/index.html b/htdocs/index.html
index 68c49c9..a1671bb 100644
--- a/htdocs/index.html
+++ b/htdocs/index.html
@@ -4,22 +4,17 @@
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" /> 5 <meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" />
6 <title>WebIOPi | Raspberry Pi IoT Framework</title> 6 <title>WebIOPi | Raspberry Pi IoT Framework</title>
7 <meta http-equiv="refresh" content="0; url=/app/gas-control" />
7</head> 8</head>
8<body> 9<body>
9 10
10<h1>WebIOPi Main Menu</h1> 11<h1>WebIOPi Main Menu</h1>
11 12
12<h2><a href="/app/gpio-header">GPIO Header</a></h2> 13<h2><a href="/app/gas-control">Gas Control</a></h2>
13<p>Control and Debug the Raspberry Pi GPIO with a display which looks like the physical header.</p> 14<p>Gas Control.</p>
14 15
15<h2><a href="/app/gpio-list">GPIO List</a></h2> 16<h2><a href="/dev.html">Developer tools</a></h2>
16<p>Control and Debug the Raspberry Pi GPIO ordered in a single column.</p> 17<p>Developer tools.</p>
17
18<h2><a href="/app/serial-monitor">Serial Monitor</a></h2>
19<p>Use the browser to play with Serial interfaces configured in WebIOPi.</p>
20
21<h2><a href="/app/devices-monitor">Devices Monitor</a></h2>
22<p>Control and Debug devices and circuits wired to your Pi and configured in WebIOPi.</p>
23 18
24</body> 19</body>
25</html> 20</html>