From 64dd0f238c76ae102a229fdee52f3a8a459021d7 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 26 May 2020 09:48:50 +0800 Subject: [PATCH 01/27] show aplayer --- theme/nexmoe2.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/theme/nexmoe2.html b/theme/nexmoe2.html index 36b121f..7555d4b 100644 --- a/theme/nexmoe2.html +++ b/theme/nexmoe2.html @@ -319,8 +319,8 @@ -
  • - +
  • + @@ -333,7 +333,7 @@
    - +
    @@ -393,15 +393,17 @@ var $$ = mdui.JQ; $$(function() { $$('.file .iframe').each(function() { $$(this).on('click', function() { + url=$$(this).attr('href'); + //url=url.substr(0,url.length-8); layer.open({ type: 2, - title: '"+'">'+ $$(this).find('span').text()+'(点击新窗口打开)', //jia, + title: ''+ $$(this).find('span').text()+'(点击新窗口打开)', //jia, //shadeClose: true, move: false, shade: false, maxmin: true, area: ['100%', '100%'], - content: $$(this).attr('href')+"" //le + content: url //le ,min: function(layero){ //zi; layero.css({top: '90%'}) @@ -439,7 +441,7 @@ TC.preview_audio = function(aud){ } TC.aplayerList.push({ name:n, - url:this.href, + url:this.href.substr(0,this.href.length-8), artist:" ", lrc:lrc }); From bddd6e91f24e1e2c7024f9c42a454236e1e00e3f Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 26 May 2020 09:49:13 +0800 Subject: [PATCH 02/27] show aplayer in nexmoe --- common.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index f694199..6080a00 100644 --- a/common.php +++ b/common.php @@ -1979,7 +1979,8 @@ function render_list($path = '', $files = '') $html .= $tmp[1]; } } - + while (strpos($html, '')) $html = str_replace('', getconstStr('Download'), $html); + if (isset($files['children'])) { while (strpos($html, '')) { $tmp = splitfirst($html, ''); @@ -2039,6 +2040,10 @@ function render_list($path = '', $files = '') $filenum++; $ext = strtolower(substr($file['name'], strrpos($file['name'], '.') + 1)); $FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList); + $FolderListStr = str_replace('', $ext, $FolderListStr); + if (in_array($ext, $exts['music'])) $FolderListStr = str_replace('', 'audio', $FolderListStr); + elseif (in_array($ext, $exts['video'])) $FolderListStr = str_replace('', 'iframe', $FolderListStr); + else $FolderListStr = str_replace('', '', $FolderListStr); $FolderListStr = str_replace('', str_replace('&','&', $file['name']), $FolderListStr); //$FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . str_replace('&','&', $file['name'])), $FolderListStr); $FolderListStr = str_replace('', time_format($file['lastModifiedDateTime']), $FolderListStr); @@ -2152,7 +2157,6 @@ function render_list($path = '', $files = '') } $html = str_replace('', str_replace('%2523', '%23', str_replace('%26amp%3B','&',spurlencode(path_format($_SERVER['base_disk_path'] . '/' . $path), '/'))), $html); $html = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path), $html); - $html = str_replace('', getconstStr('Download'), $html); $ext = strtolower(substr($path, strrpos($path, '.') + 1)); if (in_array($ext, $exts['img'])) $ext = 'img'; From c69bbe3eca28679ebacf5b39cba3c6969ae6d6a1 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 15:00:13 +0800 Subject: [PATCH 03/27] guest calculate md5 before upload --- theme/classic.html | 98 ++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/theme/classic.html b/theme/classic.html index efebcb5..8bf93ef 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -821,20 +821,55 @@ tr1.setAttribute('data-to',1); var td1=document.createElement('td'); tr1.appendChild(td1); - td1.setAttribute('style','width:30%'); + td1.setAttribute('style','width:30%;word-break:break-word;'); td1.setAttribute('id','upfile_td1_'+timea+'_'+i); td1.innerHTML=(file.webkitRelativePath||file.name)+'
    '+size_format(file.size); var td2=document.createElement('td'); tr1.appendChild(td2); td2.setAttribute('id','upfile_td2_'+timea+'_'+i); - td2.innerHTML=' ...'; if (file.size>100*1024*1024*1024) { td2.innerHTML=''; uploadbuttonshow(); return; } + upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); + + function getext(str) { + strarry=str.split('.'); + ext=strarry[strarry.length-1].toLowerCase(); + var reg = new RegExp(".","g"); + var a = str.replace(reg,""); + if (a == ext) ext = ""; + else ext = "." + ext; + return ext; + } + var ext = getext(file.webkitRelativePath||file.name); + var spark = new SparkMD5.ArrayBuffer(); + var reader = new FileReader(); + var chunksize=10*1024*1024; + var asize = 0; + function readblob(start) { + var end=start+chunksize; + var blob = file.slice(start,end); + reader.readAsArrayBuffer(blob); + } + readblob(asize); + + reader.onload = function(e){ + td2.innerHTML=' md5: '+(asize*100/file.size).toFixed(2)+'%'; + var binary = this.result; + spark.append(binary); + asize += chunksize; + if (asize < file.size) { + readblob(asize); + } else { + var filemd5 = spark.end(); + td2.innerHTML='md5: '+filemd5; + upbigfilename = filemd5+ext; + + td2.innerHTML=' ...'; var xhr1 = new XMLHttpRequest(); - xhr1.open("GET", '?action=upbigfile&upbigfilename='+ encodeURIComponent((file.webkitRelativePath||file.name)) +'&filesize='+ file.size +'&lastModified='+ file.lastModified); + xhr1.open("GET", '?action=upbigfile&upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&lastModified='+ file.lastModified); xhr1.setRequestHeader('x-requested-with','XMLHttpRequest'); xhr1.send(null); xhr1.onload = function(e){ @@ -847,14 +882,23 @@ uploadbuttonshow(); } else { td2.innerHTML=' ...'; - binupfile(file,html['uploadUrl'],timea+'_'+i); + binupfile(file,html['uploadUrl'],timea+'_'+i, upbigfilename); } } + if (xhr1.status==409) { + td2.innerHTML='md5: '+filemd5; + tdnum = timea+'_'+i; + document.getElementById('upfile_td1_'+tdnum).innerHTML='
    '+document.getElementById('upfile_td1_'+tdnum).innerHTML+'
    '; + } if (i + } + } + } } function size_format(num) { @@ -875,7 +919,7 @@ } return num.toFixed(2) + ' GB'; } - function binupfile(file,url,tdnum){ + function binupfile(file,url,tdnum,filename){ var label=document.getElementById('upfile_td2_'+tdnum); var reader = new FileReader(); var StartStr=''; @@ -896,9 +940,7 @@ var a = html['nextExpectedRanges'][0]; newstartsize = Number( a.slice(0,a.indexOf("-")) ); StartTime = new Date(); - asize = newstartsize; - if (newstartsize==0) { StartStr=':' +StartTime.toLocaleString()+'
    ' ; } else { @@ -912,19 +954,9 @@ reader.readAsArrayBuffer(blob); } readblob(asize); - - var spark = new SparkMD5.ArrayBuffer(); - + reader.onload = function(e){ var binary = this.result; - - spark.append(binary); - if (asize < newstartsize) { - asize += chunksize; - readblob(asize); - return; - } - var xhr = new XMLHttpRequest(); xhr.open("PUT", url, true); //xhr.setRequestHeader('x-requested-with','XMLHttpRequest'); @@ -945,38 +977,12 @@ if (response['size']>0) { // contain size, upload finish. 有size说明是最终返回,上传结束 var xhr3 = new XMLHttpRequest(); - xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+encodeURIComponent((file.webkitRelativePath||file.name))); + xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename); xhr3.setRequestHeader('x-requested-with','XMLHttpRequest'); xhr3.send(null); xhr3.onload = function(e){ console.log(xhr3.responseText+','+xhr3.status); } - - var filemd5 = spark.end(); - var xhr4 = new XMLHttpRequest(); - xhr4.open("GET", '?action=uploaded_rename&filename='+encodeURIComponent((file.webkitRelativePath||file.name))+'&filemd5='+filemd5); - xhr4.setRequestHeader('x-requested-with','XMLHttpRequest'); - xhr4.send(null); - xhr4.onload = function(e){ - console.log(xhr4.responseText+','+xhr4.status); - var filename; - //if (xhr4.status==200) filename = JSON.parse(xhr4.responseText)['name']; - //if (xhr4.status==409) filename = filemd5 + (file.webkitRelativePath||file.name).substr((file.webkitRelativePath||file.name).indexOf('.')); - filename = JSON.parse(xhr4.responseText)['name']; - if (filename=='') { - alert(''); - uploadbuttonshow(); - return; - } - var lasturl = location.href; - if (lasturl.substr(lasturl.length-1)!='/') lasturl += '/'; - lasturl += filename + '?preview'; - //window.open(lasturl); - document.getElementById('upfile_a_'+tdnum).href = lasturl; - document.getElementById('upfile_a1_'+tdnum).href = filename; - document.getElementById('upfile_cpbt_'+tdnum).style.display = ""; - } - EndTime=new Date(); MiddleStr = ':'+EndTime.toLocaleString()+'
    '; if (newstartsize==0) { @@ -1004,7 +1010,7 @@ xhr.send(binary); } } else { - if (window.location.pathname.indexOf('%23')>0||(file.webkitRelativePath||file.name).indexOf('%23')>0) { + if (window.location.pathname.indexOf('%23')>0||filename.indexOf('%23')>0) { label.innerHTML=''; } else { label.innerHTML=''+xhr2.responseText+''; From 388b8f33a9cda9825b84f60ae88569135b3a4d1e Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 15:01:48 +0800 Subject: [PATCH 04/27] guest calculate md5 before upload --- conststr.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conststr.php b/conststr.php index a519638..769f5c2 100644 --- a/conststr.php +++ b/conststr.php @@ -526,6 +526,10 @@ $constStr = [ 'ko-kr' => '업로드 링크 받기', 'fa' => 'دریافت لینک آپلود', ], + 'Calculate' => [ + 'en-us' => 'Calculate', + 'zh-cn' => '计算', + ], 'UpFileTooLarge' => [ 'en-us' => 'The File is too Large!', 'zh-cn' => '文件过大,终止上传。', From 0e907d48738108933a8b4b3aaad8f302eda46678 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 15:05:23 +0800 Subject: [PATCH 05/27] guest calculate md5 before upload --- common.php | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/common.php b/common.php index 6080a00..61838da 100644 --- a/common.php +++ b/common.php @@ -277,7 +277,8 @@ function main($path) $oldname = spurlencode($_GET['filename']); $pos = strrpos($oldname, '.'); if ($pos>0) $ext = strtolower(substr($oldname, $pos)); - $oldname = path_format(path_format($_SERVER['list_path'] . path_format($path)) . '/' . $oldname . '.scfupload' ); + //$oldname = path_format(path_format($_SERVER['list_path'] . path_format($path)) . '/' . $oldname . '.scfupload' ); + $oldname = path_format(path_format($_SERVER['list_path'] . path_format($path)) . '/' . $oldname); $data = '{"name":"' . $_GET['filemd5'] . $ext . '"}'; //echo $oldname .'
    '. $data; $tmp = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']); @@ -830,7 +831,7 @@ function bigfileupload($path) $getoldupinfo = json_decode($getoldupinfo_j['body'], true); if ( json_decode( curl_request($getoldupinfo['uploadUrl'])['body'], true)['@odata.context']!='' ) return output($getoldupinfo_j['body'], $getoldupinfo_j['stat']); } - if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload'; + //if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload'; $response=MSAPI('createUploadSession',path_format($path1 . '/' . $filename),'{"item": { "@microsoft.graph.conflictBehavior": "fail" }}',$_SERVER['access_token']); $responsearry = json_decode($response['body'],true); if (isset($responsearry['error'])) return output($response['body'], $response['stat']); @@ -1926,8 +1927,9 @@ function render_list($path = '', $files = '') } if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) { while (strpos($html, '')) { - $html = str_replace('', '', $html); - $html = str_replace('', '', $html); + while (strpos($html, '')) $html = str_replace('', '', $html); + while (strpos($html, '')) $html = str_replace('', '', $html); + while (strpos($html, '')) $html = str_replace('', getconstStr('Calculate'), $html); } } else { $tmp[1] = 'a'; @@ -2222,7 +2224,7 @@ function render_list($path = '', $files = '') //$description .= 'In '.$_SERVER['sitename']; $html = str_replace('', $description, $html); - while (strpos($html, '')) $html = str_replace('', $_SERVER['base_disk_path'], $html); + while (strpos($html, '')) $html = str_replace('', (substr($_SERVER['base_disk_path'],-1)=='/'?substr($_SERVER['base_disk_path'],0,-1):$_SERVER['base_disk_path']), $html); while (strpos($html, '')) $html = str_replace('', $_SERVER['base_path'], $html); while (strpos($html, '')) $html = str_replace('', str_replace('%23', '#', str_replace('&','&', $path)), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Home'), $html); @@ -2364,7 +2366,7 @@ function render_list($path = '', $files = '') $html .= $MultiDiskArea . $tmp[1]; $diskname = getConfig('diskname'); if ($diskname=='') $diskname = $_SERVER['disktag']; - if (strlen($diskname)>15) $diskname = substr($diskname, 0, 12).'...'; + //if (strlen($diskname)>15) $diskname = substr($diskname, 0, 12).'...'; while (strpos($html, '')) $html = str_replace('', $diskname, $html); $tmp = splitfirst($html, ''); @@ -2495,6 +2497,24 @@ function render_list($path = '', $files = '') $html .= $tmp[1]; while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html); + while (strpos($html, '{{.RawData}}')) { + $str = '['; + $i = 0; + foreach ($files['children'] as $file) if ($_SERVER['admin'] or !isHideFile($file['name'])) { + $tmp = []; + $tmp['name'] = $file['name']; + $tmp['size'] = size_format($file['size']); + $tmp['date'] = time_format($file['lastModifiedDateTime']); + $tmp['@time'] = $file['date']; + $tmp['@type'] = isset($file['folder'])?'folder':'file'; + $str .= json_encode($tmp).','; + } + if ($str == '[') { + $str = ''; + } else $str = substr($str, 0, -1).']'; + $html = str_replace('{{.RawData}}', base64_encode($str), $html); + } + // 最后清除换行 while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html); //while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html); From 185824353e4f3bb173aa52b345946a9254ce1678 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 15:07:59 +0800 Subject: [PATCH 06/27] multiDisk width, txt preview word break --- theme/nexmoe1.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theme/nexmoe1.html b/theme/nexmoe1.html index fd296ba..f27a55f 100644 --- a/theme/nexmoe1.html +++ b/theme/nexmoe1.html @@ -34,14 +34,14 @@ .mdui-list>.th{background-color:initial} .mdui-list-item>a{width:100%;line-height:48px} .mdui-toolbar>a:last-child{opacity:1;background-color:#1e89f2;color:#ffff} - .more-disk{display: inline-block;} + .more-disk{display: inline-block;max-width: 100px;} .more-disk div{ list-style:none; - position:absolute;display:none;background:#ffffff;border-radius:5px;margin:-7px 0 0 0;padding:0 7px;color:#205D67;z-index:1; + position:absolute;display:none;background:#ffffff;border-radius:5px;margin:0 0 0 -10px;/*padding:0 7px;*/color:#205D67;z-index:1; box-shadow: 0 0.5em 3em rgba(161,177,204,.4); } .more-disk:hover div{display:block} - .more-disk div li{line-height:normal;padding: 5px 5px;} + .more-disk div li{line-height:normal;padding: 3px 10px;} .more-disk div li a{text-decoration: none; color:rgba(0,0,0,.3);} .more-disk div li a:hover{color:rgba(0,0,0,.87);} .more-disk div li a[now]{color:rgba(0,0,0,1);} @@ -135,7 +135,7 @@
    -
    +
    From d31aad16e9378606008cafeb87cbc6c35ab4e6e2 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 15:09:41 +0800 Subject: [PATCH 07/27] txt preview break --- theme/nexmoe2.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/nexmoe2.html b/theme/nexmoe2.html index 7555d4b..3e20f26 100644 --- a/theme/nexmoe2.html +++ b/theme/nexmoe2.html @@ -191,7 +191,7 @@
    -
    +
    From 27091d508535dc501ad3bc84d4a8c170f7e8ba44 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 17:54:33 +0800 Subject: [PATCH 08/27] Update tfo_md.php --- theme/tfo_md.php | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/theme/tfo_md.php b/theme/tfo_md.php index c96135d..9e8cdc2 100644 --- a/theme/tfo_md.php +++ b/theme/tfo_md.php @@ -2,7 +2,7 @@ <?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; echo ' - ' . $diskname; } ?> - <?php echo $_SERVER['sitename'];?> - + @@ -16,9 +16,9 @@ ion-icon{font-size:16px;vertical-align:middle} ::selection{background-color:rgba(200,200,200,0.6)} input{cursor:pointer;padding: 0 8px;height:24px;font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:16px;background-color:transparent;color:#24292e} - input:hover{background:rgb(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + input:focus{background:rgb(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} textarea{font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:6px;background-color:transparent;color:#24292e} - textarea:hover{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + textarea:focus{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} .changelanguage{position:absolute;right:5px;} .title{text-shadow:0 1px 15px rgba(27,31,35,1);text-decoration:none;transition-duration: 0.3s;border:1px solid rgba(27,31,35,0);text-align:center;letter-spacing:1px;height: 10px;margin:1rem auto;padding: 16px 16px;white-space:nowrap;overflow:hidden;width:fit-content;border-radius:36px;} .title:hover{text-shadow:0 1px 15px rgba(27,31,35,0);background-color:rgba(200,200,200,1);box-shadow:0 1px 15px rgba(27,31,35,.15);} @@ -34,7 +34,7 @@ .more-disk a{border:1px solid rgba(27,31,35,0);font-weight:bold;margin:0 2px;padding:5px;transition-duration: 0.3s;border-radius: 18px;background-color:transparent;color: #24292e} .more-disk a:hover, .more-disk a[now]{color:#FFF;background:rgba(205,205,205);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table{width:100%;padding:0 20px 20px 20px;border-spacing:0;overflow:hidden;table-layout:fixed} - .list-table tr{height:32px;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} + .list-table tr{height:fit-content;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} .list-table tr[data-to]:hover{background:linear-gradient(to right, rgb(3,102,214,0.9) , rgba(3,102,214,0.3));color:white;box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table tr[data-to]:hover a{color:white} .list-table tr:first-child{background:rgba(245,245,245,0)} @@ -42,10 +42,10 @@ .list-table td.file,.list-table th.file{width:70%;} .list-table td.size,.list-table th.size{width:10%;} .list-table td,.list-table th{padding:0 8px;text-align:left;float:left;line-height:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} - .list-table td button,.list-table th button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} - .list-table td button:hover,.list-table th button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} + .list-table td button,.list-table th button,.swal-button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} + .list-table td button:hover,.list-table th button:hover,.swal-button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} .list-table .size,.list-table .updated_at{text-align:right} - .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=20);opacity:0.2;z-index:2;} + .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=30);opacity:0.3;z-index:2;} .operate{display:inline-table;margin:0;margin-right:5px;list-style:none} .operate ul{position:absolute;display:none;background:white;transition-duration: 0.3s;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);border-radius:32px;margin:-7px 0 0 0;padding:0 3px;color:#205D67;z-index:3;} @@ -398,7 +398,7 @@ echo ''; if ($_SERVER['admin']) { ?>
    - +
    @@ -429,7 +429,7 @@ echo '';
    - +
    @@ -531,7 +531,7 @@ echo ''; : - + : @@ -562,7 +562,9 @@ echo '';
    -
    +
    Power byTfo's Theme for OneManager-php
    +
    + @@ -721,6 +723,10 @@ echo ''; $readme.innerHTML = marked(document.getElementById('readme-md').innerText); } function showthumbnails(obj) { + swal("Loading Thumbnails", { + buttons: false, + timer: 1000, + }); var files=document.getElementsByName('filelist'); for ($i=0;$i'; tmptextarea.select(); tmptextarea.setSelectionRange(0, tmptextarea.value.length); document.execCommand("copy"); - alert(tmptextarea.innerHTML+""); + swal(tmptextarea.innerHTML+''); } var sort=0; function sortby(string) { @@ -895,7 +901,6 @@ echo ''; var tr1=document.createElement('tr'); table1.appendChild(tr1); tr1.setAttribute('data-to',1); - tr1.setAttribute('style','height:fit-content'); var td1=document.createElement('td'); tr1.appendChild(td1); td1.setAttribute('style','width:fit-content'); @@ -1043,7 +1048,7 @@ echo ''; //if (xhr4.status==409) filename = filemd5 + file.name.substr(file.name.indexOf('.')); filename = JSON.parse(xhr4.responseText)['name']; if (filename=='') { - alert(''); + swal(''); uploadbuttonshow(); return; } @@ -1177,7 +1182,7 @@ echo ''; html=JSON.parse(xhr.responseText); addelement(html); } - } else alert(xhr.status+'\n'+xhr.responseText); + } else swal(xhr.status+'\n'+xhr.responseText); document.getElementById(str+'_div').style.display='none'; document.getElementById('mask').style.display='none'; } From f50949dae6464a98bba7f4d5b7565e5fe774e514 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 17:56:01 +0800 Subject: [PATCH 09/27] Update tfo_mdtr.php --- theme/tfo_mdtr.php | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/theme/tfo_mdtr.php b/theme/tfo_mdtr.php index 6c17215..e286954 100644 --- a/theme/tfo_mdtr.php +++ b/theme/tfo_mdtr.php @@ -2,7 +2,7 @@ <?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; echo ' - ' . $diskname; } ?> - <?php echo $_SERVER['sitename'];?> - + @@ -16,9 +16,9 @@ ion-icon{font-size:16px;vertical-align:middle} ::selection{background-color:rgba(200,200,200,0.6)} input{cursor:pointer;padding: 0 8px;height:24px;font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:16px;background-color:transparent;color:#24292e} - input:hover{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + input:focus{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} textarea{font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:6px;background-color:transparent;color:#24292e} - textarea:hover{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + textarea:focus{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} .changelanguage{position:absolute;right:5px;} .title{text-shadow:0 1px 15px rgba(27,31,35,1);text-decoration:none;transition-duration: 0.3s;border:1px solid rgba(27,31,35,0);text-align:center;letter-spacing:1px;height: 10px;margin:1rem auto;padding: 16px 16px;white-space:nowrap;overflow:hidden;width:fit-content;border-radius:36px;} .title:hover{text-shadow:0 1px 15px rgba(27,31,35,0);background-color:rgba(200,200,200,.6);box-shadow:0 1px 15px rgba(27,31,35,.15);} @@ -34,7 +34,7 @@ .more-disk a{border:1px solid rgba(27,31,35,0);font-weight:bold;margin:0 2px;padding:5px;transition-duration: 0.3s;border-radius: 18px;background-color:transparent;color: #24292e} .more-disk a:hover, .more-disk a[now]{color:#FFF;background:rgba(245,245,245,0.3);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table{width:100%;padding:0 20px 20px 20px;border-spacing:0;overflow:hidden;table-layout:fixed} - .list-table tr{height:32px;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} + .list-table tr{height:fit-content;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} .list-table tr[data-to]:hover{background:linear-gradient(to right, rgb(3,102,214,0.9) , rgba(3,102,214,0.3));color:white;box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table tr[data-to]:hover a{color:white} .list-table tr:first-child{background:rgba(245,245,245,0)} @@ -42,9 +42,10 @@ .list-table td.file,.list-table th.file{width:70%;} .list-table td.size,.list-table th.size{width:10%;} .list-table td,.list-table th{padding:0 8px;text-align:left;float:left;line-height:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} - .list-table td button,.list-table th button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} - .list-table td button:hover,.list-table th button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} .list-table .size,.list-table .updated_at{text-align:right} - .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=20);opacity:0.2;z-index:2;} + .list-table td button,.list-table th button,.swal-button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} + .list-table td button:hover,.list-table th button:hover,.swal-button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} + .list-table .size,.list-table .updated_at{text-align:right} + .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=30);opacity:0.3;z-index:2;} .operate{display:inline-table;margin:0;margin-right:5px;list-style:none} .operate ul{position:absolute;display:none;background:white;transition-duration: 0.3s;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);border-radius:32px;margin:-7px 0 0 0;padding:0 3px;color:#205D67;z-index:3;} @@ -397,7 +398,7 @@ echo ''; if ($_SERVER['admin']) { ?>
    - +
    @@ -428,8 +429,8 @@ echo '';
    - - + +
    '; @@ -530,8 +531,8 @@ echo ''; : - - + + @@ -561,7 +562,9 @@ echo ''; -
    +
    Power byTfo's Theme for OneManager-php
    +
    + @@ -720,6 +723,10 @@ echo ''; $readme.innerHTML = marked(document.getElementById('readme-md').innerText); } function showthumbnails(obj) { + swal("Loading Thumbnails", { + buttons: false, + timer: 1000, + }); var files=document.getElementsByName('filelist'); for ($i=0;$i'; tmptextarea.select(); tmptextarea.setSelectionRange(0, tmptextarea.value.length); document.execCommand("copy"); - alert(tmptextarea.innerHTML+""); + swal(tmptextarea.innerHTML+''); } var sort=0; function sortby(string) { @@ -894,7 +901,6 @@ echo ''; var tr1=document.createElement('tr'); table1.appendChild(tr1); tr1.setAttribute('data-to',1); - tr1.setAttribute('style','height:fit-content'); var td1=document.createElement('td'); tr1.appendChild(td1); td1.setAttribute('style','width:fit-content'); @@ -1042,7 +1048,7 @@ echo ''; //if (xhr4.status==409) filename = filemd5 + file.name.substr(file.name.indexOf('.')); filename = JSON.parse(xhr4.responseText)['name']; if (filename=='') { - alert(''); + swal(''); uploadbuttonshow(); return; } @@ -1120,7 +1126,7 @@ echo ''; if (str=='') { str=document.getElementById('file_a'+num).getElementsByTagName("img")[0].alt; if (str=='') { - alert(''); + swal(''); operatediv_close(action); return; } @@ -1176,7 +1182,7 @@ echo ''; html=JSON.parse(xhr.responseText); addelement(html); } - } else alert(xhr.status+'\n'+xhr.responseText); + } else swal(xhr.status+'\n'+xhr.responseText); document.getElementById(str+'_div').style.display='none'; document.getElementById('mask').style.display='none'; } From 1e437f88647863b2d99fc7a6fa628492061dfe62 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 30 May 2020 17:57:14 +0800 Subject: [PATCH 10/27] Update tfo_mdtrbaw.php --- theme/tfo_mdtrbaw.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/theme/tfo_mdtrbaw.php b/theme/tfo_mdtrbaw.php index 2014931..b3d5248 100644 --- a/theme/tfo_mdtrbaw.php +++ b/theme/tfo_mdtrbaw.php @@ -2,7 +2,7 @@ <?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; echo ' - ' . $diskname; } ?> - <?php echo $_SERVER['sitename'];?> - + @@ -17,9 +17,9 @@ ion-icon{font-size:16px;vertical-align:middle} ::selection{background-color:rgba(200,200,200,0.6)} input{cursor:pointer;padding: 0 8px;height:24px;font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:16px;background-color:transparent;color:#24292e} - input:hover{background:rgb(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + input:focus{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} textarea{font-weight:bold;border:1px solid rgba(27,31,35,0);transition-duration: 0.3s;border-radius:6px;background-color:transparent;color:#24292e} - textarea:hover{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} + textarea:focus{background:rgba(3,102,214,0.6);color:#FFF;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);} .changelanguage{position:absolute;right:5px;} .title{text-shadow:0 1px 15px rgba(27,31,35,1);text-decoration:none;transition-duration: 0.3s;border:1px solid rgba(27,31,35,0);text-align:center;letter-spacing:1px;height: 10px;margin:1rem auto;padding: 16px 16px;white-space:nowrap;overflow:hidden;width:fit-content;border-radius:36px;} .title:hover{text-shadow:0 1px 15px rgba(27,31,35,0);background-color:rgba(200,200,200,.6);box-shadow:0 1px 15px rgba(27,31,35,.15);} @@ -35,7 +35,7 @@ .more-disk a{border:1px solid rgba(27,31,35,0);font-weight:bold;margin:0 2px;padding:5px;transition-duration: 0.3s;border-radius: 18px;background-color:transparent;color: #24292e} .more-disk a:hover, .more-disk a[now]{color:#FFF;background:rgba(245,245,245,0.3);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table{width:100%;padding:0 20px 20px 20px;border-spacing:0;overflow:hidden;table-layout:fixed} - .list-table tr{height:32px;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} + .list-table tr{height:fit-content;float:left;width:100%;transition-duration: 0.3s;border-radius:16px} .list-table tr[data-to]:hover{background:linear-gradient(to right, rgb(3,102,214,0.9) , rgba(3,102,214,0.3));color:white;box-shadow:0 1px 15px rgba(27,31,35,.15)} .list-table tr[data-to]:hover a{color:white} .list-table tr:first-child{background:rgba(245,245,245,0)} @@ -43,8 +43,10 @@ .list-table td.file,.list-table th.file{width:70%;} .list-table td.size,.list-table th.size{width:10%;} .list-table td,.list-table th{padding:0 8px;text-align:left;float:left;line-height:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} - .list-table td button,.list-table th button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} - .list-table td button:hover,.list-table th button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=20);opacity:0.2;z-index:2;} + .list-table td button,.list-table th button,.swal-button{border-radius:16px;transition-duration: 0.3s;cursor:pointer;color:#24292e;height:24px;padding: 0 8px;background:transparent;border:1px solid rgba(27,31,35,0);font-weight:bold;} + .list-table td button:hover,.list-table th button:hover,.swal-button:hover{color:#FFF;background:rgba(3,102,214,0.6);border:1px solid rgba(27,31,35,.15);box-shadow:0 1px 15px rgba(27,31,35,.15);} + .list-table .size,.list-table .updated_at{text-align:right} + .mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=30);opacity:0.3;z-index:2;} .operate{display:inline-table;margin:0;margin-right:5px;list-style:none} .operate ul{position:absolute;display:none;background:white;transition-duration: 0.3s;box-shadow:0 1px 15px rgba(27,31,35,.15);border:1px solid rgba(27,31,35,.15);border-radius:32px;margin:-7px 0 0 0;padding:0 3px;color:#205D67;z-index:3;} @@ -397,7 +399,7 @@ echo ''; if ($_SERVER['admin']) { ?>
    - +
    @@ -428,7 +430,7 @@ echo '';
    - +
    @@ -530,7 +532,7 @@ echo ''; : - + : @@ -561,7 +563,9 @@ echo '';
    -
    +
    Power byTfo's Theme for OneManager-php
    +
    + @@ -720,6 +724,10 @@ echo ''; $readme.innerHTML = marked(document.getElementById('readme-md').innerText); } function showthumbnails(obj) { + swal("Loading Thumbnails", { + buttons: false, + timer: 1000, + }); var files=document.getElementsByName('filelist'); for ($i=0;$i'; tmptextarea.select(); tmptextarea.setSelectionRange(0, tmptextarea.value.length); document.execCommand("copy"); - alert(tmptextarea.innerHTML+""); + swal(tmptextarea.innerHTML+''); } var sort=0; function sortby(string) { @@ -894,7 +902,6 @@ echo ''; var tr1=document.createElement('tr'); table1.appendChild(tr1); tr1.setAttribute('data-to',1); - tr1.setAttribute('style','height:fit-content'); var td1=document.createElement('td'); tr1.appendChild(td1); td1.setAttribute('style','width:fit-content'); @@ -1042,7 +1049,7 @@ echo ''; //if (xhr4.status==409) filename = filemd5 + file.name.substr(file.name.indexOf('.')); filename = JSON.parse(xhr4.responseText)['name']; if (filename=='') { - alert(''); + swal(''); uploadbuttonshow(); return; } @@ -1176,7 +1183,7 @@ echo ''; html=JSON.parse(xhr.responseText); addelement(html); } - } else alert(xhr.status+'\n'+xhr.responseText); + } else swal(xhr.status+'\n'+xhr.responseText); document.getElementById(str+'_div').style.display='none'; document.getElementById('mask').style.display='none'; } From 7f07ab1b3827b356b20d5afba0c99afe198a1125 Mon Sep 17 00:00:00 2001 From: 186526 <60814874+186526@users.noreply.github.com> Date: Sun, 7 Jun 2020 17:57:09 +0800 Subject: [PATCH 11/27] Add New Theme Name renexmoe (#72) --- theme/renexmoe.html | 602 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 602 insertions(+) create mode 100644 theme/renexmoe.html diff --git a/theme/renexmoe.html b/theme/renexmoe.html new file mode 100644 index 0000000..b880215 --- /dev/null +++ b/theme/renexmoe.html @@ -0,0 +1,602 @@ + +{ + "music":"audiotrack", + "video":"ondemand_video", + "img":"image", + "default":"insert_drive_file" +} + + + + + + + + <!--Title--> + + + + + + + + + + + + + +
    +
    + menu + + + chevron_right + + +
    + + format_list_bulleted + +
    +
    + +
    +
    +
  • + brightness_4 + 深色模式 +
  • +
  • + home + +
  • + + + > + cloud +
    +
    + + + + code +
    Github
    +
    + + + + + + +
    + +
    +
    + https + + +
    +
    + +
    +
    + + + + + + + +--> + + + +
    + +
    + +
    + + +
    +
    +
    + + +
    + +
    + + +
    + +
    + + + + +
    +
    +
    + + + +
    + +
    +file_download + + + + +
    +
    +
    + +
    + +
    + + +
    + + +
    + + + +
    +
    + +
    +
    + +
    + + +
    + + +
    + +
    + +
    +
    + + + + + + + + From 53f88aa506f9beec678ba05ddd2e378121bfbe95 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 7 Jun 2020 18:43:47 +0800 Subject: [PATCH 12/27] Alifc (#73) * Update index.php * Update common.php * Update and rename scf.php to tencentscf.php * Create alifc.php * Update common.php * Update alifc.php * Update alifc.php * Update alifc.php * Update normal.php * Update common.php * Update common.php * Update conststr.php * Update normal.php * Update normal.php * Update conststr.php * Update index.php * Update common.php * Rename alifc.php to AliyunFC.php * Rename heroku.php to Heroku.php * Rename normal.php to Normal.php * Rename tencentscf.php to TencentSCF.php * Update common.php * Update conststr.php * Update common.php * Update common.php * Update common.php --- common.php | 136 +++++++-- conststr.php | 10 +- index.php | 65 ++++- platform/AliyunFC.php | 397 +++++++++++++++++++++++++++ platform/{heroku.php => Heroku.php} | 0 platform/{normal.php => Normal.php} | 68 ++++- platform/{scf.php => TencentSCF.php} | 2 + 7 files changed, 645 insertions(+), 33 deletions(-) create mode 100644 platform/AliyunFC.php rename platform/{heroku.php => Heroku.php} (100%) rename platform/{normal.php => Normal.php} (79%) rename platform/{scf.php => TencentSCF.php} (96%) diff --git a/common.php b/common.php index 61838da..de54a53 100644 --- a/common.php +++ b/common.php @@ -5,6 +5,8 @@ $Base64Env = [ //'Region', // used in SCF. //'SecretId', // used in SCF. //'SecretKey', // used in SCF. + //'AccessKeyID', // used in FC. + //'AccessKeySecret', // used in FC. //'admin', //'adminloginpage', 'background', @@ -33,6 +35,7 @@ $Base64Env = [ //'sharecookie', 'shareapiurl', //'siteid', + 'domainforproxy', 'public_path', //'refresh_token', //'token_expires', @@ -43,6 +46,8 @@ $CommonEnv = [ 'Region', // used in SCF. 'SecretId', // used in SCF. 'SecretKey', // used in SCF. + 'AccessKeyID', // used in FC. + 'AccessKeySecret', // used in FC. 'admin', 'adminloginpage', 'background', @@ -64,6 +69,8 @@ $ShowedCommonEnv = [ //'Region', // used in SCF. //'SecretId', // used in SCF. //'SecretKey', // used in SCF. + //'AccessKeyID', // used in FC. + //'AccessKeySecret', // used in FC. //'admin', 'adminloginpage', 'background', @@ -95,6 +102,7 @@ $InnerEnv = [ 'shareurl', //'sharecookie', 'shareapiurl', + 'domainforproxy', 'public_path', 'refresh_token', 'token_expires', @@ -115,6 +123,7 @@ $ShowedInnerEnv = [ //'shareurl', //'sharecookie', //'shareapiurl', + 'domainforproxy', 'public_path', //'refresh_token', //'token_expires', @@ -317,6 +326,10 @@ function main($path) $files = list_files($path); //echo json_encode(array_keys($files['children']), JSON_PRETTY_PRINT); + if ($_GET['json']) { + // return a json + return files_json($files); + } if (isset($_GET['random'])&&$_GET['random']!=='') { if ($_SERVER['ishidden']<4) { $tmp = []; @@ -325,14 +338,29 @@ function main($path) } $tmp = array_values($tmp); if (count($tmp)>0) { - if (isset($_GET['url'])) return output($tmp[rand(0,count($tmp)-1)], 200); - return output('', 302, [ 'Location' => $tmp[rand(0,count($tmp)-1)] ]); + $url = $tmp[rand(0,count($tmp)-1)]; + if (isset($_GET['url'])) return output($url, 200); + $domainforproxy = ''; + $domainforproxy = getConfig('domainforproxy'); + if ($domainforproxy!='') { + $url = proxy_replace_domain($url, $domainforproxy); + } + return output('', 302, [ 'Location' => $url ]); } else return output('',404); } else return output('',401); } if (isset($files['file']) && !isset($_GET['preview'])) { // is file && not preview mode - if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) return output('', 302, [ 'Location' => $files[$_SERVER['DownurlStrName']] ]); + if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) { + $url = $files[$_SERVER['DownurlStrName']]; + $domainforproxy = ''; + $domainforproxy = getConfig('domainforproxy'); + if ($domainforproxy!='') { + $url = proxy_replace_domain($url, $domainforproxy); + } + if ( strtolower(splitlast($files['name'],'.')[1])=='html' ) return output($files['content']['body'], $files['content']['stat']); + else return output('', 302, [ 'Location' => $url ]); + } } if ( isset($files['folder']) || isset($files['file']) ) { return render_list($path, $files); @@ -347,6 +375,54 @@ function main($path) } } +function proxy_replace_domain($url, $domainforproxy) +{ + $tmp = splitfirst($url, '//'); + $http = $tmp[0]; + $tmp = splitfirst($tmp[1], '/'); + $domain = $tmp[0]; + $uri = $tmp[1]; + if (substr($domainforproxy, 0, 7)=='http://' || substr($domainforproxy, 0, 8)=='https://') $aim = $domainforproxy; + else $aim = $http . '//' . $domainforproxy; + if (substr($aim, -1)=='/') $aim = substr($aim, 0, -1); + return $aim . '/' . $uri . '&Origindomain=' . $domain; + //$url = str_replace($tmp, $domainforproxy, $url).'&Origindomain='.$tmp; +} + +function files_json($files) +{ + //$tmp = ''; + if (isset($files['file'])) { + $tmp['file']['type'] = 0; + $tmp['file']['id'] = $files['id']; + $tmp['file']['name'] = $files['name']; + $tmp['file']['time'] = $files['lastModifiedDateTime']; + $tmp['file']['size'] = $files['size']; + $tmp['file']['mime'] = $files['file']['mimeType']; + $tmp['file']['url'] = $files[$_SERVER['DownurlStrName']]; + $tmp['url'] = $files[$_SERVER['DownurlStrName']]; + } elseif (isset($files['folder'])) { + $tmp['list'] = []; + foreach ($files['children'] as $file) { + $tmp1 = null; + $tmp1 = []; + if (isset($file['file'])) { + $tmp1['type'] = 0; + $tmp1['url'] = $file[$_SERVER['DownurlStrName']]; + } elseif (isset($file['folder'])) { + $tmp1['type'] = 1; + } + $tmp1['id'] = $file['id']; + $tmp1['name'] = $file['name']; + $tmp1['time'] = $file['lastModifiedDateTime']; + $tmp1['size'] = $file['size']; + $tmp1['mime'] = $file['file']['mimeType']; + array_push($tmp['list'], $tmp1); + } + } else return output('', 404); + return output(json_encode($tmp)); +} + function get_access_token($refresh_token) { if (getConfig('Drive_ver')=='shareurl') { @@ -802,8 +878,15 @@ function get_thumbnails_url($path = '/', $location = 0) } } if ($thumb_url!='') { - if ($location) return output('', 302, [ 'Location' => $thumb_url ]); - else return output($thumb_url); + if ($location) { + $url = $thumb_url; + $domainforproxy = ''; + $domainforproxy = getConfig('domainforproxy'); + if ($domainforproxy!='') { + $url = proxy_replace_domain($url, $domainforproxy); + } + return output('', 302, [ 'Location' => $url ]); + } else return output($thumb_url); } return output('', 404); } @@ -1541,11 +1624,10 @@ function EnvOpt($needUpdate = 0) }*/ $response = setConfigResponse( setConfig($tmp, $_SERVER['disk_oprating']) ); if (api_error($response)) { - $html = api_error_msg($response); - $title = 'Error'; - } else { + $html = api_error_msg($response); + $title = 'Error'; + } else { //WaitSCFStat(); - //sleep(3); $html .= getconstStr('Success') . '!
    '; $title = getconstStr('Setup'); @@ -1655,16 +1737,30 @@ function EnvOpt($needUpdate = 0) } $html .= ' '.getconstStr('AddDisk').'

    '; - if (!((isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud')||(isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app'))) { + + $canOneKeyUpate = 0; + if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { + $canOneKeyUpate = 1; + } elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') { + $canOneKeyUpate = 1; + } elseif (isset($_SERVER['FC_SERVER_PATH'])&&$_SERVER['FC_SERVER_PATH']==='/var/fc/runtime/php7.2') { + $canOneKeyUpate = 1; + } else { + $tmp = time(); + if ( mkdir(''.$tmp, 0777) ) { + rmdir(''.$tmp); + $canOneKeyUpate = 1; + } + } + if (!$canOneKeyUpate) { $html .= ' -'.getconstStr('VPSnotupdate').'
    '; +'.getconstStr('CannotOneKeyUpate').'
    '; } else { $html .= '
    - - - - + + + @@ -1673,7 +1769,6 @@ function EnvOpt($needUpdate = 0) ', 'Program updating', 201); + } + return output('Jump', 302); + } + if ($_GET['install1']) { + //if ($_POST['admin']!='') { + $tmp['timezone'] = $_COOKIE['timezone']; + $AccessKeyID = getConfig('AccessKeyID'); + if ($AccessKeyID=='') { + $AccessKeyID = $_POST['AccessKeyID']; + $tmp['AccessKeyID'] = $AccessKeyID; + } + $AccessKeySecret = getConfig('AccessKeySecret'); + if ($AccessKeySecret=='') { + $AccessKeySecret = $_POST['AccessKeySecret']; + $tmp['AccessKeySecret'] = $AccessKeySecret; + } + $response = json_decode(SetbaseConfig($tmp, $_SERVER['accountId'], $_SERVER['region'], $_SERVER['service_name'], $_SERVER['function_name'], $AccessKeyID, $AccessKeySecret), true); + if (api_error($response)) { + $html = api_error_msg($response); + $title = 'Error'; + return message($html, $title, 201); + } else { + $html .= ' + +
    + +
    + '; + $title = getconstStr('SetAdminPassword'); + return message($html, $title, 201); + } + //} + } + if ($_GET['install0']) { + $html .= ' +
    +language:
    '; + foreach ($constStr['languages'] as $key1 => $value1) { + $html .= ' +
    '; + } + if (getConfig('AccessKeyID')==''||getConfig('AccessKeySecret')=='') $html .= ' + '.getconstStr('Create').' AccessKeyID & AccessKeySecret
    +
    +
    '; + $html .= ' + +
    + '; + $title = getconstStr('SelectLanguage'); + return message($html, $title, 201); + } + $html .= ''.getconstStr('ClickInstall').', '.getconstStr('LogintoBind'); + $title = 'Error'; + return message($html, $title, 201); +} + +function getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret) +{ + $fcClient = new Client([ + "endpoint" => 'https://'.$accountId.'.'.$region.'.fc.aliyuncs.com', + "accessKeyID" => $AccessKeyID, + "accessKeySecret" => $AccessKeySecret + ]); + return $fcClient->getFunction($service_name, $function_name); +} + +function updateEnvironment($Envs, $accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret) +{ + //print_r($Envs); + $fcClient = new Client([ + "endpoint" => 'https://'.$accountId.'.'.$region.'.fc.aliyuncs.com', + "accessKeyID" => $AccessKeyID, + "accessKeySecret" => $AccessKeySecret + ]); + $tmp = $fcClient->getFunction($service_name, $function_name)['data']; + //$tmp = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']; + foreach ($tmp['environmentVariables'] as $key => $value ) { + $tmp_env[$key] = $value; + } + foreach ($Envs as $key1 => $value1) { + $tmp_env[$key1] = $value1; + } + $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值 + ksort($tmp_env); + + $tmpdata['functionName'] = $tmp['functionName']; + $tmpdata['description'] = $tmp['description']; + $tmpdata['memorySize'] = $tmp['memorySize']; + $tmpdata['timeout'] = $tmp['timeout']; + $tmpdata['runtime'] = $tmp['runtime']; + $tmpdata['handler'] = $tmp['handler']; + $tmpdata['environmentVariables'] = $tmp_env; + $tmpdata['code']['zipFile'] = base64_encode( file_get_contents($fcClient->getFunctionCode($service_name, $function_name)['data']['url']) ); + return $fcClient->updateFunction($service_name, $function_name, $tmpdata); +} + +function SetbaseConfig($Envs, $accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret) +{ + //echo json_encode($Envs,JSON_PRETTY_PRINT); + $fcClient = new Client([ + "endpoint" => 'https://'.$accountId.'.'.$region.'.fc.aliyuncs.com', + "accessKeyID" => $AccessKeyID, + "accessKeySecret" => $AccessKeySecret + ]); + $tmp = $fcClient->getFunction($service_name, $function_name)['data']; + // $tmp = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']; + foreach ($tmp['environmentVariables'] as $key => $value ) { + $tmp_env[$key] = $value; + } + foreach ($Envs as $key1 => $value1) { + $tmp_env[$key1] = $value1; + } + $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值 + ksort($tmp_env); + + $tmpdata['functionName'] = $function_name; + $tmpdata['description'] = 'Onedrive index and manager in Ali FC.'; + $tmpdata['memorySize'] = 128; + $tmpdata['timeout'] = 30; + $tmpdata['runtime'] = 'php7.2'; + $tmpdata['handler'] = 'index.handler'; + $tmpdata['environmentVariables'] = $tmp_env; + $tmpdata['code']['zipFile'] = base64_encode( file_get_contents($fcClient->getFunctionCode($service_name, $function_name)['data']['url']) ); + return $fcClient->updateFunction($service_name, $function_name, $tmpdata); +} + +function updateProgram($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret, $source) +{ + //WaitSCFStat(); + $fcClient = new Client([ + "endpoint" => 'https://'.$accountId.'.'.$region.'.fc.aliyuncs.com', + "accessKeyID" => $AccessKeyID, + "accessKeySecret" => $AccessKeySecret + ]); + $tmp = $fcClient->getFunction($service_name, $function_name)['data']; + //$tmp = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']; + + $tmpdata['functionName'] = $tmp['functionName']; + $tmpdata['description'] = $tmp['description']; + $tmpdata['memorySize'] = $tmp['memorySize']; + $tmpdata['timeout'] = $tmp['timeout']; + $tmpdata['runtime'] = $tmp['runtime']; + $tmpdata['handler'] = $tmp['handler']; + $tmpdata['environmentVariables'] = $tmp['environmentVariables']; + $tmpdata['code']['zipFile'] = base64_encode( file_get_contents($source) ); + + return $fcClient->updateFunction($service_name, $function_name, $tmpdata); +} + +function api_error($response) +{ + return !isset($response['data']); +} + +function api_error_msg($response) +{ + return $response; + return $response['Error']['Code'] . '
    +' . $response['Error']['Message'] . '

    +function_name:' . $_SERVER['function_name'] . '
    +Region:' . $_SERVER['Region'] . '
    +namespace:' . $_SERVER['namespace'] . '
    +'; +} + +function setConfigResponse($response) +{ + return $response; +} + +function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master') +{ + $source = '/tmp/code.zip'; + $outPath = '/tmp/'; + + // 从github下载对应tar.gz,并解压 + $url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/'; + $tarfile = '/tmp/github.tar.gz'; + file_put_contents($tarfile, file_get_contents($url)); + $phar = new PharData($tarfile); + $html = $phar->extractTo($outPath, null, true);//路径 要解压的文件 是否覆盖 + + // 获取解压出的目录名 +/* + @ob_start(); + passthru('ls /tmp | grep '.$auth.'-'.$project.'',$stat); + $html.='状态:' . $stat . ' + 结果: + '; + $archivefolder = ob_get_clean(); + if (substr($archivefolder,-1)==PHP_EOL) $archivefolder = substr($archivefolder, 0, -1); + $outPath .= $archivefolder; + $html.=htmlspecialchars($archivefolder); + //return $html; +*/ + $tmp = scandir($outPath); + $name = $auth.'-'.$project; + foreach ($tmp as $f) { + if ( substr($f, 0, strlen($name)) == $name) { + $outPath .= $f; + break; + } + } + + // 将目录中文件打包成zip + $zip=new ZipArchive(); + if($zip->open($source, ZipArchive::CREATE)){ + addFileToZip($zip, $outPath); //调用方法,对要打包的根目录进行操作,并将ZipArchive的对象传递给方法 + $zip->close(); //关闭处理的zip文件 + } + + return updateProgram($_SERVER['accountId'], $_SERVER['region'], $_SERVER['service_name'], $_SERVER['function_name'], getConfig('AccessKeyID'), getConfig('AccessKeySecret'), $source); +} + +function addFileToZip($zip, $rootpath, $path = '') +{ + if (substr($rootpath,-1)=='/') $rootpath = substr($rootpath, 0, -1); + if (substr($path,0,1)=='/') $path = substr($path, 1); + $handler=opendir(path_format($rootpath.'/'.$path)); //打开当前文件夹由$path指定。 + while($filename=readdir($handler)){ + if($filename != "." && $filename != ".."){//文件夹文件名字为'.'和‘..’,不要对他们进行操作 + $nowname = path_format($rootpath.'/'.$path."/".$filename); + if(is_dir($nowname)){// 如果读取的某个对象是文件夹,则递归 + addFileToZip($zip, $rootpath, $path."/".$filename); + }else{ //将文件加入zip对象 + $zip->addFile($nowname); + $newname = $path."/".$filename; + if (substr($newname,0,1)=='/') $newname = substr($newname, 1); + $zip->renameName($nowname, $newname); + } + } + } + @closedir($path); +} diff --git a/platform/heroku.php b/platform/Heroku.php similarity index 100% rename from platform/heroku.php rename to platform/Heroku.php diff --git a/platform/normal.php b/platform/Normal.php similarity index 79% rename from platform/normal.php rename to platform/Normal.php index c56577b..0149a95 100644 --- a/platform/normal.php +++ b/platform/Normal.php @@ -252,12 +252,70 @@ Can not write config to file.
    '; } -function OnekeyUpate() -{ - return json_decode(updateHerokuapp(getConfig('function_name'), getConfig('APIKey'))['body'], true); -} - function setConfigResponse($response) { return $response; } + +function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master') +{ + // __DIR__ is xxx/platform + $projectPath = splitlast(__DIR__, '/')[0]; + + // 从github下载对应tar.gz,并解压 + $url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/'; + $tarfile = $projectPath.'/github.tar.gz'; + $githubfile = file_get_contents($url); + if (!$githubfile) return 0; + file_put_contents($tarfile, $githubfile); + if (splitfirst(PHP_VERSION, '.')[0] == '7') { + $phar = new PharData($tarfile); // need php7 + $phar->extractTo($projectPath, null, true);//路径 要解压的文件 是否覆盖 + } else { + ob_start(); + passthru('tar -xzvf '.$tarfile,$stat); + ob_get_clean(); + } + unlink($tarfile); + + $outPath = ''; + $tmp = scandir($projectPath); + $name = $auth.'-'.$project; + foreach ($tmp as $f) { + if ( substr($f, 0, strlen($name)) == $name) { + $outPath = $projectPath . '/' . $f; + break; + } + } + //error_log($outPath); + if ($outPath=='') return 0; + + //unlink($outPath.'/config.php'); + rename($projectPath.'/config.php', $outPath.'/config.php'); + + return moveFolder($outPath, $projectPath); +} + +function moveFolder($from, $to) +{ + if (substr($from, -1)=='/') $from = substr($from, 0, -1); + if (substr($to, -1)=='/') $to = substr($to, 0, -1); + if (!file_exists($to)) mkdir($to, 0777); + $handler=opendir($from); + while($filename=readdir($handler)) { + if($filename != '.' && $filename != '..'){ + $fromfile = $from.'/'.$filename; + $tofile = $to.'/'.$filename; + if(is_dir($fromfile)){// 如果读取的某个对象是文件夹,则递归 + moveFolder($fromfile, $tofile); + }else{ + //if (file_exists($tofile)) unlink($tofile); + rename($fromfile, $tofile); + if (file_exists($fromfile)) unlink($fromfile); + } + } + } + closedir($handler); + rmdir($from); + return 1; +} diff --git a/platform/scf.php b/platform/TencentSCF.php similarity index 96% rename from platform/scf.php rename to platform/TencentSCF.php index f37a687..497d110 100644 --- a/platform/scf.php +++ b/platform/TencentSCF.php @@ -23,6 +23,8 @@ function GetGlobalVariable($event) $pos = strpos($cookievalues,"="); $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1)); } + $_SERVER['HTTP_USER_AGENT'] = $event['headers']['user-agent']; + $_SERVER['HTTP_TRANSLATE']==$event['headers']['translate'];//'f' $_SERVER['USER'] = 'qcloud'; } From 44bedf16a750ae8063c39a2aa93066728c0bbb12 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 7 Jun 2020 18:55:18 +0800 Subject: [PATCH 13/27] Update readme.md --- readme.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 7c4aca2..77e5ee0 100644 --- a/readme.md +++ b/readme.md @@ -21,16 +21,26 @@ How to Install: 5.View the website in chrome or other. 在浏览器中访问。 -# Deploy to SCF +# Deploy to Tencent Serverless Cloud Function (腾讯无服务器云函数 SCF) Official: https://cloud.tencent.com/product/scf ~~How to Install: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/%E6%97%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%BD%E6%95%B0SCF%E6%90%AD%E5%BB%BAOneDrive.mp4?preview~~ - -先手动在环境变量添加Region,ap-hongkong或ap-guangzhou之类,具体看 https://cloud.tencent.com/document/api/583/17238 最底下,然后再安装。 + 添加网盘时,SCF反应不过来,会添加失败,请不要删除,再添加一次相同的就可以了。 DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/ +# Deploy to Aliyun Function Compute (阿里函数计算 FC) +Official: https://fc.console.aliyun.com/ + +How to Install: +1,新建函数 -- HTTP函数 +2,运行环境选择php7.2 +3,触发器认证方式选择anonymous,请求方式里面,点一下GET,再点一下POST,最终框框里面有这2个 +4,上传代码,开始安装 + +DEMO: 无 + # Features 特性 When downloading files, the program produce a direct url, visitor download files from MS OFFICE via the direct url, the server expend a few bandwidth in produce. 下载时,由程序解析出直链,浏览器直接从微软Onedrive服务器下载文件,服务器只消耗与微软通信的少量流量。 From e439ed8e68c4ae0d8d42bc5c293a3ba06aa1bc9c Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 7 Jun 2020 19:02:16 +0800 Subject: [PATCH 14/27] Update version --- version | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/version b/version index d613890..0093d75 100644 --- a/version +++ b/version @@ -1,7 +1,10 @@ +20200607-1856.19 +add platform: Aliyun Function Compute. add setting: replace sharepoint.com to a proxy server name. add setting: disableShowThumb,customTheme. add function: php hosting website can update by a click +现在可以安装到阿里函数计算FC了。php空间可以一键更新了。可以设置某个盘替换sharpoint.com域名为你的反代域名。新增disableShowThumb,customTheme。 + 20200503-1848.18 Rebuild theme. Add custom Css & custom Script, add FunctionalityFile: head.omf & foot.omf. 重建主题文件结构。增加自定义css与自定义script。增加2个功能文件:head.omf、foot.omf。 - 20200402-1830.17 Oneclick update can select which branch to update. Now use the accept language instead of the language config. 一键更新可以选择哪个分支了。现在开始使用浏览器语言,抛弃language设置。 From bb8c1afc585387de46a67c838e70ecfd3b5de7c9 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:22:08 +0800 Subject: [PATCH 15/27] fix: Error in install --- platform/AliyunFC.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/AliyunFC.php b/platform/AliyunFC.php index f9e13c4..295faf6 100644 --- a/platform/AliyunFC.php +++ b/platform/AliyunFC.php @@ -141,7 +141,7 @@ function install() $AccessKeySecret = $_POST['AccessKeySecret']; $tmp['AccessKeySecret'] = $AccessKeySecret; } - $response = json_decode(SetbaseConfig($tmp, $_SERVER['accountId'], $_SERVER['region'], $_SERVER['service_name'], $_SERVER['function_name'], $AccessKeyID, $AccessKeySecret), true); + $response = SetbaseConfig($tmp, $_SERVER['accountId'], $_SERVER['region'], $_SERVER['service_name'], $_SERVER['function_name'], $AccessKeyID, $AccessKeySecret); if (api_error($response)) { $html = api_error_msg($response); $title = 'Error'; @@ -317,7 +317,7 @@ function api_error($response) function api_error_msg($response) { - return $response; + return json_encode( $response, JSON_PRETTY_PRINT ); return $response['Error']['Code'] . '
    ' . $response['Error']['Message'] . '

    function_name:' . $_SERVER['function_name'] . '
    From 4b816fb206ca9f8b55e43b694377db89a1702a2a Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:41:35 +0800 Subject: [PATCH 16/27] Update readme.md --- readme.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 77e5ee0..810f6f0 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,17 @@ How to Install: Click the button [![Deploy](https://www.herokucdn.com/deploy/but DEMO: https://herooneindex.herokuapp.com/ + +# Deploy to Tencent Serverless Cloud Function (腾讯无服务器云函数 SCF) +Official: https://cloud.tencent.com/product/scf + +~~How to Install: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/%E6%97%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%BD%E6%95%B0SCF%E6%90%AD%E5%BB%BAOneDrive.mp4?preview~~ + +添加网盘时,SCF反应不过来,会添加失败,请不要删除,再添加一次相同的就可以了。 + +DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/ + + # Deploy to VPS(Virtual Private Server) 部署到VPS或空间 How to Install: 1.Start web service on your server (httpd or other), make sure you can visit it. @@ -21,14 +32,6 @@ How to Install: 5.View the website in chrome or other. 在浏览器中访问。 -# Deploy to Tencent Serverless Cloud Function (腾讯无服务器云函数 SCF) -Official: https://cloud.tencent.com/product/scf - -~~How to Install: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/%E6%97%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%BD%E6%95%B0SCF%E6%90%AD%E5%BB%BAOneDrive.mp4?preview~~ - -添加网盘时,SCF反应不过来,会添加失败,请不要删除,再添加一次相同的就可以了。 - -DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/ # Deploy to Aliyun Function Compute (阿里函数计算 FC) Official: https://fc.console.aliyun.com/ @@ -37,10 +40,13 @@ How to Install: 1,新建函数 -- HTTP函数 2,运行环境选择php7.2 3,触发器认证方式选择anonymous,请求方式里面,点一下GET,再点一下POST,最终框框里面有这2个 -4,上传代码,开始安装 +4,上传代码 +5,触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。 +6,访问你的域名,开始安装 DEMO: 无 + # Features 特性 When downloading files, the program produce a direct url, visitor download files from MS OFFICE via the direct url, the server expend a few bandwidth in produce. 下载时,由程序解析出直链,浏览器直接从微软Onedrive服务器下载文件,服务器只消耗与微软通信的少量流量。 From a1268da0fe2fb5611bb39e4a9a42b37dac921a36 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 13 Jun 2020 17:44:24 +0800 Subject: [PATCH 17/27] Guest upload folder will Encrypted after uploaded --- common.php | 117 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 43 deletions(-) diff --git a/common.php b/common.php index de54a53..401a165 100644 --- a/common.php +++ b/common.php @@ -1995,47 +1995,6 @@ function render_list($path = '', $files = '') while (strpos($html, '')) $html = str_replace('', '', $html); } - if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { - $tmp[1] = 'a'; - while ($tmp[1]!='') { - $tmp = splitfirst($html, ''); - $html = $tmp[0]; - $tmp = splitfirst($tmp[1], ''); - $html .= $tmp[1]; - } - $tmp[1] = 'a'; - while ($tmp[1]!='') { - $tmp = splitfirst($html, ''); - $html = $tmp[0]; - $tmp = splitfirst($tmp[1], ''); - $html .= $tmp[1]; - } - while (strpos($html, '')) { - $tmp = splitfirst($html, ''); - $html = $tmp[0]; - $tmp = splitfirst($tmp[1], ''); - $html .= $tmp[1]; - } - while (strpos($html, '')) { - $html = str_replace('', '', $html); - $html = str_replace('', '', $html); - } - } - if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) { - while (strpos($html, '')) { - while (strpos($html, '')) $html = str_replace('', '', $html); - while (strpos($html, '')) $html = str_replace('', '', $html); - while (strpos($html, '')) $html = str_replace('', getconstStr('Calculate'), $html); - } - } else { - $tmp[1] = 'a'; - while ($tmp[1]!='') { - $tmp = splitfirst($html, ''); - $html = $tmp[0]; - $tmp = splitfirst($tmp[1], ''); - $html .= $tmp[1]; - } - } if ($_SERVER['ishidden']==4) { $tmp[1] = 'a'; while ($tmp[1]!='') { @@ -2076,9 +2035,79 @@ function render_list($path = '', $files = '') $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } + while (strpos($html, '')) { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + } else { + while (strpos($html, '')) { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + while (strpos($html, '')) { + $html = str_replace('', '', $html); + $html = str_replace('', '', $html); + } } while (strpos($html, '')) $html = str_replace('', getconstStr('Download'), $html); + if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { + $tmp[1] = 'a'; + while ($tmp[1]!='') { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + $tmp[1] = 'a'; + while ($tmp[1]!='') { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + while (strpos($html, '')) { + $html = str_replace('', '', $html); + $html = str_replace('', '', $html); + } + while (strpos($html, '')) { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + } else { + while (strpos($html, '')) { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + while (strpos($html, '')) { + $html = str_replace('', '', $html); + $html = str_replace('', '', $html); + } + } + if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) { + while (strpos($html, '')) { + while (strpos($html, '')) $html = str_replace('', '', $html); + while (strpos($html, '')) $html = str_replace('', '', $html); + while (strpos($html, '')) $html = str_replace('', getconstStr('Calculate'), $html); + } + } else { + $tmp[1] = 'a'; + while ($tmp[1]!='') { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } + } + if (isset($files['children'])) { while (strpos($html, '')) { $tmp = splitfirst($html, ''); @@ -2613,10 +2642,12 @@ function render_list($path = '', $files = '') // 最后清除换行 while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html); + //while (strpos($html, "\r\r")) $html = str_replace("\r\r", "\r", $html); + while (strpos($html, "\n\n")) $html = str_replace("\n\n", "\n", $html); //while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html); $exetime = round(microtime(true)-$_SERVER['php_starttime'],3); - $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html); + $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runningtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html); } $theme_arr = scandir('theme'); @@ -2632,7 +2663,7 @@ function render_list($path = '', $files = '') //if ($tmp!='') $html .= ' // '; $html .= ' - + From 562ee87eef3176325fe00715d94872492d4a9d79 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 15 Jun 2020 09:53:27 +0800 Subject: [PATCH 20/27] remove space --- theme/nexmoe1.html | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/theme/nexmoe1.html b/theme/nexmoe1.html index f27a55f..725c9c8 100644 --- a/theme/nexmoe1.html +++ b/theme/nexmoe1.html @@ -51,8 +51,8 @@ /*.mdui-toolbar>*{display:none}*/ .mdui-toolbar>a:last-child,.mdui-toolbar>.mdui-typo-headline,.mdui-toolbar>i:first-child{display:block} } - - + + @@ -188,7 +188,6 @@ width:100% !important; height:230px; } - .thumb .mdui-list-item .mdui-icon{ font-size:100px; display: block; @@ -203,7 +202,6 @@ position: absolute; top: 180px; } -
    @@ -253,24 +251,23 @@ -
    - -
  • -
    + + +
  • +
    - + - + -
    -
    -
    Page: /
    -
    -
  • -
    +
    +
    +
    Page: /
    +
    + + - @@ -302,11 +299,9 @@ } $ = mdui.JQ; - $.fn.extend({ sortElements: function (comparator, getSortable) { getSortable = getSortable || function () { return this; }; - var placements = this.map(function () { var sortElement = getSortable.call(this), parentNode = sortElement.parentNode, @@ -314,24 +309,21 @@ document.createTextNode(''), sortElement.nextSibling ); - return function () { parentNode.insertBefore(this, nextSibling); parentNode.removeChild(nextSibling); }; }); - return [].sort.call(this, comparator).each(function (i) { placements[i].call(getSortable.call(this)); }); } }); - + function downall() { let dl_link_list = Array.from(document.querySelectorAll("li a")) .map(x => x.href) // 所有list中的链接 .filter(x => x.slice(-1) != "/"); // 筛选出非文件夹的文件下载链接 - let blob = new Blob([dl_link_list.join("\r\n")], { type: 'text/plain' }); // 构造Blog对象 @@ -360,7 +352,6 @@ } }); } - } $(function(){ @@ -373,23 +364,17 @@ return false; }); }); - $('.icon-sort').on('click', function () { let sort_type = $(this).attr("data-sort"), sort_order = $(this).attr("data-order"); let sort_order_to = (sort_order === "less") ? "more" : "less"; - $('li[data-sort]').sortElements(function (a, b) { let data_a = $(a).attr("data-sort-" + sort_type), data_b = $(b).attr("data-sort-" + sort_type); let rt = data_a.localeCompare(data_b, undefined, {numeric: true}); return (sort_order === "more") ? 0-rt : rt; }); - $(this).attr("data-order", sort_order_to).text("expand_" + sort_order_to); }); - }); - - From 23729cc5641aeac99053fd35d9242f9ba3207f2a Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 19 Jun 2020 15:20:48 +0800 Subject: [PATCH 21/27] Update readme.md --- readme.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 810f6f0..0dc91bc 100644 --- a/readme.md +++ b/readme.md @@ -1,25 +1,23 @@ Install program first, then add onedrive in setup after login. 先安装程序,登录后在设置中添加onedrive。 -# Deploy to heroku +# Deploy to Heroku Official: https://heroku.com How to Install: Click the button [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/qkqpttgf/OneManager-php) to Deploy a new app, or create an app then deploy via connect to your github fork. -DEMO: https://herooneindex.herokuapp.com/ - -# Deploy to Tencent Serverless Cloud Function (腾讯无服务器云函数 SCF) +# Deploy to Tencent Serverless Cloud Function (SCF 腾讯无服务器云函数) Official: https://cloud.tencent.com/product/scf +DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/ ~~How to Install: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/%E6%97%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%BD%E6%95%B0SCF%E6%90%AD%E5%BB%BAOneDrive.mp4?preview~~ 添加网盘时,SCF反应不过来,会添加失败,请不要删除,再添加一次相同的就可以了。 -DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/ - -# Deploy to VPS(Virtual Private Server) 部署到VPS或空间 +# Deploy to Virtual Private Server (VPS 或空间) +DEMO: 无 How to Install: 1.Start web service on your server (httpd or other), make sure you can visit it. 启动web服务器,确保你能访问到。 @@ -33,8 +31,9 @@ How to Install: 在浏览器中访问。 -# Deploy to Aliyun Function Compute (阿里函数计算 FC) +# Deploy to Aliyun Function Compute (FC 阿里函数计算) Official: https://fc.console.aliyun.com/ +DEMO: 无 How to Install: 1,新建函数 -- HTTP函数 @@ -44,8 +43,6 @@ How to Install: 5,触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。 6,访问你的域名,开始安装 -DEMO: 无 - # Features 特性 When downloading files, the program produce a direct url, visitor download files from MS OFFICE via the direct url, the server expend a few bandwidth in produce. From ac2a9910b0e717004b9d2e3513b5540e56a9c040 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 19 Jun 2020 15:21:53 +0800 Subject: [PATCH 22/27] Update readme.md --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 0dc91bc..ea5d7de 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,7 @@ Install program first, then add onedrive in setup after login. # Deploy to Heroku Official: https://heroku.com +Demo: https://herooneindex.herokuapp.com/ How to Install: Click the button [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/qkqpttgf/OneManager-php) to Deploy a new app, or create an app then deploy via connect to your github fork. From 28e2f7b564d7f7ea12e1771aacf87db476dc9e17 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 23 Jun 2020 15:42:57 +0800 Subject: [PATCH 23/27] add a option to display theme selection or not --- common.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common.php b/common.php index 401a165..f2bbb63 100644 --- a/common.php +++ b/common.php @@ -12,6 +12,7 @@ $Base64Env = [ 'background', 'diskname', //'disableShowThumb', + //'disableChangeTheme', //'disktag', //'downloadencrypt', //'function_name', // used in heroku. @@ -53,6 +54,7 @@ $CommonEnv = [ 'background', 'disktag', 'disableShowThumb', + 'disableChangeTheme', 'function_name', // used in heroku. 'hideFunctionalityFile', 'timezone', @@ -76,6 +78,7 @@ $ShowedCommonEnv = [ 'background', //'disktag', 'disableShowThumb', + 'disableChangeTheme', //'function_name', // used in heroku. 'hideFunctionalityFile', 'timezone', @@ -2650,19 +2653,17 @@ function render_list($path = '', $files = '') $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runningtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html); } - $theme_arr = scandir('theme'); - $html .= ' + if ($_SERVER['admin']||!getConfig('disableChangeTheme')) { + $theme_arr = scandir('theme'); + $html .= '
    '; + } $html = $authinfo . $html; if (isset($_SERVER['Set-Cookie'])) return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]); From 7a7342201f7fa57606ef5bcc018a6edbe65f0084 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 23 Jun 2020 15:43:44 +0800 Subject: [PATCH 24/27] add a option to display theme selection or not --- conststr.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conststr.php b/conststr.php index 0fc9558..3a63168 100644 --- a/conststr.php +++ b/conststr.php @@ -73,6 +73,7 @@ $constStr = [ 'diskname' => 'The disk name you want show.', 'disktag' => 'A tag used in store config and url.', 'disableShowThumb' => 'if 1, the ShowThumbnail button will not display', + 'disableChangeTheme' => 'if 1, the Theme selection button will not display', 'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password', 'background' => 'Set an url as background photo.', 'theme' => 'Select theme.', @@ -95,6 +96,7 @@ $constStr = [ 'diskname' => '这个盘你想显示什么名称。', 'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。', 'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。', + 'disableChangeTheme' => '如果填 1, 主题选择切换将被隐藏', 'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。', 'background' => '设置一个url作为背景。', 'theme' => '选择一个主题。', From d5ea792034c597e6a0f43c573526b7644faca62b Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 23 Jun 2020 16:06:44 +0800 Subject: [PATCH 25/27] Update classic.html --- theme/classic.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/theme/classic.html b/theme/classic.html index 8bf93ef..8ce43ad 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -476,7 +476,10 @@ function changelanguage(str) { if (str=='Language') str = ''; - document.cookie='language='+str+'; path=/'; + var expd = new Date(); + expd.setTime(expd.getTime()+(2*60*60*1000)); + var expires = "expires="+expd.toGMTString(); + document.cookie='language='+str+'; path=/; '+expires; location.href = location.href; } From 3bab14d3ea51426c8c0365c18d41648f7d530f70 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 23 Jun 2020 16:27:46 +0800 Subject: [PATCH 26/27] fix favicon --- theme/nchyn_grey.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/nchyn_grey.html b/theme/nchyn_grey.html index 99dd479..f07b8f5 100644 --- a/theme/nchyn_grey.html +++ b/theme/nchyn_grey.html @@ -21,8 +21,8 @@ - - + + From f7cd9e84834a654414b442ad0a8e87e37cf8968e Mon Sep 17 00:00:00 2001 From: 186526 <60814874+186526@users.noreply.github.com> Date: Tue, 23 Jun 2020 18:35:03 +0800 Subject: [PATCH 27/27] Update renexmoe.html (#77) --- theme/renexmoe.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/theme/renexmoe.html b/theme/renexmoe.html index b880215..780a384 100644 --- a/theme/renexmoe.html +++ b/theme/renexmoe.html @@ -292,6 +292,7 @@
  • +
    arrow_upward @@ -299,12 +300,14 @@
    -
    + +
  • -
  • +
  • +
    folder_open @@ -312,7 +315,8 @@
    -
    + +
  • @@ -322,12 +326,12 @@ -->
    -
    +
    -
    -
    +
    +