commit 5489edf015992dc6589dfedab7dce72150be399c
parent 02e40cfc729ff75d327bf34f4ba00bb190b9c97a
Author: kristapsdz <kristaps@bsd.lv>
Date: Thu, 5 Mar 2020 14:03:15 +0000
parent 02e40cfc729ff75d327bf34f4ba00bb190b9c97a
Author: kristapsdz <kristaps@bsd.lv>
Date: Thu, 5 Mar 2020 14:03:15 +0000
Initial working versin.
3 files changed, 91 insertions(+), 55 deletions(-)
diff --git a/main.c b/main.c @@ -76,8 +76,10 @@ gen_html_offs(struct khtmlreq *req, khtml_attr(req, KELEM_DIV, KATTR_CLASS, classes, KATTR__MAX); if (given != 0) { - khtml_attrx(req, KELEM_TIME, KATTR_DATETIME, - KATTRX_INT, given, KATTR__MAX); + khtml_attrx(req, KELEM_TIME, + KATTR_CLASS, KATTRX_STRING, "success", + KATTR_DATETIME, KATTRX_INT, given, + KATTR__MAX); khtml_int(req, given - start); khtml_closeelem(req, 1); /* time */ } else { @@ -244,7 +246,10 @@ get_html_single(struct kreq *r) khtml_elem(&req, KELEM_DOCTYPE); khtml_elem(&req, KELEM_HTML); khtml_elem(&req, KELEM_HEAD); - khtml_attr(&req, KELEM_META, + khtml_elem(&req, KELEM_TITLE); + khtml_puts(&req, "BSD.lv: Minimal CI Report"); + khtml_closeelem(&req, 1); /* title */ + khtml_attr(&req, KELEM_META, KATTR_NAME, "viewport", KATTR_CONTENT, "width=device-width, initial-scale=1", KATTR__MAX); @@ -255,6 +260,8 @@ get_html_single(struct kreq *r) khtml_closeelem(&req, 1); /* head */ khtml_elem(&req, KELEM_BODY); + khtml_attr(&req, KELEM_DIV, + KATTR_CLASS, "singleton", KATTR__MAX); khtml_attr(&req, KELEM_DIV, KATTR_CLASS, "lefthead report-id", KATTR__MAX); if (p->id < 1000) @@ -294,6 +301,8 @@ get_html_single(struct kreq *r) khtml_puts(&req, p->unamem); khtml_closeelem(&req, 1); /* div */ + khtml_attr(&req, KELEM_DIV, + KATTR_CLASS, "leftgroup", KATTR__MAX); gen_html_offs(&req, "lefthead " "report-env", p->start, p->env); gen_html_offs(&req, "lefthead " @@ -306,6 +315,7 @@ get_html_single(struct kreq *r) "report-install", p->test, p->install); gen_html_offs(&req, "lefthead " "report-dist", p->install, p->distcheck); + khtml_closeelem(&req, 1); /* div */ if (p->log[0] != '\0') { khtml_attr(&req, KELEM_DIV, KATTR_CLASS, @@ -314,6 +324,7 @@ get_html_single(struct kreq *r) khtml_closeelem(&req, 1); /* div */ } + khtml_closeelem(&req, 1); /* div */ khtml_closeelem(&req, 1); /* body */ khtml_closeelem(&req, 1); /* html */ khtml_close(&req); @@ -336,6 +347,9 @@ gen_html_last(struct kreq *r) khtml_elem(&req.html, KELEM_DOCTYPE); khtml_elem(&req.html, KELEM_HTML); khtml_elem(&req.html, KELEM_HEAD); + khtml_elem(&req.html, KELEM_TITLE); + khtml_puts(&req.html, "BSD.lv: Recent Minimal CI Reports"); + khtml_closeelem(&req.html, 1); /* title */ khtml_attr(&req.html, KELEM_META, KATTR_NAME, "viewport", KATTR_CONTENT, "width=device-width, initial-scale=1",
diff --git a/minci.c b/minci.c @@ -1,6 +0,0 @@ -#include "config.h" - -int -main(int argc, char *argv[]) -{ -}
diff --git a/minci.css b/minci.css @@ -1,57 +1,85 @@ -html, body { margin: 0; } -body { font-family: sans-serif; } -.table { width: 100%; } -.table > :nth-child(odd) { background-color: #f0f0f0; } -.table > :first-child { display: none; - background-color: #666; - font-weight: bold; - text-shadow: 0 0 #000; - color: #fff; } +html, body { margin: 0; } +body { font-family: sans-serif; } +.table { width: 100%; } +.singleton { width: calc(100% - 1rem); + max-width: 66rem; + margin: 1rem auto; } +.table > :nth-child(odd) { background-color: #f0f0f0; } +.table > :first-child { display: none; + background-color: #666; + font-weight: bold; + text-shadow: 0 0 #000; + color: #fff; } +.lefthead.report-id, +.lefthead.project-name, .cell.report-id, .cell.report-start, -.cell.project-name { display: inline-block; } +.cell.project-name { display: inline-block; } +.lefthead.report-id::after, .cell.report-start::after, -.cell.report-id::after { content: ', '; - opacity: 0.5; - margin-right: 0.2rem; } -.cell.report-id::before { content: '#'; - opacity: 0.5; } -.cell.report-env::before { content: 'env'; } -.cell.report-deps::before { content: 'deps'; } -.cell.report-build::before { content: 'build'; } -.cell.report-regress::before { content: 'test'; } -.cell.report-install::before { content: 'install'; } -.cell.report-dist::before { content: 'check'; } -.cell.report-system::before { content: 'System '; - opacity: 0.5; } -.row { padding: 0.5rem; } -.cell { padding: 0.25rem 0; } -.cellgroup { display: flex; } -.cellgroup .cell { flex: 1; } -.cellgroup .cell::before { display: block; - padding-right: 0; - opacity: 0.5; - padding-bottom: 0.25rem; - width: auto; } -.cellgroup .cell time::after { content: ' s.'; - opacity: 0.5; } -.cellgroup .cell span::after { content: '-'; - color: red; } -.report-log { white-space: pre; } +.cell.report-id::after { content: ', '; + opacity: 0.5; + margin-right: 0.2rem; } +.lefthead.report-id::before, +.cell.report-id::before { content: '#'; + opacity: 0.5; } +.cell.report-env::before { content: 'env'; } +.cell.report-deps::before { content: 'deps'; } +.cell.report-build::before { content: 'build'; } +.cell.report-regress::before { content: 'test'; } +.cell.report-install::before { content: 'install'; } +.cell.report-dist::before { content: 'check'; } +.cell.report-system::before { content: 'System '; + opacity: 0.5; } +.row { padding: 0.5rem; } +.cell { padding: 0.25rem 0; } +.cellgroup { display: flex; } +.cellgroup .cell { flex: 1; } +.cellgroup .cell::before { display: block; + padding-right: 0; + opacity: 0.5; + padding-bottom: 0.25rem; + width: auto; } +.leftgroup time::after, +.cellgroup .cell time::after { content: ' s.'; + opacity: 0.5; } +.leftgroup span::after, +.cellgroup .cell span::after { content: '-'; + color: red; } +.report-log { white-space: pre; + overflow: hidden; + font-family: monospace; + font-size: 8pt; + text-overflow: ellipsis; } +.lefthead.report-env::before { content: 'Env: '; } +.lefthead.report-deps::before { content: 'Deps: '; } +.lefthead.report-build::before { content: 'Build: '; } +.lefthead.report-regress::before { content: 'Test: '; } +.lefthead.report-install::before { content: 'Install: '; } +.lefthead.report-dist::before { content: 'Check: '; } +.leftgroup .lefthead::before { opacity: 0.5; + width: 5rem; + text-align: right; + display: inline-block; + padding-right: 0.25rem; } +.lefthead.report-log::before { content: 'Fail log...'; + opacity: 0.5; + color: red; + display: block; } @media (min-width: 80rem) { - html, body { margin: 1rem 0; } - .table { max-width: 88rem; - margin: 0 auto; } + html, body { margin: 1rem 0; } + .table { max-width: 88rem; + margin: 0 auto; } .table > :first-child, - .row { display: flex; } - .head, .cell { width: 4rem; - padding: 0 1rem; } + .row { display: flex; } + .head, .cell { width: 4rem; + padding: 0 1rem; } .head.project-name, - .cell.project-name { width: 8rem; } + .cell.project-name { width: 8rem; } .head.report-start, - .cell.report-start { width: 6rem; } - .report-system { flex: 1; } + .cell.report-start { width: 6rem; } + .report-system { flex: 1; } .cell.project-name::before, .cell.report-start::before, .cell.report-env::before,
: nply/minci