Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mesh
meshmap
Commits
b9bc99e4
Commit
b9bc99e4
authored
Nov 26, 2018
by
Eric - kg6wxc
Browse files
bugfix: Display timezone with timestamps.
parent
18dd89e9
Changes
3
Show whitespace changes
Inline
Side-by-side
scripts/map_functions.inc
View file @
b9bc99e4
...
...
@@ -431,6 +431,14 @@ function load_LinkedTO($node_info, $TopoList)
*/
function
build_Marker
(
$node_info
,
$node_ServiceList
,
$node_LinkedList
,
$node_FirmwareStatus
)
{
//timezone fixes - wxc 11-26-2018
$tz
=
new
DateTimeZone
(
$GLOBALS
[
'USER_SETTINGS'
][
'localTimeZone'
]);
//$nodeLastSeen = date_create($node_info['last_seen'], $tz);
$nodeLastSeen
=
new
DateTime
(
$node_info
[
'last_seen'
]);
date_timezone_set
(
$nodeLastSeen
,
$tz
);
$markerList
=
''
;
$nodeUrl
=
"<NodeTitle><a href='http://"
.
$node_info
[
'node'
]
.
".local.mesh:8080'>"
.
$node_info
[
'node'
]
.
"</a></NodeTitle>"
;
...
...
@@ -510,7 +518,10 @@ function build_Marker($node_info, $node_ServiceList, $node_LinkedList, $node_Fir
"', icon: "
.
$icon
.
"}).bindPopup(
\"
"
.
$nodeUrl
.
" ("
.
$band
.
")<br>"
.
$node_info
[
'lat'
]
.
", "
.
$node_info
[
'lon'
]
.
"<br>SSID: "
.
$node_info
[
'ssid'
]
.
"<br>Channel: "
.
$node_info
[
'channel'
]
.
", Bandwidth: "
.
$node_info
[
'chanbw'
]
.
"<br>"
.
$node_info
[
'model'
]
.
"<br>"
.
$firmware
.
"<br>Last Polled: "
.
$node_info
[
'last_seen'
]
.
'<br>'
.
"Uptime: "
.
$node_info
[
'uptime'
]
.
'<br>'
;
//"<br>Last Polled: " . $node_info['last_seen'] . '<br>' . "Uptime: " . $node_info['uptime'] . '<br>';
//timezone fixes - wxc 11-26-2018
"<br>Last Polled: "
.
date_format
(
$nodeLastSeen
,
'Y-m-d H:i:s T'
)
.
'<br>'
.
"Uptime: "
.
$node_info
[
'uptime'
]
.
'<br>'
;
//dot
if
(
$node_info
[
'loadavg'
]
!==
"NotAvailable"
)
{
$loadavgs
=
unserialize
(
$node_info
[
'loadavg'
]);
...
...
@@ -1093,7 +1104,9 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal
$filetime
=
wxc_scriptGetLastDateTime
(
"LINKINFO"
,
"topology"
);
if
(
$filetime
)
{
$filetime
=
date_format
(
$filetime
,
'F d Y H:i:s'
);
$tz
=
new
DateTimeZone
(
$GLOBALS
[
'USER_SETTINGS'
][
'localTimeZone'
]);
date_timezone_set
(
$filetime
,
$tz
);
$filetime
=
date_format
(
$filetime
,
'F d Y H:i:s T'
);
}
//$Content = "MeshMapDetails = '<strong>" . $numNodes . " Nodes shown, with " . $numLinks .
...
...
scripts/wxc_functions.inc
View file @
b9bc99e4
...
...
@@ -490,8 +490,13 @@ function wxc_scriptGetLastDateTime ($id, $name) {
// $lastRunSelf = wxc_getMySql("SELECT script_last_run FROM map_info WHERE id = '$id' AND table_or_script_name = '$name'");
return
0
;
}
//mysqli_close();
return
date_create
(
$lastRunSelf
[
'script_last_run'
]);
//timezone fixes - wxc 11-26-2018
$tz
=
new
DateTimeZone
(
$GLOBALS
[
'USER_SETTINGS'
][
'localTimeZone'
]);
$datetime
=
new
DateTime
(
$lastRunSelf
[
'script_last_run'
]);
date_timezone_set
(
$datetime
,
$tz
);
//return date_create($lastRunSelf['script_last_run']);
return
$datetime
;
}
//put a new "last_run_time" for the script into the DB
...
...
webpage/map_display.php
View file @
b9bc99e4
...
...
@@ -73,7 +73,8 @@ if (file_exists($INCLUDE_DIR . "/scripts/meshmap-settings.ini")) {
require
$INCLUDE_DIR
.
"/scripts/wxc_functions.inc"
;
require
$INCLUDE_DIR
.
"/scripts/map_functions.inc"
;
date_default_timezone_set
(
$USER_SETTINGS
[
'localTimeZone'
]);
//commented out for timezone fizes -wxc 11-26-2018
//date_default_timezone_set($USER_SETTINGS['localTimeZone']);
/*
* This section will try to tell if the client has internet access or not
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment