From 1cc1f60e26ea8b26151e37e3f8374b1b2d57c06e Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 5 Sep 2019 18:34:06 +0800 Subject: [PATCH 01/52] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit urlencode编码显示问题。 --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 677e339..33f893c 100644 --- a/index.js +++ b/index.js @@ -239,6 +239,7 @@ class view{ if(n == ''){ break; } + n = decodeURIComponent(n); html += `chevron_right ${n}`; } @@ -297,6 +298,7 @@ class view{ } layout(title,siteName,nav,content){ + title = decodeURIComponent(title); return ` From 53b7e7373f4dc627a1199b938b95199b8c1442ee Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 5 Sep 2019 18:41:15 +0800 Subject: [PATCH 02/52] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 列目录order by --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 33f893c..2f7b8f0 100644 --- a/index.js +++ b/index.js @@ -99,6 +99,7 @@ class googleDrive { let url = 'https://www.googleapis.com/drive/v3/files'; let params = {'includeItemsFromAllDrives':true,'supportsAllDrives':true}; params.q = `'${parent}' in parents and trashed = false`; + params.orderBy= 'folder,modifiedTime desc,name'; params.fields = "nextPageToken, files(id, name, mimeType, size , modifiedTime)"; url += '?'+this.enQuery(params); let requestOption = await this.requestOption(); @@ -260,6 +261,9 @@ class view{ console.log(item); let p = path+item.name+'/'; let d = new Date(item['modifiedTime']); + if(item['size']==undefined){ + item['size'] = ""; + } if(item['mimeType'] == 'application/vnd.google-apps.folder'){ html +=`
  • From f575b80785be01a7d996a73004db4e4e94e50912 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 5 Sep 2019 22:37:08 +0800 Subject: [PATCH 03/52] Update index.js pageSize = 1000; --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 2f7b8f0..60758f2 100644 --- a/index.js +++ b/index.js @@ -101,6 +101,7 @@ class googleDrive { params.q = `'${parent}' in parents and trashed = false`; params.orderBy= 'folder,modifiedTime desc,name'; params.fields = "nextPageToken, files(id, name, mimeType, size , modifiedTime)"; + params.pageSize = 1000; url += '?'+this.enQuery(params); let requestOption = await this.requestOption(); let response = await fetch(url, requestOption); From a0f2685d918dad26fe2de090aaefd0941fdfe900 Mon Sep 17 00:00:00 2001 From: donwa Date: Fri, 6 Sep 2019 22:34:07 +0800 Subject: [PATCH 04/52] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b6b744..b109199 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,17 @@ Google Drive Directory Index ## Demo [https://index.gd.workers.dev/](https://index.gd.workers.dev/) -## 安装运行 +## 安装部署方案1 +1、在本地安装 rclone +2、按照 https://rclone.org/drive/ 流程进行授权。 +3、执行 rclone config file 查看 rclone.conf 路径。找到root_folder_id和refresh_token记录下来。 +4、下载 https://github.com/donwa/goindex 中的 index.js 并填入 root 和 refresh_token +5、复制代码 到 CloudFlare 部署。 + + +## 安装部署方案2 +作者不会记录refresh_token,但为避免纠纷,建议有条件的同学使用方案1进行部署 1、访问[https://install.gd.workers.dev/](https://install.gd.workers.dev/) 2、授权认证后,生成部署代码。 3、复制代码 到 CloudFlare 部署。 From c54df52a98118bdb787b932b2924a7efde5e0665 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 19:14:15 +0800 Subject: [PATCH 05/52] add material style --- themes/material/app.js | 189 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 themes/material/app.js diff --git a/themes/material/app.js b/themes/material/app.js new file mode 100644 index 0000000..0d78b42 --- /dev/null +++ b/themes/material/app.js @@ -0,0 +1,189 @@ +//https://cdn.jsdelivr.net/gh/donwa/goindex/themes/material/app.js + +// 在head 中 加载 必要静态 +document.write(''); +document.write(''); +// 初始化页面,并载入必要资源 +function init(){ + document.siteName = $('title').html(); + $('body').addClass("mdui-theme-primary-blue-grey mdui-theme-accent-blue"); + var html = ` +
    + +
    +
    +
    +
      +
    • +
      + 文件 +
      +
      + 修改时间 +
      +
      + 大小 +
      +
    • +
    +
    +
    +
      +
    +
    +
    +`; + $('body').html(html); +} + +function render(path){ + title(path); + nav(path); + list(path); +} + + +// 渲染 title +function title(path){ + $('title').html(document.siteName+' - '+path); +} + +// 渲染导航栏 +function nav(path){ + var html = `
    `; + $('#nav').html(html); +} + +// 渲染文件列表 +function list(path){ + var password = localStorage.getItem('password'+path); + $('#list').html(`
    `); + $.post(path,'{"password":'+password+'}', function(data,status){ + var obj = jQuery.parseJSON(data); + if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ + var pass = prompt("目录加密,请输入密码",""); + localStorage.setItem('password'+path, pass); + if(pass != null && pass != ""){ + list(path); + }else{ + alert("输入密码为空!"); + } + }else if(typeof obj != 'null'){ + list_files(path,obj.files); + } + }); +} + +function list_files(path,files){ + html = ""; + for(i in files){ + var item = files[i]; + var p = path+item.name+'/'; + if(item['size']==undefined){ + item['size'] = ""; + } + + item['modifiedTime'] = utc2beijing(item['modifiedTime']); + item['size'] = formatFileSize(item['size']); + if(item['mimeType'] == 'application/vnd.google-apps.folder'){ + html +=`
  • +
    + folder_open + ${item.name} +
    +
    ${item['modifiedTime']}
    +
    ${item['size']}
    +
    +
  • `; + }else{ + var p = path+item.name; + html += `
  • +
    + insert_drive_file + ${item.name} +
    +
    ${item['modifiedTime']}
    +
    ${item['size']}
    +
    +
  • `; + } + } + $('#list').html(html); +} + + +//时间转换 +function utc2beijing(utc_datetime) { + // 转为正常的时间格式 年-月-日 时:分:秒 + var T_pos = utc_datetime.indexOf('T'); + var Z_pos = utc_datetime.indexOf('Z'); + var year_month_day = utc_datetime.substr(0,T_pos); + var hour_minute_second = utc_datetime.substr(T_pos+1,Z_pos-T_pos-1); + var new_datetime = year_month_day+" "+hour_minute_second; // 2017-03-31 08:02:06 + + // 处理成为时间戳 + timestamp = new Date(Date.parse(new_datetime)); + timestamp = timestamp.getTime(); + timestamp = timestamp/1000; + + // 增加8个小时,北京时间比utc时间多八个时区 + var unixtimestamp = timestamp+8*60*60; + + // 时间戳转为时间 + var unixtimestamp = new Date(unixtimestamp*1000); + var year = 1900 + unixtimestamp.getYear(); + var month = "0" + (unixtimestamp.getMonth() + 1); + var date = "0" + unixtimestamp.getDate(); + var hour = "0" + unixtimestamp.getHours(); + var minute = "0" + unixtimestamp.getMinutes(); + var second = "0" + unixtimestamp.getSeconds(); + return year + "-" + month.substring(month.length-2, month.length) + "-" + date.substring(date.length-2, date.length) + + " " + hour.substring(hour.length-2, hour.length) + ":" + + minute.substring(minute.length-2, minute.length) + ":" + + second.substring(second.length-2, second.length); +} + +// bytes自适应转换到KB,MB,GB +function formatFileSize(bytes) { + if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';} + else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';} + else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';} + else if (bytes>1) {bytes=bytes+' bytes';} + else if (bytes==1) {bytes=bytes+' byte';} + else {bytes='';} + return bytes; +} + +String.prototype.trim = function (char) { + if (char) { + return this.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); + } + return this.replace(/^\s+|\s+$/g, ''); +}; + +$(function(){ + init(); + var path = window.location.pathname; + $("body").on("click",'.folder',function(){ + var url = $(this).attr('href'); + history.replaceState(null, null, url); + render(url); + return false; + }); + render(path); +}); \ No newline at end of file From 88724f3133d6f4aa067394377ef53d5e2076bd68 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 19:34:46 +0800 Subject: [PATCH 06/52] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index 0d78b42..dd791ef 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -1,8 +1,8 @@ -//https://cdn.jsdelivr.net/gh/donwa/goindex/themes/material/app.js +//cdn.jsdelivr.net/gh/donwa/goindex/themes/material/app.js // 在head 中 加载 必要静态 -document.write(''); -document.write(''); +document.write(''); +document.write(''); // 初始化页面,并载入必要资源 function init(){ document.siteName = $('title').html(); @@ -178,10 +178,10 @@ String.prototype.trim = function (char) { $(function(){ init(); - var path = window.location.pathname; + var path = decodeURI(window.location.pathname); $("body").on("click",'.folder',function(){ var url = $(this).attr('href'); - history.replaceState(null, null, url); + history.pushState(null, null, url); render(url); return false; }); From 58bef9b4124fb98385b92ca98897e62b5960b63c Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 19:59:13 +0800 Subject: [PATCH 07/52] =?UTF-8?q?fix=20=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/material/app.js b/themes/material/app.js index dd791ef..ec4671e 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -2,6 +2,7 @@ // 在head 中 加载 必要静态 document.write(''); +//document.write(''); document.write(''); // 初始化页面,并载入必要资源 function init(){ @@ -73,7 +74,7 @@ function nav(path){ function list(path){ var password = localStorage.getItem('password'+path); $('#list').html(`
    `); - $.post(path,'{"password":'+password+'}', function(data,status){ + $.post(path,'{"password":"'+password+'"}', function(data,status){ var obj = jQuery.parseJSON(data); if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ var pass = prompt("目录加密,请输入密码",""); From 1c314c1a0c6b4d1ad022e128454fb6b0a0b2a3de Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 20:03:42 +0800 Subject: [PATCH 08/52] =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=AB=AF=E5=88=86?= =?UTF-8?q?=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 255 ++++++++++++++++++------------------------------------- 1 file changed, 84 insertions(+), 171 deletions(-) diff --git a/index.js b/index.js index 60758f2..26e5f1e 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,34 @@ var authConfig = { - "siteName": "GoIndex", + "siteName": "GoIndex", // 网站名称 + "root_pass": "", // 根目录密码,优先于.password + "version" : 1.0, // 程序版本 "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", - "refresh_token": "", - "root": "" + "refresh_token": "", // 授权 token + "root": "" // 根目录ID }; var gd; +var html = ` + + + + + + ${authConfig.siteName} + + + + + + + +`; + addEventListener('fetch', event => { - event.respondWith(handleRequest(event.request)) -}) + event.respondWith(handleRequest(event.request)); +}); /** * Fetch and log a request @@ -21,22 +39,51 @@ async function handleRequest(request) { gd = new googleDrive(authConfig); } - // if(request.method == 'POST'){ - // return apiRequest(request); - // } + if(request.method == 'POST'){ + return apiRequest(request); + } let url = new URL(request.url); let path = url.pathname; + let action = url.searchParams.get('a'); - if(path.substr(-1) == '/'){ - let list = await gd.list(path); - let v = new view(); - let html = v.list(path, list); + if(path.substr(-1) == '/' || action != null){ return new Response(html,{status:200,headers:{'Content-Type':'text/html; charset=utf-8'}}); }else{ let file = await gd.file(path); let range = request.headers.get('Range'); return gd.down(file.id, range); + } +} + + +async function apiRequest(request) { + let url = new URL(request.url); + let path = url.pathname; + + let option = {status:200,headers:{'Access-Control-Allow-Origin':'*'}} + + if(path.substr(-1) == '/'){ + // check password + let password = await gd.password(path); + console.log("dir password", password); + if(password != undefined && password != null && password != ""){ + try{ + var obj = await request.json(); + }catch(e){ + var obj = {}; + } + console.log(password,obj); + if(password != obj.password){ + let html = `{"error": {"code": 401,"message": "password error."}}`; + return new Response(html,option); + } + } + let list = await gd.list(path); + return new Response(JSON.stringify(list),option); + }else{ + let file = await gd.file(path); + let range = request.headers.get('Range'); return new Response(JSON.stringify(file)); } } @@ -46,7 +93,9 @@ class googleDrive { this.authConfig = authConfig; this.paths = []; this.files = []; + this.passwords = []; this.paths["/"] = authConfig.root; + this.passwords["/"] = authConfig.root_pass; this.accessToken(); } @@ -90,6 +139,26 @@ class googleDrive { return this._ls(id); } + async password(path){ + if(this.passwords[path] !== undefined){ + return this.passwords[path]; + } + + console.log("load",path,".password",this.passwords[path]); + + let file = await gd.file(path+'.password'); + if(file == undefined){ + this.passwords[path] = null; + }else{ + let url = `https://www.googleapis.com/drive/v3/files/${file.id}?alt=media`; + let requestOption = await this.requestOption(); + let response = await this.fetch200(url, requestOption); + this.passwords[path] = await response.text(); + } + + return this.passwords[path]; + } + async _ls(parent){ console.log("_ls",parent); @@ -98,8 +167,8 @@ class googleDrive { } let url = 'https://www.googleapis.com/drive/v3/files'; let params = {'includeItemsFromAllDrives':true,'supportsAllDrives':true}; - params.q = `'${parent}' in parents and trashed = false`; - params.orderBy= 'folder,modifiedTime desc,name'; + params.q = `'${parent}' in parents and trashed = false AND name !='.password'`; + params.orderBy= 'folder,name,modifiedTime desc'; params.fields = "nextPageToken, files(id, name, mimeType, size , modifiedTime)"; params.pageSize = 1000; url += '?'+this.enQuery(params); @@ -229,165 +298,9 @@ class googleDrive { } } -class view{ - - nav(path){ - let html = ``; - let arr = path.trim('/').split('/'); - var p = '/'; - if(arr.length > 0){ - for(let n of arr){ - p += n+'/'; - if(n == ''){ - break; - } - n = decodeURIComponent(n); - html += `chevron_right - ${n}`; - } - } - return html; - } - - ls(path, items){ - let html = `
    -
    `; - return html; - } - - list(path, items){ - let siteName = authConfig.siteName; - let title = `${siteName} - ${path}`; - let nav = this.nav(path); - let content = this.ls(path,items.files); - return this.layout(title, siteName, nav, content); - } - - layout(title,siteName,nav,content){ - title = decodeURIComponent(title); - return ` - - - - - ${title} - - - - - -
    -
    - ${siteName} - ${nav} - -
    -
    -
    - ${content} -
    - -`; - } -} - String.prototype.trim = function (char) { if (char) { return this.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); } return this.replace(/^\s+|\s+$/g, ''); -}; +}; \ No newline at end of file From d47080765333898f10a4330a5f2606ae867d500d Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 20:06:00 +0800 Subject: [PATCH 09/52] =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E5=BD=95=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 26e5f1e..5cdb76e 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 - "root_pass": "", // 根目录密码,优先于.password + "root_pass": "index", // 根目录密码,优先于.password "version" : 1.0, // 程序版本 "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", @@ -95,7 +95,9 @@ class googleDrive { this.files = []; this.passwords = []; this.paths["/"] = authConfig.root; - this.passwords["/"] = authConfig.root_pass; + if(authConfig.root_pass != ""){ + this.passwords["/"] = authConfig.root_pass; + } this.accessToken(); } From f0d6b00ae5b778bf610749e98176cc0f498199ad Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 20:35:01 +0800 Subject: [PATCH 10/52] =?UTF-8?q?=E9=A3=8E=E6=A0=BC=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 5cdb76e..35de1b7 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password - "version" : 1.0, // 程序版本 + "version" : "1.0.0", // 程序版本 + "theme" : "material", "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", "refresh_token": "", // 授权 token @@ -14,12 +15,10 @@ var html = ` - + - ${authConfig.siteName} - - - + ${authConfig.siteName} + From 6d2c77e9ae2c4e7dde957f4a49bc34a5432b4762 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 20:46:40 +0800 Subject: [PATCH 11/52] =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b109199..bf3e2e7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Google Drive Directory Index ## 安装部署方案1 -1、在本地安装 rclone +1、在本地安装 rclone 2、按照 https://rclone.org/drive/ 流程进行授权。 3、执行 rclone config file 查看 rclone.conf 路径。找到root_folder_id和refresh_token记录下来。 4、下载 https://github.com/donwa/goindex 中的 index.js 并填入 root 和 refresh_token @@ -23,3 +23,11 @@ Google Drive Directory Index 1、访问[https://install.gd.workers.dev/](https://install.gd.workers.dev/) 2、授权认证后,生成部署代码。 3、复制代码 到 CloudFlare 部署。 + +## 文件夹密码: +在google drive 文件中放置 `.password` 文件来设置密码。 +密码文件只能保护该文件不被列举,不能保护该文件夹的子文件夹不被列举。 +也不保护文件夹下文件不被下载。 + +程序文件中 `root_pass` 只为根目录密码,优先于 `.password` 文件 + From 0e9682d0b3763e827d99a3feaeb92005efff1592 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 21:13:30 +0800 Subject: [PATCH 12/52] =?UTF-8?q?fix=E7=89=B9=E6=AE=8A=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index ec4671e..9d444fa 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -1,5 +1,3 @@ -//cdn.jsdelivr.net/gh/donwa/goindex/themes/material/app.js - // 在head 中 加载 必要静态 document.write(''); //document.write(''); @@ -47,6 +45,7 @@ function render(path){ // 渲染 title function title(path){ + path = decodeURI(path); $('title').html(document.siteName+' - '+path); } @@ -59,6 +58,7 @@ function nav(path){ if(arr.length > 0){ for(i in arr){ var n = arr[i]; + n = decodeURI(n); p += n+'/'; if(n == ''){ break; @@ -179,7 +179,7 @@ String.prototype.trim = function (char) { $(function(){ init(); - var path = decodeURI(window.location.pathname); + var path = window.location.pathname; $("body").on("click",'.folder',function(){ var url = $(this).attr('href'); history.pushState(null, null, url); @@ -187,4 +187,4 @@ $(function(){ return false; }); render(path); -}); \ No newline at end of file +}); From 7df5c980393feb4ae8d30c85132ebe83f6359449 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 21:14:14 +0800 Subject: [PATCH 13/52] =?UTF-8?q?fix=20=E7=89=B9=E6=AE=8A=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index ec4671e..0cd3974 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -47,6 +47,7 @@ function render(path){ // 渲染 title function title(path){ + path = decodeURI(path); $('title').html(document.siteName+' - '+path); } @@ -59,6 +60,7 @@ function nav(path){ if(arr.length > 0){ for(i in arr){ var n = arr[i]; + n = decodeURI(n); p += n+'/'; if(n == ''){ break; @@ -179,7 +181,7 @@ String.prototype.trim = function (char) { $(function(){ init(); - var path = decodeURI(window.location.pathname); + var path = window.location.pathname; $("body").on("click",'.folder',function(){ var url = $(this).attr('href'); history.pushState(null, null, url); @@ -187,4 +189,4 @@ $(function(){ return false; }); render(path); -}); \ No newline at end of file +}); From 06d06ea862a4d43e15ce95c94cb92cf402165a16 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 21:33:35 +0800 Subject: [PATCH 14/52] =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/material/app.js b/themes/material/app.js index 0cd3974..1002e9c 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -190,3 +190,9 @@ $(function(){ }); render(path); }); + +// 监听回退事件 +window.onpopstate = function(){ + var path = window.location.pathname; + render(path); +} From e3e3695408191232df09d7140edc20f28552f39f Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 21:34:29 +0800 Subject: [PATCH 15/52] =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/material/app.js b/themes/material/app.js index 9d444fa..1fd968c 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -188,3 +188,9 @@ $(function(){ }); render(path); }); + +// 监听回退事件 +window.onpopstate = function(){ + var path = window.location.pathname; + render(path); +} From 8313d945855d7834428313f661a7522b995056ca Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 22:23:51 +0800 Subject: [PATCH 16/52] =?UTF-8?q?README.md=20HEAD.md=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 80 ++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index 1002e9c..abd58e4 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -1,5 +1,3 @@ -//cdn.jsdelivr.net/gh/donwa/goindex/themes/material/app.js - // 在head 中 加载 必要静态 document.write(''); //document.write(''); @@ -13,27 +11,38 @@ function init(){ -
    -
    -
      -
    • -
      - 文件 -
      -
      - 修改时间 -
      -
      - 大小 -
      -
    • -
    -
    -
    -
      -
    -
    -
    +
    + + + +
    +
      +
    • +
      + 文件 +
      +
      + 修改时间 +
      +
      + 大小 +
      +
    • +
    +
    +
    +
      +
    +
    + + + +
    + + `; $('body').html(html); } @@ -76,6 +85,8 @@ function nav(path){ function list(path){ var password = localStorage.getItem('password'+path); $('#list').html(`
    `); + $('#readme_md').hide().html(''); + $('#head_md').hide().html(''); $.post(path,'{"password":"'+password+'"}', function(data,status){ var obj = jQuery.parseJSON(data); if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ @@ -115,6 +126,16 @@ function list_files(path,files){ `; }else{ var p = path+item.name; + if(item.name == "README.md"){ + $.get(p, function(data){ + markdown("#readme_md",data); + }); + } + if(item.name == "HEAD.md"){ + $.get(p, function(data){ + markdown("#head_md",data); + }); + } html += `
  • insert_drive_file @@ -191,6 +212,19 @@ $(function(){ render(path); }); +// README.md HEAD.md 支持 +function markdown(el, data){ + if(window.md == undefined){ + $.getScript('https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js',function(){ + window.md = window.markdownit(); + markdown(el, data); + }); + }else{ + var html = md.render(data); + $(el).show().html(html); + } +} + // 监听回退事件 window.onpopstate = function(){ var path = window.location.pathname; From 7b202707b56aff1bbd52d72a7b927092de6fa071 Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 22:38:47 +0800 Subject: [PATCH 17/52] version to 1.0.1 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 35de1b7..cde8737 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password - "version" : "1.0.0", // 程序版本 + "version" : "1.0.1", // 程序版本 "theme" : "material", "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", @@ -304,4 +304,4 @@ String.prototype.trim = function (char) { return this.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); } return this.replace(/^\s+|\s+$/g, ''); -}; \ No newline at end of file +}; From 0bf6c90d39bd2521836a861b7baceb372bcbdf3f Mon Sep 17 00:00:00 2001 From: donwa Date: Sun, 8 Sep 2019 23:22:06 +0800 Subject: [PATCH 18/52] =?UTF-8?q?=E9=98=B2=E6=AD=A2.password=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=A2=AB=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cde8737..e78301d 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ var authConfig = { "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", "refresh_token": "", // 授权 token - "root": "" // 根目录ID + "root": "root" // 根目录ID }; var gd; @@ -49,6 +49,9 @@ async function handleRequest(request) { if(path.substr(-1) == '/' || action != null){ return new Response(html,{status:200,headers:{'Content-Type':'text/html; charset=utf-8'}}); }else{ + if(path.split('/').pop() == ".password"){ + return new Response("",{status:404}); + } let file = await gd.file(path); let range = request.headers.get('Range'); return gd.down(file.id, range); From 607a068fc13442a1df07fe8cabe4b60564dcd8cd Mon Sep 17 00:00:00 2001 From: myluoluo Date: Mon, 9 Sep 2019 06:31:37 +0800 Subject: [PATCH 19/52] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit video/mp4 image/jpeg image/gif image/png text/plain text/markdown --- themes/material/app.js | 305 +++++++++++++++++++++++++---------------- 1 file changed, 186 insertions(+), 119 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index d8ae026..b6d3762 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -4,18 +4,15 @@ document.write('
    - - +
      @@ -37,85 +34,152 @@ function init(){
    - - +
    - `; - $('body').html(html); + $('body').html(html); } function render(path){ - title(path); - nav(path); - list(path); + title(path); + nav(path); + list(path); } // 渲染 title function title(path){ - path = decodeURI(path); - $('title').html(document.siteName+' - '+path); + path = decodeURI(path); + $('title').html(document.siteName+' - '+path); } // 渲染导航栏 function nav(path){ - var html = `
    `; - $('#nav').html(html); + var html = ``; + $('#nav').html(html); +} + +// 文件预览 +var previewDom, previewUrl; +function file_preview(a) { + var fileUrl = a.href; + if(fileUrl == previewUrl) { + previewDom.remove(); + previewUrl = ""; + return false; + } + if(previewDom !== undefined) + { + previewDom.remove(); + } + var preview = `
    +
    + previewHtml +
    + + +
    +
    +
    `; + + var fileType = $(a).attr("gd-type"); + var isPreview; + switch (fileType){ + case "video/mp4": + isPreview = true; + preview = preview.replace("previewHtml", ``); + break; + case "image/jpeg": + case "image/gif": + case "image/png": + isPreview = true; + preview = preview.replace("previewHtml", ``); + break; + case "text/markdown": + case "text/plain": + var mdName = fileUrl.split('/').pop(); + if(mdName !== "HEAD.md" && mdName !== "README.md") { + isPreview = true; + preview = $(preview.replace("previewHtml", `
    `)); + $.get(fileUrl, function(data){ + markdown("#markdownShow",data); + }); + } + break; + } + if(isPreview) { + previewUrl = fileUrl; + previewDom = $(preview); + previewDom.on("click", "#fileDownload", function () { + var downForm = $('
    '); + downForm.attr('action', fileUrl); + downForm.appendTo(previewDom); + downForm.submit(); + }); + previewDom.on("click", "#previewClose", function () { + if(previewDom !== undefined) + { + previewDom.remove(); + } + previewUrl = ""; + }); + $(a).parent().after(previewDom); + return false; + } + return true; } // 渲染文件列表 function list(path){ - var password = localStorage.getItem('password'+path); - $('#list').html(`
    `); - $('#readme_md').hide().html(''); - $('#head_md').hide().html(''); - $.post(path,'{"password":"'+password+'"}', function(data,status){ - var obj = jQuery.parseJSON(data); - if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ - var pass = prompt("目录加密,请输入密码",""); - localStorage.setItem('password'+path, pass); - if(pass != null && pass != ""){ - list(path); - }else{ - alert("输入密码为空!"); - } - }else if(typeof obj != 'null'){ - list_files(path,obj.files); - } - }); + var password = localStorage.getItem('password'+path); + $('#list').html(`
    `); + $('#readme_md').hide().html(''); + $('#head_md').hide().html(''); + $.post(path,'{"password":"'+password+'"}', function(data,status){ + var obj = jQuery.parseJSON(data); + if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ + var pass = prompt("目录加密,请输入密码",""); + localStorage.setItem('password'+path, pass); + if(pass != null && pass != ""){ + list(path); + }else{ + alert("输入密码为空!"); + } + }else if(typeof obj != 'null'){ + list_files(path,obj.files); + } + }); } function list_files(path,files){ - html = ""; - for(i in files){ - var item = files[i]; - var p = path+item.name+'/'; - if(item['size']==undefined){ - item['size'] = ""; - } - - item['modifiedTime'] = utc2beijing(item['modifiedTime']); - item['size'] = formatFileSize(item['size']); - if(item['mimeType'] == 'application/vnd.google-apps.folder'){ - html +=`
  • + html = ""; + for(i in files){ + var item = files[i]; + var p = path+item.name+'/'; + if(item['size']==undefined){ + item['size'] = ""; + } + + item['modifiedTime'] = utc2beijing(item['modifiedTime']); + item['size'] = formatFileSize(item['size']); + if(item['mimeType'] == 'application/vnd.google-apps.folder'){ + html +=`
  • `; - }else{ - var p = path+item.name; - if(item.name == "README.md"){ - $.get(p, function(data){ - markdown("#readme_md",data); - }); - } - if(item.name == "HEAD.md"){ - $.get(p, function(data){ - markdown("#head_md",data); - }); - } - html += `
  • + }else{ + var p = path+item.name; + if(item.name == "README.md"){ + $.get(p, function(data){ + markdown("#readme_md",data); + }); + } + if(item.name == "HEAD.md"){ + $.get(p, function(data){ + markdown("#head_md",data); + }); + } + html += `
  • `; - } - } - $('#list').html(html); + } + } + $('#list').html(html); + $("body").off("click").on("click", "a", function() { + return file_preview(this); + }); } @@ -170,27 +237,27 @@ function utc2beijing(utc_datetime) { // 时间戳转为时间 var unixtimestamp = new Date(unixtimestamp*1000); - var year = 1900 + unixtimestamp.getYear(); - var month = "0" + (unixtimestamp.getMonth() + 1); - var date = "0" + unixtimestamp.getDate(); - var hour = "0" + unixtimestamp.getHours(); - var minute = "0" + unixtimestamp.getMinutes(); - var second = "0" + unixtimestamp.getSeconds(); - return year + "-" + month.substring(month.length-2, month.length) + "-" + date.substring(date.length-2, date.length) - + " " + hour.substring(hour.length-2, hour.length) + ":" - + minute.substring(minute.length-2, minute.length) + ":" - + second.substring(second.length-2, second.length); -} + var year = 1900 + unixtimestamp.getYear(); + var month = "0" + (unixtimestamp.getMonth() + 1); + var date = "0" + unixtimestamp.getDate(); + var hour = "0" + unixtimestamp.getHours(); + var minute = "0" + unixtimestamp.getMinutes(); + var second = "0" + unixtimestamp.getSeconds(); + return year + "-" + month.substring(month.length-2, month.length) + "-" + date.substring(date.length-2, date.length) + + " " + hour.substring(hour.length-2, hour.length) + ":" + + minute.substring(minute.length-2, minute.length) + ":" + + second.substring(second.length-2, second.length); +} // bytes自适应转换到KB,MB,GB function formatFileSize(bytes) { - if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';} - else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';} - else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';} - else if (bytes>1) {bytes=bytes+' bytes';} - else if (bytes==1) {bytes=bytes+' byte';} - else {bytes='';} - return bytes; + if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';} + else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';} + else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';} + else if (bytes>1) {bytes=bytes+' bytes';} + else if (bytes==1) {bytes=bytes+' byte';} + else {bytes='';} + return bytes; } String.prototype.trim = function (char) { @@ -201,32 +268,32 @@ String.prototype.trim = function (char) { }; $(function(){ - init(); - var path = window.location.pathname; - $("body").on("click",'.folder',function(){ - var url = $(this).attr('href'); - history.pushState(null, null, url); - render(url); - return false; - }); - render(path); + init(); + var path = window.location.pathname; + $("body").on("click",'.folder',function(){ + var url = $(this).attr('href'); + history.pushState(null, null, url); + render(url); + return false; + }); + render(path); }); // README.md HEAD.md 支持 function markdown(el, data){ - if(window.md == undefined){ - $.getScript('https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js',function(){ - window.md = window.markdownit(); - markdown(el, data); - }); - }else{ - var html = md.render(data); - $(el).show().html(html); - } + if(window.md == undefined){ + $.getScript('https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js',function(){ + window.md = window.markdownit(); + markdown(el, data); + }); + }else{ + var html = md.render(data); + $(el).show().html(html); + } } // 监听回退事件 window.onpopstate = function(){ - var path = window.location.pathname; - render(path); -} \ No newline at end of file + var path = window.location.pathname; + render(path); +} From 0621db61509f202ba43817d811803776ee33fdad Mon Sep 17 00:00:00 2001 From: myluoluo Date: Mon, 9 Sep 2019 07:01:34 +0800 Subject: [PATCH 20/52] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E3=80=81txt=20=E7=B1=BB=E5=9E=8B=E8=BD=BD=E5=85=A5=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/material/app.js b/themes/material/app.js index b6d3762..7b36d0d 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -109,16 +109,22 @@ function file_preview(a) { case "image/gif": case "image/png": isPreview = true; - preview = preview.replace("previewHtml", ``); + preview = `
    ` + preview; + preview = $(preview.replace("previewHtml", ``)); + preview.find("img")[0].onload = function(){ + $("#progressBar").remove(); + } break; case "text/markdown": case "text/plain": var mdName = fileUrl.split('/').pop(); if(mdName !== "HEAD.md" && mdName !== "README.md") { isPreview = true; + preview = `
    ` + preview; preview = $(preview.replace("previewHtml", `
    `)); $.get(fileUrl, function(data){ markdown("#markdownShow",data); + $("#progressBar").remove(); }); } break; From 3e5b3862ef65e1dcf48bfa6403ba57d3e44c5dd7 Mon Sep 17 00:00:00 2001 From: myluoluo Date: Mon, 9 Sep 2019 17:27:07 +0800 Subject: [PATCH 21/52] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit video/x-matroska video/quicktime --- themes/material/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/material/app.js b/themes/material/app.js index 7b36d0d..d5c640b 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -102,6 +102,8 @@ function file_preview(a) { var isPreview; switch (fileType){ case "video/mp4": + case "video/x-matroska": // .mkv + case "video/quicktime": // .mov isPreview = true; preview = preview.replace("previewHtml", ``); break; From 0bd689a5898cce0216d651d113841f7d17dd4783 Mon Sep 17 00:00:00 2001 From: donwa Date: Mon, 9 Sep 2019 18:36:14 +0800 Subject: [PATCH 22/52] =?UTF-8?q?fix=20nav=E5=81=8F=E7=A6=BB=EF=BC=8C?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E8=BF=94=E5=9B=9E=EF=BC=8C?= =?UTF-8?q?md=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 200 ++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 92 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index d5c640b..f1208b0 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -1,6 +1,7 @@ // 在head 中 加载 必要静态 -document.write(''); -//document.write(''); +document.write(''); +// markdown支持 +document.write(''); document.write(''); // 初始化页面,并载入必要资源 function init(){ @@ -56,7 +57,7 @@ function title(path){ // 渲染导航栏 function nav(path){ - var html = ``; $('#nav').html(html); } +// 渲染文件列表 +function list(path){ + var password = localStorage.getItem('password'+path); + $('#list').html(`
    `); + $('#readme_md').hide().html(''); + $('#head_md').hide().html(''); + $.post(path,'{"password":"'+password+'"}', function(data,status){ + var obj = jQuery.parseJSON(data); + if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ + var pass = prompt("目录加密,请输入密码",""); + localStorage.setItem('password'+path, pass); + if(pass != null && pass != ""){ + list(path); + }else{ + history.go(-1); + } + }else if(typeof obj != 'null'){ + list_files(path,obj.files); + } + }); +} + +function list_files(path,files){ + html = ""; + for(i in files){ + var item = files[i]; + var p = path+item.name+'/'; + if(item['size']==undefined){ + item['size'] = ""; + } + + item['modifiedTime'] = utc2beijing(item['modifiedTime']); + item['size'] = formatFileSize(item['size']); + if(item['mimeType'] == 'application/vnd.google-apps.folder'){ + html +=`
  • +
    + folder_open + ${item.name} +
    +
    ${item['modifiedTime']}
    +
    ${item['size']}
    +
    +
  • `; + }else{ + var p = path+item.name; + if(item.name == "README.md"){ + get_file(p, item, function(data){ + markdown("#readme_md",data); + }); + } + if(item.name == "HEAD.md"){ + get_file(p, item, function(data){ + markdown("#head_md",data); + }); + } + html += `
  • +
    + insert_drive_file + ${item.name} +
    +
    ${item['modifiedTime']}
    +
    ${item['size']}
    +
    +
  • `; + } + } + $('#list').html(html); +} + + +function get_file(path, file, callback){ + var key = "file_path_"+path+file['modifiedTime']; + var data = localStorage.getItem(key); + if(data != undefined){ + return callback(data); + }else{ + $.get(path, function(d){ + localStorage.setItem(key, d); + callback(d); + }); + } +} + // 文件预览 var previewDom, previewUrl; function file_preview(a) { @@ -153,79 +236,6 @@ function file_preview(a) { return true; } -// 渲染文件列表 -function list(path){ - var password = localStorage.getItem('password'+path); - $('#list').html(`
    `); - $('#readme_md').hide().html(''); - $('#head_md').hide().html(''); - $.post(path,'{"password":"'+password+'"}', function(data,status){ - var obj = jQuery.parseJSON(data); - if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ - var pass = prompt("目录加密,请输入密码",""); - localStorage.setItem('password'+path, pass); - if(pass != null && pass != ""){ - list(path); - }else{ - alert("输入密码为空!"); - } - }else if(typeof obj != 'null'){ - list_files(path,obj.files); - } - }); -} - -function list_files(path,files){ - html = ""; - for(i in files){ - var item = files[i]; - var p = path+item.name+'/'; - if(item['size']==undefined){ - item['size'] = ""; - } - - item['modifiedTime'] = utc2beijing(item['modifiedTime']); - item['size'] = formatFileSize(item['size']); - if(item['mimeType'] == 'application/vnd.google-apps.folder'){ - html +=`
  • -
    - folder_open - ${item.name} -
    -
    ${item['modifiedTime']}
    -
    ${item['size']}
    -
    -
  • `; - }else{ - var p = path+item.name; - if(item.name == "README.md"){ - $.get(p, function(data){ - markdown("#readme_md",data); - }); - } - if(item.name == "HEAD.md"){ - $.get(p, function(data){ - markdown("#head_md",data); - }); - } - html += `
  • -
    - insert_drive_file - ${item.name} -
    -
    ${item['modifiedTime']}
    -
    ${item['size']}
    -
    -
  • `; - } - } - $('#list').html(html); - $("body").off("click").on("click", "a", function() { - return file_preview(this); - }); -} - - //时间转换 function utc2beijing(utc_datetime) { // 转为正常的时间格式 年-月-日 时:分:秒 @@ -275,25 +285,14 @@ String.prototype.trim = function (char) { return this.replace(/^\s+|\s+$/g, ''); }; -$(function(){ - init(); - var path = window.location.pathname; - $("body").on("click",'.folder',function(){ - var url = $(this).attr('href'); - history.pushState(null, null, url); - render(url); - return false; - }); - render(path); -}); // README.md HEAD.md 支持 function markdown(el, data){ if(window.md == undefined){ - $.getScript('https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js',function(){ - window.md = window.markdownit(); - markdown(el, data); - }); + //$.getScript('https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js',function(){ + window.md = window.markdownit(); + markdown(el, data); + //}); }else{ var html = md.render(data); $(el).show().html(html); @@ -305,3 +304,20 @@ window.onpopstate = function(){ var path = window.location.pathname; render(path); } + + +$(function(){ + init(); + var path = window.location.pathname; + $("body").on("click",'.folder',function(){ + var url = $(this).attr('href'); + history.pushState(null, null, url); + render(url); + return false; + }); + + $("body").on("click", ".file", function() { + return file_preview(this); + }); + render(path); +}); From bf7ddb3ca5e8f8e13e8f082f7f40fc61e08aad70 Mon Sep 17 00:00:00 2001 From: donwa Date: Mon, 9 Sep 2019 18:36:50 +0800 Subject: [PATCH 23/52] version to 1.0.2 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e78301d..9aa3fb3 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password - "version" : "1.0.1", // 程序版本 + "version" : "1.0.2", // 程序版本 "theme" : "material", "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", From 9de6b7b6e6db1771cd9a93d1992c5898266ac4d1 Mon Sep 17 00:00:00 2001 From: donwa Date: Mon, 9 Sep 2019 18:39:12 +0800 Subject: [PATCH 24/52] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index bf3e2e7..6151d4f 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,16 @@ Google Drive Directory Index 程序文件中 `root_pass` 只为根目录密码,优先于 `.password` 文件 + +## 更新日志 +1.0.2 +优化前端逻辑 +添加文件预览功能(临时) +添加前端文件缓存功能 + +1.0.1 +添加 README.md 、 HEAD.md 支持 + +1.0.0 +前后端分离,确定基本架构 +添加.password 支持 From 26a7bb15c92494e423ee181022d16a7191e4b2e7 Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 09:19:41 +0800 Subject: [PATCH 25/52] fix .password download bypass --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9aa3fb3..16d57b2 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ async function handleRequest(request) { if(path.substr(-1) == '/' || action != null){ return new Response(html,{status:200,headers:{'Content-Type':'text/html; charset=utf-8'}}); }else{ - if(path.split('/').pop() == ".password"){ + if(path.split('/').pop().toLowerCase() == ".password"){ return new Response("",{status:404}); } let file = await gd.file(path); From a4e85d1519b9efe343598c99f319e6e5cdf6fb07 Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 09:21:05 +0800 Subject: [PATCH 26/52] version to 1.0.3 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 16d57b2..e65c3dd 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password - "version" : "1.0.2", // 程序版本 + "version" : "1.0.3", // 程序版本 "theme" : "material", "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", From da86d315c2c2fce13a77793280ab2263c4705f6c Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 09:22:15 +0800 Subject: [PATCH 27/52] 1.0.3 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6151d4f..f36265a 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ Google Drive Directory Index ## 更新日志 +1.0.3 +修复 `.password` 绕过下载问题。 + 1.0.2 优化前端逻辑 添加文件预览功能(临时) From a212d6db75cc504527aadfa53610855d0d0b910c Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 09:48:15 +0800 Subject: [PATCH 28/52] logo --- logo.png | Bin 0 -> 7046 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..97738cd2c49e5bd5808ef6613f50f6d93eb44143 GIT binary patch literal 7046 zcmaKRbyQSe_xI4*ZtV0SCz2Agtg(sEef?TpMm_MmjVE=fDXEbUWPC=32TH4 zpXFZ+AJWC`o_#MSi*&QJc7l5Wt>AVJuF|YWZJn$@2ODWt17R2l<_3Y=JE;13z;*o8 zb*=rJti^3uWo3X;NQrv^7r2)t5b5IV>M4PgX8o70#QpfMnV%K-FNl|uH0%EaWeC#* zLJ%HspfDeZ*BT@O0*VOm2?&8jMMZglf*=79KS+>YK#*5JR6kGOz`@l9;p6!)Gz=yIb@lYJbhU;<6{T74`FsuzHWETgqRL7_5CuiB z5LiG!NnBh31X2(cgD8qX3VM0JPUoMR{H1;=U;!l6t!}(9X#ZpW{>$qM~5H9~z2DXeO^!xAq`q z7lSLB)sK`F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E>{3t4EVMmTK&d26 zTY#*-wZ7b&DkIA~1%Dq{W&?%4QTau%4SOOc_Zenn#E{Bo+D9Mynv*enxV@-ySq1Ueh&sMbi5+#i+j{xWQ8p!k;}=9 z^CW`w%s=;)iOFM`7f;d@-!<1+_j{P{j~Db-+p%dcvI^Emyk`Z{ylB6q^1nLJK4hcJ zl4$(XFeYQn>a)!kqPUOG^FhCAW2f-d51Y$h{l15zT*-Yvs;v1aYSKq4w%oB;II;N4 z$*e$4%JS)Cl`IjL41S5+GV3Sx&);qNp6smmlF91AMl_kpLHAMb3SfLUfka4s@ywsm z!q*In$#jEo5p?b|6JnEZ@|ZLykc6gSSj*m@KD(LeRYr|gSdu9k{ysGM7@qZbO7qKj ziP>I0t5NAzL&-t)P=WZXSTNdwQY>Vm+SHh7(tC`Ji)T7r1-y&O=pB20QBsV5N?c57 zy)1&fZ&jXsj7r8v3xgL1%vt5Qcgnh^NWIkVZg2D!g5%gC%H~Q4a?(C)M8Cm=JXX*C z75U`+&@?%%$m>f4$xm@|t_kU&TPfFP5}vuw)A-2yTnTdaV8}zY`h_3USDNnjvj?{WBII3n5q)# z2&U3)Z4FXMVXLFYtBef}+sgII!H&}jT#07wJ+C>-synAtFy}5#@^Edf zV4zq>E0$g;6YHJfAu6N6BtvU!ir(V;Y?b6E)@g1SPrJErg`7U$@G)bfFmy)g{YeMf z^C%@?RsBRa$#K*TPVmVf3bzF##9R8v6w7!fdiLu6yE%qB6%5?vP#DGe0MKkv^$mZwzn{0X=Gqu2;CmOBLV@SU4v3icaJ3h{uzTRsVi11ScLu`>K+?X literal 0 HcmV?d00001 From 48eb326747e71d9f344dc798d75723f369a0fe34 Mon Sep 17 00:00:00 2001 From: donwa85 Date: Wed, 11 Sep 2019 09:50:34 +0800 Subject: [PATCH 29/52] README --- README.md | 49 ------------------------------------------------- README_zh.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ logo.png | Bin 7046 -> 0 bytes 3 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 README_zh.md delete mode 100644 logo.png diff --git a/README.md b/README.md index f36265a..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,49 +0,0 @@ -# goindex -Google Drive Directory Index - -## 功能: -部署在 CloudFlare Workers的小程序。 -可以将 Google Drive 文件以目录形式列出,并直连下载。 -流量走 CloudFlare ,网速由 CloudFlare 决定。 - -## Demo -[https://index.gd.workers.dev/](https://index.gd.workers.dev/) - - -## 安装部署方案1 -1、在本地安装 rclone -2、按照 https://rclone.org/drive/ 流程进行授权。 -3、执行 rclone config file 查看 rclone.conf 路径。找到root_folder_id和refresh_token记录下来。 -4、下载 https://github.com/donwa/goindex 中的 index.js 并填入 root 和 refresh_token -5、复制代码 到 CloudFlare 部署。 - - -## 安装部署方案2 -作者不会记录refresh_token,但为避免纠纷,建议有条件的同学使用方案1进行部署 -1、访问[https://install.gd.workers.dev/](https://install.gd.workers.dev/) -2、授权认证后,生成部署代码。 -3、复制代码 到 CloudFlare 部署。 - -## 文件夹密码: -在google drive 文件中放置 `.password` 文件来设置密码。 -密码文件只能保护该文件不被列举,不能保护该文件夹的子文件夹不被列举。 -也不保护文件夹下文件不被下载。 - -程序文件中 `root_pass` 只为根目录密码,优先于 `.password` 文件 - - -## 更新日志 -1.0.3 -修复 `.password` 绕过下载问题。 - -1.0.2 -优化前端逻辑 -添加文件预览功能(临时) -添加前端文件缓存功能 - -1.0.1 -添加 README.md 、 HEAD.md 支持 - -1.0.0 -前后端分离,确定基本架构 -添加.password 支持 diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..f36265a --- /dev/null +++ b/README_zh.md @@ -0,0 +1,49 @@ +# goindex +Google Drive Directory Index + +## 功能: +部署在 CloudFlare Workers的小程序。 +可以将 Google Drive 文件以目录形式列出,并直连下载。 +流量走 CloudFlare ,网速由 CloudFlare 决定。 + +## Demo +[https://index.gd.workers.dev/](https://index.gd.workers.dev/) + + +## 安装部署方案1 +1、在本地安装 rclone +2、按照 https://rclone.org/drive/ 流程进行授权。 +3、执行 rclone config file 查看 rclone.conf 路径。找到root_folder_id和refresh_token记录下来。 +4、下载 https://github.com/donwa/goindex 中的 index.js 并填入 root 和 refresh_token +5、复制代码 到 CloudFlare 部署。 + + +## 安装部署方案2 +作者不会记录refresh_token,但为避免纠纷,建议有条件的同学使用方案1进行部署 +1、访问[https://install.gd.workers.dev/](https://install.gd.workers.dev/) +2、授权认证后,生成部署代码。 +3、复制代码 到 CloudFlare 部署。 + +## 文件夹密码: +在google drive 文件中放置 `.password` 文件来设置密码。 +密码文件只能保护该文件不被列举,不能保护该文件夹的子文件夹不被列举。 +也不保护文件夹下文件不被下载。 + +程序文件中 `root_pass` 只为根目录密码,优先于 `.password` 文件 + + +## 更新日志 +1.0.3 +修复 `.password` 绕过下载问题。 + +1.0.2 +优化前端逻辑 +添加文件预览功能(临时) +添加前端文件缓存功能 + +1.0.1 +添加 README.md 、 HEAD.md 支持 + +1.0.0 +前后端分离,确定基本架构 +添加.password 支持 diff --git a/logo.png b/logo.png deleted file mode 100644 index 97738cd2c49e5bd5808ef6613f50f6d93eb44143..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7046 zcmaKRbyQSe_xI4*ZtV0SCz2Agtg(sEef?TpMm_MmjVE=fDXEbUWPC=32TH4 zpXFZ+AJWC`o_#MSi*&QJc7l5Wt>AVJuF|YWZJn$@2ODWt17R2l<_3Y=JE;13z;*o8 zb*=rJti^3uWo3X;NQrv^7r2)t5b5IV>M4PgX8o70#QpfMnV%K-FNl|uH0%EaWeC#* zLJ%HspfDeZ*BT@O0*VOm2?&8jMMZglf*=79KS+>YK#*5JR6kGOz`@l9;p6!)Gz=yIb@lYJbhU;<6{T74`FsuzHWETgqRL7_5CuiB z5LiG!NnBh31X2(cgD8qX3VM0JPUoMR{H1;=U;!l6t!}(9X#ZpW{>$qM~5H9~z2DXeO^!xAq`q z7lSLB)sK`FxwS!ojU%rqp#KZ0B?s2k!v2m)&=J8(@cMOv!cb~P%iYD;p{;1f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Oc_Zenn#E{Bo+D9Mynv*enxV@-ySq1Ueh&sMbi5+#i+j{xWQ8p!k;}=9 z^CW`w%s=;)iOFM`7f;d@-!<1+_j{P{j~Db-+p%dcvI^Emyk`Z{ylB6q^1nLJK4hcJ zl4$(XFeYQn>a)!kqPUOG^FhCAW2f-d51Y$h{l15zT*-Yvs;v1aYSKq4w%oB;II;N4 z$*e$4%JS)Cl`IjL41S5+GV3Sx&);qNp6smmlF91AMl_kpLHAMb3SfLUfka4s@ywsm z!q*In$#jEo5p?b|6JnEZ@|ZLykc6gSSj*m@KD(LeRYr|gSdu9k{ysGM7@qZbO7qKj ziP>I0t5NAzL&-t)P=WZXSTNdwQY>Vm+SHh7(tC`Ji)T7r1-y&O=pB20QBsV5N?c57 zy)1&fZ&jXsj7r8v3xgL1%vt5Qcgnh^NWIkVZg2D!g5%gC%H~Q4a?(C)M8Cm=JXX*C z75U`+&@?%%$m>f4$xm@|t_kU&TPfFP5}vuw)A-2yTnTdaV8}zY`h_3USDNnjvj?{WBII3n5q)# z2&U3)Z4FXMVXLFYtBef}+sgII!H&}jT#07wJ+C>-synAtFy}5#@^Edf zV4zq>E0$g;6YHJfAu6N6BtvU!ir(V;Y?b6E)@g1SPrJErg`7U$@G)bfFmy)g{YeMf z^C%@?RsBRa$#K*TPVmVf3bzF##9R8v6w7!fdiLu6yE%qB6%5?vP#DGe0MKkv^$mZwzn{0X=Gqu2;CmOBLV@SU4v3icaJ3h{uzTRsVi11ScLu`>K+?X From 30f5541b60689bd2b2fecfb3e1436e465ef8c57a Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:13:37 +0800 Subject: [PATCH 30/52] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index e69de29..3d52b26 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,21 @@ +![GoIndex](/theme/logo.png) + +GoIndex +==== +Combining the power of Cloudflare Workers and Google Drive will allow you to index you files on the browser on Cloudflare Workers. + +`index.js` is the content of the Workers script. + +## Demo +[https://index.gd.workers.dev/](https://index.gd.workers.dev/) + +## Deployment +1.Install `rclone` software locally +2.Follow https://rclone.org/drive/ bind a drive +3.Execute the command`rclone config file` to find the file `rclone.conf` path +4.Open `rclone.conf`,find the configuration `root_folder_id` and `refresh_token` +5.Download index.js in https://github.com/donwa/goindex and fill in root and refresh_token +6.Deploy the code to Cloudflare Workers + +About +Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers. From acad69a7470ad5d91e923cfe6eb4bfc8d0791501 Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:14:04 +0800 Subject: [PATCH 31/52] Add files via upload --- themes/material/logo.png | Bin 0 -> 7046 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 themes/material/logo.png diff --git a/themes/material/logo.png b/themes/material/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..97738cd2c49e5bd5808ef6613f50f6d93eb44143 GIT binary patch literal 7046 zcmaKRbyQSe_xI4*ZtV0SCz2Agtg(sEef?TpMm_MmjVE=fDXEbUWPC=32TH4 zpXFZ+AJWC`o_#MSi*&QJc7l5Wt>AVJuF|YWZJn$@2ODWt17R2l<_3Y=JE;13z;*o8 zb*=rJti^3uWo3X;NQrv^7r2)t5b5IV>M4PgX8o70#QpfMnV%K-FNl|uH0%EaWeC#* zLJ%HspfDeZ*BT@O0*VOm2?&8jMMZglf*=79KS+>YK#*5JR6kGOz`@l9;p6!)Gz=yIb@lYJbhU;<6{T74`FsuzHWETgqRL7_5CuiB z5LiG!NnBh31X2(cgD8qX3VM0JPUoMR{H1;=U;!l6t!}(9X#ZpW{>$qM~5H9~z2DXeO^!xAq`q z7lSLB)sK`FxwS!ojU%rqp#KZ0B?s2k!v2m)&=J8(@cMOv!cb~P%iYD;p{;1fxBb!t zzzN5RjgMW~_4dt5%?%X`KmSqtf^*#X&$DqwD%ev4V&@NoO`28Q;ECd6rGAmNS&~e9 z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M`7f;d@-!<1+_j{P{j~Db-+p%dcvI^Emyk`Z{ylB6q^1nLJK4hcJ zl4$(XFeYQn>a)!kqPUOG^FhCAW2f-d51Y$h{l15zT*-Yvs;v1aYSKq4w%oB;II;N4 z$*e$4%JS)Cl`IjL41S5+GV3Sx&);qNp6smmlF91AMl_kpLHAMb3SfLUfka4s@ywsm z!q*In$#jEo5p?b|6JnEZ@|ZLykc6gSSj*m@KD(LeRYr|gSdu9k{ysGM7@qZbO7qKj ziP>I0t5NAzL&-t)P=WZXSTNdwQY>Vm+SHh7(tC`Ji)T7r1-y&O=pB20QBsV5N?c57 zy)1&fZ&jXsj7r8v3xgL1%vt5Qcgnh^NWIkVZg2D!g5%gC%H~Q4a?(C)M8Cm=JXX*C z75U`+&@?%%$m>f4$xm@|t_kU&TPfFP5}vuw)A-2yTnTdaV8}zY`h_3USDNnjvj?{WBII3n5q)# z2&U3)Z4FXMVXLFYtBef}+sgII!H&}jT#07wJ+C>-synAtFy}5#@^Edf zV4zq>E0$g;6YHJfAu6N6BtvU!ir(V;Y?b6E)@g1SPrJErg`7U$@G)bfFmy)g{YeMf z^C%@?RsBRa$#K*TPVmVf3bzF##9R8v6w7!fdiLu6yE%qB6%5?vP#DGe0MKkv^$mZwzn{0X=Gqu2;CmOBLV@SU4v3icaJ3h{uzTRsVi11ScLu`>K+?X literal 0 HcmV?d00001 From 28e879e97eac86172c67b1e295b18c6987b5f37d Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:14:28 +0800 Subject: [PATCH 32/52] Add files via upload --- themes/logo.png | Bin 0 -> 7046 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 themes/logo.png diff --git a/themes/logo.png b/themes/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..97738cd2c49e5bd5808ef6613f50f6d93eb44143 GIT binary patch literal 7046 zcmaKRbyQSe_xI4*ZtV0SCz2Agtg(sEef?TpMm_MmjVE=fDXEbUWPC=32TH4 zpXFZ+AJW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VmVf3bzF##9R8v6w7!fdiLu6yE%qB6%5?vP#DGe0MKkv^$mZwzn{0X=Gqu2;CmOBLV@SU4v3icaJ3h{uzTRsVi11ScLu`>K+?X literal 0 HcmV?d00001 From 6b015e22d2487d3da10b9ec2618e2cfef9e20b7d Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:14:58 +0800 Subject: [PATCH 33/52] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d52b26..ba75e70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![GoIndex](/theme/logo.png) +![GoIndex](https://raw.githubusercontent.com/donwa/goindex/master/themes/logo.png) GoIndex ==== From 3c86bb4c7e15530d704d614307e838d5d61f511d Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:19:37 +0800 Subject: [PATCH 34/52] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ba75e70..0ec4648 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ GoIndex ==== -Combining the power of Cloudflare Workers and Google Drive will allow you to index you files on the browser on Cloudflare Workers. +Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and [Google Drive](https://www.google.com/drive/) will allow you to index you files on the browser on Cloudflare Workers. `index.js` is the content of the Workers script. @@ -11,11 +11,11 @@ Combining the power of Cloudflare Workers and Google Drive will allow you to ind ## Deployment 1.Install `rclone` software locally -2.Follow https://rclone.org/drive/ bind a drive +2.Follow [https://rclone.org/drive/]( https://rclone.org/drive/) bind a drive 3.Execute the command`rclone config file` to find the file `rclone.conf` path 4.Open `rclone.conf`,find the configuration `root_folder_id` and `refresh_token` 5.Download index.js in https://github.com/donwa/goindex and fill in root and refresh_token -6.Deploy the code to Cloudflare Workers +6.Deploy the code to [Cloudflare Workers](https://www.cloudflare.com/) About Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers. From 2fb882549a697cb703b8a2978c918eb9f116f4c5 Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:19:52 +0800 Subject: [PATCH 35/52] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ec4648..ad21901 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,5 @@ Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and 5.Download index.js in https://github.com/donwa/goindex and fill in root and refresh_token 6.Deploy the code to [Cloudflare Workers](https://www.cloudflare.com/) -About +## About Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers. From e1081b672aaca4fd2b9a1ede78f66950bba7b22a Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:24:51 +0800 Subject: [PATCH 36/52] Update README_zh.md --- README_zh.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README_zh.md b/README_zh.md index f36265a..f655fa0 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,10 +1,10 @@ -# goindex -Google Drive Directory Index +![GoIndex](https://raw.githubusercontent.com/donwa/goindex/master/themes/logo.png) -## 功能: -部署在 CloudFlare Workers的小程序。 -可以将 Google Drive 文件以目录形式列出,并直连下载。 -流量走 CloudFlare ,网速由 CloudFlare 决定。 +GoIndex +==== +基于 [Cloudflare Workers](https://workers.cloudflare.com/) 和 [Google Drive](https://www.google.com/drive/) 的功能,你可以部署你的代码在Cloudflare Workers,实现以目录形式展示google drive中的文件。 + +`index.js` 包含 Workers 所需的代码. ## Demo [https://index.gd.workers.dev/](https://index.gd.workers.dev/) @@ -17,7 +17,6 @@ Google Drive Directory Index 4、下载 https://github.com/donwa/goindex 中的 index.js 并填入 root 和 refresh_token 5、复制代码 到 CloudFlare 部署。 - ## 安装部署方案2 作者不会记录refresh_token,但为避免纠纷,建议有条件的同学使用方案1进行部署 1、访问[https://install.gd.workers.dev/](https://install.gd.workers.dev/) From 5f612c0b9a1c4e57e27878b043c7ac2554eaf9d2 Mon Sep 17 00:00:00 2001 From: donwa85 Date: Wed, 11 Sep 2019 10:26:04 +0800 Subject: [PATCH 37/52] delete --- themes/material/logo.png | Bin 7046 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 themes/material/logo.png diff --git a/themes/material/logo.png b/themes/material/logo.png deleted file mode 100644 index 97738cd2c49e5bd5808ef6613f50f6d93eb44143..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7046 zcmaKRbyQSe_xI4*ZtV0SCz2Agtg(sEef?TpMm_MmjVE=fDXEbUWPC=32TH4 zpXFZ+AJWC`o_#MSi*&QJc7l5Wt>AVJuF|YWZJn$@2ODWt17R2l<_3Y=JE;13z;*o8 zb*=rJti^3uWo3X;NQrv^7r2)t5b5IV>M4PgX8o70#QpfMnV%K-FNl|uH0%EaWeC#* zLJ%HspfDeZ*BT@O0*VOm2?&8jMMZglf*=79KS+>YK#*5JR6kGOz`@l9;p6!)Gz=yIb@lYJbhU;<6{T74`FsuzHWETgqRL7_5CuiB z5LiG!NnBh31X2(cgD8qX3VM0JPUoMR{H1;=U;!l6t!}(9X#ZpW{>$qM~5H9~z2DXeO^!xAq`q z7lSLB)sK`FxwS!ojU%rqp#KZ0B?s2k!v2m)&=J8(@cMOv!cb~P%iYD;p{;1fxBb!t zzzN5RjgMW~_4dt5%?%X`KmSqtf^*#X&$DqwD%ev4V&@NoO`28Q;ECd6rGAmNS&~e9 zj~hT)6lbP=@RTAIiCd<9VHB=OFRfF)@}&xYAXQo1mKV>e3u{vMCRv&wk`h+lv=fzlQrQZw>;wQpvg* zyPe4!$ZF*?sIgUbo@CLnkZZUocN@faf8J~`Hg>PegG#1PQre)@1=!lUXy@B=6eGO6 zt7*V3^h#{Tl!9OuKC+M`RanQ;RPrYEU`&?(QFnJt1EU!p4`<~V z7#G`sR_-_+Fh^=1+_sQDa=eKg5T|8Hf0`ec-8Gax(R#)Dd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7qKj ziP>I0t5NAzL&-t)P=WZXSTNdwQY>Vm+SHh7(tC`Ji)T7r1-y&O=pB20QBsV5N?c57 zy)1&fZ&jXsj7r8v3xgL1%vt5Qcgnh^NWIkVZg2D!g5%gC%H~Q4a?(C)M8Cm=JXX*C z75U`+&@?%%$m>f4$xm@|t_kU&TPfFP5}vuw)A-2yTnTdaV8}zY`h_3USDNnjvj?{WBII3n5q)# z2&U3)Z4FXMVXLFYtBef}+sgII!H&}jT#07wJ+C>-synAtFy}5#@^Edf zV4zq>E0$g;6YHJfAu6N6BtvU!ir(V;Y?b6E)@g1SPrJErg`7U$@G)bfFmy)g{YeMf z^C%@?RsBRa$#K*TPVmVf3bzF##9R8v6w7!fdiLu6yE%qB6%5?vP#DGe0MKkv^$mZwzn{0X=Gqu2;CmOBLV@SU4v3icaJ3h{uzTRsVi11ScLu`>K+?X From 53b14ec1a1db456453836c88cf96d0b966cf04ca Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:38:06 +0800 Subject: [PATCH 38/52] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ad21901..ff88f6d 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,12 @@ Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and 5.Download index.js in https://github.com/donwa/goindex and fill in root and refresh_token 6.Deploy the code to [Cloudflare Workers](https://www.cloudflare.com/) +## Quick Deployment +1.Open https://installen.gd.workers.dev/ +2.Auth and get the code +3.Deploy the code to [Cloudflare Workers](https://www.cloudflare.com/) + + + ## About Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers. From 0c3b338b35a86af88aeeb24f46a566f6178fd07e Mon Sep 17 00:00:00 2001 From: donwa Date: Wed, 11 Sep 2019 10:45:55 +0800 Subject: [PATCH 39/52] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ff88f6d..97e8102 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ GoIndex ==== +Google Drive Directory Index Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and [Google Drive](https://www.google.com/drive/) will allow you to index you files on the browser on Cloudflare Workers. `index.js` is the content of the Workers script. From fec3dfbf7b1dc5f1d8b18d1633e87a2b6399f7c7 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 09:19:51 +0800 Subject: [PATCH 40/52] =?UTF-8?q?=E8=BF=87=E6=BB=A4=20'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e65c3dd..2590507 100644 --- a/index.js +++ b/index.js @@ -120,7 +120,7 @@ class googleDrive { async _file(path){ let arr = path.split('/'); let name = arr.pop(); - name = decodeURIComponent(name); + name = decodeURIComponent(name).replace(/\'/g, "\\'"); let dir = arr.join('/')+'/'; console.log(name, dir); let parent = await this.findPathId(dir); @@ -205,7 +205,7 @@ class googleDrive { } async _findDirId(parent, name){ - name = decodeURIComponent(name); + name = decodeURIComponent(name).replace(/\'/g, "\\'"); console.log("_findDirId",parent,name); From 6b85165a5057c2cbe85326dd7df5b843651a35a2 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 17:11:13 +0800 Subject: [PATCH 41/52] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 266 +++++++++++++++++++++++++---------------- 1 file changed, 160 insertions(+), 106 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index f1208b0..568edba 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -12,40 +12,20 @@ function init(){ -
    - - -
    -
      -
    • -
      - 文件 -
      -
      - 修改时间 -
      -
      - 大小 -
      -
    • -
    -
    -
    -
      -
    -
    - - +
    - -`; + `; $('body').html(html); } function render(path){ title(path); nav(path); - list(path); + if(path.substr(-1) == '/'){ + list(path); + }else{ + file(path); + } } @@ -77,6 +57,32 @@ function nav(path){ // 渲染文件列表 function list(path){ + var content = ` + + +
    +
      +
    • +
      + 文件 +
      +
      + 修改时间 +
      +
      + 大小 +
      +
    • +
    +
    +
    +
      +
    +
    + + `; + $('#content').html(content); + var password = localStorage.getItem('password'+path); $('#list').html(`
    `); $('#readme_md').hide().html(''); @@ -130,6 +136,10 @@ function list_files(path,files){ markdown("#head_md",data); }); } + var ext = p.split('.').pop(); + if("|html|php|css|go|java|js|json|txt|sh|md|mp4|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ + p += "?a=view"; + } html += `
  • insert_drive_file @@ -158,84 +168,131 @@ function get_file(path, file, callback){ } } -// 文件预览 -var previewDom, previewUrl; -function file_preview(a) { - var fileUrl = a.href; - if(fileUrl == previewUrl) { - previewDom.remove(); - previewUrl = ""; - return false; - } - if(previewDom !== undefined) - { - previewDom.remove(); - } - var preview = `
    -
    - previewHtml -
    - - -
    -
    -
    `; - var fileType = $(a).attr("gd-type"); - var isPreview; - switch (fileType){ - case "video/mp4": - case "video/x-matroska": // .mkv - case "video/quicktime": // .mov - isPreview = true; - preview = preview.replace("previewHtml", ``); - break; - case "image/jpeg": - case "image/gif": - case "image/png": - isPreview = true; - preview = `
    ` + preview; - preview = $(preview.replace("previewHtml", ``)); - preview.find("img")[0].onload = function(){ - $("#progressBar").remove(); - } - break; - case "text/markdown": - case "text/plain": - var mdName = fileUrl.split('/').pop(); - if(mdName !== "HEAD.md" && mdName !== "README.md") { - isPreview = true; - preview = `
    ` + preview; - preview = $(preview.replace("previewHtml", `
    `)); - $.get(fileUrl, function(data){ - markdown("#markdownShow",data); - $("#progressBar").remove(); - }); - } - break; - } - if(isPreview) { - previewUrl = fileUrl; - previewDom = $(preview); - previewDom.on("click", "#fileDownload", function () { - var downForm = $('
    '); - downForm.attr('action', fileUrl); - downForm.appendTo(previewDom); - downForm.submit(); - }); - previewDom.on("click", "#previewClose", function () { - if(previewDom !== undefined) - { - previewDom.remove(); - } - previewUrl = ""; - }); - $(a).parent().after(previewDom); - return false; - } - return true; + +// 文件展示 ?a=view +function file(path){ + var name = path.split('/').pop(); + var ext = name.split('.').pop().toLowerCase().replace(`?a=view`,""); + if("|html|php|css|go|java|js|json|txt|sh|md|".indexOf(`|${ext}|`) >= 0){ + return file_code(path); + } + + if("|mp4|".indexOf(`|${ext}|`) >= 0){ + return file_video(path); + } + + if("|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ + return file_image(path); + } +} + +// 文件展示 |html|php|css|go|java|js|json|txt|sh|md| +function file_code(path){ + var type = { + "html":"html", + "php":"php", + "css":"css", + "go":"golang", + "java":"java", + "js":"javascript", + "json":"json", + "txt":"Text", + "sh":"sh", + "md":"Markdown", + }; + var name = path.split('/').pop(); + var ext = name.split('.').pop(); + var href = window.location.origin + path; + var content = ` +
    +
    
    +
    +
    + + +
    +
    file_download + + + + `; + $('#content').html(content); + + $.get(path, function(data){ + $('#editor').html($('
    ').text(data).html()); + var code_type = "Text"; + if(type[ext] != undefined ){ + code_type = type[ext]; + } + var editor = ace.edit("editor"); + editor.setTheme("ace/theme/ambiance"); + editor.setFontSize(18); + editor.session.setMode("ace/mode/"+code_type); + + //Autocompletion + editor.setOptions({ + enableBasicAutocompletion: true, + enableSnippets: true, + enableLiveAutocompletion: true, + maxLines: Infinity + }); + }); +} + +// 文件展示 mp4 +function file_video(path){ + var url = window.location.origin + path; + var content = ` +
    +
    + +
    + +
    + + +
    +
    + + +
    +
    +file_download + `; + $('#content').html(content); +} + +// +function file_image(path){ + var url = window.location.origin + path; + var content = ` +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +file_download + `; + $('#content').html(content); } + //时间转换 function utc2beijing(utc_datetime) { // 转为正常的时间格式 年-月-日 时:分:秒 @@ -315,9 +372,6 @@ $(function(){ render(url); return false; }); - - $("body").on("click", ".file", function() { - return file_preview(this); - }); + render(path); }); From c0971ee09c7308fbd59ea6a6aec71c4538251e65 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 17:12:21 +0800 Subject: [PATCH 42/52] Update README_zh.md --- README_zh.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README_zh.md b/README_zh.md index f655fa0..548d583 100644 --- a/README_zh.md +++ b/README_zh.md @@ -32,6 +32,12 @@ GoIndex ## 更新日志 +1.0.5 +添加文件展示页 + +1.0.4 +修复 注入问题。 + 1.0.3 修复 `.password` 绕过下载问题。 From c4e238d52dcde409c3113d0fbad54b5e310374d9 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 17:12:50 +0800 Subject: [PATCH 43/52] version to 1.0.5 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2590507..c8b0d32 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password - "version" : "1.0.3", // 程序版本 + "version" : "1.0.5", // 程序版本 "theme" : "material", "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", From c3682de3dbfe5b26ce4f325a052141e0f4958f22 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 18:53:47 +0800 Subject: [PATCH 44/52] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/material/app.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index 568edba..55bb7b0 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -19,6 +19,9 @@ function init(){ } function render(path){ + if(path.indexOf("?") > 0){ + path = path.substr(0,path.indexOf("?")); + } title(path); nav(path); if(path.substr(-1) == '/'){ @@ -126,6 +129,7 @@ function list_files(path,files){
  • `; }else{ var p = path+item.name; + var c = "file"; if(item.name == "README.md"){ get_file(p, item, function(data){ markdown("#readme_md",data); @@ -139,8 +143,9 @@ function list_files(path,files){ var ext = p.split('.').pop(); if("|html|php|css|go|java|js|json|txt|sh|md|mp4|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ p += "?a=view"; + c += "view"; } - html += `
  • + html += `
  • insert_drive_file ${item.name} @@ -246,7 +251,7 @@ function file_video(path){ var content = `

    -
    .. + + + + + `; + } + $('#table').html(content); + + var password = localStorage.getItem('password'+path); + $.post(path,'{"password":"'+password+'"}', function(data,status){ + var obj = jQuery.parseJSON(data); + if(typeof obj != 'null' && obj.hasOwnProperty('error') && obj.error.code == '401'){ + var pass = prompt("password",""); + localStorage.setItem('password'+path, pass); + if(pass != null && pass != ""){ + list(path); + }else{ + history.go(-1); + } + }else if(typeof obj != 'null'){ + list_files(path,obj.files); + } + }); +} + +function list_files(path,files){ + html = ""; + for(i in files){ + var item = files[i]; + if(item['size']==undefined){ + item['size'] = ""; + } + item['modifiedTime'] = utc2beijing(item['modifiedTime']); + item['size'] = formatFileSize(item['size']); + if(item['mimeType'] == 'application/vnd.google-apps.folder'){ + var p = path+item.name+'/'; + html +=` + + ${item.name}/ + ${item['size']} + ${item['modifiedTime']} + + `; + }else{ + var p = path+item.name; + html += ` + + ${item.name} + ${item['size']} + ${item['modifiedTime']} + + `; + } + } + $('#table').append(html); +} + +//时间转换 +function utc2beijing(utc_datetime) { + // 转为正常的时间格式 年-月-日 时:分:秒 + var T_pos = utc_datetime.indexOf('T'); + var Z_pos = utc_datetime.indexOf('Z'); + var year_month_day = utc_datetime.substr(0,T_pos); + var hour_minute_second = utc_datetime.substr(T_pos+1,Z_pos-T_pos-1); + var new_datetime = year_month_day+" "+hour_minute_second; // 2017-03-31 08:02:06 + + // 处理成为时间戳 + timestamp = new Date(Date.parse(new_datetime)); + timestamp = timestamp.getTime(); + timestamp = timestamp/1000; + + // 增加8个小时,北京时间比utc时间多八个时区 + var unixtimestamp = timestamp+8*60*60; + + // 时间戳转为时间 + var unixtimestamp = new Date(unixtimestamp*1000); + var year = 1900 + unixtimestamp.getYear(); + var month = "0" + (unixtimestamp.getMonth() + 1); + var date = "0" + unixtimestamp.getDate(); + var hour = "0" + unixtimestamp.getHours(); + var minute = "0" + unixtimestamp.getMinutes(); + var second = "0" + unixtimestamp.getSeconds(); + return year + "-" + month.substring(month.length-2, month.length) + "-" + date.substring(date.length-2, date.length) + + " " + hour.substring(hour.length-2, hour.length) + ":" + + minute.substring(minute.length-2, minute.length) + ":" + + second.substring(second.length-2, second.length); +} + +// bytes自适应转换到KB,MB,GB +function formatFileSize(bytes) { + if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';} + else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';} + else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';} + else if (bytes>1) {bytes=bytes+' bytes';} + else if (bytes==1) {bytes=bytes+' byte';} + else {bytes='';} + return bytes; +} + +// 监听回退事件 +window.onpopstate = function(){ + var path = window.location.pathname; + render(path); +} + + +$(function(){ + init(); + var path = window.location.pathname; + $("body").on("click",'.folder',function(){ + var url = $(this).attr('href'); + history.pushState(null, null, url); + render(url); + return false; + }); + + render(path); +}); From 4fb64e0afdbfb705c17a26e963203005f6003dd5 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 20:03:34 +0800 Subject: [PATCH 46/52] Update README_zh.md --- README_zh.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README_zh.md b/README_zh.md index 548d583..3a522e3 100644 --- a/README_zh.md +++ b/README_zh.md @@ -32,6 +32,10 @@ GoIndex ## 更新日志 + +1.0.6 +添加 classic 模板 + 1.0.5 添加文件展示页 From 4d59dd767277e79736cc1059e7675aa46bc1fbad Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 20:04:27 +0800 Subject: [PATCH 47/52] theme select --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7566b56..ab9391f 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ var authConfig = { "siteName": "GoIndex", // 网站名称 "root_pass": "index", // 根目录密码,优先于.password "version" : "1.0.6", // 程序版本 - "theme" : "material", + "theme" : "material", // material classic "client_id": "202264815644.apps.googleusercontent.com", "client_secret": "X4Z3ca8xfWDb1Voo-F9a7ZxJ", "refresh_token": "", // 授权 token From 64c073672767685fd34c66d397128f225264588f Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 20:09:00 +0800 Subject: [PATCH 48/52] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_zh.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README_zh.md b/README_zh.md index 3a522e3..f8f0f06 100644 --- a/README_zh.md +++ b/README_zh.md @@ -6,9 +6,11 @@ GoIndex `index.js` 包含 Workers 所需的代码. -## Demo +## Demo +material: [https://index.gd.workers.dev/](https://index.gd.workers.dev/) - +classic: +[https://indexc.gd.workers.dev/](https://indexc.gd.workers.dev/) ## 安装部署方案1 1、在本地安装 rclone From 9dd838fc5a5b38db9d1c2b34664fb50c41d81bc9 Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 20:10:44 +0800 Subject: [PATCH 49/52] themes demo --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 97e8102..4b6ad1b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and `index.js` is the content of the Workers script. ## Demo -[https://index.gd.workers.dev/](https://index.gd.workers.dev/) +material: [https://index.gd.workers.dev/](https://index.gd.workers.dev/) +classic: [https://indexc.gd.workers.dev/](https://indexc.gd.workers.dev/) ## Deployment 1.Install `rclone` software locally From 5bb4d48b5db6c65472478ddd9fdfdbf8380903ce Mon Sep 17 00:00:00 2001 From: donwa Date: Thu, 12 Sep 2019 20:18:18 +0800 Subject: [PATCH 50/52] fix class name --- themes/material/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/material/app.js b/themes/material/app.js index 55bb7b0..0d1b39c 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -143,7 +143,7 @@ function list_files(path,files){ var ext = p.split('.').pop(); if("|html|php|css|go|java|js|json|txt|sh|md|mp4|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ p += "?a=view"; - c += "view"; + c += " view"; } html += `
  • From f4f24950e9492e42963e982c265dbcc71172f1b9 Mon Sep 17 00:00:00 2001 From: donwa Date: Fri, 13 Sep 2019 12:04:38 +0800 Subject: [PATCH 51/52] add folder class --- themes/material/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/material/app.js b/themes/material/app.js index 0d1b39c..c54a477 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -52,7 +52,7 @@ function nav(path){ if(n == ''){ break; } - html += `chevron_right${n}`; + html += `chevron_right${n}`; } } $('#nav').html(html); From f1e81c96186cab38c5a67a9479f5b6cc7d885ebb Mon Sep 17 00:00:00 2001 From: zhuYe Date: Thu, 10 Oct 2019 07:36:41 +0800 Subject: [PATCH 52/52] Update app.js --- themes/material/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/material/app.js b/themes/material/app.js index c54a477..2053ae0 100644 --- a/themes/material/app.js +++ b/themes/material/app.js @@ -141,7 +141,7 @@ function list_files(path,files){ }); } var ext = p.split('.').pop(); - if("|html|php|css|go|java|js|json|txt|sh|md|mp4|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ + if("|html|php|css|go|java|js|json|txt|sh|md|mp4|webm|mkv|bmp|jpg|jpeg|png|gif|".indexOf(`|${ext}|`) >= 0){ p += "?a=view"; c += " view"; } @@ -183,7 +183,7 @@ function file(path){ return file_code(path); } - if("|mp4|".indexOf(`|${ext}|`) >= 0){ + if("|mp4|webm|mkv|".indexOf(`|${ext}|`) >= 0){ return file_video(path); }