Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
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-camogm
Commits
27cbb3f9
Commit
27cbb3f9
authored
Sep 23, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.fixed http req 2.temporary turned off repeated requests
parent
58cbe941
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
204 additions
and
120 deletions
+204
-120
camogm_interface.php
src/camogmgui/camogm_interface.php
+24
-14
camogmgui.js
src/camogmgui/camogmgui.js
+180
-106
No files found.
src/camogmgui/camogm_interface.php
View file @
27cbb3f9
...
@@ -157,7 +157,7 @@ else if ($cmd=="get_hdd_space"){
...
@@ -157,7 +157,7 @@ else if ($cmd=="get_hdd_space"){
if
(
isset
(
$_GET
[
'mountpoint'
]))
if
(
isset
(
$_GET
[
'mountpoint'
]))
$mountpoint
=
$_GET
[
'mountpoint'
];
$mountpoint
=
$_GET
[
'mountpoint'
];
else
else
$mountpoint
=
'/mnt/
0
'
;
$mountpoint
=
'/mnt/
sda1
'
;
xml_header
();
xml_header
();
echo
"<command>"
.
$cmd
.
"</command>"
;
echo
"<command>"
.
$cmd
.
"</command>"
;
echo
"<"
.
$cmd
.
">"
;
echo
"<"
.
$cmd
.
">"
;
...
@@ -170,12 +170,13 @@ else if ($cmd=="mount") { // mount media like HDD
...
@@ -170,12 +170,13 @@ else if ($cmd=="mount") { // mount media like HDD
if
(
isset
(
$_GET
[
'partition'
]))
if
(
isset
(
$_GET
[
'partition'
]))
$partition
=
$_GET
[
'partition'
];
$partition
=
$_GET
[
'partition'
];
else
else
$partition
=
'/dev/hda1'
;
$partition
=
'/dev/sda1'
;
//$partition = '/dev/hda1';
if
(
isset
(
$_GET
[
'mountpoint'
]))
if
(
isset
(
$_GET
[
'mountpoint'
]))
$mountpoint
=
$_GET
[
'mountpoint'
];
$mountpoint
=
$_GET
[
'mountpoint'
];
else
else
$mountpoint
=
'/var/hdd'
;
$mountpoint
=
'/var/hdd'
;
exec
(
'mkdir '
.
$mountpoint
);
exec
(
'mkdir '
.
$mountpoint
);
//exec('mkdir /var/hdd');
//exec('mkdir /var/hdd');
...
@@ -353,7 +354,7 @@ else
...
@@ -353,7 +354,7 @@ else
$i
=
2
;
$i
=
2
;
while
(
$i
<
count
(
$arr1
))
{
while
(
$i
<
count
(
$arr1
))
{
// skip flash and RAM disk partitions
// skip flash and RAM disk partitions
if
(
!
strpos
(
$arr1
[
$i
],
"mtdblock"
)
&&
!
strpos
(
$arr1
[
$i
],
"ram"
))
{
if
(
!
strpos
(
$arr1
[
$i
],
"mtdblock"
)
&&
!
strpos
(
$arr1
[
$i
],
"ram"
))
{
$temp
=
$arr1
[
$i
];
$temp
=
$arr1
[
$i
];
while
(
strstr
(
$temp
,
" "
))
{
while
(
strstr
(
$temp
,
" "
))
{
$temp
=
str_replace
(
chr
(
9
),
" "
,
$temp
);
$temp
=
str_replace
(
chr
(
9
),
" "
,
$temp
);
...
@@ -415,7 +416,8 @@ else
...
@@ -415,7 +416,8 @@ else
if
(
isset
(
$_GET
[
'partition'
]))
if
(
isset
(
$_GET
[
'partition'
]))
$partition
=
$_GET
[
'partition'
];
$partition
=
$_GET
[
'partition'
];
else
else
$partition
=
'/dev/hda1'
;
$partition
=
'/dev/sda1'
;
//$partition = '/dev/hda1';
exec
(
'mount'
,
$arr
);
exec
(
'mount'
,
$arr
);
...
@@ -426,7 +428,13 @@ else
...
@@ -426,7 +428,13 @@ else
echo
"no HDD mounted"
;
echo
"no HDD mounted"
;
break
;
break
;
case
"create_symlink"
:
case
"create_symlink"
:
exec
(
'ln -s /var/hdd /mnt/flash/html/hdd'
);
//exec('ln -s /var/hdd /mnt/flash/html/hdd');
if
(
isset
(
$_GET
[
'mountpoint'
]))
$mountpoint
=
$_GET
[
'mountpoint'
];
else
$mountpoint
=
"/mnt/sda1"
;
exec
(
"rm /www/pages/hdd"
);
exec
(
"ln -sf
$mountpoint
/www/pages/hdd"
);
break
;
break
;
// case "list":
// case "list":
// if (isset($_GET['path'])) $path = $_GET['path'];
// if (isset($_GET['path'])) $path = $_GET['path'];
...
@@ -447,7 +455,7 @@ else
...
@@ -447,7 +455,7 @@ else
//
//
// break;
// break;
case
"list_files"
:
case
"list_files"
:
if
(
!
file_exists
(
'/
mnt/flash/html
/hdd'
))
{
if
(
!
file_exists
(
'/
www/pages
/hdd'
))
{
echo
"no webshare found"
;
echo
"no webshare found"
;
break
;
break
;
}
}
...
@@ -473,32 +481,34 @@ else
...
@@ -473,32 +481,34 @@ else
echo
"</file>"
;
echo
"</file>"
;
}
}
if
(
$handle
=
opendir
(
'/mnt/flash/html/hdd'
.
$dir
))
if
(
$handle
=
opendir
(
'/www/pages/hdd/'
.
$dir
))
{
{
while
(
$file
=
readdir
(
$handle
))
while
(
$file
=
readdir
(
$handle
))
{
{
if
(
$file
!=
"."
&&
$file
!=
".."
)
if
(
$file
!=
"."
&&
$file
!=
".."
)
{
{
echo
"<file>"
;
echo
"<file>"
;
echo
"<type>"
;
echo
"<type>"
;
if
(
is_dir
(
"/
var
/hdd/"
.
$dir
.
$file
))
if
(
is_dir
(
"/
www/pages
/hdd/"
.
$dir
.
$file
))
echo
"dir"
;
echo
"dir"
;
else
else
echo
$extension
=
substr
(
$file
,
strrpos
(
$file
,
'.'
)
+
1
,
strlen
(
$file
));
echo
$extension
=
substr
(
$file
,
strrpos
(
$file
,
'.'
)
+
1
,
strlen
(
$file
));
echo
"</type>"
;
echo
"</type>"
;
echo
"<name>"
.
$file
.
"</name>"
;
echo
"<name>"
.
$file
.
"</name>"
;
echo
"<path>"
.
substr
(
$dir
,
1
)
.
$file
.
"</path>"
;
echo
"<path>"
.
substr
(
$dir
,
1
)
.
$file
.
"</path>"
;
$size
=
filesize
(
"/
var
/hdd/"
.
$dir
.
$file
);
$size
=
filesize
(
"/
www/pages
/hdd/"
.
$dir
.
$file
);
echo
"<size>"
.
$size
.
"</size>"
;
echo
"<size>"
.
$size
.
"</size>"
;
$date
=
date
(
"d M Y H:i:s"
,
filectime
(
"/var/hdd/"
.
$dir
.
$file
));
if
(
!
ini_get
(
'date.timezone'
)){
date_default_timezone_set
(
'GMT'
);
}
$date
=
date
(
"d M Y H:i:s"
,
filectime
(
"/www/pages/hdd/"
.
$dir
.
$file
));
echo
"<date>"
.
$date
.
"</date>"
;
echo
"<date>"
.
$date
.
"</date>"
;
echo
"</file>"
;
echo
"</file>"
;
}
}
}
}
closedir
(
$handle
);
closedir
(
$handle
);
}
}
else
{
else
echo
"no webshare found<br>"
;
echo
"no webshare found<br>"
;
}
break
;
break
;
case
"set_prefix"
:
case
"set_prefix"
:
$prefix
=
$_GET
[
'prefix'
];
$prefix
=
$_GET
[
'prefix'
];
...
...
src/camogmgui/camogmgui.js
View file @
27cbb3f9
This diff is collapsed.
Click to expand it.
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