File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-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+ This should be served independently of the cockpit app in order to test the "same-origin" policies
6+ -->
7+ <!DOCTYPE html>
8+ < html lang ="en ">
9+ < head >
10+ < meta charset ="UTF-8 ">
11+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
12+ < style >
13+ body {
14+ background-color : white;
15+ }
16+ </ style >
17+ </ head >
18+ < body >
19+ < h1 > Datalake consumption test</ h1 >
20+ < div id ="pitchDisplay "> </ div >
21+ < div id ="rollDisplay "> </ div >
22+
23+ < script src ="../dist/lib/cockpit-external-api.browser.js "> </ script >
24+ < script >
25+ CockpitAPI . listenToDatalakeVariable ( 'ATTITUDE/pitch' , function ( data ) {
26+ document . getElementById ( 'pitchDisplay' ) . innerText = 'Pitch (1Hz): ' + data ;
27+ } , 1 ) ;
28+ CockpitAPI . listenToDatalakeVariable ( 'ATTITUDE/roll' , function ( data ) {
29+
30+ document . getElementById ( 'rollDisplay' ) . innerText = 'Roll (10Hz): ' + data ;
31+ } , 10 ) ;
32+ </ script >
33+ </ body >
34+ </ html >
You can’t perform that action at this time.
0 commit comments