mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 06:45:13 +08:00
update 2026-05-20 18:46:21
This commit is contained in:
1 parent
4697d00834
commit
307e638681
3 files changed
+41
-6
No files matched your search
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
LUCI_TITLE:=LuCI support for ddnsto
|
||||
LUCI_DEPENDS:=+ddnsto +block-mount
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=3.2.0-r5
|
||||
PKG_VERSION:=4.0.3-r1
|
||||
PKG_RELEASE:=
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
--wulishui <wulishui@gmail.com> ,20200911
|
||||
--jjm2473 <jjm2473@gmail.com> ,20210127
|
||||
|
||||
local m, s
|
||||
local m, s, o
|
||||
|
||||
m = Map("ddnsto", translate("DDNS.to"), translate("DDNS.to is a reverse proxy.")
|
||||
m = Map("ddnsto", translate("DDNS.to"), translate("DDNS.to is a reverse proxy service.")
|
||||
.. " <a href=\"https://www.ddnsto.com/\" onclick=\"void(0)\" target=\"_blank\">"
|
||||
.. translate("Official Website")
|
||||
.. "</a>")
|
||||
@@ -18,6 +18,41 @@ s:option(Flag, "enabled", translate("Enable")).rmempty=false
|
||||
|
||||
s:option(Value, "token", translate("Token")).rmempty=false
|
||||
|
||||
o = s:option(Value, "index", translate("Device Index"))
|
||||
o.default = "0"
|
||||
o.datatype = "uinteger"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "logger", translate("Enable Logging"))
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
-- WebDAV/File Sharing settings
|
||||
s2=m:section(TypedSection, "ddnsto", translate("WebDAV File Sharing"))
|
||||
s2.addremove=false
|
||||
s2.anonymous=true
|
||||
|
||||
o = s2:option(Flag, "feat_enabled", translate("Enable WebDAV"))
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
o = s2:option(Value, "feat_port", translate("WebDAV Port"))
|
||||
o.default = "3033"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o:depends("feat_enabled", "1")
|
||||
|
||||
o = s2:option(Value, "feat_username", translate("Username"))
|
||||
o.rmempty = false
|
||||
o:depends("feat_enabled", "1")
|
||||
|
||||
o = s2:option(Value, "feat_password", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
o:depends("feat_enabled", "1")
|
||||
|
||||
o = s2:option(Value, "feat_disk_path_selected", translate("Shared Path"))
|
||||
o.rmempty = false
|
||||
o:depends("feat_enabled", "1")
|
||||
|
||||
return m
|
||||
|
||||
|
||||
@@ -97,6 +97,6 @@ Error generating stack: `+o.message+`
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const vf=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vu=Gt("smartphone",vf);function yf(){return m.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:m.jsx("div",{className:"flex items-start",children:m.jsxs("div",{className:"flex-1",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[m.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Bu,{className:"w-6 h-6 text-blue-600"})}),m.jsx("h2",{className:"text-slate-800",children:"DDNSTO 远程访问"})]}),m.jsx("p",{className:"text-slate-600 text-sm mb-2",children:"DDNSTO 远程访问,不需要公网 IP、不需要开放端口。只需一个链接,即可从任何地方安全访问您的 NAS、路由器和桌面。"}),m.jsxs("a",{href:"https://www.ddnsto.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline",children:["了解更多",m.jsx(Al,{className:"w-3 h-3"})]})]})})})}function wf({isRunning:y,isConfigured:E,hostname:d,address:U,deviceId:T,version:L,featEnabled:B,tunnelOk:G,onRefreshStatus:A}){const[Q,Z]=C.useState(!1),W={label:y?"运行中":"已停止",bgColor:y?"bg-green-100":"bg-slate-200",textColor:y?"text-green-700":"text-slate-600"},H=U&&U.trim().length>0?U:"未配置",q=Q,ae=G===!0,V=q?"检查中...":G===!0?"正常":G===!1?"无法连接服务器":"未知",Y=B==="1"||B===!0?"已开启":"未开启",we=T||"-",ze=async()=>{if(A){Z(!0);try{await A()}finally{Z(!1)}}};return m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[m.jsx("h3",{className:"text-slate-800 mb-4",children:"运行状态"}),m.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-slate-100",children:[m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${W.bgColor} ${W.textColor}`,children:W.label}),E&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-sm text-slate-500",children:"远程访问域名:"}),U&&U.trim().length>0?m.jsxs("a",{href:H,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1",children:[H,m.jsx(Al,{className:"w-3 h-3"})]}):m.jsx("span",{className:"text-sm text-slate-500",children:H})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs("button",{onClick:ze,className:"px-3 py-2 rounded-md text-blue-600 text-sm hover:bg-blue-50 transition-colors flex items-center gap-1",children:[m.jsx(hf,{className:"w-4 h-4"}),"刷新状态"]})})]}),m.jsx("div",{className:"mt-6",children:m.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[m.jsx(Bu,{className:"w-4 h-4 text-slate-400"}),q&&m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300 border-t-blue-600 animate-spin"}),m.jsxs("h4",{className:"text-sm text-slate-700",children:["服务器连接:",ae?m.jsx("span",{className:"text-green-600",children:V}):m.jsx("span",{children:V}),"| 设备 ID:",we," | 拓展功能:",Y,L?` | 版本:${L}`:""]})]})})]})}function Qu({checked:y,onChange:E,label:d,id:U,disabled:T,containerClassName:L,...B}){return m.jsxs("div",{className:`ddnsto-toggle-container ${L||""}`,children:[d&&m.jsx("label",{htmlFor:U,className:"text-sm text-slate-700 mr-3 whitespace-nowrap",children:d}),m.jsxs("label",{className:"ddnsto-toggle-switch","aria-label":d||"toggle",children:[m.jsx("input",{id:U,type:"checkbox",checked:y,disabled:T,onChange:G=>E(G.target.checked),...B}),m.jsx("span",{className:"ddnsto-toggle-slider","aria-hidden":!0})]})]})}function kf({onSave:y,isInTab:E,token:d,enabled:U,advancedConfig:T,onRegisterSave:L,onTokenChange:B,onEnabledChange:G}){const[A,Q]=C.useState(d||""),[Z,W]=C.useState(U);C.useEffect(()=>{Q(d||"")},[d]),C.useEffect(()=>{W(U)},[T,U]);const H=()=>{A.trim()&&y(A,Z?"1":"0",T)};return C.useEffect(()=>{L&&L(()=>H())},[L,A,Z,T]),m.jsxs("div",{className:E?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!E&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"text-slate-800 mb-2",children:"手动配置"}),m.jsx("p",{className:"text-xs text-slate-400 mb-6",children:"如果您已经在 DDNSTO 控制台获取了令牌,可以直接在此填写并启动插件。"})]}),m.jsxs("div",{className:"space-y-5",children:[m.jsx("div",{className:"pb-4",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用 DDNSTO"}),m.jsx(Qu,{checked:Z,onChange:q=>{W(q),G?.(q)},"aria-label":"启用 DDNSTO",containerClassName:"ml-6"})]})}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsxs("label",{className:"text-sm text-slate-700",children:["用户令牌(Token) ",m.jsx("span",{className:"text-red-500",children:"*"})]}),m.jsLine truncated
|
||||
*/const vf=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vu=Gt("smartphone",vf);function yf(){return m.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:m.jsx("div",{className:"flex items-start",children:m.jsxs("div",{className:"flex-1",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[m.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center",children:m.jsx(Bu,{className:"w-6 h-6 text-blue-600"})}),m.jsx("h2",{className:"text-slate-800",children:"DDNSTO 远程访问"})]}),m.jsx("p",{className:"text-slate-600 text-sm mb-2",children:"DDNSTO 远程访问,不需要公网 IP、不需要开放端口。只需一个链接,即可从任何地方安全访问您的 NAS、路由器和桌面。"}),m.jsxs("a",{href:"https://www.ddnsto.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline",children:["了解更多",m.jsx(Al,{className:"w-3 h-3"})]})]})})})}function wf({isRunning:y,isConfigured:E,hostname:d,address:U,deviceId:T,version:L,featEnabled:B,tunnelOk:G,onRefreshStatus:A}){const[Q,Z]=C.useState(!1),W={label:y?"运行中":"已停止",bgColor:y?"bg-green-100":"bg-slate-200",textColor:y?"text-green-700":"text-slate-600"},H=U&&U.trim().length>0?U:"未配置",q=Q,ae=G===!0,V=q?"检查中...":G===!0?"正常":G===!1?"无法连接服务器":"未知",Y=B==="1"||B===!0?"已开启":"未开启",we=T||"-",ze=async()=>{if(A){Z(!0);try{await A()}finally{Z(!1)}}};return m.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[m.jsx("h3",{className:"text-slate-800 mb-4",children:"运行状态"}),m.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-slate-100",children:[m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${W.bgColor} ${W.textColor}`,children:W.label}),E&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-sm text-slate-500",children:"远程访问域名:"}),U&&U.trim().length>0?m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("a",{href:H,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1",children:[H,m.jsx(Al,{className:"w-3 h-3"})]}),m.jsx("span",{className:"text-xs text-amber-600",title:"如域名已失效,请重新运行快速向导",children:"(如失效请重新运行快速向导)"})]}):m.jsx("span",{className:"text-sm text-slate-500",children:H})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs("button",{onClick:ze,className:"px-3 py-2 rounded-md text-blue-600 text-sm hover:bg-blue-50 transition-colors flex items-center gap-1",children:[m.jsx(hf,{className:"w-4 h-4"}),"刷新状态"]})})]}),m.jsx("div",{className:"mt-6",children:m.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[m.jsx(Bu,{className:"w-4 h-4 text-slate-400"}),q&&m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300 border-t-blue-600 animate-spin"}),m.jsxs("h4",{className:"text-sm text-slate-700",children:["服务器连接:",ae?m.jsx("span",{className:"text-green-600",children:V}):m.jsx("span",{children:V}),"| 设备 ID:",we," | 拓展功能:",Y,L?` | 版本:${L}`:""]})]})})]})}function Qu({checked:y,onChange:E,label:d,id:U,disabled:T,containerClassName:L,...B}){return m.jsxs("div",{className:`ddnsto-toggle-container ${L||""}`,children:[d&&m.jsx("label",{htmlFor:U,className:"text-sm text-slate-700 mr-3 whitespace-nowrap",children:d}),m.jsxs("label",{className:"ddnsto-toggle-switch","aria-label":d||"toggle",children:[m.jsx("input",{id:U,type:"checkbox",checked:y,disabled:T,onChange:G=>E(G.target.checked),...B}),m.jsx("span",{className:"ddnsto-toggle-slider","aria-hidden":!0})]})]})}function kf({onSave:y,isInTab:E,token:d,enabled:U,advancedConfig:T,onRegisterSave:L,onTokenChange:B,onEnabledChange:G}){const[A,Q]=C.useState(d||""),[Z,W]=C.useState(U);C.useEffect(()=>{Q(d||"")},[d]),C.useEffect(()=>{W(U)},[T,U]);const H=()=>{A.trim()&&y(A,Z?"1":"0",T)};return C.useEffect(()=>{L&&L(()=>H())},[L,A,Z,T]),m.jsxs("div",{className:E?"":"bg-white rounded-lg border border-slate-200 p-6 mb-4",children:[!E&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"text-slate-800 mb-2",children:"手动配置"}),m.jsx("p",{className:"text-xs text-slate-400 mb-6",children:"如果您已经在 DDNSTO 控制台获取了令牌,可以直接在此填写并启动插件。"})]}),m.jsxs("div",{className:"space-y-5",children:[m.jsx("div",{className:"pb-4",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("h4",{className:"text-sm text-slate-700",children:"启用 DDNSTO"}),m.jsx(Qu,{checked:Z,onChange:q=>{W(q),G?.(q)},"aria-label":"启用 DDNSTO",containerClassName:"ml-6"})]})}),m.jsxs("div",Line truncated
|
||||
${jf}
|
||||
${zf}`;if(Mf&>.attachShadow){const E=gt.shadowRoot||gt.attachShadow({mode:"open"});if(!E.querySelector("style[data-ddnsto-style]")){const d=document.createElement("style");d.setAttribute("data-ddnsto-style","true"),d.textContent=y,E.appendChild(d)}Ui=E,bl(gt,Ul),bl(gt.parentElement,Ul)}else{if(!document.head.querySelector("style[data-ddnsto-style]")){const E=document.createElement("style");E.setAttribute("data-ddnsto-style","true"),E.textContent=y,document.head.appendChild(E)}bl(gt,Ul),bl(gt.parentElement,Ul)}Ui&&qd.createRoot(Ui).render(m.jsx(Kd.StrictMode,{children:m.jsx(Ef,{config:Lf})}))}
|
||||
Reference in new issue
Block a user