Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Wed Jan 02 17:47:35 2019 +0000
Revision:
16:0edbb832ffcc
Child:
17:a08749ce4cb6
Added fault page

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 16:0edbb832ffcc 1 #include <stdio.h>
andrewboyson 16:0edbb832ffcc 2
andrewboyson 16:0edbb832ffcc 3 #include "http.h"
andrewboyson 16:0edbb832ffcc 4 #include "page.h"
andrewboyson 16:0edbb832ffcc 5 #include "nav.h"
andrewboyson 16:0edbb832ffcc 6 #include "http-base.h"
andrewboyson 16:0edbb832ffcc 7 #include "fault.h"
andrewboyson 16:0edbb832ffcc 8
andrewboyson 16:0edbb832ffcc 9 void HttpFaultHtml()
andrewboyson 16:0edbb832ffcc 10 {
andrewboyson 16:0edbb832ffcc 11 HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
andrewboyson 16:0edbb832ffcc 12 PageAddHeader(NavSite, "Fault", "settings.css", "NULL");
andrewboyson 16:0edbb832ffcc 13 NavAdd(FAULT_PAGE);
andrewboyson 16:0edbb832ffcc 14 PageAddH1(NavSite, "Fault");
andrewboyson 16:0edbb832ffcc 15
andrewboyson 16:0edbb832ffcc 16 PageAddH2("Last fault");
andrewboyson 16:0edbb832ffcc 17 int faultType = FaultTypeGet();
andrewboyson 16:0edbb832ffcc 18 char text[20];
andrewboyson 16:0edbb832ffcc 19 FaultTypeToString(faultType, sizeof(text), text);
andrewboyson 16:0edbb832ffcc 20 PageAddLabelledValue("Fault type", 17, text);
andrewboyson 16:0edbb832ffcc 21 if (faultType)
andrewboyson 16:0edbb832ffcc 22 {
andrewboyson 16:0edbb832ffcc 23 PageAddLabelledInt("After point", 17, FaultPointGet());
andrewboyson 16:0edbb832ffcc 24 PageAddCheckInput("/fault", "Clear fault", "faultclear", "clear");
andrewboyson 16:0edbb832ffcc 25 }
andrewboyson 16:0edbb832ffcc 26 else
andrewboyson 16:0edbb832ffcc 27 {
andrewboyson 16:0edbb832ffcc 28 PageAddCheckInput("/fault", "Test fault", "faulttest", "test");
andrewboyson 16:0edbb832ffcc 29 }
andrewboyson 16:0edbb832ffcc 30
andrewboyson 16:0edbb832ffcc 31 PageAddEnd();
andrewboyson 16:0edbb832ffcc 32 }
andrewboyson 16:0edbb832ffcc 33