update 2024-02-19 23:29:07
23
luci-app-istorex/Makefile
Executable file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=IstoreX
|
||||
PKG_VERSION:=0.6.6
|
||||
LUCI_DEPENDS:=+luci-app-quickstart +luci-app-store +luci-lib-taskd
|
||||
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.15)
|
||||
LUCI_MINIFY_CSS:=0
|
||||
LUCI_MINIFY_JS:=0
|
||||
|
||||
define Package/luci-app-istorex/conffiles
|
||||
/etc/config/istorex
|
||||
/www/luci-static/istorex/image/bg.gif
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
BIN
luci-app-istorex/htdocs/luci-static/istorex/bg.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
@ -0,0 +1 @@
|
||||
import{d as y,i as p,r as x,o as t,c as n,a as s,b as C,l as a,H as B,_ as D,p as $,q as I,u as S,F as _,E as k,m as v,e as h}from"./index.js?v=5b4be379";const b=e=>($("data-v-f0f8da84"),e=e(),I(),e),F={class:"disk-item"},E={class:"disk-item_contanier"},z={class:"disk-item_icon"},N={class:"disk-item_name"},w=b(()=>s("div",{class:"auto"},null,-1)),O={class:"disk-item_used"},V={key:0,class:"disk-item_info"},j={class:"label-msg.warning"},q={key:1,class:"disk-item_info"},M=b(()=>s("div",{class:"auto"},null,-1)),A=y({__name:"item",props:{disk:{type:Object,required:!0}},setup(e){const l=e;p(()=>{var o;return((o=l.disk.childrens)==null?void 0:o.length)||0}),p(()=>{var u,c;let o=0;return(c=(u=l.disk)==null?void 0:u.childrens)==null||c.forEach(i=>{if(!i.mountPoint){const r=Number(i.sizeInt),g=(1<<30)*2;r>g&&o++}}),o});const d=()=>{B.OpenDisk({disk:l.disk})};return(o,u)=>{const c=x("icon-disk");return t(),n("div",F,[s("div",E,[s("div",z,[C(c)]),s("div",N,[s("span",null,a(e.disk.name)+" \u3010"+a(e.disk.size)+"\u3011"+a(e.disk.venderModel),1)]),w,s("div",O,[s("span",null,a(e.disk.used)+" / "+a(e.disk.total),1)])]),e.disk.errorInfo?(t(),n("div",V,[s("span",j,a(e.disk.errorInfo),1)])):(t(),n("div",q,[s("span",null,a(e.disk.path),1),M,s("a",{onClick:u[0]||(u[0]=i=>d())}," \u67E5\u770B ")]))])}}});var m=D(A,[["__scopeId","data-v-f0f8da84"]]);const f=e=>($("data-v-bf0d8af0"),e=e(),I(),e),H={key:0,class:"ul-container"},L=f(()=>s("div",{class:"ul-container_title"},[s("span",null,"\u7CFB\u7EDF\u78C1\u76D8")],-1)),P={class:"ul-container_body"},G={key:1,class:"ul-container"},J=f(()=>s("div",{class:"ul-container_title"},[s("span",null,"\u5DF2\u6302\u8F7D\u78C1\u76D8")],-1)),K={class:"ul-container_body"},Q={key:2,class:"ul-container"},R=f(()=>s("div",{class:"ul-container_title"},[s("span",null,"\u672A\u8BC6\u522B\u78C1\u76D8")],-1)),T={class:"ul-container_body"},U={key:3,class:"ul-container"},W=f(()=>s("div",{class:"ul-container_title"},[s("span",null,"raid")],-1)),X={class:"ul-container_body"},Y=y({__name:"index",setup(e){const l=S(),d=p(()=>l.disk),o=p(()=>l.raid.disks);return(u,c)=>(t(),n("main",null,[d.value.rootDisks.length>0?(t(),n("ul",H,[L,s("div",P,[(t(!0),n(_,null,k(d.value.rootDisks,(i,r)=>(t(),h(m,{disk:i},null,8,["disk"]))),256))])])):v("",!0),d.value.mountedDisks.length>0?(t(),n("ul",G,[J,s("div",K,[(t(!0),n(_,null,k(d.value.mountedDisks,(i,r)=>(t(),h(m,{disk:i},null,8,["disk"]))),256))])])):v("",!0),d.value.errorDisks.length>0?(t(),n("ul",Q,[R,s("div",T,[(t(!0),n(_,null,k(d.value.errorDisks,(i,r)=>(t(),h(m,{disk:i},null,8,["disk"]))),256))])])):v("",!0),o.value.length>0?(t(),n("ul",U,[W,s("div",X,[(t(!0),n(_,null,k(o.value,(i,r)=>(t(),h(m,{disk:i},null,8,["disk"]))),256))])])):v("",!0)]))}});var ss=D(Y,[["__scopeId","data-v-bf0d8af0"]]);export{ss as default};
|
@ -0,0 +1 @@
|
||||
import{d as u,r as e,o as r,e as s,w as i,b as c,P as t}from"./index.js?v=5b4be379";const _=u({__name:"index",setup(l){const a=[{name:"disk",title:"\u6211\u7684\u78C1\u76D8",path:"/router/disk"},{name:"disk-raid",title:"\u78C1\u76D8\u9635\u5217",fn:()=>{t({full:!0,title:"\u78C1\u76D8\u9635\u5217",src:"/cgi-bin/luci/admin/nas/raid"})}},{name:"disk-smart",title:"S.M.A.R.T",fn:()=>{t({full:!0,title:"S.M.A.R.T",src:"/cgi-bin/luci/admin/nas/smart"})}}];return(m,d)=>{const n=e("router-loading"),o=e("layout-page");return r(),s(o,{menus:a},{default:i(()=>[c(n)]),_:1})}}});export{_ as default};
|
@ -0,0 +1 @@
|
||||
import{_ as o,r as n,o as r,c as t,b as a}from"./index.js?v=5b4be379";const c={},s={id:"page",class:"page-container"};function _(d,i){const e=n("router-loading");return r(),t("div",s,[a(e)])}var p=o(c,[["render",_]]);export{p as default};
|
@ -0,0 +1 @@
|
||||
var C=(r,h,d)=>new Promise((k,c)=>{var F=l=>{try{E(d.next(l))}catch(v){c(v)}},t=l=>{try{E(d.throw(l))}catch(v){c(v)}},E=l=>l.done?k(l.value):Promise.resolve(l.value).then(F,t);E((d=d.apply(r,h)).next())});import{_ as S,d as w,s as m,j as I,v as N,o,c as n,F as _,a as s,x,D as g,E as y,m as D,l as p,B as T,p as G,q as U,C as A,T as B}from"./index.js?v=5b4be379";const i=r=>(G("data-v-6bbc1a4d"),r=r(),U(),r),V=["onSubmit"],M=i(()=>s("p",null,"\u4E00\u4E2A\u7B80\u6613\u6C99\u7BB1\uFF0C\u65B9\u4FBF\u7528\u6765\u5B9E\u9A8C\u7CFB\u7EDF\u914D\u7F6E\u548C\u7A0B\u5E8F\uFF0C\u65B9\u4FBF\u5F00\u53D1\u672A\u5B8C\u6210\u7684\u8F6F\u4EF6\uFF0C\u4F46\u4E0D\u4FDD\u62A4Docker\u548C\u786C\u76D8\u7684\u6570\u636E",-1)),q={key:0,class:"label-msg warning"},z=i(()=>s("div",{class:"label-value"},null,-1)),L=i(()=>s("div",{class:"label-name"},[s("span",null,"\u72B6\u6001")],-1)),P={class:"label-value"},$=["value"],j=i(()=>s("option",{disabled:"",selected:"true"},"\u83B7\u53D6\u4E2D...",-1)),O=i(()=>s("option",{disabled:"",value:"stopped"},"\u672A\u5F00\u542F",-1)),W=i(()=>s("option",{disabled:"",value:"running"},"\u5F00\u542F\u4E2D",-1)),H=[j,O,W],J={key:0,class:"label-btns"},K=i(()=>s("div",{class:"label-name"},[s("span",null,"\u76EE\u6807\u78C1\u76D8\uFF08\u5EFA\u8BAE\u9009\u62E9U\u76D8\u6216\u8005\u79FB\u52A8\u786C\u76D8\uFF0C\u65B9\u4FBF\u88C5\u5378\uFF09")],-1)),Q={class:"label-value"},R=i(()=>s("option",{value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u78C1\u76D8",-1)),X=["value"],Y=i(()=>s("div",{class:"label-name"},[s("span",null,"\u76EE\u6807\u5206\u533A\uFF08\u5206\u533A\u5927\u5C0F\u987B\u5927\u4E8E8G\uFF0C\u5C06\u6B64\u5206\u533A\u4F5C\u4E3A\u5916\u90E8 overlay \u4F7F\u7528\uFF09")],-1)),Z={class:"label-value"},uu=i(()=>s("option",{selected:"true",value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u5206\u533A",-1)),su=["value","disabled"],tu={key:1,class:"label-btns"},eu=["disabled"],au={key:2,class:"label-msg warning"},ou=w({__name:"index",setup(r){return C(this,null,function*(){let h,d;const k=m(!1),c=m(""),F=m(0),t=I({status:"stopped",diskpath:"",partition:"",sandboxDisks:{disks:[]}}),E=()=>C(this,null,function*(){const b=yield Promise.all([A.Nas.SandboxDisks.GET(),A.Nas.GetSandbox.GET()]);try{const u=b[0];if(u!=null&&u.data){const{result:e,error:a}=u.data;e&&(t.sandboxDisks.disks=e.disks||[]),a&&(c.value=a)}}catch(u){c.value=u,F.value=3}try{const u=b[1];if(u!=null&&u.data){const{result:e}=u.data;e&&(t.status=e.status)}}catch(u){console.log(u)}});[h,d]=N(()=>E()),yield h,d();const l=()=>{t.partition=""},v=()=>C(this,null,function*(){if(confirm("\u6B64\u64CD\u4F5C\u4F1A\u5C06\u4F1A\u5220\u9664\u8BE5\u5206\u533A\u5168\u90E8\u6570\u636E,\u662F\u5426\u7EE7\u7EED?")){const b=B.Loading("\u914D\u7F6E\u4E2D...");try{const u=yield A.Nas.Sandbox.POST({path:t.partition});if(u!=null&&u.data){const{result:e,error:a,success:f}=u.data;a&&B.Warning(a),(u.data.success||0)==0&&B.Success("\u914D\u7F6E\u6210\u529F")}}catch(u){B.Error(`${u}`)}b.Close()}});return(b,u)=>(o(),n("form",{class:"form-container",onSubmit:T(v,["prevent"])},[M,t.sandboxDisks.disks.length==0?(o(),n("div",q," \u68C0\u6D4B\u4E0D\u5230\u6302\u8F7D\u7684\u78C1\u76D8\u4FE1\u606F\uFF0C\u8BF7\u5148\u63D2\u4E0A\u78C1\u76D8\uFF0C\u5EFA\u8BAE\u4F7F\u7528U\u76D8\u6216\u8005\u79FB\u52A8\u786C\u76D8\uFF0C\u65B9\u4FBF\u88C5\u5378 ")):(o(),n(_,{key:1},[z,L,s("div",P,[s("select",{value:t.status,disabled:""},H,8,$)]),F.value==0?(o(),n("div",J,[s("button",{class:"sumbit",type:"button",onClick:u[0]||(u[0]=e=>F.value=1)},"\u914D\u7F6E")])):F.value==1?(o(),n(_,{key:1},[K,s("div",Q,[x(s("select",{"onUpdate:modelValue":u[1]||(u[1]=e=>t.diskpath=e),onChange:l},[R,(o(!0),n(_,null,y(t.sandboxDisks.disks,(e,a)=>(o(),n("option",{value:e.path,key:a},p(e.venderModel)+"\uFF08"+p(e.size)+"\uFF09 ",9,X))),128))],544),[[g,t.diskpath]])]),t.diskpath?(o(),n(_,{key:0},[Y,(o(!0),n(_,null,y(t.sandboxDisks.disks,e=>(o(),n("div",Z,[e.path==t.diskpath?x((o(),n("select",{key:0,"onUpdate:modelValue":u[2]||(u[2]=a=>t.partition=a)},[uu,(o(!0),n(_,null,y(e.childrens,(a,f)=>(o(),n("option",{value:a.path,key:f,disabled:a.sizeInt<8192e6},p(a.name)+"\uFF08"+p(a.filesystem||"\u672A\u683C\u5F0F\u5316")+"\uFF09"+p(a.total),9,su))),128))],512)),[[g,t.partition]]):D("",!0)]))),256))],64)):D("",!0),t.diskpath&&t.partition?(o(),n("div",tu,[s("button",{class:"sumbit",disabled:k.value},"\u4FDD\u5B58",8,eu)])):D("",!0)],64)):D("",!0)],64)),c.value?(o(),n("div",au,p(c.value),1)):D("",!0)],40,V))})}});var lu=S(ou,[["__scopeId","data-v-6bbc1a4d"]]);export{lu as default};
|
@ -0,0 +1 @@
|
||||
var f=Object.defineProperty;var F=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var v=(s,t,u)=>t in s?f(s,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[t]=u,b=(s,t)=>{for(var u in t||(t={}))h.call(t,u)&&v(s,u,t[u]);if(F)for(var u of F(t))A.call(t,u)&&v(s,u,t[u]);return s};var E=(s,t,u)=>new Promise((r,d)=>{var c=n=>{try{a(u.next(n))}catch(o){d(o)}},l=n=>{try{a(u.throw(n))}catch(o){d(o)}},a=n=>n.done?r(n.value):Promise.resolve(n.value).then(c,l);a((u=u.apply(s,t)).next())});import{d as y,s as m,j as x,o as D,c as _,a as e,x as i,A as p,y as B,z as C,l as V,m as g,B as I,G as w,T as S,C as k}from"./index.js?v=5b4be379";const M=["onSubmit"],N=w('<div class="label-info"> \u65C1\u8DEF\u7531\u6A21\u5F0F\uFF0C\u4E5F\u53EB\u5355\u81C2\u8DEF\u7531\u6A21\u5F0F\u3002\u60A8\u53EF\u4EE5\u7528\u4E0A\u4E00\u7EA7\u8DEF\u7531\u62E8\u53F7\uFF0C\u7136\u540E\u7531\u8BE5\u8BBE\u5907\u6765\u5B9E\u73B0\u4E00\u4E9B\u9AD8\u7EA7\u529F\u80FD\u3002 </div><div class="label-name"><span>LAN \u63A5\u53E3\u914D\u7F6E\u65B9\u5F0F</span></div><div class="label-value"><select disabled><option> \u65C1\u8DEF\u7531\u6A21\u5F0F\u4EC5\u652F\u6301\u9759\u6001IP\u5730\u5740 </option></select></div><div class="label-name"><span>IP \u5730\u5740\uFF08\u8BF7\u548C\u4E0A\u4E00\u6B65\u8BB0\u5F55\u7684\u4E3B\u8DEF\u7531\u5730\u5740\u5728\u540C\u4E00\u7F51\u6BB5\uFF09</span></div>',4),P={class:"label-value"},U=e("div",{class:"label-name"},[e("span",null,"\u5B50\u7F51\u63A9\u7801")],-1),q={class:"label-value"},L=e("div",{class:"label-name"},[e("span",null,"\u7F51\u5173\u5730\u5740")],-1),T={class:"label-value"},G=e("div",{class:"label-name"},[e("span",null,"DNS\u670D\u52A1\u5668")],-1),H={class:"label-value"},R=e("div",{class:"label-name"},[e("span",null,"\u662F\u5426\u63D0\u4F9B DHCP\uFF08\u5982\u679C\u662F\u63D0\u4F9B DHCP\uFF0C\u5219\u9700\u8981\u5173\u95ED\u4E3B\u8DEF\u7531 DHCP\uFF09")],-1),j={class:"label-value"},z={class:"label-flex"},O={class:"label-btns"},J=["disabled"],K={key:0,class:"label-msg"},X=y({__name:"index",setup(s){const t=m(""),u=x({subnetMask:"255.255.255.0",staticDnsIp:"223.5.5.5",staticLanIp:"",gateway:"",enableDhcp:!0}),r=m(!1),d=()=>E(this,null,function*(){const c=b({},u),l=S.Loading("\u914D\u7F6E\u4E2D...");try{const a=yield k.Guide.GatewayRouter.POST(c);if(a!=null&&a.data){const{success:n,error:o}=a==null?void 0:a.data;o&&(t.value=o),(n==null||n==0)&&(t.value="\u914D\u7F6E\u6210\u529F")}}catch(a){t.value=a}l.Close()});return(c,l)=>(D(),_("form",{class:"form-container",onSubmit:I(d,["prevent"])},[N,e("div",P,[i(e("input",{type:"text",placeholder:"ip\u5730\u5740","onUpdate:modelValue":l[0]||(l[0]=a=>u.staticLanIp=a),required:""},null,512),[[p,u.staticLanIp,void 0,{trim:!0}]])]),U,e("div",q,[i(e("input",{type:"text",placeholder:"\u5B50\u7F51\u63A9\u7801\u5730\u5740","onUpdate:modelValue":l[1]||(l[1]=a=>u.subnetMask=a),required:""},null,512),[[p,u.subnetMask,void 0,{trim:!0}]])]),L,e("div",T,[i(e("input",{type:"text",placeholder:"\u7F51\u5173\u5730\u5740","onUpdate:modelValue":l[2]||(l[2]=a=>u.gateway=a),required:""},null,512),[[p,u.gateway,void 0,{trim:!0}]])]),G,e("div",H,[i(e("input",{type:"text",placeholder:"dns\u670D\u52A1\u5668\u5730\u5740","onUpdate:modelValue":l[3]||(l[3]=a=>u.staticDnsIp=a),required:""},null,512),[[p,u.staticDnsIp,void 0,{trim:!0}]])]),R,e("div",j,[e("div",z,[e("label",null,[i(e("input",{type:"radio",value:!1,"onUpdate:modelValue":l[4]||(l[4]=a=>u.enableDhcp=a)},null,512),[[B,u.enableDhcp]]),C("\u5173\u95ED")]),e("label",null,[i(e("input",{type:"radio",value:!0,"onUpdate:modelValue":l[5]||(l[5]=a=>u.enableDhcp=a)},null,512),[[B,u.enableDhcp]]),C("\u542F\u7528")])])]),e("div",O,[e("button",{class:"sumbit",disabled:r.value},"\u4FDD\u5B58",8,J)]),t.value?(D(),_("div",K,[e("span",null,V(t.value),1)])):g("",!0)],40,M))}});export{X as default};
|
@ -0,0 +1 @@
|
||||
var c=(p,t,a)=>new Promise((n,o)=>{var r=e=>{try{s(a.next(e))}catch(_){o(_)}},d=e=>{try{s(a.throw(e))}catch(_){o(_)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,d);s((a=a.apply(p,t)).next())});import{_ as i,d as u,I as l,o as x,c as g,b as m,J as v}from"./index.js?v=5b4be379";const f={id:"page",class:"page-top-container"},b=u({__name:"index",setup(p){const t=l();return(()=>c(this,null,function*(){yield t.getApp()}))(),(n,o)=>(x(),g("div",f,[m(v)]))}});var h=i(b,[["__scopeId","data-v-701aba0b"]]);export{h as default};
|
@ -0,0 +1 @@
|
||||
import{_ as o,r,o as t,e as n,w as s,S as a,b as c}from"./index.js?v=5b4be379";const _={};function u(f,i){const e=r("router-view");return t(),n(a,null,{default:s(()=>[c(e)]),_:1})}var p=o(_,[["render",u]]);export{p as default};
|
@ -0,0 +1 @@
|
||||
import{_ as r}from"./index.js?v=5b4be379";const e={};function n(_,c){return null}var a=r(e,[["render",n]]);export{a as default};
|
@ -0,0 +1 @@
|
||||
var _=(p,d,a)=>new Promise((c,n)=>{var o=s=>{try{i(a.next(s))}catch(e){n(e)}},f=s=>{try{i(a.throw(s))}catch(e){n(e)}},i=s=>s.done?c(s.value):Promise.resolve(s.value).then(o,f);i((a=a.apply(p,d)).next())});import{d as g,s as b,j as E,v as w,o as S,c as m,a as r,F as x,E as F,l as h,m as L,B,x as D,y as G,z as T,C as y,T as v}from"./index.js?v=5b4be379";const C=["onSubmit"],k=r("div",{class:"label-name"},[r("span",null,"\u9009\u62E9\u8F6F\u4EF6\u6E90 ")],-1),I={class:"label-value"},V={class:"label-flex"},N=["value"],M={class:"label-btns"},j=["disabled"],q={key:0,class:"label-msg"},O=g({__name:"index",setup(p){return _(this,null,function*(){let d,a;const c=b(!1),n=b(""),o=E({softsourceListIfo:[],softSource:{},currSoftSource:{}}),f=()=>_(this,null,function*(){var s,e,u;try{const t=yield y.Guide.SoftSourceList.GET();if((s=t==null?void 0:t.data)!=null&&s.result){const l=(e=t==null?void 0:t.data)==null?void 0:e.result;o.softsourceListIfo=l.softSourceList||[]}}catch(t){console.log(t)}try{const t=yield y.Guide.GetSoftSource.GET();if((u=t==null?void 0:t.data)!=null&&u.result){const l=t.data.result;o.softSource=l.softSource,o.currSoftSource=l.softSource}}catch(t){console.log(t)}});[d,a]=w(()=>f()),yield d,a();const i=()=>_(this,null,function*(){const s=v.Loading("\u6B63\u5728\u5207\u6362\u4E2D...");c.value=!0;try{const e=yield y.Guide.SoftSource.POST({softSourceIdentity:o.softSource.identity});if(e!=null&&e.data){const{result:u,error:t,success:l}=e.data;t&&v.Warning(t),(e.data.success||0)==0&&(v.Success("\u5207\u6362\u6210\u529F"),yield f())}}catch(e){v.Error(`${e}`)}finally{c.value=!1,s.Close()}});return(s,e)=>(S(),m("form",{class:"form-container",onSubmit:B(i,["prevent"])},[k,r("div",I,[(S(!0),m(x,null,F(o.softsourceListIfo,u=>(S(),m("label",V,[D(r("input",{type:"radio",value:u.identity,"onUpdate:modelValue":e[0]||(e[0]=t=>o.softSource.identity=t)},null,8,N),[[G,o.softSource.identity,void 0,{trim:!0}]]),T(" "+h(u.name),1)]))),256))]),r("div",M,[r("button",{class:"sumbit",disabled:c.value},"\u4FDD\u5B58",8,j)]),n.value?(S(),m("div",q,[r("span",null,h(n.value),1)])):L("",!0)],40,C))})}});export{O as default};
|
@ -0,0 +1 @@
|
||||
var r=(c,m,i)=>new Promise((w,t)=>{var n=l=>{try{o(i.next(l))}catch(v){t(v)}},s=l=>{try{o(i.throw(l))}catch(v){t(v)}},o=l=>l.done?w(l.value):Promise.resolve(l.value).then(n,s);o((i=i.apply(c,m)).next())});import{_ as V,d as T,u as I,s as f,j as A,v as M,o as E,c as b,a as u,x as _,y as h,z as D,A as k,m as y,l as U,B as q,p as G,q as N,C as B,T as x}from"./index.js?v=5b4be379";const p=c=>(G("data-v-c5783954"),c=c(),N(),c),L=["onSubmit"],O=p(()=>u("p",null,[D(" \u6B22\u8FCE\u4F7F\u7528\u5FEB\u901F\u7F51\u7EDC\u914D\u7F6E\u5411\u5BFC\uFF0C\u8BF7\u9009\u62E9\u4E00\u79CD\u8FDE\u63A5\u65B9\u5F0F\u4EE5\u5F00\u59CB\u8054\u7F51\uFF0C\u6216\u4F7F\u7528\u5DE6\u4FA7\u83DC\u5355\u8FDB\u884C\u8054\u7F51\u914D\u7F6E "),u("br"),D(" \u6CA1\u627E\u5230\u60F3\u8981\u7684\u914D\u7F6E\uFF1F\u8BF7\u4F7F\u7528 "),u("a",{href:"/cgi-bin/luci/admin/network/network",target:"_blank"},"\u9AD8\u7EA7\u6A21\u5F0F")],-1)),j=p(()=>u("div",{class:"label-name"},[u("span",null,"\u8054\u7F51\u65B9\u5F0F")],-1)),z={class:"label-value"},R={class:"label-flex"},H={style:{display:"none"}},J={key:0,class:"ul-container"},K=p(()=>u("div",{class:"ul-container_title"},[u("span",null,"\u62E8\u53F7\u8054\u7F51\u914D\u7F6E")],-1)),Q=p(()=>u("div",{class:"label-value"},null,-1)),W=p(()=>u("div",{class:"label-name"},[u("span",null,"\u8D26\u53F7")],-1)),X={class:"label-value"},Y=p(()=>u("div",{class:"label-name"},[u("span",null,"\u5BC6\u7801")],-1)),Z={class:"label-value"},$={key:1,class:"label-btns"},uu=["disabled"],eu={key:2,class:"label-msg"},au=T({__name:"index",setup(c){return r(this,null,function*(){let m,i;const w=I(),t=f(""),n=f(!1),s=f(""),o=A({account:"",password:""}),l=A({wanProto:"dhcp",dnsProto:"auto",staticIp:"",subnetMask:"",manualDnsIp:[],gateway:""}),v=()=>r(this,null,function*(){n.value=!0;try{const d=yield B.Guide.Pppoe.GET(),{result:e}=d.data;e&&(o.account=e.account||"",o.password=e.password||"")}catch(d){s.value=d}t.value=yield w.getAsyncNetworkProto,n.value=!1});[m,i]=M(()=>v()),yield m,i();const P=()=>r(this,null,function*(){switch(t.value){case"pppoe":yield S();break;case"dhcp":yield g();break;default:s.value="\u627E\u4E0D\u5230\u4F60\u8981\u7684\u914D\u7F6E";break}}),S=()=>r(this,null,function*(){if(o.account==""){s.value="\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A";return}if(o.password==""){s.value="\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A";return}n.value=!0;const d=x.Loading("\u4FDD\u5B58\u4E2D...");try{const e=yield B.Guide.Pppoe.POST({account:o.account,password:o.password});if(e.data){const{error:a,success:F}=e.data;a&&(s.value=a),(F==null||F==0)&&(s.value="\u914D\u7F6E\u5B8C\u6210")}}catch(e){s.value=e}finally{}n.value=!1,d.Close()}),g=()=>r(this,null,function*(){const d={wanProto:l.wanProto,dnsProto:l.dnsProto};n.value=!0;const e=x.Loading("\u4FDD\u5B58\u4E2D...");try{const a=yield B.Guide.ClientModel.POST(d);if(a!=null&&a.data){const{success:F,error:C}=a==null?void 0:a.data;C&&(s.value=C),(F==null||F==0)&&(s.value="\u914D\u7F6E\u5B8C\u6210")}}catch(a){s.value=a}n.value=!1,e.Close()});return(d,e)=>(E(),b("form",{class:"form-container",onSubmit:q(P,["prevent"])},[O,j,u("div",z,[u("div",R,[u("label",null,[_(u("input",{type:"radio",value:"pppoe","onUpdate:modelValue":e[0]||(e[0]=a=>t.value=a)},null,512),[[h,t.value]]),D("\u8D26\u53F7\u5BC6\u7801")]),u("label",null,[_(u("input",{type:"radio",value:"dhcp","onUpdate:modelValue":e[1]||(e[1]=a=>t.value=a)},null,512),[[h,t.value]]),D("\u81EA\u52A8\u8054\u7F51")]),u("label",H,[_(u("input",{type:"radio",value:"static",hidden:"true","onUpdate:modelValue":e[2]||(e[2]=a=>t.value=a)},null,512),[[h,t.value]]),D("\u7F51\u5173\u8054\u7F51")])])]),t.value=="pppoe"?(E(),b("ul",J,[K,Q,W,u("div",X,[_(u("input",{type:"text",placeholder:"\u5BBD\u5E26\u8D26\u53F7","onUpdate:modelValue":e[3]||(e[3]=a=>o.account=a),required:""},null,512),[[k,o.account,void 0,{trim:!0}]])]),Y,u("div",Z,[_(u("input",{type:"password",placeholder:"\u5BBD\u5E26\u5BC6\u7801","onUpdate:modelValue":e[4]||(e[4]=a=>o.password=a),required:""},null,512),[[k,o.password,void 0,{trim:!0}]])])])):y("",!0),t.value=="pppoe"||t.value=="dhcp"?(E(),b("div",$,[u("button",{class:"sumbit",disabled:n.value},"\u4FDD\u5B58",8,uu)])):y("",!0),s.value?(E(),b("div",eu,[u("span",null,U(s.value),1)])):y("",!0)],40,L))})}});var ou=V(au,[["__scopeId","data-v-c5783954"]]);export{ou as default};
|
@ -0,0 +1 @@
|
||||
import{_ as r}from"./index.js?v=5b4be379";const e={};function n(_,c){return null}var a=r(e,[["render",n]]);export{a as default};
|
@ -0,0 +1 @@
|
||||
var g=Object.defineProperty;var y=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var C=(o,u,s)=>u in o?g(o,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[u]=s,k=(o,u)=>{for(var s in u||(u={}))w.call(u,s)&&C(o,s,u[s]);if(y)for(var s of y(u))A.call(u,s)&&C(o,s,u[s]);return o};var b=(o,u,s)=>new Promise((i,t)=>{var p=d=>{try{c(s.next(d))}catch(l){t(l)}},m=d=>{try{c(s.throw(d))}catch(l){t(l)}},c=d=>d.done?i(d.value):Promise.resolve(d.value).then(p,m);c((s=s.apply(o,u)).next())});import{d as T,s as E,j as U,v as q,o as _,c as f,a as e,x as r,A as D,F as V,y as P,z as x,m as B,l as G,B as H,C as M,T as F}from"./index.js?v=5b4be379";import{i as v}from"./chunk.6d3585bb.js";const L=["onSubmit"],N=e("div",{class:"label-name"},[e("span",null,"\u5185\u7F51\u5730\u5740")],-1),R={class:"label-value"},j=e("div",{class:"label-name"},[e("span",null,"\u5B50\u7F51\u63A9\u7801")],-1),z={class:"label-value"},O=e("div",{class:"label-name"},[e("span",null,"DHCP\u670D\u52A1")],-1),$={class:"label-value"},J={class:"label-flex"},K=e("div",{class:"label-name"},[e("span",null,"IP\u6C60\u8D77\u59CB\u5730\u5740")],-1),Q={class:"label-value"},W=e("div",{class:"label-name"},[e("span",null,"IP\u6C60\u7ED3\u675F\u5730\u5740")],-1),X={class:"label-value"},Y={class:"label-btns"},Z=["disabled"],ee={key:2,class:"label-msg"},ue=T({__name:"index",setup(o){return b(this,null,function*(){let u,s;const i=E(""),t=U({lanIp:"",netMask:"255.255.255.0",enableDhcp:!1,dhcpStart:"",dhcpEnd:""}),p=E(!1),m=E(!1),c=()=>b(this,null,function*(){p.value=!0;const l=yield M.Guide.GetLan.GET();if(l.data){const{result:a}=l.data;a&&(t.lanIp=a.lanIp,t.netMask=a.netMask,m.value=a.enableDhcp||!1,t.dhcpStart=a.dhcpStart,t.dhcpEnd=a.dhcpEnd,a.lanIp,location.hostname)}p.value=!1});[u,s]=q(()=>c()),yield u,s();const d=()=>b(this,null,function*(){const l=k({},t);if(!v.isValidIP(l.lanIp)){F.Error("IPv4\u5730\u5740\u683C\u5F0F\u9519\u8BEF");return}if(!v.isValidMask(l.netMask)){F.Error("IPv4\u5B50\u7F51\u63A9\u7801\u683C\u5F0F\u9519\u8BEF");return}if(l.enableDhcp&&!v.isValidIP(l.dhcpStart)||!v.isValidIP(l.dhcpEnd)||!v.isValidMaskRange(l.lanIp,l.netMask,l.dhcpStart,l.dhcpEnd)){F.Error("DHCP\u7684IP\u6C60\u683C\u5F0F\u9519\u8BEF\u6216\u8D85\u51FA\u5B50\u7F51\u8303\u56F4");return}const a=F.Loading("\u6B63\u5728\u914D\u7F6E,\u8BF7\u7A0D\u7B49\u2026");let n=!1;try{const h=yield M.Guide.LanIp.POST(l);if(h.data){const{result:ae,success:S,error:I}=h.data;if(I){i.value=I;return}(S||0)==0&&(n=!0)}}catch(h){i.value=h}finally{a.Close()}n&&(i.value=`\u66F4\u65B0\u6210\u529F,\u8BF7\u8FDB\u5165 ${l.lanIp} \u8DEF\u7531\u5668\u5730\u5740`)});return(l,a)=>(_(),f("form",{class:"form-container",onSubmit:H(d,["prevent"])},[N,e("div",R,[r(e("input",{type:"text",placeholder:"192.168.100.1","onUpdate:modelValue":a[0]||(a[0]=n=>t.lanIp=n),required:""},null,512),[[D,t.lanIp,void 0,{trim:!0}]])]),j,e("div",z,[r(e("input",{type:"text",placeholder:"255.255.255.0","onUpdate:modelValue":a[1]||(a[1]=n=>t.netMask=n),required:""},null,512),[[D,t.netMask,void 0,{trim:!0}]])]),m.value?(_(),f(V,{key:0},[O,e("div",$,[e("div",J,[e("label",null,[r(e("input",{type:"radio",value:!1,"onUpdate:modelValue":a[2]||(a[2]=n=>t.enableDhcp=n)},null,512),[[P,t.enableDhcp]]),x("\u4FDD\u6301DHCP")]),e("label",null,[r(e("input",{type:"radio",value:!0,"onUpdate:modelValue":a[3]||(a[3]=n=>t.enableDhcp=n)},null,512),[[P,t.enableDhcp]]),x("\u4FEE\u6539DHCP")])])])],64)):B("",!0),t.enableDhcp?(_(),f(V,{key:1},[K,e("div",Q,[r(e("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":a[4]||(a[4]=n=>t.dhcpStart=n),required:""},null,512),[[D,t.dhcpStart,void 0,{trim:!0}]])]),W,e("div",X,[r(e("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":a[5]||(a[5]=n=>t.dhcpEnd=n),required:""},null,512),[[D,t.dhcpEnd,void 0,{trim:!0}]])])],64)):B("",!0),e("div",Y,[e("button",{class:"sumbit",disabled:p.value},"\u4FDD\u5B58",8,Z)]),i.value?(_(),f("div",ee,[e("span",null,G(i.value),1)])):B("",!0)],40,L))})}});export{ue as default};
|
@ -0,0 +1 @@
|
||||
import{d as a,r as e,o as u,e as r,w as p,b as s}from"./index.js?v=5b4be379";const _=a({__name:"index",setup(c){const t=[{name:"index",title:"\u7F51\u7EDC\u914D\u7F6E",path:"/router/network"},{name:"pppoe",title:"\u62E8\u53F7\u8FDE\u63A5",path:"/router/network/pppoe"},{name:"dhcp",title:"DHCP\u8FDE\u63A5",path:"/router/network/dhcp"},{name:"gateway",title:"\u65C1\u8DEF\u7531\u8FDE\u63A5",path:"/router/network/gateway"},{name:"intranet",title:"\u5185\u7F51\u914D\u7F6E",path:"/router/network/intranet"},{name:"dns",title:"DNS\u914D\u7F6E",path:"/router/network/dns"}];return(i,l)=>{const o=e("router-loading"),n=e("layout-page");return u(),r(n,{menus:t},{default:p(()=>[s(o)]),_:1})}}});export{_ as default};
|
@ -0,0 +1 @@
|
||||
var d=(_,i,l)=>new Promise((t,e)=>{var n=o=>{try{c(l.next(o))}catch(u){e(u)}},p=o=>{try{c(l.throw(o))}catch(u){e(u)}},c=o=>o.done?t(o.value):Promise.resolve(o.value).then(n,p);c((l=l.apply(_,i)).next())});import{d as E,s as v,j as h,v as F,o as D,c as f,a,x as b,A as B,l as y,m as A,B as C,C as w,T as x}from"./index.js?v=5b4be379";const g=["onSubmit"],S=a("div",{class:"label-info"}," \u8BF7\u786E\u4FDD\u60A8\u5DF2\u5C06\u8DEF\u7531 WAN \u53E3\u8FDE\u63A5\u5230\u5149\u732B ",-1),T=a("div",{class:"label-name"},[a("span",null,"\u8D26\u53F7")],-1),V={class:"label-value"},k=a("div",{class:"label-name"},[a("span",null,"\u5BC6\u7801")],-1),q={class:"label-value"},G={class:"label-btns"},N=["disabled"],P={key:0,class:"label-msg"},j=E({__name:"index",setup(_){return d(this,null,function*(){let i,l;const t=v(""),e=h({account:"",password:""}),n=v(!1),p=v(!1),c=()=>d(this,null,function*(){n.value=!0;try{const u=yield w.Guide.Pppoe.GET(),{result:s}=u.data;s&&(e.account=s.account||"",e.password=s.password||"")}catch(u){t.value=u}finally{}n.value=!1,p.value=!0});[i,l]=F(()=>c()),yield i,l();const o=()=>d(this,null,function*(){if(e.account==""){t.value="\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A";return}if(e.password==""){t.value="\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A";return}n.value=!0;const u=x.Loading("\u4FDD\u5B58\u4E2D...");try{const s=yield w.Guide.Pppoe.POST({account:e.account,password:e.password});if(s.data){const{error:r,success:m}=s.data;r&&(t.value=r),(m==null||m==0)&&(t.value="\u914D\u7F6E\u5B8C\u6210")}}catch(s){t.value=s}finally{}n.value=!1,u.Close()});return(u,s)=>(D(),f("form",{class:"form-container",onSubmit:C(o,["prevent"])},[S,T,a("div",V,[b(a("input",{type:"text",placeholder:"\u5BBD\u5E26\u8D26\u53F7","onUpdate:modelValue":s[0]||(s[0]=r=>e.account=r),required:""},null,512),[[B,e.account,void 0,{trim:!0}]])]),k,a("div",q,[b(a("input",{type:"password",placeholder:"\u5BBD\u5E26\u5BC6\u7801","onUpdate:modelValue":s[1]||(s[1]=r=>e.password=r),required:""},null,512),[[B,e.password,void 0,{trim:!0}]])]),a("div",G,[a("button",{class:"sumbit",disabled:n.value},"\u4FDD\u5B58",8,N)]),t.value?(D(),f("div",P,[a("span",null,y(t.value),1)])):A("",!0)],40,g))})}});export{j as default};
|
@ -0,0 +1 @@
|
||||
var p=(o,u,s)=>new Promise((h,c)=>{var f=r=>{try{t(s.next(r))}catch(l){c(l)}},x=r=>{try{t(s.throw(r))}catch(l){c(l)}},t=r=>r.done?h(r.value):Promise.resolve(r.value).then(f,x);t((s=s.apply(o,u)).next())});import{_ as v,d as w,j as B,v as m,k as g,o as a,c as i,a as e,F as k,E as y,z as _,l as n,p as A,q as C,C as M}from"./index.js?v=5b4be379";const d=o=>(A("data-v-16a9b49b"),o=o(),C(),o),D={class:"page-table"},F=d(()=>e("colgroup",null,[e("col"),e("col"),e("col"),e("col"),e("col"),e("col")],-1)),E=d(()=>e("thead",null,[e("tr",null,[e("th",null," \u72B6\u6001 "),e("th",null," \u63A5\u53E3 "),e("th",null," \u7C7B\u578B "),e("th",null," mac "),e("th",null," \u63A5\u6536 "),e("th",null," \u53D1\u9001 ")])],-1)),b={class:"flex-icon"},z=d(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:v":"https://vecta.io/nano",width:"48",height:"38",viewBox:"0 0 12.7 10.05"},[e("defs",null,[e("filter",{id:"A","color-interpolation-filters":"sRGB"},[e("feColorMatrix",{result:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "}),e("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),e("feColorMatrix",{in:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "})]),e("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),e("g",{transform:"translate(0 -286.95)"},[e("rect",{x:".21",y:"287.25",width:"12.33",height:"9.5",ry:".57",fill:"#e6e6e6",stroke:"#e6e6e6","stroke-linejoin":"round","stroke-width":".37","paint-order":"normal"}),e("path",{transform:"matrix(.105 0 0 .0989 -6.0834 280.6)",d:"M73.96 75.66h89.41c2.31 0 4.17 1.86 4.17 4.17v52.65h-21.74v9.41h-8.69v12.59h-36.87v-12.59h-8.69v-9.41H69.79V79.83c0-2.31 1.86-4.17 4.17-4.17z",fill:"#999",filter:"url(#A)",stroke:"#999","stroke-width":"2.5"}),e("g",{transform:"matrix(.1048 0 0 .1048 -6.0999 280.7)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[e("use",{"xlink:href":"#B"}),e("use",{"xlink:href":"#B",x:"73.04"}),e("use",{"xlink:href":"#B",x:"52.17"}),e("use",{"xlink:href":"#B",x:"41.74"}),e("use",{"xlink:href":"#B",x:"31.3"}),e("use",{"xlink:href":"#B",x:"20.87"}),e("use",{"xlink:href":"#B",x:"10.43"}),e("use",{"xlink:href":"#B",x:"62.61"})]),e("rect",{x:"1.24",y:"294.55",width:"1.6",height:"1.38",ry:".11",fill:"#ccc",stroke:"#ccc","stroke-width":".22","paint-order":"normal"})])],-1)),N=d(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"48",height:"38",viewBox:"0 0 12.7 10.05","xmlns:v":"https://vecta.io/nano"},[e("defs",null,[e("filter",{id:"A","color-interpolation-filters":"sRGB"},[e("feColorMatrix",{result:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "}),e("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),e("feColorMatrix",{in:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "})]),e("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),e("g",{transform:"translate(-.03 -287.07)"},[e("rect",{x:".24",y:"287.36",width:"12.33",height:"9.5",ry:".57",fill:"#e6e6e6",stroke:"#e6e6e6","stroke-linejoin":"round","stroke-width":".37","paint-order":"normal"}),e("path",{transform:"matrix(.105 0 0 .0989 -6.0532 280.72)",d:"M73.96 75.66h89.41c2.31 0 4.17 1.86 4.17 4.17v52.65h-21.74v9.41h-8.69v12.59h-36.87v-12.59h-8.69v-9.41H69.79V79.83c0-2.31 1.86-4.17 4.17-4.17z",fill:"#4d4d4d",filter:"url(#A)",stroke:"#4d4d4d","stroke-width":"2.5"}),e("g",{transform:"matrix(.1048 0 0 .1048 -6.0697 280.81)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[e("use",{"xlink:href":"#B"}),e("use",{"xlink:href":"#B",x:"73.04"}),e("use",{"xlink:href":"#B",x:"52.17"}),e("use",{"xlink:href":"#B",x:"41.74"}),e("use",{"xlink:href":"#B",x:"31.3"}),e("use",{"xlink:href":"#B",x:"20.87"}),e("use",{"xlink:href":"#B",x:"10.43"}),e("use",{"xlink:href":"#B",x:"62.61"})]),e("rect",{x:"1.27",y:"294.67",width:"1.6",height:"1.38",ry:".11",fill:"#55d400",stroke:"#55d400","stroke-width":".22","paint-order":"normal"})])],-1)),S=w({__name:"index",setup(o){return p(this,null,function*(){let u,s;const h=B({ports:[]}),c=t=>{switch(t){case"full":return"\u5168\u53CC\u5DE5";case"half":return"\u534A\u53CC\u5DE5"}};let f=!1;const x=()=>p(this,null,function*(){try{const t=yield M.Network.PortList.GET();if(t!=null&&t.data){const{result:r}=t==null?void 0:t.data;r&&(h.ports=r.ports||[])}}catch(t){console.log(t)}setTimeout(()=>{f||x()},1e4)});return[u,s]=m(()=>x()),yield u,s(),g(()=>{f=!0}),(t,r)=>(a(),i("table",D,[F,E,e("tbody",null,[(a(!0),i(k,null,y(h.ports,l=>(a(),i("tr",null,[e("th",b,[l.linkState=="DOWN"?(a(),i(k,{key:0},[z,_("\u672A\u8FDE\u63A5 ")],64)):(a(),i(k,{key:1},[N,_(" \u5DF2\u8FDE\u63A5 ")],64))]),e("th",null,n(l.name)+"\uFF08"+n(l.interfaceNames.join(",").toLocaleUpperCase())+"\uFF09 ",1),e("th",null,n(c(l.duplex)),1),e("th",null,n(l.macAddress||"--"),1),e("th",null,n(l.rx_packets||"--"),1),e("th",null,n(l.tx_packets||"--"),1)]))),256))])]))})}});var L=v(S,[["__scopeId","data-v-16a9b49b"]]);export{L as default};
|
@ -0,0 +1 @@
|
||||
import{_ as u,d as l,u as p,r as t,o as e,c as i,a as m,b as o,w as a,e as s,f as v,S as f,t as x,g as y}from"./index.js?v=5b4be379";const h={class:"body"},k=l({__name:"index",setup(C){const n=p();return(w,B)=>{const _=t("layout-header"),r=t("router-view");return e(),i("div",{id:"main",key:y(n).reloadCount},[m("div",h,[o(_),o(r,null,{default:a(({Component:c,route:d})=>[(e(),s(f,null,{default:a(()=>[(e(),s(v(c),{key:d.path}))]),_:2},1024))]),_:1}),o(x)])])}}});var S=u(k,[["__scopeId","data-v-5f4eb506"]]);export{S as default};
|
@ -0,0 +1 @@
|
||||
import{d as a,r as e,o as u,e as r,w as s,b as p}from"./index.js?v=5b4be379";const m=a({__name:"index",setup(i){const t=[{name:"setting-index",title:"\u529F\u80FD\u4FE1\u606F",path:"/router/setting"},{name:"opkg",title:"\u8F6F\u4EF6\u6E90\u914D\u7F6E",path:"/router/setting/opkg"},{name:"opkg",title:"\u5411\u5BFC\u6A21\u5F0F",path:"/wizard"}];return(_,c)=>{const o=e("router-loading"),n=e("layout-page");return u(),r(n,{menus:t},{default:s(()=>[p(o)]),_:1})}}});export{m as default};
|
@ -0,0 +1 @@
|
||||
import{d as c,u,i as r,s as d,o as l,c as e,a as t,F as _,E as i,l as s}from"./index.js?v=5b4be379";const h={class:"ul-container"},p={class:"ul-container_body"},m={class:"page-table"},v=t("colgroup",null,[t("col"),t("col"),t("col"),t("col")],-1),f=t("thead",null,[t("tr",null,[t("th",null,"Mac"),t("th",null,"IPv4"),t("th",null,"IPv6"),t("th")])],-1),b=t("th",null,null,-1),g=t("th",null,null,-1),E=c({__name:"index",setup(x){const o=u(),a=r(()=>o.device.devices);return d(),(y,B)=>(l(),e("main",null,[t("ul",h,[t("div",p,[t("table",m,[v,f,t("tbody",null,[(l(!0),e(_,null,i(a.value,n=>(l(),e("tr",null,[t("th",null,s(n.mac),1),t("th",null,s(n.ipv4addr),1),b,g]))),256))])])])])]))}});export{E as default};
|
@ -0,0 +1 @@
|
||||
var m=(v,c,d)=>new Promise((l,e)=>{var u=o=>{try{r(d.next(o))}catch(a){e(a)}},i=o=>{try{r(d.throw(o))}catch(a){e(a)}},r=o=>o.done?l(o.value):Promise.resolve(o.value).then(u,i);r((d=d.apply(v,c)).next())});import{d as S,s as h,j as F,v as N,o as p,c as D,a as n,x as _,D as P,F as B,A as I,m as g,l as x,B as k,C as y,T as w}from"./index.js?v=5b4be379";const C=["onSubmit"],E=n("div",{class:"label-name"},[n("span",null,"DNS\u9009\u9879")],-1),A={class:"label-value"},T=n("option",{value:"auto"},"\u4F7F\u7528\u8FD0\u8425\u5546\u63D0\u4F9B\u7684DNS",-1),V=n("option",{value:"manual"},"\u81EA\u5B9A\u4E49DNS",-1),G=[T,V],M=n("div",{class:"label-name"},[n("span",null,"DNS\u670D\u52A1\u5668\u5730\u5740")],-1),U={class:"label-value"},q=n("div",{class:"label-name"}," \u5907\u7528DNS\u670D\u52A1\u5668\u5730\u5740 ",-1),j={class:"label-value"},L={class:"label-btns"},O=["disabled"],z={key:1,class:"label-msg"},K=S({__name:"index",setup(v){return m(this,null,function*(){let c,d;const l=h(""),e=F({interfaceName:"",dnsProto:"auto",manualDnsIp:[]}),u=F({dns1:"",dns2:""}),i=h(!1),r=()=>m(this,null,function*(){i.value=!0;try{const a=yield y.Guide.DnsConfig.GET();if(a!=null&&a.data){const{result:t}=a.data;if(t){e.dnsProto=t.dnsProto,e.manualDnsIp=t.manualDnsIp||[];for(let s=0;s<e.manualDnsIp.length;s++){s==0?u.dns1=e.manualDnsIp[s]:s==1&&(u.dns2=e.manualDnsIp[s]);break}}}}catch(a){l.value=a}i.value=!1});[c,d]=N(()=>r()),yield c,d();const o=()=>m(this,null,function*(){let a={};switch(e.dnsProto){case"auto":break;case"manual":a.manualDnsIp=[],e.manualDnsIp!=null&&e.manualDnsIp.length>0?a.manualDnsIp=e.manualDnsIp:(a.manualDnsIp.push(u.dns1),u.dns2&&a.manualDnsIp.push(u.dns2));break}a.dnsProto=e.dnsProto,a.interfaceName=e.interfaceName;const t=w.Loading("\u914D\u7F6E\u4E2D...");try{const s=yield y.Guide.DnsConfig.POST(a);if(s!=null&&s.data){const{success:f,error:b}=s==null?void 0:s.data;b&&(l.value=b),(f==null||f==0)&&(l.value="\u914D\u7F6E\u6210\u529F")}}catch(s){l.value=s}t.Close()});return(a,t)=>(p(),D("form",{class:"form-container",onSubmit:k(o,["prevent"])},[E,n("div",A,[_(n("select",{"onUpdate:modelValue":t[0]||(t[0]=s=>e.dnsProto=s)},G,512),[[P,e.dnsProto]])]),e.dnsProto=="manual"?(p(),D(B,{key:0},[M,n("div",U,[_(n("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165 dns \u5730\u5740","onUpdate:modelValue":t[1]||(t[1]=s=>u.dns1=s),required:""},null,512),[[I,u.dns1,void 0,{trim:!0}]])]),q,n("div",j,[_(n("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u5907\u7528 dns \u5730\u5740","onUpdate:modelValue":t[2]||(t[2]=s=>u.dns2=s)},null,512),[[I,u.dns2,void 0,{trim:!0}]])])],64)):g("",!0),n("div",L,[n("button",{class:"sumbit",disabled:i.value},"\u4FDD\u5B58",8,O)]),l.value?(p(),D("div",z,[n("span",null,x(l.value),1)])):g("",!0)],40,C))})}});export{K as default};
|
@ -0,0 +1 @@
|
||||
var m=(_,v,l)=>new Promise((n,r)=>{var F=i=>{try{c(l.next(i))}catch(u){r(u)}},h=i=>{try{c(l.throw(i))}catch(u){r(u)}},c=i=>i.done?n(i.value):Promise.resolve(i.value).then(F,h);c((l=l.apply(_,v)).next())});import{_ as g,d as y,j as k,v as E,i as x,o,c as a,a as e,l as d,F as A,K as S,L as B,p as b,q as N,C as w}from"./index.js?v=5b4be379";const D=_=>(b("data-v-613b66e3"),_=_(),N(),_),$={id:"page",class:"page-container"},I=D(()=>e("div",{class:"notice_info"},[e("li",null," \u52A8\u6001 DNS \uFF08DDNS\uFF09\u8BA9\u60A8\u5373\u4F7F\u5728\u6CA1\u6709\u9759\u6001 IP \u5730\u5740\u7684\u60C5\u51B5\u4E0B\uFF0C\u4ECD\u53EF\u5C06\u670D\u52A1\u5668\u8FDE\u540C\u7ED1\u5B9A\u7684\u57DF\u540D\u6620\u5C04\u81F3\u516C\u7F51\u4E0A\u3002 "),e("li",null," \u5982\u679C\u60A8\u6CA1\u6709\u516C\u7F51 IP \u8BF7\u4F7F\u7528 DDNSTO \uFF0C\u521D\u6B21\u4F7F\u7528 DDNSTO \u9700\u8981\u521D\u59CB\u5316\u914D\u7F6E ")],-1)),P={class:"text-container"},T={class:"text-container_item"},O=D(()=>e("div",{class:"text-container_item_title"},[e("span",null,"DDNSTO\uFF1A")],-1)),q={class:"text-container_item_flex"},G={class:"text-container_item_block"},j=["href"],K={key:0,class:"domain"},L={key:1,class:"domain"},V={class:"text-container_item"},z=D(()=>e("div",{class:"text-container_item_title"},[e("span",null,"myddns_ipv4\uFF1A")],-1)),H={class:"text-container_item_flex"},J={class:"text-container_item_block"},M=["href"],Q={key:1,class:"domain"},R={class:"text-container_item"},U=D(()=>e("div",{class:"text-container_item_title"},[e("span",null,"myddns_ipv6\uFF1A")],-1)),W={class:"text-container_item_flex"},X={class:"text-container_item_block"},Y=["href"],Z={key:1,class:"domain"},tt=y({__name:"index",setup(_){return m(this,null,function*(){let v,l;k({ipv4:"",ipv6:""});const n=k({ddnstoDomain:"",ipv4Domain:"",ipv6Domain:""}),r=k({install:!0,error:null}),F=()=>m(this,null,function*(){yield Promise.all([h()])}),h=()=>m(this,null,function*(){try{const t=yield w.Guide.Ddns.GET(),{result:s,error:p}=t.data;if(p)throw p;s&&(n.ddnstoDomain=s.ddnstoDomain,n.ipv4Domain=s.ipv4Domain,n.ipv6Domain=s.ipv6Domain)}catch(t){console.log(t)}});[v,l]=E(()=>F()),yield v,l();const c=x(()=>n.ddnstoDomain),i=x(()=>{const t=n.ipv4Domain;return t!=null&&t!=""&&t!="Stopped"?{url:`http://${t}`,title:t,ok:!0}:{url:`http://${t}`,title:"\u672A\u914D\u7F6E",ok:!1}}),u=x(()=>{const t=n.ipv6Domain;return t!=null&&t!=""&&t!="Stopped"?{url:`http://${t}`,title:t,ok:!0}:{url:`http://${t}`,title:"\u672A\u914D\u7F6E",ok:!1}}),C=()=>{S({domain:c.value,callback:t=>{}})},f=t=>{B({setup:t,callback:s=>{switch(t){case"ipv4":n.ipv4Domain=s.domain;break;case"ipv6":n.ipv6Domain=s.domain;break}}})};return(t,s)=>(o(),a("div",$,[I,e("div",P,[e("div",T,[O,e("div",q,[e("div",G,[r.install?(o(),a("a",{key:0,href:c.value,target:"_blank",class:"domain"},d(c.value),9,j)):(o(),a(A,{key:1},[r.error?(o(),a("a",K,d(r.error),1)):(o(),a("a",L,"\u672A\u5B89\u88C5"))],64)),e("a",{class:"setting",onClick:s[0]||(s[0]=p=>C())},"\u5FEB\u901F\u914D\u7F6E")])])]),e("div",V,[z,e("div",H,[e("div",J,[i.value.ok?(o(),a("a",{key:0,href:i.value.url,target:"_blank",class:"domain"},d(i.value.title),9,M)):(o(),a("a",Q,d(i.value.title),1)),e("a",{class:"setting",onClick:s[1]||(s[1]=p=>f("ipv4"))},"\u5FEB\u901F\u914D\u7F6E")])])]),e("div",R,[U,e("div",W,[e("div",X,[u.value.ok?(o(),a("a",{key:0,href:u.value.url,target:"_blank",class:"domain"},d(u.value.title),9,Y)):(o(),a("a",Z,d(u.value.title),1)),e("a",{class:"setting",onClick:s[2]||(s[2]=p=>f("ipv6"))},"\u5FEB\u901F\u914D\u7F6E")])])])])]))})}});var it=g(tt,[["__scopeId","data-v-613b66e3"]]);export{it as default};
|
BIN
luci-app-istorex/htdocs/luci-static/istorex/copy.png
Normal file
After Width: | Height: | Size: 318 B |
7
luci-app-istorex/htdocs/luci-static/istorex/device.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38" fill="none">
|
||||
<rect opacity="0.1" width="38" height="38" rx="19" fill="#FF8F6B" />
|
||||
<rect x="9.5" y="20.0557" width="19" height="6.33333" rx="1" fill="#FF8F6B" />
|
||||
<rect x="9.5" y="11.6111" width="19" height="6.33333" rx="1" fill="#FF8F6B" />
|
||||
<rect x="11.6113" y="13.7222" width="6.33333" height="2.11111" rx="1" fill="white" />
|
||||
<rect x="11.6113" y="22.1667" width="6.33333" height="2.11111" rx="1" fill="white" />
|
||||
</svg>
|
After Width: | Height: | Size: 527 B |
BIN
luci-app-istorex/htdocs/luci-static/istorex/disk.png
Normal file
After Width: | Height: | Size: 692 B |
BIN
luci-app-istorex/htdocs/luci-static/istorex/file-manage.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/file.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/folder.png
Normal file
After Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/icon_language_cn.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/icon_language_en.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/image/bg.gif
Normal file
After Width: | Height: | Size: 676 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/image/logo.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
36
luci-app-istorex/htdocs/luci-static/istorex/index.js
Normal file
11
luci-app-istorex/htdocs/luci-static/istorex/info.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
||||
<path
|
||||
d="M22 2C22 0.89543 21.1046 0 20 0H2C0.89543 0 0 0.895431 0 2V20C0 21.1046 0.895432 22 2 22H20C21.1046 22 22 21.1046 22 20V2Z"
|
||||
fill="black" fill-opacity="0.08" />
|
||||
<path
|
||||
d="M4 4C4 3.44772 4.44772 3 5 3H17C17.5523 3 18 3.44772 18 4V18C18 18.5523 17.5523 19 17 19H5C4.44772 19 4 18.5523 4 18V4Z"
|
||||
fill="#AAAAAA" />
|
||||
<rect x="7" y="8" width="7" height="1" fill="#D9D9D9" />
|
||||
<rect x="7" y="11" width="7" height="1" fill="#D9D9D9" />
|
||||
<rect x="7" y="14" width="8" height="1" fill="#D9D9D9" />
|
||||
</svg>
|
After Width: | Height: | Size: 654 B |
BIN
luci-app-istorex/htdocs/luci-static/istorex/logo.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
18
luci-app-istorex/htdocs/luci-static/istorex/logout.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none">
|
||||
<g opacity="0.8" filter="url(#filter0_b_605_1471)">
|
||||
<rect width="50" height="50" rx="16" fill="white" />
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M7.76236 11.4259C7.59214 11.6505 7.49994 11.9253 7.5 12.2079V38.5754C7.49966 38.8582 7.59173 39.1333 7.76198 39.3582C7.93223 39.5831 8.1712 39.7452 8.442 39.8196L19.9453 42.9816C20.1349 43.0337 20.3339 43.041 20.5268 43.003C20.7197 42.965 20.9013 42.8826 21.0575 42.7624C21.2136 42.6421 21.3402 42.4872 21.4273 42.3097C21.5144 42.1321 21.5597 41.9367 21.5596 41.7387V9.04722C21.5598 8.84906 21.5147 8.65351 21.4277 8.4758C21.3407 8.29809 21.2142 8.14301 21.058 8.02262C20.9018 7.90223 20.7201 7.81979 20.5271 7.7817C20.3341 7.74362 20.135 7.75092 19.9453 7.80303L8.442 10.965C8.17141 11.0393 7.93259 11.2013 7.76236 11.4259ZM23.75 12.7962C23.75 12.6307 23.7738 12.4669 23.8201 12.3141C23.8664 12.1613 23.9342 12.0224 24.0198 11.9055C24.1053 11.7885 24.2068 11.6957 24.3186 11.6324C24.4303 11.5691 24.5501 11.5365 24.6711 11.5365H41.5789C41.6999 11.5365 41.8197 11.5691 41.9314 11.6324C42.0432 11.6957 42.1447 11.7885 42.2302 11.9055C42.3158 12.0224 42.3836 12.1613 42.4299 12.3141C42.4762 12.4669 42.5 12.6307 42.5 12.7962V37.9885C42.5 38.1539 42.4762 38.3177 42.4299 38.4705C42.3836 38.6233 42.3158 38.7622 42.2302 38.8791C42.1447 38.9961 42.0432 39.0889 41.9314 39.1522C41.8197 39.2155 41.6999 39.2481 41.5789 39.2481H24.6711C24.5501 39.2481 24.4303 39.2155 24.3186 39.1522C24.2068 39.0889 24.1053 38.9961 24.0198 38.8791C23.9342 38.7622 23.8664 38.6233 23.8201 38.4705C23.7738 38.3177 23.75 38.1539 23.75 37.9885V12.7962ZM31.729 18.1172C31.7287 17.9854 31.7685 17.8568 31.8431 17.7485C31.9177 17.6403 32.0234 17.5577 32.146 17.512C32.2686 17.4662 32.4022 17.4594 32.5288 17.4926C32.6553 17.5257 32.7688 17.5972 32.8537 17.6973L39.0412 24.9731C39.1403 25.0897 39.1947 25.2382 39.1947 25.3917C39.1947 25.5452 39.1403 25.6936 39.0412 25.8103L32.8537 33.0861C32.7688 33.1862 32.6553 33.2577 32.5288 33.2908C32.4022 33.324 32.2686 33.3172 32.146 33.2714C32.0234 33.2256 31.9177 33.1431 31.8431 33.0348C31.7685 32.9266 31.7287 32.798 31.729 32.6662V27.9676H28.5336C28.3641 27.9676 28.2016 27.8998 28.0817 27.779C27.9619 27.6583 27.8945 27.4945 27.8945 27.3237V23.4597C27.8945 23.2889 27.9619 23.1251 28.0817 23.0044C28.2016 22.8836 28.3641 22.8157 28.5336 22.8157H31.729V18.1172Z"
|
||||
fill="#0066FF" />
|
||||
<defs>
|
||||
<filter id="filter0_b_605_1471" x="-24" y="-24" width="98" height="98"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="12" />
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_605_1471" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_605_1471"
|
||||
result="shape" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/nas.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/network.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
9
luci-app-istorex/htdocs/luci-static/istorex/network.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38" fill="none">
|
||||
<rect opacity="0.1" width="38" height="38" rx="19" fill="#605BFF" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M26.4052 20.6107L26.4057 20.6102V20.6113C26.4055 20.6111 26.4054 20.6109 26.4052 20.6107ZM26.4052 20.6107C25.5051 19.3859 24.3736 18.3996 23.0921 17.723C21.8104 17.0463 20.4105 16.6961 18.9932 16.6976C17.5808 16.6962 16.1854 17.0441 14.9071 17.7166C13.6288 18.3892 12.4992 19.3696 11.5989 20.5877L13.7116 22.5479C14.3543 21.6773 15.1611 20.9766 16.0742 20.4959C16.9874 20.0153 17.9842 19.7668 18.9932 19.768C20.0059 19.7665 21.0062 20.0166 21.922 20.5002C22.8378 20.9839 23.6463 21.689 24.289 22.5648L26.4052 20.6107ZM28.4992 18.6263L30.6109 16.665C27.7618 12.8233 23.5415 10.5557 18.9932 10.5557C16.7775 10.5534 14.5886 11.0983 12.5827 12.1516C10.5768 13.2049 8.8033 14.7406 7.38867 16.6492L9.49631 18.6128C11.8303 15.4749 15.276 13.6272 18.9932 13.6272C20.809 13.6247 22.6029 14.0715 24.2463 14.9358C25.8897 15.8 27.342 17.0603 28.4992 18.6263ZM20.0411 26.4524L22.1336 24.4652C21.3579 23.4417 20.2181 22.8382 18.9938 22.8382C18.3768 22.8378 17.7677 22.9928 17.2117 23.2918C16.6556 23.5908 16.1668 24.0261 15.7815 24.5654L17.9223 26.4862L18.9576 27.4444L20.0411 26.4524Z"
|
||||
fill="#605BFF" />
|
||||
<path
|
||||
d="M25.8613 17.9443C28.4848 17.9443 30.6113 20.0709 30.6113 22.6943C30.6113 25.3178 28.4848 27.4443 25.8613 27.4443C23.2379 27.4443 21.1113 25.3178 21.1113 22.6943C21.1113 20.0709 23.2379 17.9443 25.8613 17.9443ZM25.0268 24.0718L24.0183 23.0634C23.9745 23.018 23.9221 22.9819 23.8641 22.957C23.8062 22.9321 23.7439 22.919 23.6808 22.9184C23.6177 22.9179 23.5552 22.9299 23.4968 22.9538C23.4384 22.9777 23.3854 23.0129 23.3408 23.0575C23.2962 23.1021 23.2609 23.1552 23.237 23.2135C23.2132 23.2719 23.2011 23.3345 23.2017 23.3975C23.2022 23.4606 23.2153 23.5229 23.2402 23.5809C23.2651 23.6388 23.3013 23.6912 23.3467 23.7351L24.6905 25.0788C24.7795 25.1679 24.9003 25.2179 25.0263 25.2179C25.1522 25.2179 25.273 25.1679 25.3621 25.0788L28.7204 21.7201C28.7668 21.6766 28.804 21.6241 28.8298 21.566C28.8555 21.5078 28.8693 21.445 28.8704 21.3813C28.8714 21.3177 28.8596 21.2545 28.8358 21.1955C28.8119 21.1365 28.7764 21.0829 28.7314 21.0379C28.6864 20.9928 28.6329 20.9573 28.5739 20.9334C28.5149 20.9095 28.4517 20.8977 28.3881 20.8987C28.3244 20.8997 28.2616 20.9134 28.2034 20.9392C28.1452 20.9649 28.0927 21.0021 28.0492 21.0485L25.0263 24.0709L25.0268 24.0718Z"
|
||||
fill="#605BFF" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
12
luci-app-istorex/htdocs/luci-static/istorex/open.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
||||
<path
|
||||
d="M22 2C22 0.89543 21.1046 0 20 0H2C0.89543 0 0 0.895431 0 2V20C0 21.1046 0.895432 22 2 22H20C21.1046 22 22 21.1046 22 20V2Z"
|
||||
fill="black" fill-opacity="0.08" />
|
||||
<path d="M4 13H18V18C18 18.5523 17.5523 19 17 19H5C4.44772 19 4 18.5523 4 18V13Z" fill="#AAAAAA" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M7 17C7.55228 17 8 16.5523 8 16C8 15.4477 7.55228 15 7 15C6.44772 15 6 15.4477 6 16C6 16.5523 6.44772 17 7 17ZM10 17C10.5523 17 11 16.5523 11 16C11 15.4477 10.5523 15 10 15C9.44772 15 9 15.4477 9 16C9 16.5523 9.44772 17 10 17Z"
|
||||
fill="#D9D9D9" />
|
||||
<path
|
||||
d="M5.06352 3.88412C5.12232 3.38008 5.54933 3 6.05678 3H15.9432C16.4507 3 16.8777 3.38008 16.9365 3.88412L18 13H4L5.06352 3.88412Z"
|
||||
fill="#928F8F" />
|
||||
</svg>
|
After Width: | Height: | Size: 897 B |
BIN
luci-app-istorex/htdocs/luci-static/istorex/partition.png
Normal file
After Width: | Height: | Size: 853 B |
BIN
luci-app-istorex/htdocs/luci-static/istorex/photo.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
18
luci-app-istorex/htdocs/luci-static/istorex/right.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="35" height="90" viewBox="0 0 35 90" fill="none">
|
||||
<g filter="url(#filter0_d_622_2367)">
|
||||
<rect x="15" y="10" width="20" height="70" fill="white" fill-opacity="0.8" shape-rendering="crispEdges"/>
|
||||
</g>
|
||||
<path d="M22 45.5691C22 45.016 22.1988 44.532 22.5964 44.1172L26.8373 40.1761C27.1024 39.8995 27.4999 39.9686 27.765 40.2452C28.0301 40.5218 27.9638 40.9366 27.6987 41.2132L23.4578 45.2234C23.3916 45.2926 23.3253 45.4309 23.3253 45.5691C23.3253 45.7074 23.3916 45.8457 23.5241 45.984L27.765 49.7868C28.0301 50.0634 28.0963 50.4782 27.8313 50.7548C27.5662 51.0314 27.1686 51.1005 26.9036 50.8239L22.6626 47.0211C22.1988 46.6754 22 46.1914 22 45.5691Z" fill="black" fill-opacity="0.5"/>
|
||||
<defs>
|
||||
<filter id="filter0_d_622_2367" x="0" y="0" width="40" height="90" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dx="-5"/>
|
||||
<feGaussianBlur stdDeviation="5"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_622_2367"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_622_2367" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
18
luci-app-istorex/htdocs/luci-static/istorex/safari.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none">
|
||||
<g opacity="0.8" filter="url(#filter0_b_605_1465)">
|
||||
<rect width="50" height="50" rx="16" fill="white" />
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M7.5 25.3923C7.5 15.6753 15.3571 7.75769 25 7.75769C34.7321 7.75769 42.5893 15.6753 42.5 25.3923C42.5 35.1093 34.6429 43.0269 25 43.0269C15.3571 43.0269 7.5 35.1093 7.5 25.3923ZM29.375 29.2611L32.9464 18.2845C33.125 18.0146 33.0357 17.7446 32.8571 17.5647C32.7679 17.3848 32.4107 17.3848 32.1429 17.4747L21.25 21.0736C20.9821 21.1636 20.7143 21.4335 20.625 21.7034L17.0536 32.6801C16.875 32.95 16.9643 33.2199 17.1429 33.3999C17.2321 33.5798 17.5893 33.5798 17.8571 33.4898L28.75 29.8909C29.0179 29.801 29.2857 29.531 29.375 29.2611ZM22.3218 25.3922C22.3218 23.8626 23.5718 22.693 25.0003 22.693C26.5182 22.693 27.6789 23.9526 27.6789 25.3922C27.6789 26.9217 26.5182 28.0913 25.0003 28.0913C23.4825 28.0913 22.3218 26.8317 22.3218 25.3922Z"
|
||||
fill="#0066FF" />
|
||||
<defs>
|
||||
<filter id="filter0_b_605_1465" x="-24" y="-24" width="98" height="98"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="12" />
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_605_1465" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_605_1465"
|
||||
result="shape" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/setting.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
15
luci-app-istorex/htdocs/luci-static/istorex/setting.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M3.375 12C3.375 12.4973 3.57254 12.9742 3.92417 13.3258C4.27581 13.6775 4.75272 13.875 5.25 13.875C5.74728 13.875 6.22419 13.6775 6.57583 13.3258C6.92746 12.9742 7.125 12.4973 7.125 12C7.125 11.5027 6.92746 11.0258 6.57583 10.6742C6.22419 10.3225 5.74728 10.125 5.25 10.125C4.75272 10.125 4.27581 10.3225 3.92417 10.6742C3.57254 11.0258 3.375 11.5027 3.375 12ZM10.125 12C10.125 12.4973 10.3225 12.9742 10.6742 13.3258C11.0258 13.6775 11.5027 13.875 12 13.875C12.4973 13.875 12.9742 13.6775 13.3258 13.3258C13.6775 12.9742 13.875 12.4973 13.875 12C13.875 11.5027 13.6775 11.0258 13.3258 10.6742C12.9742 10.3225 12.4973 10.125 12 10.125C11.5027 10.125 11.0258 10.3225 10.6742 10.6742C10.3225 11.0258 10.125 11.5027 10.125 12ZM17.4242 13.3258C17.0725 12.9742 16.875 12.4973 16.875 12C16.875 11.5027 17.0725 11.0258 17.4242 10.6742C17.7758 10.3225 18.2527 10.125 18.75 10.125C19.2473 10.125 19.7242 10.3225 20.0758 10.6742C20.4275 11.0258 20.625 11.5027 20.625 12C20.625 12.4973 20.4275 12.9742 20.0758 13.3258C19.7242 13.6775 19.2473 13.875 18.75 13.875C18.2527 13.875 17.7758 13.6775 17.4242 13.3258Z"
|
||||
fill="black"
|
||||
fill-opacity="0.8"
|
||||
/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
18
luci-app-istorex/htdocs/luci-static/istorex/setup.svg
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/store@3x.png
Normal file
After Width: | Height: | Size: 203 KiB |
1
luci-app-istorex/htdocs/luci-static/istorex/style.css
Normal file
BIN
luci-app-istorex/htdocs/luci-static/istorex/sync.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/tag-0.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/tag-1.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/tag-2.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/tag-3.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/tag-4.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
18
luci-app-istorex/htdocs/luci-static/istorex/task.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none">
|
||||
<g opacity="0.8" filter="url(#filter0_b_605_1479)">
|
||||
<rect width="50" height="50" rx="16" fill="white" />
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M32.4559 14.6579H17.7223C17.1059 14.6579 16.5794 14.2144 16.6736 13.5127V9.98231C16.6736 9.45275 17.1102 8.83709 17.8122 8.83709H18.5998C19.2119 8.83709 19.7384 8.39795 19.7384 7.69188C19.7384 6.45625 20.7015 5.48755 21.93 5.48755H28.4236C29.6521 5.48755 30.6152 6.45625 30.6152 7.69188C30.6152 8.22143 31.0519 8.83709 31.7539 8.83709H32.4559C33.068 8.83709 33.5945 9.27624 33.5945 9.98231V13.5127C33.5945 14.0422 33.1579 14.6579 32.4559 14.6579ZM27.5418 10.0684C27.5418 8.74237 26.5787 7.59716 25.1747 7.59716C23.9462 7.59716 22.8076 8.74237 22.8076 10.0684C22.8076 11.3945 23.9462 12.5397 25.1747 12.5397C26.4032 12.5397 27.5418 11.6571 27.5418 10.0684ZM36.9288 9.36234H37.6308C39.1205 9.36234 40.0879 10.6884 39.9937 12.0101V40.9505C39.9937 42.4488 38.5041 44.0374 37.1 44.0374H12.8936C11.2285 44.0374 10 42.2723 10 40.9505V12.1909C10 10.6023 10.7919 9.36665 12.6325 9.54317H13.3388C13.9509 9.54317 14.4774 9.98231 14.4774 10.6884V15.8892C14.4774 16.4188 14.9141 17.0344 15.6161 17.0344L34.5617 16.8579C35.1738 16.8579 35.7003 16.4188 35.7003 15.7127V10.5076C35.7003 9.80149 36.2268 9.36234 36.9288 9.36234ZM16.4936 34.5399H20.9582C21.3948 34.5399 21.7458 34.1869 21.7458 33.7477C21.7458 33.3086 21.3948 32.9555 20.9582 32.9555H16.4936C16.057 32.9555 15.7059 33.3086 15.7059 33.7477C15.7059 34.1869 16.057 34.5399 16.4936 34.5399ZM16.4936 28.8999H25.701C26.1376 28.8999 26.4886 28.5469 26.4886 28.1077C26.4886 27.6686 26.1333 27.3156 25.701 27.3156H16.4936C16.057 27.3156 15.7059 27.6686 15.7059 28.1077C15.7059 28.5469 16.057 28.8999 16.4936 28.8999ZM33.5258 23.4278C33.9496 23.4278 34.292 23.0834 34.292 22.6572V22.6184C34.292 22.1922 33.9496 21.8478 33.5258 21.8478H16.4722C16.0484 21.8478 15.7059 22.1922 15.7059 22.6184V22.6572C15.7059 23.0834 16.0484 23.4278 16.4722 23.4278H33.5258Z"
|
||||
fill="#0066FF" />
|
||||
<defs>
|
||||
<filter id="filter0_b_605_1479" x="-24" y="-24" width="98" height="98"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="12" />
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_605_1479" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_605_1479"
|
||||
result="shape" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
BIN
luci-app-istorex/htdocs/luci-static/istorex/user.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
12
luci-app-istorex/htdocs/luci-static/istorex/warning.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||
<g clip-path="url(#clip0_605_1211)">
|
||||
<path d="M15.1432 10.9578C14.7339 11.9034 14.1804 12.7249 13.4827 13.4223C12.7853 14.12 11.9664 14.6737 11.0268 15.0828C10.0869 15.4924 9.08074 15.6969 8.00829 15.6969C6.9361 15.6969 5.9271 15.4924 4.9813 15.0828C4.03574 14.6737 3.21424 14.12 2.51681 13.4223C1.81913 12.7248 1.26538 11.9034 0.856294 10.9578C0.44673 10.012 0.242188 9.00302 0.242188 7.93081C0.242188 6.85836 0.44673 5.85221 0.856294 4.91235C1.26538 3.97272 1.81913 3.15382 2.51681 2.45638C3.21424 1.7587 4.03574 1.20518 4.9813 0.79587C5.9271 0.386554 6.93609 0.181763 8.00829 0.181763C9.08074 0.181763 10.0869 0.386553 11.0268 0.79587C11.9664 1.2052 12.7853 1.7587 13.4827 2.45638C14.1804 3.15383 14.7339 3.97273 15.1432 4.91235C15.5525 5.85221 15.7573 6.85836 15.7573 7.93081C15.7573 9.00302 15.5526 10.012 15.1432 10.9578Z" fill="#FF8F6B"/>
|
||||
<path d="M8.00024 11.0815C7.38043 11.0815 6.87842 11.5836 6.87842 12.2034C6.87842 12.8232 7.38043 13.3252 8.00024 13.3252C8.62005 13.3252 9.12206 12.8232 9.12206 12.2034C9.12206 11.5836 8.62005 11.0815 8.00024 11.0815Z" fill="white"/>
|
||||
<path d="M8.00024 9.99549C7.69062 9.99549 7.43933 9.47186 7.43933 8.82536L6.87842 3.55978C6.87842 2.91328 7.38043 2.38965 8.00024 2.38965C8.62005 2.38965 9.12206 2.91328 9.12206 3.55978L8.56115 8.82536C8.56115 9.47186 8.30986 9.99549 8.00024 9.99549Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_605_1211">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
144
luci-app-istorex/luasrc/controller/istorex.lua
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
module("luci.controller.istorex", package.seeall)
|
||||
|
||||
function index()
|
||||
if luci.sys.call("pgrep quickstart >/dev/null") == 0 then
|
||||
entry({"admin", "istorex"}, call("istorex_template")).leaf = true
|
||||
if nixio.fs.access("/usr/lib/lua/luci/view/istorex/main_dev.htm") then
|
||||
entry({"admin", "istorex_dev"}, call("istorex_template_dev")).leaf = true
|
||||
end
|
||||
else
|
||||
entry({"admin", "istorex"}, call("redirect_fallback")).leaf = true
|
||||
end
|
||||
entry({"admin", "istorex_api","status"}, call("istorex_api_status")).dependent = false
|
||||
entry({"admin", "istorex_api","update"}, call("istorex_api_update")).dependent = false
|
||||
entry({"admin", "istorex_api","upload-bg"}, call("istorex_api_uploadbg")).dependent = false
|
||||
end
|
||||
|
||||
local function user_id()
|
||||
local jsonc = require "luci.jsonc"
|
||||
local json_parse = jsonc.parse
|
||||
local fs = require "nixio.fs"
|
||||
local data = fs.readfile("/etc/.app_store.id")
|
||||
|
||||
local id
|
||||
if data ~= nil then
|
||||
id = json_parse(data)
|
||||
end
|
||||
if id == nil then
|
||||
fs.unlink("/etc/.app_store.id")
|
||||
id = {arch="",uid=""}
|
||||
end
|
||||
|
||||
id.version = (fs.readfile("/etc/.app_store.version") or "?"):gsub("[\r\n]", "")
|
||||
|
||||
return id
|
||||
end
|
||||
|
||||
function get_config_data()
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local model = uci:get_first("istorex", "istorex", "model")
|
||||
local enabled = uci:get_first("istorex", "istorex", "enabled")
|
||||
local data = {
|
||||
model = model,
|
||||
enabled = enabled,
|
||||
}
|
||||
return data
|
||||
end
|
||||
|
||||
function get_params()
|
||||
local config = get_config_data()
|
||||
local data = {
|
||||
prefix=luci.dispatcher.build_url(unpack({"admin", "istorex"})),
|
||||
id=user_id(),
|
||||
model = config.model,
|
||||
}
|
||||
return data
|
||||
end
|
||||
|
||||
function get_dev_params()
|
||||
local config = get_config_data()
|
||||
local data = {
|
||||
prefix=luci.dispatcher.build_url(unpack({"admin", "istorex_dev"})),
|
||||
id=user_id(),
|
||||
model = config.model,
|
||||
}
|
||||
return data
|
||||
end
|
||||
|
||||
function redirect_fallback()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","status"))
|
||||
end
|
||||
|
||||
function istorex_template()
|
||||
luci.template.render("istorex/main", get_params())
|
||||
end
|
||||
|
||||
function istorex_template_dev()
|
||||
luci.template.render("istorex/main_dev", get_dev_params())
|
||||
end
|
||||
|
||||
function istorex_api_status()
|
||||
local result = get_config_data()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
success = 0,
|
||||
result = result,
|
||||
})
|
||||
end
|
||||
|
||||
function istorex_api_update()
|
||||
local http = require "luci.http"
|
||||
local jsonc = require "luci.jsonc"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local content = http.content()
|
||||
local json_parse = jsonc.parse
|
||||
local req = json_parse(content)
|
||||
local data = {
|
||||
}
|
||||
if req == nil or next(req) == nil then
|
||||
data.error = "invalid request"
|
||||
else
|
||||
uci:set("istorex","@istorex[0]","model", req.model)
|
||||
uci:commit("istorex")
|
||||
data.success = 0
|
||||
end
|
||||
http.prepare_content("application/json")
|
||||
http.write_json(data)
|
||||
end
|
||||
|
||||
function istorex_api_uploadbg()
|
||||
local uci = require "uci"
|
||||
local x = uci.cursor()
|
||||
local fd
|
||||
local path
|
||||
local finished = false
|
||||
local tmpdir = "/www/luci-static/istorex/image"
|
||||
local filename = ""
|
||||
luci.http.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
if not fd then
|
||||
filename = meta.file
|
||||
path = tmpdir .. "/bg.gif"
|
||||
fd = io.open(path, "w")
|
||||
end
|
||||
if chunk then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof then
|
||||
fd:close()
|
||||
finished = true
|
||||
end
|
||||
end
|
||||
)
|
||||
luci.http.formvalue("file")
|
||||
local result = {
|
||||
filename = filename
|
||||
}
|
||||
local data = {
|
||||
success = finished,
|
||||
result = result
|
||||
}
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(data)
|
||||
end
|
4
luci-app-istorex/luasrc/view/istorex/index.htm
Normal file
@ -0,0 +1,4 @@
|
||||
<%
|
||||
local istorex = require "luci.controller.istorex"
|
||||
istorex.istorex_template()
|
||||
%>
|
57
luci-app-istorex/luasrc/view/istorex/main.htm
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!-- <meta name="viewport" content="width=1400, initial-scale=1.0" /> -->
|
||||
<!-- <meta name="viewport" content="width=1100" /> -->
|
||||
<title><%=luci.sys.hostname()%></title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/promis.min.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<%+tasks/embed%>
|
||||
<script>
|
||||
(function(){
|
||||
var pathe_prefix = "<%=prefix%>"
|
||||
window.istoreXVer = "<%# PKG_VERSION %>"
|
||||
window.HostName = "<%=luci.sys.hostname()%>"
|
||||
window.path_base = pathe_prefix
|
||||
window.token = "<%=token%>"
|
||||
window.model = "<%=model%>"
|
||||
window.device_id = {
|
||||
arch:"<%=id.arch%>",
|
||||
uid:"<%=id.uid%>",
|
||||
version:"<%=id.version%>"
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
L = new LuCI(<%= luci.http.write_json({
|
||||
token = token,
|
||||
media = media,
|
||||
resource = resource,
|
||||
scriptname = luci.http.getenv("SCRIPT_NAME"),
|
||||
pathinfo = luci.http.getenv("PATH_INFO"),
|
||||
documentroot = luci.http.getenv("DOCUMENT_ROOT"),
|
||||
requestpath = luci.dispatcher.context.requestpath,
|
||||
dispatchpath = luci.dispatcher.context.path,
|
||||
pollinterval = luci.config.main.pollinterval or 5,
|
||||
ubuspath = luci.config.main.ubuspath or '/ubus/',
|
||||
sessionid = luci.dispatcher.context.authsession,
|
||||
nodespec = luci.dispatcher.context.dispatched,
|
||||
apply_rollback = math.max(applyconf and applyconf.rollback or 90, 30),
|
||||
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
|
||||
apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
|
||||
apply_display = math.max(applyconf and applyconf.display or 1.5, 1),
|
||||
rollback_token = rollback_token
|
||||
}) %>);
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
<link rel="stylesheet" href="/luci-static/istorex/style.css<%# ?v=PKG_VERSION %>">
|
||||
<script type="module" crossorigin src="/luci-static/istorex/index.js<%# ?v=PKG_VERSION %>"></script>
|
||||
</body>
|
||||
</html>
|
60
luci-app-istorex/luasrc/view/istorex/main_dev.htm
Normal file
@ -0,0 +1,60 @@
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
-%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -->
|
||||
<meta name="viewport" content="width=1100" />
|
||||
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/promis.min.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<%+tasks/embed%>
|
||||
<script>
|
||||
(function(){
|
||||
var pathe_prefix = "<%=prefix%>"
|
||||
window.istoreXVer = "<%# PKG_VERSION %>"
|
||||
window.HostName = "<%=luci.sys.hostname()%>"
|
||||
window.path_base = pathe_prefix
|
||||
window.token = "<%=token%>"
|
||||
window.model = "<%=model%>"
|
||||
window.device_id = {
|
||||
arch:"<%=id.arch%>",
|
||||
uid:"<%=id.uid%>",
|
||||
version:"<%=id.version%>"
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
L = new LuCI(<%= luci.http.write_json({
|
||||
token = token,
|
||||
media = media,
|
||||
resource = resource,
|
||||
scriptname = luci.http.getenv("SCRIPT_NAME"),
|
||||
pathinfo = luci.http.getenv("PATH_INFO"),
|
||||
documentroot = luci.http.getenv("DOCUMENT_ROOT"),
|
||||
requestpath = luci.dispatcher.context.requestpath,
|
||||
dispatchpath = luci.dispatcher.context.path,
|
||||
pollinterval = luci.config.main.pollinterval or 5,
|
||||
ubuspath = luci.config.main.ubuspath or '/ubus/',
|
||||
sessionid = luci.dispatcher.context.authsession,
|
||||
nodespec = luci.dispatcher.context.dispatched,
|
||||
apply_rollback = math.max(applyconf and applyconf.rollback or 90, 30),
|
||||
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
|
||||
apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
|
||||
apply_display = math.max(applyconf and applyconf.display or 1.5, 1),
|
||||
rollback_token = rollback_token
|
||||
}) %>);
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="http://localhost:3000/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
3
luci-app-istorex/root/etc/config/istorex
Normal file
@ -0,0 +1,3 @@
|
||||
config istorex
|
||||
option enabled '1'
|
||||
option model 'wizard'
|
4
luci-app-istorex/root/etc/uci-defaults/50_luci-istorex
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"admin/istorex": {
|
||||
"order": 0,
|
||||
"action": {
|
||||
"type": "template",
|
||||
"path": "istorex/index"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-istorex": {
|
||||
"description": "Grant UCI access for luci-app-istorex",
|
||||
"read": {
|
||||
"uci": [ "istorex" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "istorex" ]
|
||||
}
|
||||
}
|
||||
}
|
24
luci-app-quickstart/API.md
Normal file
@ -0,0 +1,24 @@
|
||||
## API
|
||||
这里列出的接口都是 lua 实现的,对于 POST 请求都是提交表单( `multipart/form-data` 或者 `application/x-www-form-urlencoded` ),而不是 JSON,并且 POST 请求必须提供 `token` 参数用于防止 CSRF,`token` 的值可以从全局变量 `window.token` 取得。
|
||||
|
||||
1. 自动安装配置软件包
|
||||
```
|
||||
POST /cgi-bin/luci/admin/nas/quickstart/auto_setup
|
||||
token=xxx&packages=aria2&packages=qbittorrent
|
||||
|
||||
|
||||
{"success":0}
|
||||
{"success":1, "scope":"taskd", "error":"task already running"}
|
||||
```
|
||||
这是个异步接口,除非任务已经在运行,否则都会成功(success=0)。`packages` 是需要安装配置的软件包列表,与元数据的id对应
|
||||
|
||||
2. 获取安装配置结果
|
||||
```
|
||||
GET /cgi-bin/luci/admin/nas/quickstart/setup_result
|
||||
|
||||
|
||||
{"success":0, "result": {"ongoing": true, "packages": ["aria2", "qbittorrent"], "success":["aria2"], "failed":[]} }
|
||||
{"success":404, "scope":"taskd", "error":"task not found"}
|
||||
```
|
||||
用于在安装过程中或者安装完成时获取当前状态。
|
||||
安装过程中或者安装完成时,`success` 都是 0,`result.ongoing` 表示是否在安装过程中,`result.packages` 是提交的任务列表,`result.success` 是已成功的任务列表,`result.failed` 是已失败的任务列表
|
22
luci-app-quickstart/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for quickstart
|
||||
LUCI_DEPENDS:=+quickstart +luci-app-store
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=0.8.3-3
|
||||
# PKG_RELEASE MUST be empty for luci.mk
|
||||
PKG_RELEASE:=
|
||||
|
||||
LUCI_MINIFY_CSS:=0
|
||||
LUCI_MINIFY_JS:=0
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
47
luci-app-quickstart/htdocs/luci-static/quickstart/vendor.js
Normal file
189
luci-app-quickstart/luasrc/controller/istore_backend.lua
Normal file
@ -0,0 +1,189 @@
|
||||
-- Copyright 2022 xiaobao <xiaobao@linkease.com>
|
||||
-- Licensed to the public under the MIT License
|
||||
|
||||
local http = require "luci.http"
|
||||
local nixio = require "nixio"
|
||||
local ltn12 = require "luci.ltn12"
|
||||
local table = require "table"
|
||||
local util = require "luci.util"
|
||||
|
||||
module("luci.controller.istore_backend", package.seeall)
|
||||
|
||||
local BLOCKSIZE = 2048
|
||||
local ISTOREOS_PORT = 3038
|
||||
|
||||
function index()
|
||||
entry({"istore"}, call("istore_backend")).leaf=true
|
||||
end
|
||||
|
||||
local function sink_socket(sock, io_err)
|
||||
if sock then
|
||||
return function(chunk, err)
|
||||
if not chunk then
|
||||
return 1
|
||||
else
|
||||
return sock:send(chunk)
|
||||
end
|
||||
end
|
||||
else
|
||||
return ltn12.sink.error(io_err or "unable to send socket")
|
||||
end
|
||||
end
|
||||
|
||||
local function session_retrieve(sid, allowed_users)
|
||||
local sdat = util.ubus("session", "get", { ubus_rpc_session = sid })
|
||||
if type(sdat) == "table" and
|
||||
type(sdat.values) == "table" and
|
||||
type(sdat.values.token) == "string" and
|
||||
(not allowed_users or
|
||||
util.contains(allowed_users, sdat.values.username))
|
||||
then
|
||||
return sid, sdat.values
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
local function get_session()
|
||||
local sid
|
||||
local key
|
||||
local sdat
|
||||
for _, key in ipairs({"sysauth_https", "sysauth_http", "sysauth"}) do
|
||||
sid = http.getcookie(key)
|
||||
if sid then
|
||||
sid, sdat = session_retrieve(sid, nil)
|
||||
if sid and sdat then
|
||||
return sid, sdat
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
local function chunksource(sock, buffer)
|
||||
buffer = buffer or ""
|
||||
return function()
|
||||
local output
|
||||
local _, endp, count = buffer:find("^([0-9a-fA-F]+);?.-\r\n")
|
||||
while not count and #buffer <= 1024 do
|
||||
local newblock, code = sock:recv(1024 - #buffer)
|
||||
if not newblock then
|
||||
return nil, code
|
||||
end
|
||||
buffer = buffer .. newblock
|
||||
_, endp, count = buffer:find("^([0-9a-fA-F]+);?.-\r\n")
|
||||
end
|
||||
count = tonumber(count, 16)
|
||||
if not count then
|
||||
return nil, -1, "invalid encoding"
|
||||
elseif count == 0 then
|
||||
return nil
|
||||
elseif count + 2 <= #buffer - endp then
|
||||
output = buffer:sub(endp+1, endp+count)
|
||||
buffer = buffer:sub(endp+count+3)
|
||||
return output
|
||||
else
|
||||
output = buffer:sub(endp+1, endp+count)
|
||||
buffer = ""
|
||||
if count - #output > 0 then
|
||||
local remain, code = sock:recvall(count-#output)
|
||||
if not remain then
|
||||
return nil, code
|
||||
end
|
||||
output = output .. remain
|
||||
count, code = sock:recvall(2)
|
||||
else
|
||||
count, code = sock:recvall(count+2-#buffer+endp)
|
||||
end
|
||||
if not count then
|
||||
return nil, code
|
||||
end
|
||||
return output
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function istore_backend()
|
||||
local sock = nixio.connect("127.0.0.1", ISTOREOS_PORT)
|
||||
if not sock then
|
||||
http.status(500, "connect failed")
|
||||
return
|
||||
end
|
||||
local input = {}
|
||||
input[#input+1] = http.getenv("REQUEST_METHOD") .. " " .. http.getenv("REQUEST_URI") .. " HTTP/1.1"
|
||||
local req = http.context.request
|
||||
local start = "HTTP_"
|
||||
local start_len = string.len(start)
|
||||
local ctype = http.getenv("CONTENT_TYPE")
|
||||
if ctype then
|
||||
input[#input+1] = "Content-Type: " .. ctype
|
||||
end
|
||||
for k, v in pairs(req.message.env) do
|
||||
if string.sub(k, 1, start_len) == start and not string.find(k, "FORWARDED") then
|
||||
input[#input+1] = string.sub(k, start_len+1, string.len(k)) .. ": " .. v
|
||||
end
|
||||
end
|
||||
local sid, sdat = get_session()
|
||||
if sdat ~= nil then
|
||||
input[#input+1] = "X-Forwarded-Sid: " .. sid
|
||||
input[#input+1] = "X-Forwarded-Token: " .. sdat.token
|
||||
end
|
||||
-- input[#input+1] = "X-Forwarded-For: " .. http.getenv("REMOTE_HOST") ..":".. http.getenv("REMOTE_PORT")
|
||||
local num = tonumber(http.getenv("CONTENT_LENGTH")) or 0
|
||||
input[#input+1] = "Content-Length: " .. tostring(num)
|
||||
input[#input+1] = "\r\n"
|
||||
local source = ltn12.source.cat(ltn12.source.string(table.concat(input, "\r\n")), http.source())
|
||||
local ret = ltn12.pump.all(source, sink_socket(sock, "write sock error"))
|
||||
if ret ~= 1 then
|
||||
sock:close()
|
||||
http.status(500, "proxy error")
|
||||
return
|
||||
end
|
||||
|
||||
local linesrc = sock:linesource()
|
||||
local line, code, error = linesrc()
|
||||
if not line then
|
||||
sock:close()
|
||||
http.status(500, "response parse failed")
|
||||
return
|
||||
end
|
||||
|
||||
local protocol, status, msg = line:match("^([%w./]+) ([0-9]+) (.*)")
|
||||
if not protocol then
|
||||
sock:close()
|
||||
http.status(500, "response protocol error")
|
||||
return
|
||||
end
|
||||
num = tonumber(status) or 0
|
||||
http.status(num, msg)
|
||||
|
||||
local chunked = 0
|
||||
line = linesrc()
|
||||
while line and line ~= "" do
|
||||
local key, val = line:match("^([%w-]+)%s?:%s?(.*)")
|
||||
if key and key ~= "Status" then
|
||||
if key == "Transfer-Encoding" and val == "chunked" then
|
||||
chunked = 1
|
||||
end
|
||||
if key ~= "Connection" and key ~= "Transfer-Encoding" and key ~= "Content-Length" then
|
||||
http.header(key, val)
|
||||
end
|
||||
end
|
||||
line = linesrc()
|
||||
end
|
||||
if not line then
|
||||
sock:close()
|
||||
http.status(500, "parse header failed")
|
||||
return
|
||||
end
|
||||
|
||||
local body_buffer = linesrc(true)
|
||||
if chunked == 1 then
|
||||
ltn12.pump.all(chunksource(sock, body_buffer), http.write)
|
||||
else
|
||||
local body_source = ltn12.source.cat(ltn12.source.string(body_buffer), sock:blocksource())
|
||||
ltn12.pump.all(body_source, http.write)
|
||||
end
|
||||
|
||||
sock:close()
|
||||
end
|
||||
|
152
luci-app-quickstart/luasrc/controller/quickstart.lua
Normal file
@ -0,0 +1,152 @@
|
||||
local http = require "luci.http"
|
||||
|
||||
module("luci.controller.quickstart", package.seeall)
|
||||
|
||||
function index()
|
||||
if luci.sys.call("pgrep quickstart >/dev/null") == 0 then
|
||||
entry({"admin", "quickstart"}, template("quickstart/home"), _("QuickStart"), 1).leaf = true
|
||||
entry({"admin", "network_guide"}, call("networkguide_index"), _("NetworkGuide"), 2)
|
||||
entry({"admin", "network_guide", "pages"}, call("quickstart_index", {index={"admin", "network_guide", "pages"}})).leaf = true
|
||||
if nixio.fs.access("/usr/lib/lua/luci/view/quickstart/main_dev.htm") then
|
||||
entry({"admin", "quickstart_dev"}, call("quickstart_dev", {index={"admin", "quickstart_dev"}})).leaf = true
|
||||
end
|
||||
entry({"admin", "nas", "raid"}, call("quickstart_index", {index={"admin", "nas"}}), _("RAID"), 10).leaf = true
|
||||
entry({"admin", "nas", "smart"}, call("quickstart_index", {index={"admin", "nas"}}), _("S.M.A.R.T."), 11).leaf = true
|
||||
entry({"admin", "network", "interfaceconfig"}, call("quickstart_index", {index={"admin", "network"}}), _("NetworkPort"), 11).leaf = true
|
||||
|
||||
entry({"admin", "nas", "quickstart"}).dependent = false
|
||||
entry({"admin", "nas", "quickstart", "auto_setup"}, post("auto_setup"))
|
||||
entry({"admin", "nas", "quickstart", "setup_result"}, call("setup_result"))
|
||||
else
|
||||
entry({"admin", "quickstart"}, call("redirect_fallback")).leaf = true
|
||||
end
|
||||
end
|
||||
|
||||
function networkguide_index()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "network_guide", "pages", "network"))
|
||||
end
|
||||
|
||||
function redirect_fallback()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "status"))
|
||||
end
|
||||
|
||||
function quickstart_index(param)
|
||||
luci.template.render("quickstart/main", {prefix=luci.dispatcher.build_url(unpack(param.index))})
|
||||
end
|
||||
|
||||
function quickstart_dev(param)
|
||||
luci.template.render("quickstart/main_dev", {prefix=luci.dispatcher.build_url(unpack(param.index))})
|
||||
end
|
||||
|
||||
function auto_setup()
|
||||
local os = require "os"
|
||||
local fs = require "nixio.fs"
|
||||
local rshift = nixio.bit.rshift
|
||||
|
||||
-- json style
|
||||
-- local jsonc = require "luci.jsonc"
|
||||
-- local json_parse = jsonc.parse
|
||||
-- local req = json_parse(luci.http.content())
|
||||
-- local pkgs = ""
|
||||
-- for k, v in pairs(req.packages) do
|
||||
-- pkgs = pkgs .. " " .. luci.util.shellquote(v)
|
||||
-- end
|
||||
|
||||
-- form style
|
||||
local packages = luci.http.formvalue("packages")
|
||||
local pkgs = ""
|
||||
if type(packages) == "table" then
|
||||
if #packages > 0 then
|
||||
for k, v in pairs(packages) do
|
||||
pkgs = pkgs .. " " .. luci.util.shellquote(v)
|
||||
end
|
||||
end
|
||||
else
|
||||
if packages ~= nil and packages ~= "" then
|
||||
pkgs = luci.util.shellquote(packages)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local ret
|
||||
if pkgs == "" then
|
||||
ret = {
|
||||
success = 1,
|
||||
scope = "params",
|
||||
error = "Parameter 'packages' undefined!",
|
||||
}
|
||||
else
|
||||
local cmd = "/usr/libexec/quickstart/auto_setup.sh " .. pkgs
|
||||
cmd = "/etc/init.d/tasks task_add auto_setup " .. luci.util.shellquote(cmd)
|
||||
local r = os.execute(cmd .. " >/var/log/auto_setup.stdout 2>/var/log/auto_setup.stderr")
|
||||
local e = fs.readfile("/var/log/auto_setup.stderr")
|
||||
local o = fs.readfile("/var/log/auto_setup.stdout")
|
||||
|
||||
fs.unlink("/var/log/auto_setup.stderr")
|
||||
fs.unlink("/var/log/auto_setup.stdout")
|
||||
e = e or ""
|
||||
if r == 256 and e == "" then
|
||||
e = "os.execute exit code 1"
|
||||
end
|
||||
r = rshift(r,8)
|
||||
ret = {
|
||||
success = r,
|
||||
scope = "taskd",
|
||||
error = e,
|
||||
detail = o,
|
||||
}
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(ret)
|
||||
end
|
||||
|
||||
function setup_result()
|
||||
local fs = require "nixio.fs"
|
||||
local taskd = require "luci.model.tasks"
|
||||
local packages = nil
|
||||
local success = nil
|
||||
local failed = nil
|
||||
local status = taskd.status("auto_setup")
|
||||
local ret = {
|
||||
}
|
||||
if status.running or status.exit_code ~= 404 then
|
||||
local item
|
||||
local po = fs.readfile("/var/log/auto_setup.input") or ""
|
||||
for item in po:gmatch("[^\n]+") do
|
||||
if packages then
|
||||
packages[#packages+1] = item
|
||||
else
|
||||
packages = {item}
|
||||
end
|
||||
end
|
||||
local so = fs.readfile("/var/log/auto_setup.success") or ""
|
||||
for item in so:gmatch("[^\n]+") do
|
||||
if success then
|
||||
success[#success+1] = item
|
||||
else
|
||||
success = {item}
|
||||
end
|
||||
end
|
||||
local fo = fs.readfile("/var/log/auto_setup.failed") or ""
|
||||
for item in fo:gmatch("[^\n]+") do
|
||||
if failed then
|
||||
failed[#failed+1] = item
|
||||
else
|
||||
failed = {item}
|
||||
end
|
||||
end
|
||||
ret.success = 0
|
||||
ret.result = {
|
||||
ongoing = status.running,
|
||||
packages = packages,
|
||||
success = success,
|
||||
failed = failed,
|
||||
}
|
||||
else
|
||||
ret.success = 404
|
||||
ret.scope = "taskd"
|
||||
ret.error = "task not found"
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(ret)
|
||||
end
|
2
luci-app-quickstart/luasrc/view/quickstart/home.htm
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
<% luci.template.render("quickstart/main", {prefix=luci.dispatcher.build_url("admin", "quickstart")}) %>
|
49
luci-app-quickstart/luasrc/view/quickstart/main.htm
Normal file
@ -0,0 +1,49 @@
|
||||
<%+header%>
|
||||
<%
|
||||
local jsonc = require "luci.jsonc"
|
||||
local features = { "_lua_force_array_" }
|
||||
local configs = {}
|
||||
if luci.sys.call("which ota >/dev/null 2>&1 && ota >/dev/null 2>&1") == 0 then
|
||||
features[#features+1] = "ota"
|
||||
end
|
||||
if luci.sys.call("[ -d /ext_overlay ] >/dev/null 2>&1") == 0 then
|
||||
features[#features+1] = "sandbox"
|
||||
end
|
||||
if luci.sys.call("[ -e /etc/init.d/dockerd ] >/dev/null 2>&1") == 0 then
|
||||
features[#features+1] = "dockerd"
|
||||
end
|
||||
if luci.sys.call("[ -e /etc/init.d/unishare ] >/dev/null 2>&1") == 0 then
|
||||
features[#features+1] = "unishare"
|
||||
end
|
||||
if luci.sys.call("/etc/init.d/ttyd running >/dev/null 2>&1") == 0 then
|
||||
features[#features+1] = "ttyd"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local port = uci:get_first("ttyd", "ttyd", "port") or "7681"
|
||||
local ssl = uci:get_first("ttyd", "ttyd", "ssl") or "0"
|
||||
configs["ttyd"] = {
|
||||
port = tonumber(port),
|
||||
ssl = ssl == "1"
|
||||
}
|
||||
end
|
||||
-%>
|
||||
<script>
|
||||
(function(){
|
||||
window.token = "<%=token%>";
|
||||
var vue_prefix="<%=prefix%>";
|
||||
window.vue_base = vue_prefix + '/';
|
||||
window.quickstart_features = <%=jsonc.stringify(features)%>;
|
||||
window.quickstart_configs = <%=jsonc.stringify(configs)%>;
|
||||
if (location.pathname != vue_prefix && !location.pathname.startsWith(window.vue_base)) {
|
||||
if (window.history && window.history.replaceState) {
|
||||
window.history.replaceState({}, null, vue_prefix);
|
||||
} else {
|
||||
location.href = vue_prefix;
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<div id="app">
|
||||
</div>
|
||||
<script type="module" crossorigin src="/luci-static/quickstart/index.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<link rel="stylesheet" href="/luci-static/quickstart/style.css<%# ?v=PKG_VERSION %>">
|
||||
<%+footer%>
|
11
luci-app-quickstart/po/zh-cn/quickstart.po
Normal file
@ -0,0 +1,11 @@
|
||||
msgid "NetworkGuide"
|
||||
msgstr "网络向导"
|
||||
|
||||
msgid "QuickStart"
|
||||
msgstr "首页"
|
||||
|
||||
msgid "RAID"
|
||||
msgstr "磁盘阵列"
|
||||
|
||||
msgid "NetworkPort"
|
||||
msgstr "网口配置"
|
1
luci-app-quickstart/po/zh_Hans
Symbolic link
@ -0,0 +1 @@
|
||||
zh-cn
|
4
luci-app-quickstart/root/etc/uci-defaults/50_luci-quickstart
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
61
luci-app-quickstart/root/usr/libexec/quickstart/auto_setup.sh
Executable file
@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
> /var/log/auto_setup.success
|
||||
> /var/log/auto_setup.failed
|
||||
> /var/log/auto_setup.input
|
||||
|
||||
save_input() {
|
||||
local pkg
|
||||
for pkg in $@; do
|
||||
echo "$pkg" >> /var/log/auto_setup.input
|
||||
done
|
||||
}
|
||||
save_input "$@"
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
load_quickstart_cfg() {
|
||||
config_load quickstart || return $?
|
||||
|
||||
local main_dir conf_dir pub_dir dl_dir tmp_dir
|
||||
config_get main_dir "main" main_dir
|
||||
[ -z "$main_dir" ] && { echo "Home dir not configured!" >&2 ; return 1 ; }
|
||||
config_get conf_dir "main" conf_dir "$main_dir/Configs"
|
||||
config_get pub_dir "main" pub_dir "$main_dir/Public"
|
||||
config_get tmp_dir "main" tmp_dir "$main_dir/Caches"
|
||||
config_get dl_dir "main" dl_dir "$pub_dir/Downloads"
|
||||
|
||||
export ISTORE_CONF_DIR="$conf_dir"
|
||||
export ISTORE_DL_DIR="$dl_dir"
|
||||
export ISTORE_CACHE_DIR="$tmp_dir"
|
||||
export ISTORE_PUBLIC_DIR="$pub_dir"
|
||||
|
||||
mkdir -p "$ISTORE_CONF_DIR" "$ISTORE_DL_DIR" "$ISTORE_CACHE_DIR" "$ISTORE_PUBLIC_DIR"
|
||||
chmod 777 "$ISTORE_DL_DIR"
|
||||
}
|
||||
|
||||
auto_setup_app() {
|
||||
local pkg=$1
|
||||
is-opkg install "app-meta-$pkg" || return 1
|
||||
sh -c ". '/usr/libexec/istorea/$pkg.sh'"
|
||||
}
|
||||
|
||||
auto_setup_apps() {
|
||||
local pkg
|
||||
for pkg in $@; do
|
||||
echo "Setting up $pkg..."
|
||||
if auto_setup_app $pkg; then
|
||||
echo "Set up $pkg success"
|
||||
echo "$pkg" >> /var/log/auto_setup.success
|
||||
else
|
||||
echo "Set up $pkg failed"
|
||||
echo "$pkg" >> /var/log/auto_setup.failed
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
load_quickstart_cfg || exit $?
|
||||
|
||||
auto_setup_apps "$@"
|
||||
|
||||
[ ! -s /var/log/auto_setup.failed ]
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"admin/quickstart/*": {
|
||||
"title": "QuickStart",
|
||||
"order": 1,
|
||||
"action": {
|
||||
"type": "template",
|
||||
"path": "quickstart/home"
|
||||
}
|
||||
}
|
||||
}
|
68
quickstart/Makefile
Normal file
@ -0,0 +1,68 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
# Copyright (C) 2020 jjm2473@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_ARCH_quickstart:=$(ARCH)
|
||||
|
||||
PKG_NAME:=quickstart
|
||||
PKG_VERSION:=0.8.6
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/linkease/istore-packages/releases/download/prebuilt/
|
||||
PKG_HASH:=8d4c644af0b0413bff8e605c27d465a59f89869d92c1f3cfa00f9590d3a3b405
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=Quickstart, the quick start.
|
||||
DEPENDS:=@(x86_64||aarch64||arm) +shadow-utils +shadow-useradd +mount-utils +block-mount +lsblk +e2fsprogs +parted +smartmontools +smartd +mdadm +ip-full +ubus +uci +bash
|
||||
URL:=https://easepi.linkease.com/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Quickstart is a dashboard & user guide
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/quickstart
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
if [ -f /etc/uci-defaults/09-quickstart ]; then
|
||||
chmod 755 /etc/uci-defaults/09-quickstart
|
||||
/etc/uci-defaults/09-quickstart && rm -f /etc/uci-defaults/09-quickstart
|
||||
fi
|
||||
fi
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/hotplug.d/block $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/quickstart.$(PKG_ARCH_quickstart) $(1)/usr/sbin/quickstart
|
||||
$(INSTALL_BIN) ./files/quickstart.init $(1)/etc/init.d/quickstart
|
||||
$(INSTALL_BIN) ./files/quickstart.uci-default $(1)/etc/uci-defaults/09-quickstart
|
||||
$(INSTALL_BIN) ./files/quickstart.hotplug $(1)/etc/hotplug.d/block/09-quickstart
|
||||
$(INSTALL_CONF) ./files/quickstart.config $(1)/etc/config/quickstart
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
1
quickstart/files/quickstart.config
Normal file
@ -0,0 +1 @@
|
||||
config quickstart 'main'
|
3
quickstart/files/quickstart.hotplug
Normal file
@ -0,0 +1,3 @@
|
||||
if [ "$ACTION" = "add" -o "$ACTION" = "remove" ]; then
|
||||
quickstart blockChange
|
||||
fi
|
13
quickstart/files/quickstart.init
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=92
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/quickstart serve --unix /var/run/quickstart/local.sock
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
8
quickstart/files/quickstart.uci-default
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$PKG_UPGRADE" = 1 ]; then
|
||||
/etc/init.d/quickstart enable
|
||||
/etc/init.d/quickstart start
|
||||
fi
|
||||
|
||||
exit 0
|