X-Git-Url: https://unix4lyfe.org/gitweb/darkstat/blobdiff_plain/ea1a5a68fc9decaeb8839f83daf2ec7e25069998..8a8b16582f1b1a8c589748e7532b5ba37f230fab:/html.c diff --git a/html.c b/html.c index bc3d341..82e2f91 100644 --- a/html.c +++ b/html.c @@ -8,40 +8,43 @@ * GNU General Public License version 2. (see COPYING.GPL) */ -#include "config.h" /* for PACKAGE_STRING */ +#include "darkstat.h" #include "str.h" #include "html.h" -#include "http.h" /* for base_url */ +#include "http.h" /* for http_base_url */ -void html_open(struct str *buf, const char *title, const char *interface, - void (*header_callback)(struct str *buf)) +void html_open(struct str *buf, const char *title, + const int want_graph_js) { - str_append(buf, "\n" - "\n" - "\n"); - str_appendf(buf, "%s (darkstat3 : %s)\n" - "\n", title, interface, - PACKAGE_STRING); - str_append(buf, "\n"); - str_appendf(buf, "\n", - base_url, "style.css"); - if (header_callback != NULL) - header_callback(buf); - - str_append(buf, "\n" + str_appendf(buf, + "\n" + "\n" + "\n" + "%s (darkstat3 %s)\n" + "\n" + "\n" + "\n" + , title, opt_interface, http_base_url); + + if (want_graph_js) + str_appendf(buf, + "\n" + , http_base_url); + + str_appendf(buf, + "\n" "\n" "
\n" - "\n" + "\n" "
\n" - "
\n"); - str_appendf(buf, "

%s

\n", title); + "
\n" + "

%s

\n" + , http_base_url, http_base_url, title); } void html_close(struct str *buf) @@ -49,9 +52,7 @@ void html_close(struct str *buf) str_append(buf, "
\n" "\n" - "\n" - ); + "\n"); } - /* vim:set ts=4 sw=4 tw=78 expandtab: */