Commit 6e0fb623 authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

BugFixs/Enhancements/Additions

Can change the non mesh markers info without having to recreate now.

The polling script can now find the info for some nodes that it could
not before, such as firmware 3.15.1.0b4, this was a pleasant side effect
of trying to remove some of the bunk entries i nthe database.

The polling script will now also try to check and "fix" the database,
this is due to changes in the newer AREDN firmwares (anything beyond
3.17RC1)
Some of those changes were made by me, just for the map. :)
These DB "fixes" also include removing some columns that were no longer
and were making the DB much larger than it needs to be, this will also
help cut down on the memory footprint when loading the webpage.

The numbers at the bottom of the map reflecting nodes and link, should
be more accurate now (I hope).

The Map legend has been change to use pure HTML5/CSS, the only images
are the small circle icons, this may cause issues with very old
browsers...

Removed some files that were no longer needed or forgetten about.
parent 7723b474
...@@ -4,3 +4,5 @@ ...@@ -4,3 +4,5 @@
**/meshmap-settings.ini **/meshmap-settings.ini
**/meshmap.css **/meshmap.css
**/admin.css **/admin.css
**/leaflet-custom-control-vertical-center.css
**/map-legend.css
...@@ -32,7 +32,8 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -32,7 +32,8 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
<li><strong>openssl PHP extension</strong><br/> <li><strong>openssl PHP extension</strong><br/>
(you may only need mysqlnd, it should be safe to enable both for now)<br/> (you may only need mysqlnd, it should be safe to enable both for now)<br/>
(One or more of these extensions may need to be enabled in php.ini)<br/> (One or more of these extensions may need to be enabled in php.ini)<br/>
(if you do not already have mysqlnd, you might need to install it, <code>apt-get install php[5 or 7]-mysqlnd</code>)</li> (if you do not already have mysqlnd, you might need to install it, <code>apt-get install php[5 or 7]-mysqlnd</code>)<br/>
(<em>the requirement for the mysqlnd extension will be removed in the near future</em>)</li>
<li><strong>MySQL/MariaDB</strong><br/> <li><strong>MySQL/MariaDB</strong><br/>
(Other database systems are up to you)</li> (Other database systems are up to you)</li>
<li><strong>An AREDN Mesh node available over the local network</strong><br/> <li><strong>An AREDN Mesh node available over the local network</strong><br/>
...@@ -40,7 +41,9 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -40,7 +41,9 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
<li><strong>Map Tiles</strong><br/> <li><strong>Map Tiles</strong><br/>
(Either in a static directory or available via some tile server&hellip;)</li> (Either in a static directory or available via some tile server&hellip;)</li>
<li><strong>RPi3 or better</strong><br/> <li><strong>RPi3 or better</strong><br/>
(The DB access can be pretty slow on an RPi1, you can move the DB to another system though&hellip;)</li> (The DB access can be pretty slow on an RPi1, you can move the DB to another system though&hellip;)<br/>
(If your local mesh network grows to become very large, with tunnels opened to the entire planet,<br/>
you might find even an RPi3+ to become inadequate, it&rsquo;ll still work, it just might be slow)</li>
<li><strong>Patience</strong><br/> <li><strong>Patience</strong><br/>
(Perhaps a lot!)</li> (Perhaps a lot!)</li>
<li><strong>Familiarity with Linux/Apache/SQL</strong><br/> <li><strong>Familiarity with Linux/Apache/SQL</strong><br/>
...@@ -50,7 +53,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -50,7 +53,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
<blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/> <blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/>
It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/> It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/>
There is no reason that part could not be adapted to run from a Windows scheduled task though.<br/> There is no reason that cronjob could not be adapted to run from a Windows scheduled task though.<br/>
PHP is PHP after all.</blockquote> PHP is PHP after all.</blockquote>
...@@ -109,6 +112,7 @@ Choose your own password!</p> ...@@ -109,6 +112,7 @@ Choose your own password!</p>
<li><p><strong>4: Copy scripts/user-settings.ini-default to scripts/user-settings.ini and edit the user-settings.ini file</strong></p> <li><p><strong>4: Copy scripts/user-settings.ini-default to scripts/user-settings.ini and edit the user-settings.ini file</strong></p>
<ul> <ul>
<li>You <strong>must</strong> do this or the <strong><em>entire system</em></strong> will refuse to run!</li>
<li>The file scripts/user-settings.ini is the most important to get right.<br/> <li>The file scripts/user-settings.ini is the most important to get right.<br/>
It is <strong>very important</strong> to make sure your SQL username and password are correct in scripts/user-settings.ini!!</li> It is <strong>very important</strong> to make sure your SQL username and password are correct in scripts/user-settings.ini!!</li>
<li>Also important is, if the system that this is running on cannot resolve &ldquo;localnode.local.mesh&rdquo; you can change that in the user-settings.ini file.</li> <li>Also important is, if the system that this is running on cannot resolve &ldquo;localnode.local.mesh&rdquo; you can change that in the user-settings.ini file.</li>
...@@ -210,22 +214,25 @@ You can add the &ldquo;Non Mesh&rdquo; Markers, fire stations, police stations, ...@@ -210,22 +214,25 @@ You can add the &ldquo;Non Mesh&rdquo; Markers, fire stations, police stations,
The admin pages also allow for some maintenance of the database, more feedback is encouraged on this!</p> The admin pages also allow for some maintenance of the database, more feedback is encouraged on this!</p>
<p>You can change the way the page looks by copying webpage/css/meshmap-default.css to webpage/css/meshmap.css.<br/> <p>You can change the way the page looks by copying webpage/css/meshmap-default.css to webpage/css/meshmap.css.<br/>
The meshmap.css file will be used in place of the -default.css file.<br/> The meshmap.css file will override the -default.css file.<br/>
(This also applies to other *-default.css files)</p> (This also applies to other *-default.css files, there are a few, please look at them if you wish to customize the layout of the map)</p>
<h2>ToDo List</h2> <h2>ToDo List</h2>
<hr /> <hr />
<p>(In no particular order)<br/> <p>(In no particular order)<br/>
- [x] Finally finish my admin page idea.<br/> - [x] Finally finish my admin page idea (mostly).<br/>
- [x] Add new MeshMap Logo.<br/> - [x] Add new MeshMap Logo.<br/>
- [x] Change the user editable files to be distributed with &ldquo;-default&rdquo; added to the extension, no more tar.gz file.<br/> - [x] User css files will override the defaults.<br/>
- [x] Use a cookie instead of _POST for the internet check (No more stupid dialog box on refresh).<br/> - [x] Polling script checks the DB before it runs and makes changes if needed.<br/>
- [ ] Make &ldquo;Parallel Threads&rdquo; work again in get-map-info script, with limits on how many can be run at once (this will greatly speed up network polling).<br/> - [ ] Make &ldquo;Parallel Threads&rdquo; work again in get-map-info script, with limits on how many can be run at once.<br/>
- [x] Changes so sbarc.org can have the new version too!<br/> (this will greatly speed up network polling)<br/>
- [x] Catch more nodes information now, like 3.15.1.0b04 and hopefully some other pesky ones!<br/>
(this will probably cause some warnings during node polling, but it is getting the info it needs)<br/>
(also helps clean up the database and was a nice side effect of that)<br/>
- [ ] Change css file for the &ldquo;?&rdquo; slide-out menu.<br/> - [ ] Change css file for the &ldquo;?&rdquo; slide-out menu.<br/>
- [x] Fix a typo in the attribution bar so the pop-up for the links is only for the links number.<br/> - [x] Make the numbers for stations and links in the attribution bar a bit more accurate I hope.<br/>
- [ ] Implement N2MH&rsquo;s &ldquo;Link aging&rdquo; idea(s).<br/> - [ ] Implement N2MH&rsquo;s &ldquo;Link aging&rdquo; idea(s).<br/>
- [ ] The &ldquo;Planning&rdquo; Tab.<br/> - [ ] The &ldquo;Planning&rdquo; Tab.<br/>
- [ ] Make it so other networks can export their data for use on a &ldquo;Mega Map&rdquo; type page. :)</p> - [ ] Make it so other networks can export their data for use on a &ldquo;Mega Map&rdquo; type page. :)</p>
...@@ -238,4 +245,4 @@ The meshmap.css file will be used in place of the -default.css file.<br/> ...@@ -238,4 +245,4 @@ The meshmap.css file will be used in place of the -default.css file.<br/>
I can&rsquo;t think of <em>everything</em>!<br/> I can&rsquo;t think of <em>everything</em>!<br/>
If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you&rsquo;d like!</p> If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you&rsquo;d like!</p>
<p>This README file last updated: May 2018</p> <p>This README file last updated: July 2018</p>
...@@ -26,6 +26,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -26,6 +26,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
(you may only need mysqlnd, it should be safe to enable both for now) (you may only need mysqlnd, it should be safe to enable both for now)
(One or more of these extensions may need to be enabled in php.ini) (One or more of these extensions may need to be enabled in php.ini)
(if you do not already have mysqlnd, you might need to install it, `apt-get install php[5 or 7]-mysqlnd`) (if you do not already have mysqlnd, you might need to install it, `apt-get install php[5 or 7]-mysqlnd`)
(<em>the requirement for the mysqlnd extension will be removed in the near future</em>)
- **MySQL/MariaDB** - **MySQL/MariaDB**
(Other database systems are up to you) (Other database systems are up to you)
- **An AREDN Mesh node available over the local network** - **An AREDN Mesh node available over the local network**
...@@ -34,6 +35,8 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -34,6 +35,8 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
(Either in a static directory or available via some tile server...) (Either in a static directory or available via some tile server...)
- **RPi3 or better** - **RPi3 or better**
(The DB access can be pretty slow on an RPi1, you can move the DB to another system though...) (The DB access can be pretty slow on an RPi1, you can move the DB to another system though...)
(If your local mesh network grows to become very large, with tunnels opened to the entire planet,<br/>
you might find even an RPi3+ to become inadequate, it'll still work, it just might be slow)
- **Patience** - **Patience**
(Perhaps a lot!) (Perhaps a lot!)
- **Familiarity with Linux/Apache/SQL** - **Familiarity with Linux/Apache/SQL**
...@@ -41,7 +44,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail. ...@@ -41,7 +44,7 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
<blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/> <blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/>
It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/> It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/>
There is no reason that part could not be adapted to run from a Windows scheduled task though.<br/> There is no reason that cronjob could not be adapted to run from a Windows scheduled task though.<br/>
PHP is PHP after all.</blockquote> PHP is PHP after all.</blockquote>
### Map Tile Server info ### Map Tile Server info
...@@ -88,6 +91,7 @@ Choose your own password! ...@@ -88,6 +91,7 @@ Choose your own password!
> `FLUSH PRIVILEGES;` > `FLUSH PRIVILEGES;`
- **4: Copy scripts/user-settings.ini-default to scripts/user-settings.ini and edit the user-settings.ini file** - **4: Copy scripts/user-settings.ini-default to scripts/user-settings.ini and edit the user-settings.ini file**
* You **must** do this or the **<em>entire system</em>** will refuse to run!
* The file scripts/user-settings.ini is the most important to get right. * The file scripts/user-settings.ini is the most important to get right.
It is **very important** to make sure your SQL username and password are correct in scripts/user-settings.ini!! It is **very important** to make sure your SQL username and password are correct in scripts/user-settings.ini!!
* Also important is, if the system that this is running on cannot resolve "localnode.local.mesh" you can change that in the user-settings.ini file. * Also important is, if the system that this is running on cannot resolve "localnode.local.mesh" you can change that in the user-settings.ini file.
...@@ -168,20 +172,23 @@ You can add the "Non Mesh" Markers, fire stations, police stations, EOC's , etc ...@@ -168,20 +172,23 @@ You can add the "Non Mesh" Markers, fire stations, police stations, EOC's , etc
The admin pages also allow for some maintenance of the database, more feedback is encouraged on this! The admin pages also allow for some maintenance of the database, more feedback is encouraged on this!
You can change the way the page looks by copying webpage/css/meshmap-default.css to webpage/css/meshmap.css. You can change the way the page looks by copying webpage/css/meshmap-default.css to webpage/css/meshmap.css.
The meshmap.css file will be used in place of the -default.css file. The meshmap.css file will override the -default.css file.
(This also applies to other *-default.css files) (This also applies to other *-default.css files, there are a few, please look at them if you wish to customize the layout of the map)
## ToDo List ## ToDo List
---------- ----------
(In no particular order) (In no particular order)
- [x] Finally finish my admin page idea. - [x] Finally finish my admin page idea (mostly).
- [x] Add new MeshMap Logo. - [x] Add new MeshMap Logo.
- [x] Change the user editable files to be distributed with "-default" added to the extension, no more tar.gz file. - [x] User css files will override the defaults.
- [x] Use a cookie instead of _POST for the internet check (No more stupid dialog box on refresh). - [x] Polling script checks the DB before it runs and makes changes if needed.
- [ ] Make "Parallel Threads" work again in get-map-info script, with limits on how many can be run at once (this will greatly speed up network polling). - [ ] Make "Parallel Threads" work again in get-map-info script, with limits on how many can be run at once.
- [x] Changes so sbarc.org can have the new version too! (this will greatly speed up network polling)
- [x] Catch more nodes information now, like 3.15.1.0b04 and hopefully some other pesky ones!
(this will probably cause some warnings during node polling, but it is getting the info it needs)
(also helps clean up the database and was a nice side effect of that)
- [ ] Change css file for the "?" slide-out menu. - [ ] Change css file for the "?" slide-out menu.
- [x] Fix a typo in the attribution bar so the pop-up for the links is only for the links number. - [x] Make the numbers for stations and links in the attribution bar a bit more accurate I hope.
- [ ] Implement N2MH's "Link aging" idea(s). - [ ] Implement N2MH's "Link aging" idea(s).
- [ ] The "Planning" Tab. - [ ] The "Planning" Tab.
- [ ] Make it so other networks can export their data for use on a "Mega Map" type page. :) - [ ] Make it so other networks can export their data for use on a "Mega Map" type page. :)
...@@ -192,4 +199,4 @@ The meshmap.css file will be used in place of the -default.css file. ...@@ -192,4 +199,4 @@ The meshmap.css file will be used in place of the -default.css file.
I can't think of *everything*! I can't think of *everything*!
If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you'd like! If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you'd like!
This README file last updated: May 2018 This README file last updated: July 2018
-- -------------------------------------------------------- -- --------------------------------------------------------
-- Host: 192.168.81.222 -- Host: 192.168.81.222
-- Server version: 10.2.14-MariaDB-log - MariaDB Server -- Server version: 10.3.7-MariaDB-log - MariaDB Server
-- Server OS: Linux -- Server OS: Linux
-- HeidiSQL Version: 9.4.0.5125 -- HeidiSQL Version: 9.4.0.5125
-- -------------------------------------------------------- -- --------------------------------------------------------
...@@ -19,7 +19,7 @@ USE `node_map`; ...@@ -19,7 +19,7 @@ USE `node_map`;
-- Dumping structure for table node_map.hosts_ignore -- Dumping structure for table node_map.hosts_ignore
CREATE TABLE IF NOT EXISTS `hosts_ignore` ( CREATE TABLE IF NOT EXISTS `hosts_ignore` (
`ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The name of the host, no domain', `name` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`reason` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `reason` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`timestamp` datetime DEFAULT NULL, `timestamp` datetime DEFAULT NULL,
UNIQUE KEY `name_2` (`name`), UNIQUE KEY `name_2` (`name`),
...@@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `map_info` ( ...@@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `map_info` (
-- Dumping structure for table node_map.marker_info -- Dumping structure for table node_map.marker_info
CREATE TABLE IF NOT EXISTS `marker_info` ( CREATE TABLE IF NOT EXISTS `marker_info` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`lat` double NOT NULL, `lat` double NOT NULL,
...@@ -55,9 +55,11 @@ CREATE TABLE IF NOT EXISTS `marker_info` ( ...@@ -55,9 +55,11 @@ CREATE TABLE IF NOT EXISTS `marker_info` (
-- Data exporting was unselected. -- Data exporting was unselected.
-- Dumping structure for table node_map.node_info -- Dumping structure for table node_map.node_info
CREATE TABLE IF NOT EXISTS `node_info` ( CREATE TABLE IF NOT EXISTS `node_info` (
`node` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `node` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`wlan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `wlan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_seen` datetime DEFAULT NULL, `last_seen` datetime DEFAULT NULL,
`uptime` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`loadavg` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`model` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `model` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`firmware_version` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `firmware_version` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`ssid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `ssid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
...@@ -73,7 +75,7 @@ CREATE TABLE IF NOT EXISTS `node_info` ( ...@@ -73,7 +75,7 @@ CREATE TABLE IF NOT EXISTS `node_info` (
`firmware_mfg` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `firmware_mfg` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`grid_square` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `grid_square` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`lan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `lan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`sysinfo_json` mediumblob DEFAULT NULL, `services` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
`location_fix` int(11) DEFAULT 0, `location_fix` int(11) DEFAULT 0,
UNIQUE KEY `node` (`node`) UNIQUE KEY `node` (`node`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Information about the nodes\r\ntaken from sysinfo.json that is on every node.'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Information about the nodes\r\ntaken from sysinfo.json that is on every node.';
...@@ -81,9 +83,11 @@ CREATE TABLE IF NOT EXISTS `node_info` ( ...@@ -81,9 +83,11 @@ CREATE TABLE IF NOT EXISTS `node_info` (
-- Data exporting was unselected. -- Data exporting was unselected.
-- Dumping structure for table node_map.removed_nodes -- Dumping structure for table node_map.removed_nodes
CREATE TABLE IF NOT EXISTS `removed_nodes` ( CREATE TABLE IF NOT EXISTS `removed_nodes` (
`node` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `node` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`wlan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `wlan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_seen` datetime DEFAULT NULL, `last_seen` datetime DEFAULT NULL,
`uptime` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`loadavg` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`model` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `model` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`firmware_version` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `firmware_version` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`ssid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `ssid` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
...@@ -99,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `removed_nodes` ( ...@@ -99,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `removed_nodes` (
`firmware_mfg` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `firmware_mfg` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`grid_square` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `grid_square` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`lan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `lan_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`sysinfo_json` mediumblob DEFAULT NULL, `services` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
`time_removed` datetime DEFAULT NULL, `time_removed` datetime DEFAULT NULL,
UNIQUE KEY `node` (`node`) UNIQUE KEY `node` (`node`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='A place to put old nodes'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='A place to put old nodes';
...@@ -107,10 +111,10 @@ CREATE TABLE IF NOT EXISTS `removed_nodes` ( ...@@ -107,10 +111,10 @@ CREATE TABLE IF NOT EXISTS `removed_nodes` (
-- Data exporting was unselected. -- Data exporting was unselected.
-- Dumping structure for table node_map.topology -- Dumping structure for table node_map.topology
CREATE TABLE IF NOT EXISTS `topology` ( CREATE TABLE IF NOT EXISTS `topology` (
`node` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `node` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`nodelat` double DEFAULT NULL, `nodelat` double DEFAULT NULL,
`nodelon` double DEFAULT NULL, `nodelon` double DEFAULT NULL,
`linkto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `linkto` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`linklat` double DEFAULT NULL, `linklat` double DEFAULT NULL,
`linklon` double DEFAULT NULL, `linklon` double DEFAULT NULL,
`cost` double DEFAULT NULL, `cost` double DEFAULT NULL,
...@@ -128,7 +132,7 @@ CREATE TABLE IF NOT EXISTS `users` ( ...@@ -128,7 +132,7 @@ CREATE TABLE IF NOT EXISTS `users` (
`passwd` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, `passwd` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_login` datetime DEFAULT NULL, `last_login` datetime DEFAULT NULL,
KEY `id` (`id`) KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='a place to put users for the admin page(s)'; ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='a place to put users for the admin page(s)';
-- Data exporting was unselected. -- Data exporting was unselected.
-- Dumping structure for trigger node_map.node_info_after_insert -- Dumping structure for trigger node_map.node_info_after_insert
......
This diff is collapsed.
...@@ -86,7 +86,8 @@ function build_NodesAndLinks($NodeList, $TopoList, $MarkerList = null) ...@@ -86,7 +86,8 @@ function build_NodesAndLinks($NodeList, $TopoList, $MarkerList = null)
* Find the Services for the node * Find the Services for the node
********************************/ ********************************/
// $node_ServiceList = load_ServiceList($node_info['olsrinfo_json']); // $node_ServiceList = load_ServiceList($node_info['olsrinfo_json']);
$node_ServiceList = ''; // $node_ServiceList = '';
$node_ServiceList = load_ServiceList($node_info['services']);
/* /*
* Build the Nodes Marker * Build the Nodes Marker
...@@ -151,14 +152,14 @@ function build_NodesAndLinks($NodeList, $TopoList, $MarkerList = null) ...@@ -151,14 +152,14 @@ function build_NodesAndLinks($NodeList, $TopoList, $MarkerList = null)
* *
* @return string List of Services to Display * @return string List of Services to Display
*/ */
function load_ServiceList($json_data) function load_ServiceList($serviceList)
{ {
$json_array = wxc_findServices($json_data, 'services'); $localServiceArray = wxc_listServices($serviceList);
$serviceList = ''; $serviceList = '';
if (is_array($json_array)) if (is_array($localServiceArray))
{ {
foreach ($json_array as $key => $value) foreach ($localServiceArray as $key => $value)
{ {
//WXC 6-30-2017: removed links for services that have no link //WXC 6-30-2017: removed links for services that have no link
if ($value == NULL) { if ($value == NULL) {
...@@ -259,7 +260,8 @@ function load_LinkList($NodeList, $TopoList) ...@@ -259,7 +260,8 @@ function load_LinkList($NodeList, $TopoList)
{ {
$display_color = $MESH_SETTINGS['DTD_Link_Plus']; $display_color = $MESH_SETTINGS['DTD_Link_Plus'];
$dtd = 1; $dtd = 1;
$display_opacity = 0.4; $display_opacity = 0.3;
$display_weight = 0.3;
$map_LayerAssigned = 'dtdLinks'; $map_LayerAssigned = 'dtdLinks';
} }
//find the "infinite cost" links (they show as "INFINITE" in the olsr files the other script changes that to 99.99) //find the "infinite cost" links (they show as "INFINITE" in the olsr files the other script changes that to 99.99)
...@@ -387,24 +389,22 @@ function load_LinkedTO($node_info, $TopoList) ...@@ -387,24 +389,22 @@ function load_LinkedTO($node_info, $TopoList)
} }
} }
} }
//now take all that info back out and put into a properly formatted string variable that we'll use later] //now take all that info back out and put into a properly formatted string variable that we'll use later
foreach ($linkInfoForStationPopups as $nodeNameLinkArray => $linktoArray) //this part of the function reformatted by kg6wxc.
{ foreach ($linkInfoForStationPopups as $nodeNameLinkArray => $linktoArray) {
if ($linktoArray > '') if (!empty($linktoArray)) {
{ foreach ($linktoArray as $linkedNodeName => $costArray) {
foreach ($linktoArray as $linkedNodeName => $costArray) if (!empty($costArray)) {
{ if (!empty($costArray['costTo']) && !empty($costArray['costFrom'])) {
if (($costArray['costTo'] == 0.1) && ($costArray['costFrom'] == 0.1)) //if ((isset($costArray['costTo']) == 0.1) && (isset($costArray['costFrom']) == 0.1)) {
{ if ($costArray['costTo'] == "0.1" && $costArray['costFrom'] == "0.1") {
$display_cost = ' <Link_DTD>(DTD)</Link_DTD> '; $display_cost = ' <Link_DTD>(DTD)</Link_DTD> ';
}else {
$display_cost = ' (' . $costArray['costTo'] . '/' . $costArray['costFrom'] . ') ';
}
$linkedToList .= $linkedNodeName . $display_cost . $costArray['distance'] . ' mi ' . $costArray['bearing'] . '&deg;<br>';
} }
else
{
$display_cost = ' (' . $costArray['costTo'] . '/' . $costArray['costFrom'] .
') ';
} }
$linkedToList .= $linkedNodeName . $display_cost . $costArray['distance'] . ' mi ' .
$costArray['bearing'] . '&deg;<br>';
} }
} }
} }
...@@ -510,8 +510,14 @@ function build_Marker($node_info, $node_ServiceList, $node_LinkedList, $node_Fir ...@@ -510,8 +510,14 @@ function build_Marker($node_info, $node_ServiceList, $node_LinkedList, $node_Fir
"', icon: " . $icon . "}).bindPopup(\" " . $nodeUrl . " (" . $band . ")<br>" . $node_info['lat'] . "', icon: " . $icon . "}).bindPopup(\" " . $nodeUrl . " (" . $band . ")<br>" . $node_info['lat'] .
", " . $node_info['lon'] . "<br>SSID: " . $node_info['ssid'] . "<br>Channel: " . $node_info['channel'] . ", " . $node_info['lon'] . "<br>SSID: " . $node_info['ssid'] . "<br>Channel: " . $node_info['channel'] .
", Bandwidth: " . $node_info['chanbw'] . "<br>" . $node_info['model'] . "<br>" . $firmware . ", Bandwidth: " . $node_info['chanbw'] . "<br>" . $node_info['model'] . "<br>" . $firmware .
"<br>Last Polled: " . $node_info['last_seen'] . "<br>Last Polled: " . $node_info['last_seen'] . '<br>' . "Uptime: " . $node_info['uptime'] . '<br>';
$node_ServiceList . $node_LinkedList . "\").addTo(" . $AssignedLayer . ") ,\n"; // Close out this node //dot
if ($node_info['loadavg'] !== "NotAvailable") {
$loadavgs = unserialize($node_info['loadavg']);
//var_dump($loadavgs);
$markerList .= 'LoadAvg: 1 min ' . $loadavgs[0] . ', 5 min ' . $loadavgs[1] . ', 15 min ' . $loadavgs[2] . "<br>";
}
$markerList .= $node_ServiceList . $node_LinkedList . "\").addTo(" . $AssignedLayer . ") ,\n"; // Close out this node
/* /*
* If Upgrade Suggested add Node to that layer * If Upgrade Suggested add Node to that layer
*/ */
...@@ -983,12 +989,41 @@ function create_MapLegend() ...@@ -983,12 +989,41 @@ function create_MapLegend()
{ {
//legend overlay //legend overlay
$Content = <<< EOD $Content = <<< EOD
var legendHidden = L.control({position: 'topright'});
legendHidden.onAdd = function(map) {
var div = L.DomUtil.create('div', 'info legendHidden', L.DomUtil.get('map'));
div.innerHTML += '<button id="legendLinkButtonHidden" onclick="hideLegend()">Map Legend</button>';
return div;
};
var legend = L.control({position: 'topright'}); var legend = L.control({position: 'topright'});
legend.onAdd = function (map) { legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend', L.DomUtil.get('map')); var div = L.DomUtil.create('div', 'info legend', L.DomUtil.get('map'));
div.innerHTML += div.innerHTML +=
'<img src="images/mapLegend/LinkCostLegend.jpg" alt="legend" width="175" height="25"><br>' + '<div id="legend">' +
'<img src="images/mapLegend/DTDLinkLegend.jpg" alt="legend" width="75" height="60" align="right">'; '<div id="legendGradientRectangle">1.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link Cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.000</div>' +
'<div id="legendDTDLink">DTD</div>' +
'<div id="legendOtherWireless">RF DTD</div>' +
'<div id="legendTunnelLink">Tunnel</div>' +
'<div id="legendInfinite">Infinite</div>' +
'<div id="legendUnknownOther">' +
'<img class="legendBandIcon" src="images/mapMarkers/greyRadioCircle-icon.png">Unknown' +
'</div>' +
'<div id="legend900MHz">' +
'<img class="legendBandIcon" src="images/mapMarkers/magentaRadioCircle-icon.png">900MHz' +
'</div>' +
'<div id="legend2GHz">' +
'<img class="legendBandIcon" src="images/mapMarkers/purpleRadioCircle-icon.png">2GHz' +
'</div>' +
'<div id="legend3GHz">' +
'<img class="legendBandIcon" src="images/mapMarkers/blueRadioCircle-icon.png">3GHz' +
'</div>' +
'<div id="legend5GHz">' +
'<img class="legendBandIcon" src="images/mapMarkers/goldRadioCircle-icon.png">5GHz' +
'</div>' +
'<div id="legendHide"><button id="legendLinkButton" onclick="hideLegend()">Hide</button></div>' +
'</div>';
// '<img src="images/mapLegend/LinkCostLegend.jpg" alt="legend" width="175" height="25"><br>' +
// '<img src="images/mapLegend/DTDLinkLegend.jpg" alt="legend" width="75" height="60" align="right">';
return div; return div;
};\n\n };\n\n
EOD; EOD;
...@@ -1006,17 +1041,39 @@ function create_MapImage() ...@@ -1006,17 +1041,39 @@ function create_MapImage()
//init the map with size, zoom level, center co-ords, etc... //init the map with size, zoom level, center co-ords, etc...
//http://leafletjs.com/reference-1.0.3.html#control-zoom //http://leafletjs.com/reference-1.0.3.html#control-zoom
$Content = " $Content = "
if (typeof rfLinks === 'undefined' || rfLinks === null) {
var map = L.map('mapid', { var map = L.map('mapid', {
//attributionControl: false, //attributionControl: false,
center: [" . $USER_SETTINGS['map_center_coordinates'] . "], center: [" . $USER_SETTINGS['map_center_coordinates'] . "],
zoom: [" . $USER_SETTINGS['map_initial_zoom_level'] . "], zoom: [" . $USER_SETTINGS['map_initial_zoom_level'] . "],
minZoom: 0, minZoom: 0,
maxZoom: 18, maxZoom: 18,
zoomSnap: 0, //zoomSnap: 0,
zoomDelta: 0.25, zoomSnap: 1,
//zoomDelta: 0.25,
zoomDelta: 1,
//layers: [defaultMap, twoGHzStations, threeGHzStations, fiveGHzStations, nineHundredMHzStations, otherStations, rfLinks, tunnelLinks, dtdLinks, infiniteLinks],
layers: [defaultMap, twoGHzStations, threeGHzStations, fiveGHzStations, nineHundredMHzStations, otherStations],
//layers: [defaultMap],
fullscreenControl: true
});\n\n
}else {
var map = L.map('mapid', {
//attributionControl: false,
center: [" . $USER_SETTINGS['map_center_coordinates'] . "],
zoom: [" . $USER_SETTINGS['map_initial_zoom_level'] . "],
minZoom: 0,
maxZoom: 18,
//zoomSnap: 0,
zoomSnap: 1,
//zoomDelta: 0.25,
zoomDelta: 1,
layers: [defaultMap, twoGHzStations, threeGHzStations, fiveGHzStations, nineHundredMHzStations, otherStations, rfLinks, tunnelLinks, dtdLinks, infiniteLinks], layers: [defaultMap, twoGHzStations, threeGHzStations, fiveGHzStations, nineHundredMHzStations, otherStations, rfLinks, tunnelLinks, dtdLinks, infiniteLinks],
//layers: [defaultMap, twoGHzStations, threeGHzStations, fiveGHzStations, nineHundredMHzStations, otherStations],
//layers: [defaultMap],
fullscreenControl: true fullscreenControl: true
});\n\n });\n\n
}
"; ";
return $Content; return $Content;
...@@ -1076,16 +1133,98 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal ...@@ -1076,16 +1133,98 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal
function instantiate_Map() function instantiate_Map()
{ {
$Content = <<< EOD $Content = <<< EOD
// Create additional Control placeholders
function addControlPlaceholders(map) {
var corners = map._controlCorners,
l = 'leaflet-',
container = map._controlContainer;
function createCorner(vSide, hSide) {
var className = l + vSide + ' ' + l + hSide;
corners[vSide + hSide] = L.DomUtil.create('div', className, container);
}
createCorner('verticalcenter', 'left');
createCorner('verticalcenter', 'right');
}
addControlPlaceholders(map);
map.zoomControl.setPosition('verticalcenterleft');
map.fullscreenControl.setPosition('verticalcenterleft');
//admin icon (the gears)
L.Control.Admin = L.Control.extend({
options: {
position: 'verticalcenterleft'
},
onAdd: function(map) {
var adminControl = L.DomUtil.create('div', 'leaflet-control-custom leaflet-bar');
adminControl.style.backgroundColor = 'white';
//adminControl.content = "\F013";
//adminControl.font-family = "FontAwesome";
//adminControl.style.background = "fa-cog";
adminControl.style.width = '30px';
adminControl.style.height = '30px';
adminControl.title = 'Admin';
var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', adminControl);
var gear = L.DomUtil.create('span', 'fa fa-cogs', link);