Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
16:0edbb832ffcc
Child:
17:a08749ce4cb6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/http-fault-html.c	Wed Jan 02 17:47:35 2019 +0000
@@ -0,0 +1,33 @@
+#include <stdio.h>
+
+#include      "http.h"
+#include      "page.h"
+#include       "nav.h"
+#include "http-base.h"
+#include     "fault.h"
+
+void HttpFaultHtml()
+{
+    HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
+    PageAddHeader(NavSite, "Fault", "settings.css", "NULL");
+    NavAdd(FAULT_PAGE);
+    PageAddH1(NavSite, "Fault");
+    
+    PageAddH2("Last fault");
+    int faultType = FaultTypeGet();
+    char text[20];
+    FaultTypeToString(faultType, sizeof(text), text);
+    PageAddLabelledValue("Fault type", 17, text);
+    if (faultType)
+    {
+        PageAddLabelledInt("After point", 17, FaultPointGet());
+        PageAddCheckInput("/fault", "Clear fault", "faultclear", "clear");
+    }
+    else
+    {
+        PageAddCheckInput("/fault", "Test fault", "faulttest", "test");
+    }
+    
+    PageAddEnd();
+}
+