-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.rkt
More file actions
42 lines (34 loc) · 771 Bytes
/
web.rkt
File metadata and controls
42 lines (34 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/home/radiacao/racket/bin/racket
#lang racket
(require "banco.rkt")
(displayln "Content-type: text/html")
(newline)
(newline)
(displayln
"<html><head>
<title> Controle </title>
<meta http-equiv='refresh' content='10;url=/pedro/web.rkt'
<body>
<center>
<h1> Consumo Diario</h1>
</center>")
(displayln (~a
"<ul>
<li> <p> Gasto Atual: " (soma-dados) " Wh </p> </li>
<p>
<li> <p> Consumo Maximo: "(valor-maximo) " Wh </p> </li>
<p>
<li>"))
(displayln
"<form action='/pedro/new.rkt' method='get'>
<p>Configurar Valor Maximo (Wh):
<input type='text' name='maximo' value='100'/>
<input type='submit' value='Reconfigurar'/>
</p>
</form>")
(displayln (~a "<li> <p> Status: " (verificar-limite) "</p></li>"))
(displayln
"</ul>
</body>
</head>
</html>")