mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-08 11:27:28 +08:00
luci-app-aliyundrive-webdav: update to 1.11.0 and remove useless commands (#191)
* luci-app-aliyundrive-webdav: update to 1.11.0 and remove useless commands * luci-app-aliyundrive-webdav:remove aliyunpds support and fix QR code garbled problem
This commit is contained in:
parent
9fc2e3466b
commit
a8351ec14e
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-aliyundrive-webdav
|
||||
PKG_VERSION:=1.10.6
|
||||
PKG_VERSION:=1.11.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
|
@ -6,18 +6,19 @@ function index()
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "services", "aliyundrive-webdav"}, alias("admin", "services", "aliyundrive-webdav", "client"), _("AliyunDrive WebDAV"), 10) -- 首页
|
||||
page = entry({ "admin", "services", "aliyundrive-webdav" }, alias("admin", "services", "aliyundrive-webdav", "client"),
|
||||
_("AliyunDrive WebDAV"), 10) -- 首页
|
||||
page.dependent = true
|
||||
page.acl_depends = { "luci-app-aliyundrive-webdav" }
|
||||
|
||||
entry({"admin", "services", "aliyundrive-webdav", "client"}, cbi("aliyundrive-webdav/client"), _("Settings"), 10).leaf = true -- 客户端配置
|
||||
entry({"admin", "services", "aliyundrive-webdav", "log"}, form("aliyundrive-webdav/log"), _("Log"), 30).leaf = true -- 日志页面
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "client" }, cbi("aliyundrive-webdav/client"), _("Settings"), 10).leaf = true -- 客户端配置
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "log" }, form("aliyundrive-webdav/log"), _("Log"), 30).leaf = true -- 日志页面
|
||||
|
||||
entry({"admin", "services", "aliyundrive-webdav", "status"}, call("action_status")).leaf = true -- 运行状态
|
||||
entry({"admin", "services", "aliyundrive-webdav", "logtail"}, call("action_logtail")).leaf = true -- 日志采集
|
||||
entry({"admin", "services", "aliyundrive-webdav", "qrcode"}, call("action_generate_qrcode")).leaf = true -- 生成扫码登录二维码地址和参数
|
||||
entry({"admin", "services", "aliyundrive-webdav", "query"}, call("action_query_qrcode")).leaf = true -- 查询扫码登录结果
|
||||
entry({"admin", "services", "aliyundrive-webdav", "invalidate-cache"}, call("action_invalidate_cache")).leaf = true -- 清除缓存
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "status" }, call("action_status")).leaf = true -- 运行状态
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "logtail" }, call("action_logtail")).leaf = true -- 日志采集
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "qrcode" }, call("action_generate_qrcode")).leaf = true -- 生成扫码登录二维码地址和参数
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "query" }, call("action_query_qrcode")).leaf = true -- 查询扫码登录结果
|
||||
entry({ "admin", "services", "aliyundrive-webdav", "invalidate-cache" }, call("action_invalidate_cache")).leaf = true -- 清除缓存
|
||||
end
|
||||
|
||||
function action_status()
|
||||
|
@ -44,10 +44,6 @@ prefer_http_download = e:option(Flag, "prefer_http_download", translate("Prefer
|
||||
prefer_http_download.description = translate("Prefer downloading files using HTTP instead of HTTPS protocol")
|
||||
prefer_http_download.rmempty = false
|
||||
|
||||
no_redirect = e:option(Flag, "no_redirect", translate("Disable Redirect"))
|
||||
no_redirect.description = translate("Disable 302 redirect when using app refresh token")
|
||||
no_redirect.rmempty = false
|
||||
|
||||
upload_buffer_size = e:option(Value, "upload_buffer_size", translate("Upload Buffer Size"))
|
||||
upload_buffer_size.default = "16777216"
|
||||
upload_buffer_size.datatype = "uinteger"
|
||||
@ -71,9 +67,6 @@ read_only = e:option(Flag, "read_only", translate("Enable read only mode"))
|
||||
read_only.description = translate("Disallow upload, modify and delete file operations")
|
||||
read_only.rmempty = false
|
||||
|
||||
domain_id = e:option(Value, "domain_id", translate("Domain ID"))
|
||||
domain_id.description = translate("Input domain_id option will use <a href=\"https://www.aliyun.com/product/storage/pds\" target=\"_blank\">Aliyun PDS</a> instead of <a href=\"https://www.aliyundrive.com\" target=\"_blank\">AliyunDrive</a>")
|
||||
|
||||
debug = e:option(Flag, "debug", translate("Debug Mode"))
|
||||
debug.rmempty = false
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
background: rgba(255, 255, 255, .8);
|
||||
}
|
||||
#mask-box #code-box {
|
||||
color: #000000;
|
||||
width: 288px;
|
||||
height: 325px;
|
||||
border: 1px solid #585858;
|
||||
@ -50,31 +51,31 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
(function( window, document, undefined ) {
|
||||
// 选取 DOM 元素
|
||||
// 选取 DOM 元素
|
||||
var selector, section = document.querySelector("[id$='refresh_token']");
|
||||
|
||||
// 遮罩容器
|
||||
// 遮罩容器
|
||||
var mask = document.createElement('div');
|
||||
mask.id = 'mask-box';
|
||||
|
||||
// 二维码容器
|
||||
// 二维码容器
|
||||
var code = document.createElement('div');
|
||||
code.id = 'code-box';
|
||||
code.innerHTML = "请使用 阿里云盘 App 进行扫码认证";
|
||||
code.innerHTML = "请使用 阿里云盘 App 进行扫码认证";
|
||||
|
||||
// 刷新按钮
|
||||
// 刷新按钮
|
||||
var load = document.createElement('a');
|
||||
load.id = 'load-link';
|
||||
load.innerHTML = "刷新";
|
||||
load.innerHTML = "刷新";
|
||||
|
||||
// 创建二维码
|
||||
// 创建二维码
|
||||
var make = new QRCode( code, { correctLevel: QRCode.CorrectLevel.L });
|
||||
make.clear = function() {
|
||||
code.getElementsByTagName("img").item(0).removeAttribute('src');
|
||||
this._oDrawing.clear();
|
||||
}
|
||||
|
||||
// 关闭按钮
|
||||
// 关闭按钮
|
||||
var link = document.createElement('a');
|
||||
link.id = 'close-link';
|
||||
link.addEventListener('click', ( e ) => {
|
||||
@ -84,12 +85,12 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 二维码层居中
|
||||
// 二维码层居中
|
||||
var center = function() {
|
||||
// 调整遮罩层覆盖范围
|
||||
// 调整遮罩层覆盖范围
|
||||
mask.style.width = section.clientWidth + "px";
|
||||
mask.style.height = section.clientHeight + "px";
|
||||
// 二维码层居中
|
||||
// 二维码层居中
|
||||
var top = selector.offsetTop - selector.parentNode.offsetTop;
|
||||
if ( selector.offsetTop <= 380 ) {
|
||||
code.style.top = top + selector.offsetHeight + "px";
|
||||
@ -99,27 +100,27 @@
|
||||
code.style.left = ( ( section.offsetWidth - code.offsetWidth ) / 2 ) + parseInt( ( selector.currentStyle || window.getComputedStyle( selector ) ).marginLeft ) + "px";
|
||||
};
|
||||
|
||||
// 获取二维码
|
||||
// 获取二维码
|
||||
var feedback = function() {
|
||||
// 清除二维码
|
||||
// 清除二维码
|
||||
make.clear();
|
||||
// 获取通信数据
|
||||
// 获取通信数据
|
||||
XHR.get( '<%=luci.dispatcher.build_url("admin", "services", "aliyundrive-webdav","qrcode")%>', null, ( x, d ) => {
|
||||
if ( x.status != 200 ) {
|
||||
alert('获取二维码失败!');
|
||||
alert('获取二维码失败!');
|
||||
return false;
|
||||
}
|
||||
// 移除刷新
|
||||
// 移除刷新
|
||||
load.remove();
|
||||
// 创建二维码
|
||||
// 创建二维码
|
||||
make.makeCode( d.codeContent );
|
||||
// 监听扫码反馈
|
||||
// 监听扫码反馈
|
||||
XHR.poll( 3, '<%=luci.dispatcher.build_url("admin", "services", "aliyundrive-webdav", "query")%>', { t: d.t, ck: d.ck }, ( x, d ) => {
|
||||
if ( d.refresh_token.trim() ) {
|
||||
// 清除线程
|
||||
// 清除线程
|
||||
XHR.halt();
|
||||
XHR._q = [];
|
||||
// 回写 Cookie 数据
|
||||
// 回写 Cookie 数据
|
||||
mask.remove();
|
||||
selector.value = d.refresh_token.trim();
|
||||
}
|
||||
@ -127,9 +128,9 @@
|
||||
});
|
||||
};
|
||||
|
||||
// 鼠标事件
|
||||
// 鼠标事件
|
||||
var event = function( e ) {
|
||||
// 区分单击、双击事件
|
||||
// 区分单击、双击事件
|
||||
if ( e.target.tagName == "INPUT" && e.type == "dblclick" ) {
|
||||
selector = e.target;
|
||||
} else if ( e.target.tagName == "IMG" && e.type == "click" && /add/ig.test( e.target.src ) ) {
|
||||
@ -138,18 +139,18 @@
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// 插入容器
|
||||
// 插入容器
|
||||
if ( !document.contains( mask ) ) {
|
||||
section.prepend( mask );
|
||||
mask.prepend( code );
|
||||
code.prepend( link );
|
||||
center();
|
||||
}
|
||||
// 获取及监听扫码事件
|
||||
// 获取及监听扫码事件
|
||||
feedback();
|
||||
};
|
||||
|
||||
// 绑定事件
|
||||
// 绑定事件
|
||||
section.addEventListener( 'click', event );
|
||||
section.addEventListener( 'dblclick', event );
|
||||
})( window, document );
|
||||
|
@ -85,12 +85,6 @@ msgstr "启用只读模式"
|
||||
msgid "Disallow upload, modify and delete file operations"
|
||||
msgstr "禁止上传、修改和删除文件操作"
|
||||
|
||||
msgid "Domain ID"
|
||||
msgstr "阿里云相册与云盘服务 domainId"
|
||||
|
||||
msgid "Input domain_id option will use <a href=\"https://www.aliyun.com/product/storage/pds\" target=\"_blank\">Aliyun PDS</a> instead of <a href=\"https://www.aliyundrive.com\" target=\"_blank\">AliyunDrive</a>"
|
||||
msgstr "填写此选项将使用<a href=\"https://www.aliyun.com/product/storage/pds\" target=\"_blank\">阿里云相册与网盘服务</a>而不是<a href=\"https://www.aliyundrive.com\" target=\"_blank\">阿里云盘</a>"
|
||||
|
||||
msgid "Skip uploading same size files"
|
||||
msgstr "跳过上传相同大小的文件"
|
||||
|
||||
@ -102,9 +96,3 @@ msgstr "使用 HTTP 下载"
|
||||
|
||||
msgid "Prefer downloading files using HTTP instead of HTTPS protocol"
|
||||
msgstr "优先使用 HTTP 而不是 HTTPS 协议下载,低端设备上降低 CPU 占用"
|
||||
|
||||
msgid "Disable Redirect"
|
||||
msgstr "禁用重定向"
|
||||
|
||||
msgid "Disable 302 redirect when using app refresh token"
|
||||
msgstr "使用 app refresh token 时禁用 302 重定向"
|
||||
|
Loading…
Reference in New Issue
Block a user