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
eb27ad00
Commit
eb27ad00
authored
Sep 28, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter mountpoints in camogmgui
parent
47834f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
+34
-25
camogm_interface.php
src/camogmgui/camogm_interface.php
+34
-25
No files found.
src/camogmgui/camogm_interface.php
View file @
eb27ad00
...
@@ -349,6 +349,8 @@ else
...
@@ -349,6 +349,8 @@ else
case
"listdevices"
:
case
"listdevices"
:
exec
(
"cat /proc/partitions"
,
$arr1
);
exec
(
"cat /proc/partitions"
,
$arr1
);
exec
(
"cat /proc/mounts"
,
$arr2
);
exec
(
"cat /proc/mounts"
,
$arr2
);
$ret
=
get_mnt_dev
();
$mnt_dev
=
$ret
[
"devices"
];
$j
=
0
;
$j
=
0
;
// first two lines are header and empty line separator, skip them
// first two lines are header and empty line separator, skip them
$i
=
2
;
$i
=
2
;
...
@@ -372,33 +374,40 @@ else
...
@@ -372,33 +374,40 @@ else
}
}
$j
=
0
;
$j
=
0
;
foreach
(
$partitions
as
$partition
)
{
foreach
(
$partitions
as
$partition
)
{
echo
"<item>"
;
$include
=
false
;
echo
"<partition>/dev/"
.
$partition
.
"</partition>"
;
foreach
(
$mnt_dev
as
$dev
)
{
echo
"<size>"
.
round
(
$size
[
$j
]
/
1024
/
1024
,
2
)
.
" GB</size>"
;
if
(
strpos
(
$dev
,
$partition
))
$j
++
;
$include
=
true
;
$i
=
0
;
while
(
$i
<
count
(
$arr2
))
{
if
(
strpos
(
$arr2
[
$i
],
$partition
))
{
$parts
=
explode
(
" "
,
$arr2
[
$i
]);
$mountpoint
=
$parts
[
1
];
$filesystem
=
$parts
[
2
];
}
$i
++
;
}
}
if
(
$mountpoint
!=
""
)
{
if
(
$include
)
{
echo
"<mountpoint>"
.
$mountpoint
.
"</mountpoint>"
;
echo
"<item>"
;
$mountpoint
=
""
;
echo
"<partition>/dev/"
.
$partition
.
"</partition>"
;
}
else
{
echo
"<size>"
.
round
(
$size
[
$j
]
/
1024
/
1024
,
2
)
.
" GB</size>"
;
echo
"<mountpoint>none</mountpoint>"
;
$j
++
;
}
$i
=
0
;
if
(
$filesystem
!=
""
)
{
while
(
$i
<
count
(
$arr2
))
{
echo
"<filesystem>"
.
$filesystem
.
"</filesystem>"
;
if
(
strpos
(
$arr2
[
$i
],
$partition
))
$filesystem
=
""
;
{
}
else
{
$parts
=
explode
(
" "
,
$arr2
[
$i
]);
echo
"<filesystem>none</filesystem>"
;
$mountpoint
=
$parts
[
1
];
$filesystem
=
$parts
[
2
];
}
$i
++
;
}
if
(
$mountpoint
!=
""
)
{
echo
"<mountpoint>"
.
$mountpoint
.
"</mountpoint>"
;
$mountpoint
=
""
;
}
else
{
echo
"<mountpoint>none</mountpoint>"
;
}
if
(
$filesystem
!=
""
)
{
echo
"<filesystem>"
.
$filesystem
.
"</filesystem>"
;
$filesystem
=
""
;
}
else
{
echo
"<filesystem>none</filesystem>"
;
}
echo
"</item>"
;
}
}
echo
"</item>"
;
}
}
break
;
break
;
case
"list_raw_devices"
:
case
"list_raw_devices"
:
...
...
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