mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
add/fix iplocation
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
4cd7b408fa
commit
7e7361de9b
3 changed files with 9 additions and 3 deletions
|
@ -1058,7 +1058,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
db.Get('iploc_' + obj.remoteaddr, function (err, iplocs) {
|
db.Get('iploc_' + obj.remoteaddr, function (err, iplocs) {
|
||||||
if ((iplocs != null) && (iplocs.length == 1)) {
|
if ((iplocs != null) && (iplocs.length == 1)) {
|
||||||
// We have a location in the database for this remote IP
|
// We have a location in the database for this remote IP
|
||||||
const iploc = nodes[0], x = {};
|
const iploc = iplocs[0], x = {};
|
||||||
if ((iploc != null) && (iploc.ip != null) && (iploc.loc != null)) {
|
if ((iploc != null) && (iploc.ip != null) && (iploc.loc != null)) {
|
||||||
x.publicip = iploc.ip;
|
x.publicip = iploc.ip;
|
||||||
x.iploc = iploc.loc + ',' + (Math.floor((new Date(iploc.date)) / 1000));
|
x.iploc = iploc.loc + ',' + (Math.floor((new Date(iploc.date)) / 1000));
|
||||||
|
@ -1067,10 +1067,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
} else {
|
} else {
|
||||||
// Check if we need to ask for the IP location
|
// Check if we need to ask for the IP location
|
||||||
var doIpLocation = 0;
|
var doIpLocation = 0;
|
||||||
if (device.iploc == null) {
|
if (obj.iploc == null) {
|
||||||
doIpLocation = 1;
|
doIpLocation = 1;
|
||||||
} else {
|
} else {
|
||||||
const loc = device.iploc.split(',');
|
const loc = obj.iploc.split(',');
|
||||||
if (loc.length < 3) {
|
if (loc.length < 3) {
|
||||||
doIpLocation = 2;
|
doIpLocation = 2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1742,6 +1742,11 @@
|
||||||
"default": false,
|
"default": false,
|
||||||
"description": "Enables the geo-location feature and device location map in the user interface, this feature is not being worked on."
|
"description": "Enables the geo-location feature and device location map in the user interface, this feature is not being worked on."
|
||||||
},
|
},
|
||||||
|
"ipLocation": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "When enabled, the remote agents will submit there approximate location to MeshCentral, Use in combination with \"geoLocation\"."
|
||||||
|
},
|
||||||
"novnc": {
|
"novnc": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": true,
|
||||||
|
|
|
@ -316,6 +316,7 @@
|
||||||
"_agentNoProxy": true,
|
"_agentNoProxy": true,
|
||||||
"_lockAgentDownload": true,
|
"_lockAgentDownload": true,
|
||||||
"_geoLocation": true,
|
"_geoLocation": true,
|
||||||
|
"_ipLocation": true,
|
||||||
"_novnc": false,
|
"_novnc": false,
|
||||||
"_mstsc": true,
|
"_mstsc": true,
|
||||||
"_ssh": true,
|
"_ssh": true,
|
||||||
|
|
Loading…
Reference in a new issue