mirror of
https://github.com/ShaYmez/allmon2-last-heard.git
synced 2024-11-30 03:39:01 -05:00
Match IRLP correctly
This commit is contained in:
parent
6e6ba72715
commit
697df67989
3
app.js
3
app.js
@ -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);
|
||||
};
|
||||
};
|
||||
|
@ -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],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user