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

3
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]+))?/);
if (!match) return;
match[2] = match[3] < 2000 ? 'stn' : match[2];
let type = this.getNodeType(match[2]);
this.addEntry(
@ -162,4 +163,4 @@ String.prototype.hashCode = function() {
hash = hash & hash; // Convert to 32bit integer
}
return Math.abs(hash);
};
};

View File

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