Skip to content

Commit

Permalink
Add link back to HousePortal
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fb-martin committed Nov 24, 2020
1 parent df5744e commit 02dd69b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hc_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ static const char *hc_http_status (const char *method, const char *uri,
gethostname (hc_hostname, sizeof(hc_hostname));
}
added = snprintf (cursor, size,
"{\"host\":\"%s\",\"timestamp\":%ld,\"clock\":{",
hc_hostname, (long)time(0));
"{\"host\":\"%s\",\"proxy\":\"%s\",\"timestamp\":%ld,\"clock\":{",
hc_hostname, houseportal_server(), (long)time(0));
if (added > 0) {
cursor += added;
size -= added;
Expand Down
4 changes: 4 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<link rel=stylesheet type="text/css" href="/house.css" title="House">
<script>
function clockUpdate (response) {

document.getElementById('portal').href = 'http://'+response.proxy+'/index.html';

var hasdata = false;
if (response.clock.gps) {
hasdata = response.clock.gps.fix;
Expand Down Expand Up @@ -55,6 +58,7 @@
<tr><td>
<table class="housetop">
<tr>
<td><a id="portal" href="/index.html">Portal</a></td>
<td><span>Clock</span></td>
</tr>
</table>
Expand Down

0 comments on commit 02dd69b

Please sign in to comment.