mirror of
https://github.com/elua/elua.git
synced 2025-01-25 01:02:54 +08:00
fixed some errors in index.pht, also made it smaller
This commit is contained in:
parent
92465cf2a6
commit
2f8d70c2c0
@ -1,19 +1,18 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>eLua webserver test</title>
|
||||
<html><head><title>eLua webserver test</title>
|
||||
</head><body>
|
||||
<div style="text-align: center;"><big>Welcome to the <span style="font-weight: bold;">eLua</span> web server!<span style="font-weight: bold;"></span></big><br> </div>
|
||||
<p align="center"><big>Welcome to the <b>eLua</b> web server!</big><br></p>
|
||||
<br>
|
||||
<div style="text-align: left;">The right column of the following table is generated by embedded Lua code:<br>
|
||||
<br>
|
||||
<table style="text-align: left; width: 400px;" border="1" cellpadding="2" cellspacing="2">
|
||||
<table width="400" border="1" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><span style="font-weight: bold;">eLua CPU</span></td>
|
||||
<td><b>eLua CPU</b></td>
|
||||
<td><?lua print(pd.cpu()) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span style="font-weight: bold;">eLua board</span></td>
|
||||
<td><b>eLua board</b></td>
|
||||
<td><?lua print(pd.board()) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -21,11 +20,11 @@
|
||||
<br>
|
||||
And now let's test CGI. Use the form below to control the on-board LED.<br><br>
|
||||
<form method="get" action="http://elua/index.pht" name="led">
|
||||
<table style="text-align: left; width: 400px;" border="0" cellpadding="2" cellspacing="2">
|
||||
<table width="400" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;" valign="undefined"><button value="ledon" name="ledon">Led ON</button></td>
|
||||
<td style="text-align: center;" valign="undefined"><button value="ledoff" name="ledoff">Led OFF</button></td>
|
||||
<td style="center"><input type="submit" value="Led ON" name="ledon"></td>
|
||||
<td style="center"><input type="submit" value="Led OFF" name="ledoff"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -33,10 +32,10 @@ And now let's test CGI. Use the form below to control the on-board LED.<br><br>
|
||||
<?lua
|
||||
local ledpin = pio.PF_0
|
||||
pio.output(ledpin)
|
||||
if reqdata['ledon'] == 'ledon' then
|
||||
if reqdata['ledon'] then
|
||||
pio.set(ledpin)
|
||||
print '<br><font color="blue"><b>The LED is now ON</b></font><br>'
|
||||
elseif reqdata['ledoff'] == 'ledoff' then
|
||||
elseif reqdata['ledoff'] then
|
||||
pio.clear(ledpin)
|
||||
print '<br><font color="blue"><b>The LED is now OFF</b></font><br>'
|
||||
elseif next(reqdata) ~= nil then
|
||||
|
Loading…
x
Reference in New Issue
Block a user