2 typeof define === "function" ? function (m) { define("kismet-ui-rtladsb-js", m); } :
3 typeof exports === "object" ? function (m) { module.exports = m(); } :
4 function(m){ this.kismet_ui_rtladsb = m(); }
11 var local_uri_prefix = "";
12 if (typeof(KISMET_URI_PREFIX) !== 'undefined')
13 local_uri_prefix = KISMET_URI_PREFIX;
15 // Flag we're still loading
16 exports.load_complete = 0;
18 /* Highlight rtl devices */
19 kismet_ui.AddDeviceRowHighlight({
20 name: "RTLadsb Devices",
21 description: "RTLadsb Sensor",
23 //defaultcolor: "#efe0c3",
24 defaultcolor: "#ffb3b3",
27 'kismet.device.base.phyname',
30 selector: function(data) {
101 if (data['kismet.device.base.phyname'] === 'RTLADSB') {
102 for (var re of aircraft_info) {
104 if (data['rtladsb.device']['kismet.adsb.icao_record']['adsb.icao.owner'].toLowerCase().includes(re)) {
106 for (var excld of exclude_list) {
107 if (data['rtladsb.device']['kismet.adsb.icao_record']['adsb.icao.owner'].toLowerCase().includes(excld)) {
113 if (Boolean(retval)) {
117 for (var re of icao_list) {
118 if (data['rtladsb.device']['rtladsb.device.icao'].toLowerCase().includes(re))
126 kismet_ui.AddDeviceDetail("rtladsb", "RTLADSB (SDR)", 0, {
127 filter: function(data) {
128 return (data['kismet.device.base.phyname'] === "RTLADSB");
130 draw: function(data, target) {
131 target.devicedata(data, {
135 field: "rtladsb.device/rtladsb.device.icao",
138 empty: "<i>Unknown</i>"
141 field: "rtladsb.device/rtladsb.device.callsign",
146 help: "Flight registration / Callsign",
149 field: "rtladsb.device/rtladsb.device.callsign",
152 title: "Flightaware",
155 draw: function(opts) {
156 return '<a href="https://flightaware.com/live/flight/' + opts['value'] + '" target="_new">Track ' + opts['value'] + ' on FlightAware</a>';
160 field: "rtladsb.device/kismet.adsb.icao_record/adsb.icao.regid",
162 title: "Registration ID",
165 help: "Aircraft registration ID or tail number",
168 field: "rtladsb.device/kismet.adsb.icao_record/adsb.icao.atype",
170 title: "Aircraft Classification",
173 help: "Aircraft classification type",
176 field: "rtladsb.device/kismet.adsb.icao_record/adsb.icao.model",
181 help: "Aircraft model (general model type)",
184 field: "rtladsb.device/kismet.adsb.icao_record/adsb.icao.type",
189 help: "Aircraft type (specific model type)",
192 field: "rtladsb.device/kismet.adsb.icao_record/adsb.icao.owner",
194 title: "Aircraft Operator",
197 help: "Aircraft operator or owner of record",
200 field: "rtladsb.device/rtladsb.device.altitude",
206 field: "rtladsb.device/rtladsb.device.speed",
212 field: "rtladsb.device/rtladsb.device.heading",
216 draw: function(opts) {
218 return Math.round(opts['value']) + '° <i class="fa fa-plane" style="transform: rotate(' + (opts['value'] -45) + 'deg)" />';
223 field: "rtladsb.device/rtladsb.device.latitude",
228 draw: function(opts) {
230 return opts['data']['rtladsb.device']['rtladsb.device.latitude'] + ', ' + opts['data']['rtladsb.device']['rtladsb.device.longitude'] + ' <a target="_new" href="https://openstreetmap.org/?&mlat=' + opts['data']['rtladsb.device']['rtladsb.device.latitude'] + '&mlon=' + opts['data']['rtladsb.device']['rtladsb.device.longitude'] + '">View on Open Street Maps</a>';
238 field: "rtladsb.device/rtladsb.device.asgs",
240 title: "Airspeed(AS) / Groundspeed (GS)",
248 kismet_ui_tabpane.AddTab({
250 tabTitle: 'ADSB Live',
252 createCallback: function(div) {
253 var url = new URL(parent.document.URL);
254 url.searchParams.append('parent_url', url.origin)
255 url.searchParams.append('local_uri_prefix', local_uri_prefix);
256 url.pathname = `${local_uri_prefix}/adsb_map_panel.html`;
270 // We're done loading
271 exports.load_complete = 1;