Match IRLP correctly

This commit is contained in:
Rob Vella 2021-02-07 15:46:14 -08:00
parent 6e6ba72715
commit 697df67989
2 changed files with 10 additions and 8 deletions

1
app.js
View File

@ -101,6 +101,7 @@ let App = new Vue({
let match = v.match(/([A-Za-z]+ [0-9]+ [0-9]+\:[0-9]+\:[0-9]+) (rpt|stn)([A-Za-z0-9]+) .*? (?:\[(?:via) ([0-9]+))?/); let match = v.match(/([A-Za-z]+ [0-9]+ [0-9]+\:[0-9]+\:[0-9]+) (rpt|stn)([A-Za-z0-9]+) .*? (?:\[(?:via) ([0-9]+))?/);
if (!match) return; if (!match) return;
match[2] = match[3] < 2000 ? 'stn' : match[2];
let type = this.getNodeType(match[2]); let type = this.getNodeType(match[2]);
this.addEntry( this.addEntry(

View File

@ -1,7 +1,7 @@
<?php <?php
$cmd = $_GET['cmd'] ?? null; $cmd = $_GET['cmd'] ?? null;
$node = intval($_GET['node'] ?? null); $node = $_GET['node'] ?? null;
$type = intval($_GET['type'] ?? null); $type = intval($_GET['type'] ?? null);
header("Cache-Control: no-cache, max-age=0"); header("Cache-Control: no-cache, max-age=0");
@ -34,18 +34,19 @@ function fetchNodeInfoAllstar($node) {
$db = explode("\n", $db); $db = explode("\n", $db);
foreach ($db as $row) { foreach ($db as $row) {
$row = explode("|", $row); $row = explode("|", $row);
if (intval($row[0]) !== $node) continue; if (intval($row[0]) != $node) continue;
return [ return [
'node' => $node, 'node' => $node,
'callsign' => $row[1], 'callsign' => $row[1] ?? '',
'desc' => $row[2], 'desc' => $row[2] ?? '',
'location' => $row[3] 'location' => $row[3] ?? ''
]; ];
} }
return [ return [
'node' => $node 'node' => $node,
'callsign' => $row[1],
]; ];
} }