File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ <!--
2+ This is a test page to test the datalake consumption of the external-api library, in a widget
3+ to test, run "python -m http.server" in the cockpit directory and create an iframe widget with the url
4+ http://localhost:8000/test/test.html
5+ -->
6+ <!DOCTYPE html>
7+ < html lang ="en ">
8+ < head >
9+ < meta charset ="UTF-8 ">
10+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
11+ < style >
12+ body {
13+ background-color : white;
14+ }
15+ </ style >
16+ </ head >
17+ < body >
18+ < h1 > Datalake consumption test</ h1 >
19+ < div id ="pitchDisplay "> </ div >
20+ < div id ="rollDisplay "> </ div >
21+
22+ < script src ="../dist/lib/cockpit-external-api.browser.js "> </ script >
23+ < script >
24+ CockpitAPI . listenToDatalakeVariable ( 'ATTITUDE/pitch' , function ( data ) {
25+ document . getElementById ( 'pitchDisplay' ) . innerText = 'Pitch (1Hz): ' + data ;
26+ } , 1 ) ;
27+ CockpitAPI . listenToDatalakeVariable ( 'ATTITUDE/roll' , function ( data ) {
28+
29+ document . getElementById ( 'rollDisplay' ) . innerText = 'Roll (10Hz): ' + data ;
30+ } , 10 ) ;
31+ </ script >
32+ </ body >
33+ </ html >
You can’t perform that action at this time.
0 commit comments