From 4a8f1b88607975444abcefebc2b71d9ade79090b Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Mon, 15 Nov 2021 22:53:11 -0500 Subject: Render table --- assets/index_begin.html | 3 +++ assets/index_end.html | 4 +++- src/clog.c | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/index_begin.html b/assets/index_begin.html index 6c14258..3709210 100644 --- a/assets/index_begin.html +++ b/assets/index_begin.html @@ -7,3 +7,6 @@

clog posts

+ + + diff --git a/assets/index_end.html b/assets/index_end.html index 308b1d0..53fb2b5 100644 --- a/assets/index_end.html +++ b/assets/index_end.html @@ -1,2 +1,4 @@ +
idtitlebody
+ - + \ No newline at end of file diff --git a/src/clog.c b/src/clog.c index 9e11790..87e58e7 100644 --- a/src/clog.c +++ b/src/clog.c @@ -47,7 +47,8 @@ int page(struct http_request *req) */ int err = kore_pgsql_setup(&sql, "db", KORE_PGSQL_SYNC); kore_log(LOG_ERR, "kore_pgsql_setup: %d", err); - if (!err) { + if (!err) + { kore_pgsql_logerror(&sql); goto out; } @@ -69,9 +70,12 @@ int page(struct http_request *req) id = kore_pgsql_getvalue(&sql, row, 0); title = kore_pgsql_getvalue(&sql, row, 1); body = kore_pgsql_getvalue(&sql, row, 2); + kore_log(LOG_NOTICE, "id: '%s'", id); kore_log(LOG_NOTICE, "title: '%s'", title); kore_log(LOG_NOTICE, "body: '%s'", body); + + kore_buf_appendf(buf, "\t%s%s%s\n", id, title, body); } out: ; -- cgit v1.2.3