[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 22/49: examples/web: Make a non-functional web form for
From: |
gnunet |
Subject: |
[gnunet-scheme] 22/49: examples/web: Make a non-functional web form for searching the DHT. |
Date: |
Sat, 25 Dec 2021 22:59:59 +0100 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit f66adf06f910f2289f740c503e049e6ba1369a7b
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Sep 25 16:51:52 2021 +0200
examples/web: Make a non-functional web form for searching the DHT.
* examples/web.scm
(search-form): New variable.
(url-handler)[body]: Rename to ...
(url-handler)[estimate-text]: ... this.
(url-handler): Include the search form.
---
examples/web.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/examples/web.scm b/examples/web.scm
index b39cdba..4e8f00f 100644
--- a/examples/web.scm
+++ b/examples/web.scm
@@ -35,6 +35,24 @@
(body ,body))
port))))
+;; TODO: make the form work, defaults, ...
+(define search-form
+ '(form
+ (@ (action "/search") (method "get"))
+ (ul (li (label (@ (for "type")) "Type: ")
+ (input (@ (type "number") (id "type") (name "type"))))
+ (li (label (@ (for "replication-level")) "Replication level: ")
+ (input (@ (type "number") (id "replication-level")
+ (name "replication-level"))))
+ (li (label (@ (for "key-encoding")) "Key encoding: ")
+ (select
+ (@ (name "key-encoding") (id "key-encoding"))
+ (option (@ (value "utf-8-text")) "free-form text encoded as UTF-8")
+ (option (@ (value "hexadecimal")) "binary data encoded in
hexadecimal")))
+ (li (label (@ (for "key")) "Key: ")
+ (input (@ (type "text") (id "key") (name "key")))))
+ (input (@ (type "submit") (value "Search the DHT")))))
+
(define (estimate->html estimate)
`(dl (dt "Timestamp")
(dd ,(number->string (nse:estimate:timestamp estimate)))
@@ -45,11 +63,11 @@
(define (url-handler server request body)
(define current-estimate (nse:estimate server))
- (define body
+ (define estimate-text
(if current-estimate
(estimate->html current-estimate)
'(p "No estimate yet")))
- (respond/html body))
+ (respond/html `(div ,estimate-text ,search-form)))
(define (start config)
(define nse-server (nse:connect config))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 08/49: examples: Consider extending the web interface with other services., (continued)
- [gnunet-scheme] 08/49: examples: Consider extending the web interface with other services., gnunet, 2021/12/25
- [gnunet-scheme] 07/49: dht/client: Implement reconnecting., gnunet, 2021/12/25
- [gnunet-scheme] 09/49: examples/web: Connect to the DHT service., gnunet, 2021/12/25
- [gnunet-scheme] 10/49: dht/client: Register new get operations for processing., gnunet, 2021/12/25
- [gnunet-scheme] 12/49: dht/client: Send messages for new get operations., gnunet, 2021/12/25
- [gnunet-scheme] 13/49: dht/client: Send PUT messages., gnunet, 2021/12/25
- [gnunet-scheme] 24/49: examples/web: Put different information on separate pages., gnunet, 2021/12/25
- [gnunet-scheme] 20/49: dht/client: Call the callback on the client result., gnunet, 2021/12/25
- [gnunet-scheme] 17/49: dht/struct: Fix typo in synopsis., gnunet, 2021/12/25
- [gnunet-scheme] 14/49: Merge branch 'master' into dht, gnunet, 2021/12/25
- [gnunet-scheme] 22/49: examples/web: Make a non-functional web form for searching the DHT.,
gnunet <=
- [gnunet-scheme] 27/49: examples/web: Process DHT insertion forms., gnunet, 2021/12/25
- [gnunet-scheme] 40/49: examples/web: Don't hash the data., gnunet, 2021/12/25
- [gnunet-scheme] 35/49: examples/web: Allow module reloading., gnunet, 2021/12/25
- [gnunet-scheme] 23/49: examles/web: Add a non-functional form for DHT insertions., gnunet, 2021/12/25
- [gnunet-scheme] 15/49: Update copyright notices, gnunet, 2021/12/25
- [gnunet-scheme] 34/49: crypto: Implement functional variants., gnunet, 2021/12/25
- [gnunet-scheme] 33/49: examples/web: Hash free-form text first., gnunet, 2021/12/25
- [gnunet-scheme] 46/49: Merge branch 'dht'., gnunet, 2021/12/25
- [gnunet-scheme] 11/49: config: Define default UNIXPATH for DHT service., gnunet, 2021/12/25
- [gnunet-scheme] 16/49: Merge branch 'master' into dht, gnunet, 2021/12/25