Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
30:6a08abbe6301
Parent:
29:4d649264d6b6
Child:
35:dc4333b13aba
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fault/http-fault-html.c	Thu Jan 17 13:07:53 2019 +0000
@@ -0,0 +1,35 @@
+#include <stdio.h>
+
+#include         "http.h"
+#include         "page.h"
+#include "page-derived.h"
+#include  "http-server.h"
+#include        "fault.h"
+
+void HttpFaultHtml()
+{
+    HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
+    PageAddHeader(PageSite, "Fault", "settings.css", "NULL");
+    PageAddNav(FAULT_PAGE);
+    PageAddH1(PageSite, "Fault");
+    
+    PageAddH2("Last fault");
+    int faultType = FaultTypeGet();
+    char text[20];
+    FaultTypeToString(faultType, sizeof(text), text);
+    PageAddLabelledValue("Fault type", 17, text);
+    if (faultType)
+    {
+        FaultZoneToString(FaultZoneGet(), sizeof(text), text);
+        PageAddLabelledValue("Fault zone", 17, text);
+        PageAddLabelledInt("After point", 17, FaultPointGet());
+        PageAddCheckInput("/fault", "Clear fault", "faultclear", "clear");
+    }
+    else
+    {
+        PageAddCheckInput("/fault", "Test fault", "faulttest", "test");
+    }
+    
+    PageAddEnd();
+}
+