|
@@ -80,6 +80,9 @@ if(isset($_GET["bkend"])){
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
<title>ArOZ Onlineβ</title>
|
|
|
<style>
|
|
|
+ body{
|
|
|
+ background:rgba(245,245,245,0.8);
|
|
|
+ }
|
|
|
@media (max-width: 767px){
|
|
|
.ts.bottom.right.snackbar.active{
|
|
|
width: 100% !important;
|
|
@@ -101,7 +104,7 @@ if(isset($_GET["bkend"])){
|
|
|
</nav>
|
|
|
<br>
|
|
|
<div class="ts container">
|
|
|
-<div class="ts inverted info segment">
|
|
|
+<div class="ts inverted segment">
|
|
|
<p>Batch moving :
|
|
|
<select class="ts basic dropdown" name="batchfolderdropdown">
|
|
|
<option>Select</option>
|
|
@@ -144,10 +147,18 @@ if(isset($_GET["bkend"])){
|
|
|
</div>
|
|
|
</dialog>
|
|
|
</div>
|
|
|
+<br><br><br><br>
|
|
|
<div class="ts bottom right snackbar">
|
|
|
<div class="content"></div>
|
|
|
</div>
|
|
|
<script>
|
|
|
+//Bind enter key to the input bar
|
|
|
+$("#playlistname").on("keydown",function(e){
|
|
|
+ if (e.keyCode == 13){
|
|
|
+ submit();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
//first script to run
|
|
|
$.ajax({url: "manager.php?bkend=true&query=unsort", success: function(result){
|
|
|
var resultArr = JSON.parse(result);
|
|
@@ -199,23 +210,45 @@ function step4(){
|
|
|
$( "select[name='batchfolderdropdown']" ).change(function() {
|
|
|
var Arr = $(this).attr("file").split(",");
|
|
|
var DOM = $(this);
|
|
|
+
|
|
|
+ var length = Arr.length;
|
|
|
+ var success = 0;
|
|
|
+ var failed = 0;
|
|
|
+
|
|
|
$.each(Arr, function( index, value ) {
|
|
|
if(value!== ""){
|
|
|
+ $(DOM).parent().parent().parent().append('<div class="ts active inverted dimmer"><div class="ts text loader">Processing...</div></div>');
|
|
|
$.get( "../SystemAOB/functions/file_system/fsexec.php?opr=move&from=" + value + "&target=" + $(DOM).val() + value.replace(/^.*[\\\/]/, ''), function(UUID) {
|
|
|
//Return an UUID, can call fsexec.php?listen={uuid} to see the file moving progress
|
|
|
if(!UUID.includes("ERROR")){
|
|
|
var timer = setInterval(function(){
|
|
|
$.get( '../SystemAOB/functions/file_system/fsexec.php?listen=["' + UUID + '"]', function(data) {
|
|
|
if(data[0][1] == "done"){
|
|
|
- $("#unsortlist").html('<div class="ts slate accordion item"><i class="notice circle icon"></i><span class="header">No file unsorted</span><span class="description">Upload some files to here :)</span></div>');
|
|
|
- msgbox("Success");
|
|
|
+ success += 1;
|
|
|
+ if(success == length){
|
|
|
+ $("#unsortlist").html('<div class="ts slate accordion item"><i class="notice circle icon"></i><span class="header">No file unsorted</span><span class="description">Upload some files to here :)</span></div>');
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ }
|
|
|
+ if((success + failed) == length){
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ msgbox("Moved " + value.replace(/^.*[\\\/]/, ''));
|
|
|
clearInterval(timer);
|
|
|
}else if(data[0][1] == "error"){
|
|
|
+ failed += 1;
|
|
|
+ if((success + failed) == length){
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ msgbox("Error moving " + value.replace(/^.*[\\\/]/, ''));
|
|
|
clearInterval(timer);
|
|
|
}
|
|
|
});
|
|
|
}, 3000);
|
|
|
}else{
|
|
|
+ failed += 1;
|
|
|
+ if((success + failed) == length){
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
msgbox(UUID);
|
|
|
}
|
|
|
});
|
|
@@ -226,6 +259,7 @@ function step4(){
|
|
|
$( "select[name='folderdropdown']" ).change(function() {
|
|
|
if($(this).val()!==""){
|
|
|
var DOM = $(this);
|
|
|
+ $(DOM).parent().parent().parent().append('<div class="ts active inverted dimmer"><div class="ts text loader">Processing...</div></div>');
|
|
|
$.get( "../SystemAOB/functions/file_system/fsexec.php?opr=move&from=" + $(this).attr("file") + "&target=" + $(this).val() + $(this).attr("file").replace(/^.*[\\\/]/, ''), function(UUID) {
|
|
|
//Return an UUID, can call fsexec.php?listen={uuid} to see the file moving progress
|
|
|
if(!UUID.includes("ERROR")){
|
|
@@ -238,14 +272,18 @@ function step4(){
|
|
|
$("#unsortlist").html('<div class="ts slate accordion item"><i class="notice circle icon"></i><span class="header">No file unsorted</span><span class="description">Upload some files to here :)</span></div>');
|
|
|
}
|
|
|
});
|
|
|
- msgbox("Success");
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ msgbox("Success moving " + value.replace(/^.*[\\\/]/, ''));
|
|
|
clearInterval(timer);
|
|
|
}else if(data[0][1] == "error"){
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ msgbox("Error moving " + value.replace(/^.*[\\\/]/, ''));
|
|
|
clearInterval(timer);
|
|
|
}
|
|
|
});
|
|
|
}, 3000);
|
|
|
}else{
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
msgbox(UUID);
|
|
|
}
|
|
|
});
|