Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: clock/web-clock-html.c
- Revision:
- 109:3e82f62c7e1f
- Parent:
- 103:91194cc19bbb
--- a/clock/web-clock-html.c Sun Apr 28 09:56:42 2019 +0000
+++ b/clock/web-clock-html.c Mon Apr 29 14:45:30 2019 +0000
@@ -1,69 +1,68 @@
#include <time.h>
#include "http.h"
-#include "page.h"
-#include "page-derived.h"
-#include "web-base.h"
+#include "web-page-base.h"
+#include "web-add.h"
void WebClockHtml()
{
HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
- PageAddHeader(PageSite, "Clock", "settings.css", "clock.js");
- PageAddNav(CLOCK_PAGE);
- PageAddH1(PageSite, "Clock");
+ WebAddHeader("Clock", "settings.css", "clock.js");
+ WebAddNav(CLOCK_PAGE);
+ WebAddH1("Clock");
- PageAddH2("Status");
- PageAddAjaxLed("RTC is set" , "ajax-rtc-set" );
- PageAddAjaxLed("Clock is set" , "ajax-clock-set" );
- PageAddAjaxLed("External source is ok", "ajax-source-ok" );
- PageAddAjaxLed("Time synchronised" , "ajax-time-locked");
- PageAddAjaxLed("Rate synchronised" , "ajax-rate-locked");
+ WebAddH2("Status");
+ WebAddAjaxLed("RTC is set" , "ajax-rtc-set" );
+ WebAddAjaxLed("Clock is set" , "ajax-clock-set" );
+ WebAddAjaxLed("External source is ok", "ajax-source-ok" );
+ WebAddAjaxLed("Time synchronised" , "ajax-time-locked");
+ WebAddAjaxLed("Rate synchronised" , "ajax-rate-locked");
- PageAddH2("Server UTC time");
+ WebAddH2("Server UTC time");
HttpAddText("<div id='ajax-date-utc'></div>\r\n");
- PageAddH2("Server local time");
+ WebAddH2("Server local time");
HttpAddText("<div id='ajax-date-pc'></div>\r\n");
- PageAddH2("Server - PC (ms)");
+ WebAddH2("Server - PC (ms)");
HttpAddText("<div id='ajax-date-diff'></div>\r\n");
- PageAddH2("UTC");
- PageAddAjaxInputToggle("Enable epoch change" , "ajax-leap-enable" , "chg-clock-leap-enable" );
- PageAddAjaxInputToggle("Direction of next epoch" , "ajax-leap-forward" , "chg-clock-leap-forward");
- PageAddAjaxInput ("Year next epoch starts" , 4, "ajax-leap-year" , "set-clock-leap-year" );
- PageAddAjaxInput ("Month next epoch starts" , 4, "ajax-leap-month" , "set-clock-leap-month" );
- PageAddAjaxInput ("Current era offset" , 4, "ajax-leap-count" , "set-clock-leap-count" );
+ WebAddH2("UTC");
+ WebAddAjaxInputToggle("Enable epoch change" , "ajax-leap-enable" , "chg-clock-leap-enable" );
+ WebAddAjaxInputToggle("Direction of next epoch" , "ajax-leap-forward" , "chg-clock-leap-forward");
+ WebAddAjaxInput ("Year next epoch starts" , 4, "ajax-leap-year" , "set-clock-leap-year" );
+ WebAddAjaxInput ("Month next epoch starts" , 4, "ajax-leap-month" , "set-clock-leap-month" );
+ WebAddAjaxInput ("Current era offset" , 4, "ajax-leap-count" , "set-clock-leap-count" );
HttpAddText("<div><button type='button' onclick='displayLeap()'>Display leap</button></div>\r\n");
HttpAddText("<div>The leap seconds list is available <a href='https://www.ietf.org/timezones/data/leap-seconds.list' target='_blank'>here</a></div>\r\n");
- PageAddH2("Governer");
- PageAddAjaxInput ("Ppb" , 5, "ajax-ppb" , "ppb" );
- PageAddAjaxInput ("Ppb divisor" , 5, "ajax-ppb-divisor" , "ppbdivisor" );
- PageAddAjaxInput ("Ppb max change" , 5, "ajax-ppb-max-chg" , "ppbmaxchange" );
- PageAddAjaxInput ("Ppb synced limit" , 5, "ajax-ppb-syn-lim" , "syncedlimitppb");
- PageAddAjaxInput ("Ppb synced hysteresis" , 5, "ajax-ppb-syn-hys" , "syncedhysppb" );
- PageAddAjaxInput ("Offset divisor" , 5, "ajax-off-divisor" , "slewdivisor" );
- PageAddAjaxInput ("Offset max (ms)" , 5, "ajax-off-max" , "slewmax" );
- PageAddAjaxInput ("Offset synced limit (ms)", 5, "ajax-off-syn-lim" , "syncedlimitns" );
- PageAddAjaxInput ("Offset synced hys (ms)" , 5, "ajax-off-syn-hys" , "syncedhysns" );
- PageAddAjaxInput ("Offset reset limit (s)" , 5, "ajax-off-rst-lim" , "maxoffsetsecs" );
- PageAddAjaxInputToggle("Trace" , "ajax-gov-trace" , "clockgovtrace" );
+ WebAddH2("Governer");
+ WebAddAjaxInput ("Ppb" , 5, "ajax-ppb" , "ppb" );
+ WebAddAjaxInput ("Ppb divisor" , 5, "ajax-ppb-divisor" , "ppbdivisor" );
+ WebAddAjaxInput ("Ppb max change" , 5, "ajax-ppb-max-chg" , "ppbmaxchange" );
+ WebAddAjaxInput ("Ppb synced limit" , 5, "ajax-ppb-syn-lim" , "syncedlimitppb");
+ WebAddAjaxInput ("Ppb synced hysteresis" , 5, "ajax-ppb-syn-hys" , "syncedhysppb" );
+ WebAddAjaxInput ("Offset divisor" , 5, "ajax-off-divisor" , "slewdivisor" );
+ WebAddAjaxInput ("Offset max (ms)" , 5, "ajax-off-max" , "slewmax" );
+ WebAddAjaxInput ("Offset synced limit (ms)", 5, "ajax-off-syn-lim" , "syncedlimitns" );
+ WebAddAjaxInput ("Offset synced hys (ms)" , 5, "ajax-off-syn-hys" , "syncedhysns" );
+ WebAddAjaxInput ("Offset reset limit (s)" , 5, "ajax-off-rst-lim" , "maxoffsetsecs" );
+ WebAddAjaxInputToggle("Trace" , "ajax-gov-trace" , "clockgovtrace" );
- PageAddH2("NTP");
- PageAddAjaxInput ("Server url" , 5, "ajax-ntp-server" , "ntpserver" );
- PageAddAjaxInput ("Initial interval (s)" , 5, "ajax-ntp-initial" , "clockinitial" );
- PageAddAjaxInput ("Normal interval (m)" , 5, "ajax-ntp-normal" , "clocknormal" );
- PageAddAjaxInput ("Retry interval (s)" , 5, "ajax-ntp-retry" , "clockretry" );
- PageAddAjaxInput ("Offset (ms)" , 5, "ajax-ntp-offset" , "clockoffset" );
- PageAddAjaxInput ("Max delay (ms)" , 5, "ajax-ntp-max-delay", "clockmaxdelay" );
+ WebAddH2("NTP");
+ WebAddAjaxInput ("Server url" , 5, "ajax-ntp-server" , "ntpserver" );
+ WebAddAjaxInput ("Initial interval (s)" , 5, "ajax-ntp-initial" , "clockinitial" );
+ WebAddAjaxInput ("Normal interval (m)" , 5, "ajax-ntp-normal" , "clocknormal" );
+ WebAddAjaxInput ("Retry interval (s)" , 5, "ajax-ntp-retry" , "clockretry" );
+ WebAddAjaxInput ("Offset (ms)" , 5, "ajax-ntp-offset" , "clockoffset" );
+ WebAddAjaxInput ("Max delay (ms)" , 5, "ajax-ntp-max-delay", "clockmaxdelay" );
- PageAddH2("Scan times");
- PageAddAjaxLabelled ("Program cycles avg", "ajax-scan-avg");
- PageAddAjaxLabelled ("Program cycles max", "ajax-scan-max");
- PageAddAjaxLabelled ("Program cycles min", "ajax-scan-min");
+ WebAddH2("Scan times");
+ WebAddAjaxLabelled ("Program cycles avg", "ajax-scan-avg");
+ WebAddAjaxLabelled ("Program cycles max", "ajax-scan-max");
+ WebAddAjaxLabelled ("Program cycles min", "ajax-scan-min");
- PageAddEnd();
+ WebAddEnd();
}