Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-gps
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-gps
Commits
50284d4a
Commit
50284d4a
authored
Nov 15, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes
parent
274d5dc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
read_imu_log.php
src/read_imu_log.php
+20
-11
No files found.
src/read_imu_log.php
View file @
50284d4a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* Copyright (C) 2016 Elphel, Inc.
* Copyright (C) 2016 Elphel, Inc.
*/
*/
$hardcodeddir
=
"logs
/
"
;
$hardcodeddir
=
"logs"
;
if
(
isset
(
$_GET
[
'format'
])){
if
(
isset
(
$_GET
[
'format'
])){
$format
=
$_GET
[
'format'
];
$format
=
$_GET
[
'format'
];
...
@@ -40,7 +40,7 @@ if (isset($_GET['list'])){
...
@@ -40,7 +40,7 @@ if (isset($_GET['list'])){
if
(
isset
(
$_GET
[
'file'
])){
if
(
isset
(
$_GET
[
'file'
])){
if
(
$_SERVER
[
'REMOTE_ADDR'
]
!=
$_SERVER
[
'SERVER_ADDR'
]){
if
(
$_SERVER
[
'REMOTE_ADDR'
]
!=
$_SERVER
[
'SERVER_ADDR'
]){
$file
=
$hardcodeddir
.
basename
(
$_GET
[
'file'
]);
$file
=
$hardcodeddir
.
"/"
.
basename
(
$_GET
[
'file'
]);
}
else
{
}
else
{
$file
=
$_GET
[
'file'
];
$file
=
$_GET
[
'file'
];
}
}
...
@@ -49,8 +49,8 @@ if (isset($_GET['file'])){
...
@@ -49,8 +49,8 @@ if (isset($_GET['file'])){
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
}
else
{
}
else
{
//this is for $_SERVER['REMOTE_ADDR']==$_SERVER['SERVER_ADDR']
//this is for $_SERVER['REMOTE_ADDR']==$_SERVER['SERVER_ADDR']
if
(
is_file
(
$hardcodeddir
.
$file
)){
if
(
is_file
(
$hardcodeddir
.
"/"
.
$file
)){
$file
=
$hardcodeddir
.
$file
;
$file
=
$hardcodeddir
.
"/"
.
$file
;
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
$numRecordsInFile
=
filesize
(
$file
)
/
64
;
}
else
{
}
else
{
echo
"File not found"
;
echo
"File not found"
;
...
@@ -120,8 +120,8 @@ if ($format=="csv"){
...
@@ -120,8 +120,8 @@ if ($format=="csv"){
<tr><td>Filename</td><td>$file</td></tr>
<tr><td>Filename</td><td>$file</td></tr>
<tr><td>Found records</td><td>$numRecordsInFile</td></tr>
<tr><td>Found records</td><td>$numRecordsInFile</td></tr>
<tr><td>Filter</td><td>$filterhex</td></tr>
<tr><td>Filter</td><td>$filterhex</td></tr>
<tr><td>Start index</td><td>$
record
</td></tr>
<tr><td>Start index</td><td>$
sindex
</td></tr>
<tr><td>
Start index</td><td>$file
</td></tr>
<tr><td>
End index</td><td>$eindex
</td></tr>
</table>
</table>
TEXT;
TEXT;
}
}
...
@@ -514,10 +514,13 @@ function showlist(){
...
@@ -514,10 +514,13 @@ function showlist(){
global
$hardcodeddir
;
global
$hardcodeddir
;
$local
=
true
;
if
(
isset
(
$_GET
[
'file'
]))
$file
=
$_GET
[
'file'
];
if
(
isset
(
$_GET
[
'file'
]))
$file
=
$_GET
[
'file'
];
if
(
$_SERVER
[
'REMOTE_ADDR'
]
!=
$_SERVER
[
'SERVER_ADDR'
]){
if
(
$_SERVER
[
'REMOTE_ADDR'
]
!=
$_SERVER
[
'SERVER_ADDR'
]){
$dir
=
$hardcodeddir
;
$dir
=
$hardcodeddir
;
$local
=
false
;
}
else
{
}
else
{
if
(
!
isset
(
$file
)
||
(
$file
==
""
)){
if
(
!
isset
(
$file
)
||
(
$file
==
""
)){
$dir
=
"."
;
$dir
=
"."
;
...
@@ -534,22 +537,24 @@ function showlist(){
...
@@ -534,22 +537,24 @@ function showlist(){
}
}
}
}
}
}
$files
=
scandir
(
$dir
);
$files
=
scandir
(
$dir
);
if
(
$dir
==
"."
)
$dir
=
""
;
else
$dir
.=
"/"
;
if
(
$dir
==
"."
||
(
!
$local
))
$dirlink
=
""
;
else
$dirlink
=
"
$dir
/"
;
$res
=
""
;
$res
=
""
;
foreach
(
$files
as
$f
){
foreach
(
$files
as
$f
){
if
((
$f
[
0
]
!=
"."
)
&&
(
!
is_dir
(
$dir
.
$f
)))
{
if
((
$f
[
0
]
!=
"."
)
&&
(
!
is_dir
(
$dir
.
$f
)))
{
$res
.=
"<li><a href='#' class='filenamechanger'>
$dir$f
</a></li>
\n
"
;
$res
.=
"<li><a href='#' class='filenamechanger'>
$dir
link
$f
</a></li>
\n
"
;
}
}
}
}
$base
=
substr
(
$_SERVER
[
'SCRIPT_NAME'
],
0
,
strrpos
(
$_SERVER
[
'SCRIPT_NAME'
],
"/"
)
+
1
);
$base
=
substr
(
$_SERVER
[
'SCRIPT_NAME'
],
0
,
strrpos
(
$_SERVER
[
'SCRIPT_NAME'
],
"/"
)
+
1
);
$base
=
$_SERVER
[
'SERVER_NAME'
]
.
$base
;
$base
=
$_SERVER
[
'SERVER_NAME'
]
.
$base
;
$res
=
"Log files list (<b><i>
$base
</i></b>, click to select):<ul>
$res
</ul>"
;
$res
=
"Log files list (<b><i>
$base
$dir
</i></b>, click to select):<ul>
$res
</ul>"
;
return
$res
;
return
$res
;
...
@@ -694,7 +699,7 @@ function show(){
...
@@ -694,7 +699,7 @@ function show(){
// There was a connection error of some sort
// There was a connection error of some sort
};
};
loading_interval = setInterval(loading,
1
00);
loading_interval = setInterval(loading,
5
00);
request.send();
request.send();
}
}
...
@@ -793,6 +798,10 @@ var loading_interval;
...
@@ -793,6 +798,10 @@ var loading_interval;
function loading(){
function loading(){
console.log("loading");
console.log("loading");
var tmp = document.getElementById("csvlink").innerHTML;
if (tmp.length<2) tmp += ".";
else tmp = "";
document.getElementById("csvlink").innerHTML = tmp;
}
}
TEXT;
TEXT;
...
...
Write
Preview
Markdown
is supported
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