Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web interface: add board name, bluemark logo and initial bluemark style #81

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RemoteIDModule/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ String status_json(void)
snprintf(githash, sizeof(githash), "(%08x)", GIT_VERSION);
const json_table_t table[] = {
{ "STATUS:VERSION", String(FW_VERSION_MAJOR) + "." + String(FW_VERSION_MINOR) + " " + githash},
{ "STATUS:BOARD_ID", String(BOARD_ID)},
{ "STATUS:UPTIME", String(hr) + ":" + String(minsec_str) },
{ "STATUS:FREEMEM", String(ESP.getFreeHeap()) },
{ "BASICID:UAType", ENUM_MAP(uatype, UAS_data.BasicID[0].UAType) },
Expand Down
Binary file added RemoteIDModule/web/images/bluemark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 4 additions & 10 deletions RemoteIDModule/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</head>

<body>
<a href="/index.html"><img src="images/logo.jpg" alt="ArduPilot"></a></p>
<a href="/index.html"><img id="logo" src="" alt="logo"></a></p>
<h1>ArduRemoteID</h1>

<h2>Status</h2>
Expand All @@ -20,6 +20,7 @@ <h2>Status</h2>
<legend>System</legend>
<table class="values">
<tr><td>Version</td><td><div id="STATUS:VERSION"></div></td></tr>
<tr><td>Board</td><td><div id="STATUS:BOARD"></div></td></tr>
<tr><td>Up Time</td><td><div id="STATUS:UPTIME"></div></td></tr>
<tr><td>Free Memory</td><td><div id="STATUS:FREEMEM"></div></td></tr>
</table>
Expand Down Expand Up @@ -87,14 +88,8 @@ <h2>Status</h2>
</fieldset>

<h2>Documentation</h2>

<ul>
<li><a href="https://ardupilot.org/ardupilot/index.html">ArduPilot Project</a></li>
<li><a href="https://github.com/ArduPilot/ArduRemoteID">ArduRemoteID Project</a></li>
<li><a href="https://ardupilot.org/plane/docs/common-remoteid.html">ArduPilot RemoteID Documentation</a></li>
<li><a href="https://www.opendroneid.org/">OpenDroneID Website</a></li>
</ul>

<div id="documentation">
</div>
<h2>Firmware Update</h2>

<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>
Expand Down Expand Up @@ -135,6 +130,5 @@ <h2>Firmware Update</h2>
// poll status information at 1Hz (900ms to cope with some lag)
ajax_json_poll_fill("/ajax/status.json", 900);
</script>

</body>
</html>
33 changes: 33 additions & 0 deletions RemoteIDModule/web/js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,39 @@ function page_fill_json_html(json) {
var element = document.getElementById(v);
if (element) {
element.innerHTML = json[v];
} else if (v == "STATUS:BOARD_ID") {
if(typeof page_fill_json_html.run_once == 'undefined' ) {
//run this code only once to avoid updating these fields
if (json[v] == "3") {
document.getElementById("logo").src="images/bluemark.png";
document.getElementById("logo").alt="BlueMark";
document.getElementById("STATUS:BOARD").innerText = "BlueMark db200";
document.getElementById("documentation").innerHTML = "<ul><li><a href='https://download.bluemark.io/db200.pdf'>db200 manual</a></li><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
document.body.style.background = "#fafafa";
} else if (json[v] == "4") {
document.getElementById("logo").src="images/bluemark.png";
document.getElementById("logo").alt="BlueMark";
document.getElementById("STATUS:BOARD").innerText = "BlueMark db110";
document.getElementById("documentation").innerHTML = "<ul><li><a href='https://download.bluemark.io/db110.pdf'>db110 manual</a></li><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
document.body.style.background = "#fafafa";
} else {
document.getElementById("logo").src="images/logo.jpg";
document.getElementById("logo").alt="ArduPilot";

if (json[v] == "1") {
document.getElementById("STATUS:BOARD").innerText = "ESP32S3_DEV";
} else if (json[v] == "2") {
document.getElementById("STATUS:BOARD").innerText = "ESP32C3_DEV";
} else if (json[v] == "5") {
document.getElementById("STATUS:BOARD").innerText = "JW_TBD";
} else {
document.getElementById("STATUS:BOARD").innerText = "unknown";
}

document.getElementById("documentation").innerHTML = "<ul><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
}
}
run_once = 1;
}
}
}
Expand Down