|
@@ -1,5 +1,85 @@
|
|
|
<?php
|
|
|
include '../auth.php';
|
|
|
+if(isset($_GET["bkend"])){
|
|
|
+ if(isset($_GET["query"])){
|
|
|
+ if($_GET["query"] == "playlist"){
|
|
|
+ $intdirs = array_filter(glob("storage/" . "*"), 'is_dir');
|
|
|
+ $IntDirWInfo = [];
|
|
|
+ foreach ($intdirs as &$intdir) {
|
|
|
+ preg_match('/storage\/([^\/]*)/', $intdir, $out_playlist);
|
|
|
+ $tmp = [];
|
|
|
+ if(ctype_xdigit($out_playlist[1])){
|
|
|
+ $tmp["name"] = "Internal - ".hex2bin($out_playlist[1]);
|
|
|
+ }else{
|
|
|
+ $tmp["name"] = "Internal - ".$out_playlist[1];
|
|
|
+ }
|
|
|
+ $tmp["dir"] = "../../../Video/".$intdir."/";
|
|
|
+ $tmp["drive"] = "internal";
|
|
|
+ $tmp["playlist"] = $out_playlist[1];
|
|
|
+ array_push($IntDirWInfo,$tmp);
|
|
|
+ }
|
|
|
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
+ $ExtDirWInfo = []; //TODO: add ext support
|
|
|
+ }else{
|
|
|
+ if (file_exists("/media/")){
|
|
|
+ $extdirs = array_filter(glob("/media/*/Video/*"), 'is_dir');
|
|
|
+ $ExtDirWInfo = [];
|
|
|
+ foreach ($extdirs as &$extdir) {
|
|
|
+ preg_match('/\/media\/([^\/]*)\//', $extdir, $out_storage);
|
|
|
+ preg_match('/Video\/([^\/]*)/', $extdir, $out_playlist);
|
|
|
+ $tmp = [];
|
|
|
+ if(ctype_xdigit($out_playlist[1])){
|
|
|
+ $tmp["name"] = $out_storage[1]." - ".hex2bin($out_playlist[1]);
|
|
|
+ }else{
|
|
|
+ $tmp["name"] = $out_storage[1]." - ".$out_playlist[1];
|
|
|
+ }
|
|
|
+ $tmp["dir"] = $extdir."/";
|
|
|
+ $tmp["drive"] = $out_storage[1];
|
|
|
+ $tmp["playlist"] = $out_playlist[1];
|
|
|
+ array_push($ExtDirWInfo,$tmp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $dirs = array_merge($IntDirWInfo,$ExtDirWInfo);
|
|
|
+ echo json_encode($dirs);
|
|
|
+ }else if($_GET["query"] == "storage"){
|
|
|
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
+ $extdirs = [];
|
|
|
+ }else{
|
|
|
+ $extdirs = array_filter(glob("/media/*"), 'is_dir');
|
|
|
+ }
|
|
|
+ $dirs = array_merge($extdirs,["internal"]);
|
|
|
+ echo json_encode($dirs);
|
|
|
+ }else if($_GET["query"] == "unsort"){
|
|
|
+ $intdirs = glob('uploads/*.{jpg,jpeg,png,gif}', GLOB_BRACE);
|
|
|
+ $IntDirWInfo = [];
|
|
|
+ foreach ($intdirs as &$intdir) {
|
|
|
+ $tmp = [];
|
|
|
+ $tmp["dir"] = "../../../Photo/".$intdir;
|
|
|
+ $tmp["drive"] = "internal";
|
|
|
+ array_push($IntDirWInfo,$tmp);
|
|
|
+ }
|
|
|
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
+ $ExtDirWInfo = []; //TODO: add ext support
|
|
|
+ }else{
|
|
|
+ if (file_exists("/media/")){
|
|
|
+ $extdirs = glob("/media/*/Photo/*.{jpg,jpeg,png,gif}");
|
|
|
+ $ExtDirWInfo = [];
|
|
|
+ foreach ($extdirs as &$extdir) {
|
|
|
+ preg_match('/\/media\/([^\/]*)\//', $extdir, $out_storage);
|
|
|
+ $tmp = [];
|
|
|
+ $tmp["dir"] = $extdir;
|
|
|
+ $tmp["drive"] = $out_storage[1];
|
|
|
+ array_push($ExtDirWInfo,$tmp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $dirs = array_merge($IntDirWInfo,$ExtDirWInfo);
|
|
|
+ echo json_encode($dirs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ die();
|
|
|
+}
|
|
|
?>
|
|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
@@ -9,216 +89,329 @@ include '../auth.php';
|
|
|
<link rel="stylesheet" href="../script/tocas/tocas.css">
|
|
|
<script type='text/javascript' src="../script/tocas/tocas.js"></script>
|
|
|
<script type='text/javascript' src="../script/ao_module.js"></script>
|
|
|
+ <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;
|
|
|
+ bottom: 0px !important;
|
|
|
+ right: 0px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
</head>
|
|
|
<body>
|
|
|
- <nav id="topbar" class="ts attached inverted borderless normal menu">
|
|
|
- <div class="ts narrow container">
|
|
|
- <a href="../" class="item">ArOZ Onlineβ</a>
|
|
|
- </div>
|
|
|
- </nav>
|
|
|
- <br>
|
|
|
-
|
|
|
- <div class="ts fluid container">
|
|
|
-
|
|
|
- <div class="ts breadcrumb">
|
|
|
- <a href="index.php" class="section"><i class="arrow left icon"></i>Back</a>
|
|
|
- <div class="divider">/</div>
|
|
|
- <div class="section"><i class="folder icon"></i>Photo Station File Management System</div>
|
|
|
- <div class="divider">/</div>
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- <div align="center"><i class="chevron right icon"></i><i class="chevron right icon"></i><i class="chevron right icon"></i><i class="chevron right icon"></i></div>
|
|
|
-
|
|
|
- <div class="ts grid">
|
|
|
- <!-- Left file browsing zone -->
|
|
|
-
|
|
|
- <div class="six wide column">
|
|
|
- <div id="imagelist" class="ts form">
|
|
|
- <div class="ts selection segmented list">
|
|
|
- <?php
|
|
|
- $leftTemplate='<div class="item" style="overflow: hide;">
|
|
|
- <div class="ts checkbox">
|
|
|
- <input id="%FILE_ID%" name="box2check" type="checkbox" onClick="showPreview('."'"."%FILE_ID%"."'".')">
|
|
|
- <label for="%FILE_ID%"><i class="image icon"></i>%FILE_NAME%</label>
|
|
|
- <div id="%FILE_ID%-ext" style="display:none;">%FILE_EXTENSION%</div>
|
|
|
- <div id="%FILE_ID%-ofn" style="display:none;">%ORIGINAL_FILENAME%</div>
|
|
|
- <div id="%FILE_ID%-rfp" style="display:none;">%FILE_PATH%</div>
|
|
|
- <div id="%FILE_ID%-size" style="display:none;">%FILE_SIZE%</div>
|
|
|
- </div>
|
|
|
- </div>';
|
|
|
- $files = glob('uploads/*.{jpg,jpeg,png,gif}', GLOB_BRACE);
|
|
|
- foreach($files as $file){
|
|
|
- $filename = basename($file);
|
|
|
- $ext = pathinfo($file, PATHINFO_EXTENSION);
|
|
|
- $orgfilename = str_replace("." . $ext,"",str_replace("inith","",basename($file)));
|
|
|
- $orgfilename = hex2bin($orgfilename);
|
|
|
- $lbox = str_replace("%FILE_ID%",str_replace(".","-dot-",str_replace(" ","-space-",$orgfilename)),$leftTemplate);
|
|
|
- $lbox = str_replace("%FILE_NAME%",$filename,$lbox);
|
|
|
- $lbox = str_replace("%ORIGINAL_FILENAME%",$orgfilename,$lbox);
|
|
|
- $lbox = str_replace("%FILE_PATH%",$file,$lbox);
|
|
|
- $lbox = str_replace("%FILE_EXTENSION%",$ext,$lbox);
|
|
|
- $lbox = str_replace("%FILE_SIZE%",filesize($file),$lbox);
|
|
|
- echo $lbox;
|
|
|
- }
|
|
|
- ?>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <!-- Center file browsing zone -->
|
|
|
- <div class="four wide column">
|
|
|
- <div class="ts card">
|
|
|
- <!-- Image preview -->
|
|
|
- <div class="secondary very padded extra content">
|
|
|
- <div class="ts icon header">
|
|
|
- <img id="previewWindow" class="ts medium image" src="img/Photo_manager.png"></img>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <!-- File Information -->
|
|
|
- <div class="extra content">
|
|
|
- <div class="header" id="ImageName">Photo Station File Management System</div>
|
|
|
- </div>
|
|
|
- <div align="center">
|
|
|
- <div class="ts icon buttons">
|
|
|
- <button id="btn1" class="ts button" onclick="TogglePreview()"><i class="mouse pointer icon"></i><i class="eye icon"></i></button>
|
|
|
- <button id="btn2" class="ts button" onClick="MoveFile(1);"><i class="checkmark box icon"></i><i class="arrow right center icon"></i></button>
|
|
|
- <button id="btn3" class="ts button" onClick="MoveFile(2);"><i class="folder outline icon"></i><i class="arrow right center icon"></i></button>
|
|
|
- <button id="btn4" class="ts negative button" onClick="MoveFile(3)"><i class="checkmark box icon"></i><i class="trash outline icon"></i></button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="extra content">
|
|
|
- <div class="ts list">
|
|
|
-
|
|
|
- <div class="item">
|
|
|
- <i class="file image outline icon"></i>
|
|
|
- <div class="content">
|
|
|
- <div class="header">File Extension</div>
|
|
|
- <div id="fileext" class="description">/</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <div class="item">
|
|
|
- <i class="terminal icon"></i>
|
|
|
- <div class="content">
|
|
|
- <div class="header">Storage Name</div>
|
|
|
- <div id="storagename" class="description">/</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <div class="item">
|
|
|
- <i class="image icon"></i>
|
|
|
- <div class="content">
|
|
|
- <div class="header">Image Size</div>
|
|
|
- <div id="imgsize" class="description">/</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <div class="item">
|
|
|
- <i class="folder icon"></i>
|
|
|
- <div class="content">
|
|
|
- <div class="header">Target Folder</div>
|
|
|
- <div id="targetdir" class="description">/</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- Functional Butons -->
|
|
|
- <div align="center">
|
|
|
- <div class="ts icon buttons">
|
|
|
- <button class="ts button" OnClick="toggle();"><i class="checkmark box icon"></i>All</button>
|
|
|
- <button class="ts button" OnClick="toggleFalse();"><i class="square outline icon"></i>All</button>
|
|
|
- <button class="ts button" OnClick="newfolder()"><i class="folder outline icon"></i>New</button>
|
|
|
- <button class="ts button" OnClick="done();"><i class="checkmark icon"></i>DONE</button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="ts horizontal right floated middoted link list">
|
|
|
- <div class="item">CopyRight IMUS Laboratory</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- Right file browsing zone -->
|
|
|
- <div class="six wide column">
|
|
|
- <div class="ts selection segmented list">
|
|
|
- <div id="filenamer" class="item" style="display:none;">
|
|
|
- <div class="ts fluid borderless icon input">
|
|
|
- <input id="fileNameInput" type="text" placeholder="New Folder">
|
|
|
- <i class="folder outline icon"></i>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <?php
|
|
|
- $storagedir = "storage/";
|
|
|
- echo '<a class="item">
|
|
|
- <i class="folder open icon"></i>
|
|
|
- storage/
|
|
|
- </a>';
|
|
|
- $rightTemplate=' <a id="%FOLDER_ID%" class="item" onClick="%FUNCTION_CALL%">
|
|
|
-    
|
|
|
- <i class="folder icon"></i>
|
|
|
- %FOLDER_NAME%
|
|
|
- </a>';
|
|
|
- $dirs = array_filter(glob($storagedir . "*"), 'is_dir');
|
|
|
- foreach($dirs as $dir){
|
|
|
- $foldername = str_replace($storagedir,"",$dir);
|
|
|
- $rbox = str_replace("%FUNCTION_CALL%","selectFolder('$foldername')",$rightTemplate);
|
|
|
- $rbox = str_replace("%FOLDER_NAME%",$foldername,$rbox);
|
|
|
- $rbox = str_replace("%FOLDER_ID%",$foldername,$rbox);
|
|
|
- echo $rbox;
|
|
|
- }
|
|
|
-
|
|
|
- ?>
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
+<nav class="ts attached borderless small menu">
|
|
|
+ <a id="rtiBtn" href="index.php" class="item"><i class="angle left icon"></i></a>
|
|
|
+ <a href="index.php" class="item">ArOZ Photo</a>
|
|
|
+ <div class="right menu">
|
|
|
+ <a onclick="ts('#AddstorageModal').modal('show')" class="item"><i class="add outline icon"></i></a>
|
|
|
+ <a href="../Upload Manager/upload_interface.php?target=Photo&filetype=jpg,jpeg,png,gif" class="item"><i class="upload icon"></i></a>
|
|
|
+ <a href="Image_manager.php" class="item"><i class="folder open outline icon"></i></a>
|
|
|
</div>
|
|
|
+</nav>
|
|
|
+<br>
|
|
|
+<div class="ts container">
|
|
|
+<div class="ts inverted segment">
|
|
|
+ <p>Batch moving :
|
|
|
+ <select class="ts basic dropdown" name="batchfolderdropdown">
|
|
|
+ <option>Select</option>
|
|
|
+ </select>
|
|
|
+ <button name="batchfolderbutton" class="ts button"><i class="move icon"></i>Move</button>
|
|
|
+ <button onclick="ts('#AddstorageModal').modal('show')" class="ts right floated button"><i class="add icon"></i>New folder</button>
|
|
|
+ </p>
|
|
|
+</div>
|
|
|
|
|
|
- </div>
|
|
|
+ <div class="ts stackable grid" id="unsortlist">
|
|
|
|
|
|
- </div>
|
|
|
- <!-- Notifier Div-->
|
|
|
- <div id="nfb" class="ts active bottom right snackbar" style="display:none;">
|
|
|
- <div id="nfbtxt" class="content">
|
|
|
- Loading...
|
|
|
- </div>
|
|
|
- <a class="primary action" onclick="$('#nfb').fadeOut('slow');">Close</a>
|
|
|
</div>
|
|
|
- <!-- Action Confirm div-->
|
|
|
- <dialog id="confirmbox" class="ts basic fullscreen modal" style="display:none; background:rgba(0,0,0,0.7);position:fixed;top:100px;" open>
|
|
|
- <div class="ts icon header">
|
|
|
- <i class="exchange icon"></i>File Operation Confirmation
|
|
|
+</div>
|
|
|
+
|
|
|
+<div class="ts modals dimmer">
|
|
|
+ <dialog id="AddstorageModal" class="ts fullscreen modal" open>
|
|
|
+ <div class="header">
|
|
|
+ Create new storage
|
|
|
</div>
|
|
|
- <div id="confirminfo" class="content">
|
|
|
- <p></p>
|
|
|
+ <div class="content">
|
|
|
+ <div class="ts form">
|
|
|
+ <div class="field">
|
|
|
+ <label>Storage</label>
|
|
|
+ <select name="storagedropdown">
|
|
|
+ <option>Select</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="field">
|
|
|
+ <label>New storage name</label>
|
|
|
+ <input type="text" id="storagename">
|
|
|
+ <small></small>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="actions">
|
|
|
- <button class="ts inverted basic deny button" onClick="$('#confirmbox').fadeOut('slow');">
|
|
|
+ <button class="ts deny button">
|
|
|
Cancel
|
|
|
</button>
|
|
|
- <button class="ts inverted basic positive button" OnClick="ConfirmAction();">
|
|
|
+ <button class="ts positive button" onclick="submit()">
|
|
|
Confirm
|
|
|
</button>
|
|
|
</div>
|
|
|
</dialog>
|
|
|
- <script>
|
|
|
- var VDI = ao_module_virtualDesktop;
|
|
|
- if (VDI){
|
|
|
- $("#topbar").hide();
|
|
|
- $("body").css("background","rgba(255,255,255,0.7)").css("padding","20px");
|
|
|
+</div>
|
|
|
+<br><br><br><br>
|
|
|
+<div class="ts bottom right snackbar">
|
|
|
+ <div class="content"></div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+//Bind enter key to the input bar
|
|
|
+$("#storagename").on("keydown",function(e){
|
|
|
+ if (e.keyCode == 13){
|
|
|
+ submit();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+//first script to run
|
|
|
+$.ajax({url: "Image_manager.php?bkend=true&query=unsort", success: function(result){
|
|
|
+ var resultArr = JSON.parse(result);
|
|
|
+ var allfile = "";
|
|
|
+ $.each(resultArr, function( index, value ) {
|
|
|
+ if(value["drive"] !== "internal"){
|
|
|
+ var drivename = '<div class="ts horizontal right floated label"><i class="usb icon"></i>' + value["drive"] + '</div>';
|
|
|
+ }else{
|
|
|
+ var drivename = '';
|
|
|
+ }
|
|
|
+ $("#unsortlist").append('<div class="four wide column" id="' + value["dir"] + '"><div class="ts card" style="height:100%"><div class="image"><img src="AOB' + value["dir"] + '"><div class="header"><div class="sub header">' + ao_module_codec.decodeUmFilename(value["dir"].replace(/^.*[\\\/]/, '')) + drivename + '</div></div></div><div class="content"><p><i class="move icon"></i>Move to <select class="ts basic dropdown" name="folderdropdown" file="' + value["dir"] + '" storage="' + value["drive"] + '"><option>Select</option></select></p><button name="deletefile" file="' + value["dir"] + '" class="ts mini very compact negative button"><i class="delete icon"></i>Delete</button></div></div></div>');
|
|
|
+ allfile += value["dir"] + ",";
|
|
|
+ });
|
|
|
+ $("select[name='batchfolderdropdown']").attr("file",allfile.substr(0,allfile.length -1));
|
|
|
+ step2();
|
|
|
+}});
|
|
|
+
|
|
|
+function step2(){
|
|
|
+ $.ajax({url: "Image_manager.php?bkend=true&query=playlist", success: function(result){
|
|
|
+ var resultArr = JSON.parse(result);
|
|
|
+ $("select[name='folderdropdown']").html("");
|
|
|
+ $("select[name='folderdropdown']").append(new Option("Select",""));
|
|
|
+
|
|
|
+ $("select[name='batchfolderdropdown']").html("");
|
|
|
+ $("select[name='batchfolderdropdown']").append(new Option("Select",""));
|
|
|
+ $.each(resultArr, function( index, value ) {
|
|
|
+ $("select[name='folderdropdown'][storage='" + value["drive"] + "']").append(new Option(value["name"],value["dir"]));
|
|
|
+ $("select[name='batchfolderdropdown']").append(new Option(value["name"],value["dir"]));
|
|
|
+ });
|
|
|
+
|
|
|
+ step3();
|
|
|
+ }});
|
|
|
+}
|
|
|
+
|
|
|
+function step3(){
|
|
|
+ $.ajax({url: "Image_manager.php?bkend=true&query=storage", success: function(result){
|
|
|
+ var resultArr = JSON.parse(result);
|
|
|
+ $("select[name='storagedropdown']").html("");
|
|
|
+ $("select[name='storagedropdown']").append(new Option("Select",""));
|
|
|
+ $.each(resultArr, function( index, value ) {
|
|
|
+ $("select[name='storagedropdown']").append(new Option(value,value));
|
|
|
+ });
|
|
|
+ }});
|
|
|
+
|
|
|
+ step4();
|
|
|
+}
|
|
|
+
|
|
|
+function step4(){
|
|
|
+ $( "button[name='batchfolderbutton']" ).click(function() {
|
|
|
+ if($("select[name='batchfolderdropdown']").val()!==""){
|
|
|
+ var Arr = $("select[name='batchfolderdropdown']").attr("file").split(",");
|
|
|
+ var DOM = $("select[name='batchfolderdropdown']");
|
|
|
+
|
|
|
+ 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" id="processingtext">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"){
|
|
|
+ success += 1;
|
|
|
+ if(success == length){
|
|
|
+ $("#unsortlist").html('<div class="ts card"><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></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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ msgbox("Nothing selected");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $( "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")){
|
|
|
+ var timer = setInterval(function(){
|
|
|
+ $.get( '../SystemAOB/functions/file_system/fsexec.php?listen=["' + UUID + '"]', function(data) {
|
|
|
+ if(data[0][1] == "done"){
|
|
|
+ $(DOM).parent().parent().parent().parent().fadeOut( "slow", function() {
|
|
|
+ $(DOM).parent().parent().parent().parent().remove();
|
|
|
+ if($.trim($("#unsortlist").html()) == ""){
|
|
|
+ $("#unsortlist").html('<div class="ts card"><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></div>');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ msgbox("Success moving " + $(DOM).attr("file").replace(/^.*[\\\/]/, ''));
|
|
|
+ clearInterval(timer);
|
|
|
+ }else if(data[0][1] == "error"){
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ msgbox("Error moving " + $(DOM).attr("file").replace(/^.*[\\\/]/, ''));
|
|
|
+ clearInterval(timer);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 3000);
|
|
|
+ }else{
|
|
|
+ $(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
|
|
|
+ msgbox(UUID);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ /*
|
|
|
+ $.post( "mover.php", { opr: 1, files: $(this).attr("file"), dir: $(this).val() },function( data ) {
|
|
|
+ if(data == "DONE"){
|
|
|
+ $(DOM).parent().parent().parent().parent().parent().fadeOut( "slow", function() {
|
|
|
+ $(DOM).parent().parent().parent().parent().parent().remove();
|
|
|
+ if($.trim($("#unsortlist").html()) == ""){
|
|
|
+ $("#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("Finished.");
|
|
|
+ }else{
|
|
|
+ msgbox("Error.");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ */
|
|
|
+ }else{
|
|
|
+ msgbox("Nothing selected");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $( "button[name='deletefile']" ).click(function() {
|
|
|
+ var DOM = $(this);
|
|
|
+ $.post( "mover.php", { opr: 3, files: $(this).attr("file")},function( data ) {
|
|
|
+ if(data == "DONE"){
|
|
|
+ $(DOM).parent().parent().parent().parent().parent().fadeOut( "slow", function() {
|
|
|
+ $(DOM).parent().parent().parent().parent().parent().remove();
|
|
|
+ if($.trim($("#unsortlist").html()) == ""){
|
|
|
+ $("#unsortlist").html('<div class="ts card"><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></div>');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ msgbox("Finished.");
|
|
|
+ }else{
|
|
|
+ msgbox("Error.");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $( "details" ).click(function() {
|
|
|
+ $("details[open='']").not(this).removeAttr('open');
|
|
|
+ });
|
|
|
+
|
|
|
+ $( ".ts.accordion.item" ).hover(function() {
|
|
|
+ $(".ts.accordion.item").not(this).removeAttr('style');
|
|
|
+ $(this).attr('style',"background-color:#f7f7f7");
|
|
|
+ });
|
|
|
+
|
|
|
+ if($.trim($("#unsortlist").html()) == ""){
|
|
|
+ $("#unsortlist").html('<div class="ts card"><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></div>');
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ var OldArr = [];
|
|
|
+ var firstInitOldArr = true;
|
|
|
+ setInterval(function(){
|
|
|
+ var notmatch = false;
|
|
|
+ $.ajax({url: "Image_manager.php?bkend=true&query=unsort", success: function(result){
|
|
|
+ var resultArr = JSON.parse(result);
|
|
|
+ if(resultArr.length !== OldArr.length){
|
|
|
+ notmatch = true;
|
|
|
+ }else{
|
|
|
+ for (var i = 0; resultArr.length < i; i++) {
|
|
|
+ if (resultArr[i] !== oldArr[i]){
|
|
|
+ notmatch = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(firstInitOldArr){
|
|
|
+ firstInitOldArr = false;
|
|
|
+ notmatch = false;
|
|
|
+ }
|
|
|
+ if(notmatch){
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ OldArr = resultArr;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 3000);
|
|
|
+*/
|
|
|
+
|
|
|
+function submit(){
|
|
|
+ if(storage = $("select[name='storagedropdown']").val() !== ""){
|
|
|
+ var storage = $("select[name='storagedropdown']").val() + "/";
|
|
|
+ if(storage == "internal/"){
|
|
|
+ storage = "storage/";
|
|
|
+ }
|
|
|
+ $.post( "new_folder.php", { storage: storage, name : $("#storagename").val() },function( data ) {
|
|
|
+ if(data == "DONE"){
|
|
|
+ msgbox("Finished.");
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ msgbox("You must select the directory.");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function msgbox(content,bgcolor,fontcolor){
|
|
|
+ $(".snackbar").attr("style",'background-color: ' + bgcolor + ';color:' + fontcolor);
|
|
|
+ ts('.snackbar').snackbar({
|
|
|
+ content: content,
|
|
|
+ onAction: () => {
|
|
|
+ $(".snackbar").removeAttr("style");
|
|
|
}
|
|
|
- </script>
|
|
|
-<script src="Image_manager.js"></script>
|
|
|
+ });
|
|
|
+}
|
|
|
+</script>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|