extending sample json
This commit is contained in:
@@ -1743,7 +1743,8 @@ def resolve_device_name_pholus (pMAC, pIP, allRes):
|
||||
|
||||
index = 0
|
||||
for result in allRes:
|
||||
if result["MAC"] == pMAC and result["Record_Type"] == "Answer" and '._googlezone' not in result["Value"]:
|
||||
# limiting entries used for name resolution to the ones containing the current IP (v4 only)
|
||||
if result["MAC"] == pMAC and result["Record_Type"] == "Answer" and result["IP_v4_or_v6"] == pIP and '._googlezone' not in result["Value"]:
|
||||
# found entries with a matching MAC address, let's collect indexes
|
||||
pholusMatchesIndexes.append(index)
|
||||
|
||||
|
||||
@@ -17,9 +17,129 @@
|
||||
"title": "Pi.Alert Notifications",
|
||||
"title_link": "",
|
||||
"text": {
|
||||
"internet": [],
|
||||
"new_devices": [],
|
||||
"down_devices": [],
|
||||
"internet": [
|
||||
[
|
||||
"Internet",
|
||||
"243.243.243.243",
|
||||
"2022-01-06 18:32:03",
|
||||
"Internet IP Changed",
|
||||
"Previous Internet IP: 0.0.0.0",
|
||||
1,
|
||||
null
|
||||
],
|
||||
[
|
||||
"Internet",
|
||||
"243.243.243.243",
|
||||
"2022-01-06 18:32:03",
|
||||
"New Device",
|
||||
null,
|
||||
1,
|
||||
null
|
||||
]
|
||||
],
|
||||
"new_devices": [
|
||||
[
|
||||
"b8:b8:b8:b8:b8:b8",
|
||||
"192.168.1.19",
|
||||
"2023-01-06 18:32:03",
|
||||
"New Device",
|
||||
"Raspberry Pi Foundation",
|
||||
1,
|
||||
null,
|
||||
"b8:b8:b8:b8:b8:b8",
|
||||
"raspberrypi",
|
||||
"(unknown)",
|
||||
null,
|
||||
"Raspberry Pi Foundation",
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
"2021-01-06 18:32:03",
|
||||
"2021-01-06 18:32:03",
|
||||
"192.168.1.19",
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
1,
|
||||
1,
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
],
|
||||
[
|
||||
"b1:b8:b8:b8:b8:b8",
|
||||
"192.168.1.45",
|
||||
"2021-01-06 18:32:03",
|
||||
"New Device",
|
||||
"EliteGroup Computer Systems Co., LTD",
|
||||
1,
|
||||
null,
|
||||
"b1:b8:b8:b8:b8:b8",
|
||||
"my-NUC",
|
||||
"(unknown)",
|
||||
null,
|
||||
"EliteGroup Computer Systems Co., LTD",
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
"2023-01-06 18:32:03",
|
||||
"2023-01-06 18:32:03",
|
||||
"192.168.1.45",
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
1,
|
||||
1,
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
]
|
||||
],
|
||||
"down_devices": [
|
||||
[
|
||||
"aa:77:aa:77:aa:77",
|
||||
"192.168.1.151",
|
||||
"2021-01-07 14:20:53",
|
||||
"Device Down",
|
||||
"",
|
||||
1,
|
||||
25,
|
||||
"aa:77:aa:77:aa:77",
|
||||
"ttgo_tdisplay_weather",
|
||||
"(unknown)",
|
||||
"",
|
||||
"Espressif Inc.",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"2021-01-06 23:13:06",
|
||||
"2021-01-06 23:13:06",
|
||||
"192.168.1.151",
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
"2021-01-06 23:34:37.067330",
|
||||
0,
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
""
|
||||
]
|
||||
],
|
||||
"events": [
|
||||
[
|
||||
"aa:77:aa:77:aa:77",
|
||||
|
||||
@@ -414,7 +414,7 @@
|
||||
<span id="iconRandomMACactive" data-toggle="tooltip" data-placement="right" title="Random MAC is Active" class="hidden">
|
||||
<i style="font-size: 24px;" class="text-yellow glyphicon glyphicon-random"></i>     </span>
|
||||
|
||||
<a href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/RAMDOM_MAC.md" target="_blank" style="color: #777;">
|
||||
<a href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/RANDOM_MAC.md" target="_blank" style="color: #777;">
|
||||
<i class="fa fa-info-circle"></i> </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -496,7 +496,7 @@ the arp-scan will take hours to complete instead of seconds.
|
||||
|
||||
//Webhooks
|
||||
'REPORT_WEBHOOK_name' => 'Enable Webhooks',
|
||||
'REPORT_WEBHOOK_description' => 'Enable webhooks for notifications. If enabled, configure related settings below.',
|
||||
'REPORT_WEBHOOK_description' => 'Enable webhooks for notifications. Webhooks help you to connect to a lot of 3rd party tools, such as IFTTT, Zapier or <a href="https://n8n.io/" target="_blank">n8n</a> to name a few. Check out this simple <a href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/WEBHOOK_N8N.md" target="_blank">n8n guide here</a> to get started. If enabled, configure related settings below.',
|
||||
'WEBHOOK_URL_name' => 'Target URL',
|
||||
'WEBHOOK_URL_description' => 'Target URL starting with <code>http://</code> or <code>https://</code>.',
|
||||
'WEBHOOK_PAYLOAD_name' => 'Payload type',
|
||||
|
||||
@@ -49,7 +49,12 @@ CommitDB();
|
||||
<section class="content-header">
|
||||
<?php require 'php/templates/notification.php'; ?>
|
||||
<h1 id="pageTitle">
|
||||
<?php echo lang('Navigation_Settings');?> <a><i id='toggleSettings' onclick="toggleAllSettings()" class="fa fa-angle-double-down"></i> </a>
|
||||
<?php echo lang('Navigation_Settings');?>
|
||||
<a style="cursor:pointer">
|
||||
<span>
|
||||
<i id='toggleSettings' onclick="toggleAllSettings()" class="fa fa-angle-double-down"></i>
|
||||
</span>
|
||||
</a>
|
||||
</h1>
|
||||
<div class="settingsImported"><?php echo lang("settings_imported");?> <span id="lastImportedTime"></span></div>
|
||||
</section>
|
||||
@@ -70,13 +75,13 @@ CommitDB();
|
||||
$isIn = ' in ';
|
||||
foreach ($groups as $group) {
|
||||
$html = $html.'<div class=" box panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
|
||||
<h4 class="panel-title">'.$group.'</h4>
|
||||
</a>
|
||||
</div>
|
||||
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">'.$group.'</h4>
|
||||
</div>
|
||||
</a>
|
||||
<div id="'.$group.'" class="panel-collapse collapse '.$isIn.'">
|
||||
<div class="panel-body">';
|
||||
<div class="panel-body">';
|
||||
$isIn = ' '; // open the first panel only by default on page load
|
||||
|
||||
// populate settings for each group id="collapse100" class="panel-collapse collapse"
|
||||
|
||||
Reference in New Issue
Block a user