Commit 7c1c5571 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

mount/umount 2

parent b9c2be88
...@@ -29,8 +29,8 @@ function reload() { ...@@ -29,8 +29,8 @@ function reload() {
makeRequest('camogm_interface.php', '?cmd=run_camogm'); makeRequest('camogm_interface.php', '?cmd=run_camogm');
setTimeout('makeRequest("camogm_interface.php", "?cmd=setmov")', 500); // set MOV as default container format setTimeout('makeRequest("camogm_interface.php", "?cmd=setmov")', 500); // set MOV as default container format
} }
function mount_hdd() { function mount_hdd(callback) {
makeRequest('camogm_interface.php', '?cmd=mount'); makeRequest('camogm_interface.php','?cmd=mount',callback);
document.getElementById('directory').value = "/var/hdd/"; document.getElementById('directory').value = "/var/hdd/";
document.getElementById('mount_hdd_button').style.display = "none"; document.getElementById('mount_hdd_button').style.display = "none";
} }
...@@ -40,7 +40,7 @@ function process_mount_hdd(xmldoc) { ...@@ -40,7 +40,7 @@ function process_mount_hdd(xmldoc) {
if (response == "done") if (response == "done")
{ {
//setTimeout('is_hdd_mounted()', 500); //setTimeout('is_hdd_mounted()', 500);
//is_mounted(,"scan_devices()"); scan_devices("is_mounted(selected_device)");
console.log("mounted"); console.log("mounted");
} }
} }
...@@ -54,7 +54,7 @@ function mount_custom_partition(partition) { ...@@ -54,7 +54,7 @@ function mount_custom_partition(partition) {
function unmount_custom_partition(mountpoint) { function unmount_custom_partition(mountpoint) {
if (mountpoint != "") { if (mountpoint != "") {
//calling back scan_devices() //calling back scan_devices()
makeRequest('camogm_interface.php','?cmd=umount&mountpoint='+mountpoint,"scan_devices()"); makeRequest('camogm_interface.php','?cmd=umount&mountpoint='+mountpoint,"scan_devices(list_files(\"\"))");
} }
} }
...@@ -213,6 +213,7 @@ function list_files(dir) { ...@@ -213,6 +213,7 @@ function list_files(dir) {
function process_list_file(xmldoc) { function process_list_file(xmldoc) {
var can_continue = true; var can_continue = true;
if (xmldoc.getElementsByTagName('list_files').length > 0) { if (xmldoc.getElementsByTagName('list_files').length > 0) {
if (xmldoc.getElementsByTagName('list_files')[0].firstChild!=null){
if (xmldoc.getElementsByTagName('list_files')[0].firstChild.data != null) { if (xmldoc.getElementsByTagName('list_files')[0].firstChild.data != null) {
if (xmldoc.getElementsByTagName('list_files')[0].firstChild.data == "no webshare found") { if (xmldoc.getElementsByTagName('list_files')[0].firstChild.data == "no webshare found") {
console.log("webshare not found"); console.log("webshare not found");
...@@ -225,6 +226,7 @@ function process_list_file(xmldoc) { ...@@ -225,6 +226,7 @@ function process_list_file(xmldoc) {
} }
} }
} }
}
if (can_continue){ if (can_continue){
console.log("Processing file list"); console.log("Processing file list");
var count = xmldoc.getElementsByTagName('file').length; var count = xmldoc.getElementsByTagName('file').length;
...@@ -284,6 +286,8 @@ function process_list_file(xmldoc) { ...@@ -284,6 +286,8 @@ function process_list_file(xmldoc) {
} }
response += "</table><br>"; response += "</table><br>";
document.getElementById('filelist').innerHTML = response; document.getElementById('filelist').innerHTML = response;
}else{
} }
} }
function start_compressor(parent, port) { function start_compressor(parent, port) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment