mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-13 05:53:06 +01:00
Merge pull request #197 from TobiasE-github/Webinterface
New tab in webinterface with a screenshot button
This commit is contained in:
12
lib/obp60task/index.js
Normal file
12
lib/obp60task/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
(function(){
|
||||
const api=window.esp32nmea2k;
|
||||
if (! api) return;
|
||||
const tabName="OBP60";
|
||||
api.registerListener((id, data) => {
|
||||
// if (!data.testboard) return; //do nothing if we are not active
|
||||
let page = api.addTabPage(tabName, "OBP60");
|
||||
api.addEl('button', '', page, 'Screenshot').addEventListener('click', function (ev) {
|
||||
window.open('/api/user/OBP60Task/screenshot', 'screenshot');
|
||||
})
|
||||
}, api.EVENTS.init);
|
||||
})();
|
||||
Reference in New Issue
Block a user