|
|
@@ -18,6 +18,11 @@ include '../../auth.php';
|
|
|
<link rel="stylesheet" href="../../script/tocas/tocas.css">
|
|
|
<script type='text/javascript' src="../../script/tocas/tocas.js"></script>
|
|
|
<title>ArOZ Onlineβ</title>
|
|
|
+ <style>
|
|
|
+ a{
|
|
|
+ cursor:pointer;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<?php
|
|
|
@@ -46,14 +51,66 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
|
|
|
?>
|
|
|
<!-- External Storage Mounting options-->
|
|
|
+ <!--
|
|
|
<div class="ts horizontal divider">External Storage Device Mount Options</div>
|
|
|
This mounting options is for the external USB storage device.
|
|
|
<div class="ts fluid small buttons">
|
|
|
<button class="ts fluid positive button" onClick="MountExtUSB();">Mount sdc1 to /dev/pi</button>
|
|
|
<button class="ts fluid negative button" onClick="UmountExtUSB();">Umount /dev/pi</button>
|
|
|
</div>
|
|
|
+ -->
|
|
|
<!-- Internal Storage Mounting options-->
|
|
|
- <div class="ts horizontal divider">Internal Device Mounting Options (Developer only)</div>
|
|
|
+ <div class="ts horizontal divider">External Storage Mount Options</div>
|
|
|
+ <table class="ts table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Devices</th>
|
|
|
+ <th>Mounted Location</th>
|
|
|
+ <th>Toggle</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <?php
|
|
|
+ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
|
|
+ $storageDev = glob("/dev/sd*1");
|
|
|
+ $emmcChk = shell_exec("cat /proc/self/mounts | grep mmcblk0");
|
|
|
+ $eMMCMode = false;
|
|
|
+ $counter = 1;
|
|
|
+ if (trim($emmcChk) != ""){
|
|
|
+ //Raspberry Pi or similar SBCs that use eMMC to boot. Include sda as external storage
|
|
|
+ $eMMCMode = true;
|
|
|
+ }
|
|
|
+ foreach ($storageDev as $dev){
|
|
|
+ $result = shell_exec("cat /proc/self/mounts | grep " . $dev);
|
|
|
+ if (trim($result) != ""){
|
|
|
+ $tmp = explode(' ',$result);
|
|
|
+ if (!$emmcChk && trim($tmp[0]) == "/dev/sda1"){
|
|
|
+ //Echo nothing as sda1 is boot parition if eMMC is not found
|
|
|
+ //To be implemented
|
|
|
+ }else{
|
|
|
+ echo '<tr>
|
|
|
+ <td>' . $tmp[0] . '</td>
|
|
|
+ <td>'. $tmp[1] .'</td>
|
|
|
+ <td><a mptID=' . $counter . ' mountPt="' . $tmp[1] . '" onClick="umountThis(this);">Umount</a></td>
|
|
|
+ </tr>';
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ //This parition exists but not mounted
|
|
|
+ echo '<tr>
|
|
|
+ <td>' . $dev . '</td>
|
|
|
+ <td>Not mounted</td>
|
|
|
+ <td><a mptID=' . $counter . ' devDir="' . $dev . '" onClick="mountThis(this);">Mount</a></td>
|
|
|
+ </tr>';
|
|
|
+ }
|
|
|
+ $counter++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <!--
|
|
|
<div class="ts inverted vertically fitted segment">
|
|
|
<details class="ts inverted accordion">
|
|
|
<summary>
|
|
|
@@ -73,7 +130,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
</div>
|
|
|
</details>
|
|
|
</div>
|
|
|
-
|
|
|
+ -->
|
|
|
<?php
|
|
|
if ($isWindows) {echo '</div></details>';}
|
|
|
?>
|
|
|
@@ -84,7 +141,9 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
ArOZ Online BETA SystemAOB Storage Devices Mounting Tool
|
|
|
<br>
|
|
|
</div>
|
|
|
-
|
|
|
+<div id="dummyLoader" class="ts active dimmer" style="display:none;">
|
|
|
+ <div class="ts text loader">Waiting File System Reponse</div>
|
|
|
+</div>
|
|
|
|
|
|
<script>
|
|
|
var isWindows = <?php echo $isWindows ? "true" : "false";?>;
|
|
|
@@ -121,7 +180,7 @@ function UpdateUSBList(){
|
|
|
}else{
|
|
|
var etc = "";
|
|
|
}
|
|
|
- $('#deviceList').append('<div class="item"><i class="usb icon"></i> '+ devices[i].substring(0, 50) + etc + '</div>');
|
|
|
+ $('#deviceList').append('<div class="item"><i class="usb icon"></i> '+ devices[i].substring(0, 50) + etc + '</div>');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -140,13 +199,40 @@ function UpdateStorageDeviceList(){
|
|
|
}else{
|
|
|
var etc = "";
|
|
|
}
|
|
|
- $('#mountList').append('<div class="item"><i class="disk outline icon"></i> '+ data[i].substring(0, 50) + etc + '</div>');
|
|
|
+ $('#mountList').append('<div class="item"><i class="disk outline icon"></i> '+ data[i].substring(0, 50) + etc + '</div>');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function umountThis(object){
|
|
|
+ var mountPt = $(object).attr('mountPt');
|
|
|
+ umountLocation(mountPt);
|
|
|
+}
|
|
|
+
|
|
|
+function mountThis(object){
|
|
|
+ var mountPt = "/media/storage" + $(object).attr('mptID');
|
|
|
+ var devDir = $(object).attr('devDir');
|
|
|
+ mountDev(devDir,mountPt);
|
|
|
+}
|
|
|
+
|
|
|
+function umountLocation(mountPt){
|
|
|
+ $("#dummyLoader").show();
|
|
|
+ $.get("ntfs-3g.php?mpo=" + mountPt, function(data) {
|
|
|
+ window.location.reload();
|
|
|
+ $("#dummyLoader").hide();
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function mountDev(dev,mountPt){
|
|
|
+ $("#dummyLoader").show();
|
|
|
+ $.get("ntfs-3g.php?md=" + dev + "&mpn=" + mountPt, function(data) {
|
|
|
+ window.location.reload();
|
|
|
+ $("#dummyLoader").hide();
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
function MountExtUSB(){
|
|
|
//Mount sdc1 to /media/pi
|
|
|
$.get("ntfs-3g.php?md=/dev/sdc1&mpn=/media/pi", function(data) {
|
|
|
@@ -162,6 +248,7 @@ function UmountExtUSB(){
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
function debug_umso(){
|
|
|
$.get("ntfs-3g.php?mpo=/media/storage1", function(data) {
|
|
|
window.location.reload();
|