Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Tue Jan 15 17:46:01 2019 +0000
Revision:
29:4d649264d6b6
Parent:
17:a08749ce4cb6
Separated nav into base and derived modules

Who changed what in which revision?

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