s+1&&p s+1&&p{let o=Ct(a),n=Ct(e)&o,s=~o,c;return s>=105?(c=n|s-5,n=n|100):s>=3?(c=n|s-1,n=n|2):(n=n|1,c=n),[He(n),He(c)]},df=e=>ee.IPv4.subnetMaskFromPrefixLength(e).toString();var ht={isValidMask:nf,isValidIP:of,isValidMaskRange:rf,calcMaskRange:sf,prefixToMask:df};const mt=e=>(N("data-v-a0faa6f2"),e=e(),q(),e),uf=["onSubmit"],lf=mt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u5185\u7F51\u914D\u7F6E")],-1)),cf={class:"actioner-dns_body"},pf={class:"label-item"},ff=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IPv4\u5730\u5740")],-1)),mf={class:"label-item_value"},bf={class:"label-item"},vf=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IPv4\u5B50\u7F51\u63A9\u7801")],-1)),gf={class:"label-item_value"},_f={key:0,class:"chose_dhcp"},hf={key:0,class:"dhcp_info"},xf={key:1,class:"dhcp_info"},kf={class:"label-item"},wf=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IP\u6C60\u8D77\u59CB\u5730\u5740")],-1)),yf={class:"label-item_value"},Ff={class:"label-item"},Ef=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IP\u6C60\u7ED3\u675F\u5730\u5740")],-1)),Cf={class:"label-item_value"},$f={class:"actioner-dns_footer"},Df=["disabled"],Bf={key:1,class:"actioner-dns"},Yf=mt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u66F4\u6362\u914D\u7F6E")],-1)),Af={class:"actioner-dns_body"},Sf={key:0,class:"setting_status"},zf=mt(()=>t("div",{class:"success_icon"},[t("svg",{t:"1642063181211",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5062",width:"128",height:"128"},[t("path",{d:"M512 85.333333c235.648 0 426.666667 191.018667 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333z m-74.965333 550.4L346.453333 545.152a42.666667 42.666667 0 1 0-60.330666 60.330667l120.704 120.704a42.666667 42.666667 0 0 0 60.330666 0l301.653334-301.696a42.666667 42.666667 0 1 0-60.288-60.330667l-271.530667 271.488z",fill:"#52C41A","p-id":"5063"})])],-1)),Pf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u6210\u529F",-1)),Tf=["href"],If={key:1,class:"setting_status"},Lf=mt(()=>t("div",{class:"success_icon"},[t("svg",{t:"1642063200324",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5898",width:"128",height:"128"},[t("path",{d:"M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",fill:"#E84335","p-id":"5899"})])],-1)),Mf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u5931\u8D25",-1)),Of=mt(()=>t("p",null,"\u8BF7\u5C1D\u8BD5\u91CD\u65B0\u914D\u7F6E",-1)),Nf={key:2,class:"setting_status"},qf=mt(()=>t("div",{class:"success_icon"},[t("svg",{width:"128px",height:"128px",viewBox:"0 0 128 128",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[t("g",{id:"icon_yellow",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t("g",{id:"Icon/Warning"},[t("rect",{id:"\u77E9\u5F62",fill:"#000000","fill-rule":"nonzero",opacity:"0",x:"0",y:"0",width:"128",height:"128"}),t("path",{d:"M64,8 C33.075,8 8,33.075 8,64 C8,94.925 33.075,120 64,120 C94.925,120 120,94.925 120,64 C120,33.075 94.925,8 64,8 Z M60,37 C60,36.45 60.45,36 61,36 L67,36 C67.55,36 68,36.45 68,37 L68,71 C68,71.55 67.55,72 67,72 L61,72 C60.45,72 60,71.55 60,71 L60,37 Z M64,92 C60.6875,92 58,89.3125 58,86 C58,82.6875 60.6875,80 64,80 C67.3125,80 70,82.6875 70,86 C70,89.3125 67.3125,92 64,92 Z",id:"\u5F62\u72B6",fill:"#FAAD14"})])])])],-1)),Vf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u8D85\u65F6",-1)),jf=mt(()=>t("p",null,"\u8DEF\u7531\u5668 IP \u53EF\u80FD\u5DF2\u7ECF\u4FEE\u6539\u6210\u529F\u3002\u82E5\u5237\u65B0\u9875\u9762\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u8FDE\u63A5\u8DEF\u7531\u5668\uFF0C\u5426\u5219\u8BF7\u5C1D\u8BD5\u91CD\u65B0\u914D\u7F6E\u3002",-1)),Rf=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0),n=y({lanIp:"",netMask:"255.255.255.0",enableDhcp:!1,dhcpStart:"",dhcpEnd:""});y("");const s=y(!1);y(!0),y(!1);const c=y(""),p=y(2),f=y(!1),d=y("timeout");let l=!0;(()=>{S.Guide.GetLan.GET().then(g=>{g.data.result&&(f.value=g.data.result.enableDhcp||!1,g.data.result.enableDhcp=!1,n.value=g.data.result,g.data.result.lanIp!==location.hostname&&(l=!1))})})();const m=()=>{const g=n.value;if(!ht.isValidIP(g.lanIp)){F.Warning("IPv4\u5730\u5740\u683C\u5F0F\u9519\u8BEF");return}if(!ht.isValidMask(g.netMask)){F.Warning("IPv4\u5B50\u7F51\u63A9\u7801\u683C\u5F0F\u9519\u8BEF");return}const k=ht.calcMaskRange(g.lanIp,g.netMask);g.dhcpStart=k[0],g.dhcpEnd=k[1],n.value=g},b=()=>{const g=n.value;if(!ht.isValidIP(g.lanIp)){F.Warning("IPv4\u5730\u5740\u683C\u5F0F\u9519\u8BEF");return}if(!ht.isValidMask(g.netMask)){F.Warning("IPv4\u5B50\u7F51\u63A9\u7801\u683C\u5F0F\u9519\u8BEF");return}if(g.enableDhcp&&!ht.isValidIP(g.dhcpStart)||!ht.isValidIP(g.dhcpEnd)||!ht.isValidMaskRange(g.lanIp,g.netMask,g.dhcpStart,g.dhcpEnd)){F.Warning("DHCP\u7684IP\u6C60\u683C\u5F0F\u9519\u8BEF\u6216\u8D85\u51FA\u5B50\u7F51\u8303\u56F4");return}const k=F.Loading("\u6B63\u5728\u914D\u7F6E\u2026\u8BF7\u7A0D\u7B49",30);let x=0;const C=D=>{d.value=D,o.value=1,x=1,k.Close()},A=()=>{const D=new Date().getTime()+3e4,$=l?location.protocol+"//"+g.lanIp+(location.port?":"+location.port:""):location.origin,O=$+"/luci-static/resources/icons/loading.gif",H=()=>{x==0&&(new Date().getTime()>D?C("timeout"):window.setTimeout(Z,2e3))},j=()=>{x==0&&(c.value=$+location.pathname,C("success"),window.setTimeout(()=>{p.value=1},1e3),window.setTimeout(()=>{location.href=c.value},2e3))},Z=()=>{if(x!=0)return;console.log("check online ",O);const _t=new Image;_t.onload=j,_t.onerror=H,_t.src=O};window.setTimeout(Z,5e3)};S.Guide.LanIp.POST(g).then(D=>{var $;if(D!=null&&D.data){if((D.data.success||0)==0)return;if(($=D.data)!=null&&$.error)throw D.data.error}throw"\u672A\u77E5\u9519\u8BEF"}).catch(D=>{x==0&&(C("fail"),F.Error(D))}),A(),window.setTimeout(()=>{x==0&&C("timeout")},3e4)},_=g=>{g.preventDefault(),a.Close&&a.Close()},v=g=>{location.reload()};return(g,k)=>(i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0?(i(),r("form",{key:0,class:"actioner-dns",onSubmit:nt(b,["prevent"])},[lf,t("div",cf,[t("div",pf,[ff,t("div",mf,[z(t("input",{type:"text",placeholder:"192.168.100.1","onUpdate:modelValue":k[0]||(k[0]=x=>n.value.lanIp=x),onChange:m},null,544),[[W,n.value.lanIp,void 0,{trim:!0}]])])]),t("div",bf,[vf,t("div",gf,[z(t("input",{type:"text",placeholder:"255.255.255.0","onUpdate:modelValue":k[1]||(k[1]=x=>n.value.netMask=x),onChange:m},null,544),[[W,n.value.netMask,void 0,{trim:!0}]])])]),f.value?(i(),r("div",_f,[B(ea,{modelValue:n.value.enableDhcp,"onUpdate:modelValue":k[2]||(k[2]=x=>n.value.enableDhcp=x)},{default:V(()=>[n.value.enableDhcp?(i(),r("span",hf,"\u4FEE\u6539DHCP\u670D\u52A1")):(i(),r("span",xf,"\u4FDD\u6301DHCP\u670D\u52A1\u8BBE\u7F6E"))]),_:1},8,["modelValue"])])):E("",!0),n.value.enableDhcp?(i(),r(L,{key:1},[t("div",kf,[wf,t("div",yf,[z(t("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":k[3]||(k[3]=x=>n.value.dhcpStart=x)},null,512),[[W,n.value.dhcpStart,void 0,{trim:!0}]])])]),t("div",Ff,[Ef,t("div",Cf,[z(t("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":k[4]||(k[4]=x=>n.value.dhcpEnd=x)},null,512),[[W,n.value.dhcpEnd,void 0,{trim:!0}]])])])],64)):E("",!0)]),t("div",$f,[t("button",{class:"cbi-button cbi-button-apply app-btn",disabled:s.value},"\u786E\u8BA4",8,Df),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:_},"\u53D6\u6D88")])],40,uf)):o.value==1?(i(),r("div",Bf,[Yf,t("div",Af,[d.value=="success"?(i(),r("div",Sf,[zf,Pf,t("a",{href:c.value,class:"NewAdress"},h(p.value)+"s\u540E \u8DF3\u8F6C\u65B0\u5730\u5740",9,Tf)])):d.value=="fail"?(i(),r("div",If,[Lf,Mf,Of,t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:v},"\u6211\u77E5\u9053\u4E86")])):d.value=="timeout"?(i(),r("div",Nf,[qf,Vf,jf,t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:v},"\u5237\u65B0\u9875\u9762")])):E("",!0)])])):E("",!0)]),_:1},8,["Close"]))}});var Gf=Y(Rf,[["__scopeId","data-v-a0faa6f2"]]);const Uf=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Gf,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},bt=e=>(N("data-v-0384f3ac"),e=e(),q(),e),Wf={key:0,class:"actioner-dns"},Hf=bt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u6C99\u7BB1\u6A21\u5F0F\u914D\u7F6E\u5411\u5BFC")],-1)),Zf={class:"actioner-dns_body"},Jf=bt(()=>t("p",{class:"sandbox_info"},"\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)),Xf={key:0,class:"disk_loading_icon"},Kf=bt(()=>t("span",{class:"disk_loading_info"},"\u6B63\u5728\u52A0\u8F7D\u4E2D...",-1)),Qf={key:1,class:"disk_tips"},tm=bt(()=>t("span",null,"\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",-1)),em={class:"label-item"},am=bt(()=>t("div",{class:"label-item_key"},[t("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)),om={class:"label-item_value"},nm=bt(()=>t("option",{value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u78C1\u76D8",-1)),im=["value"],rm={class:"label-item"},sm=bt(()=>t("div",{class:"label-item_key"},[t("span",null,"\u76EE\u6807\u5206\u533A\uFF08\u5206\u533A\u5927\u5C0F\u987B\u5927\u4E8E2G\uFF0C\u5C06\u6B64\u5206\u533A\u4F5C\u4E3A\u5916\u90E8 overlay \u4F7F\u7528\uFF09")],-1)),dm={class:"label-item_value"},um=bt(()=>t("option",{selected:"true",value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u5206\u533A",-1)),lm=["value","disabled"],cm={class:"sandbox_tips"},pm=bt(()=>t("span",null,"\u6B64\u64CD\u4F5C\u4F1A\u5C06\u4F1A\u5220\u9664\u8BE5\u5206\u533A\u5168\u90E8\u6570\u636E",-1)),fm={class:"sandbox_info timeout"},mm=U("\u5373\u5C06\u91CD\u542F\u8BBE\u5907 "),bm=bt(()=>t("p",{class:"sandbox_roboot_tips"},[U("\u7B49\u5F85\u8BBE\u5907\u91CD\u542F\uFF0C\u91CD\u542F\u5B8C\u6210\u540E"),t("span",{class:"sandbox_roboot_refresh"},"\u8BF7\u5237\u65B0\u754C\u9762")],-1)),vm={key:0,class:"actioner-dns_footer"},gm=["disabled"],_m={key:1,class:"actioner-tips"},hm=bt(()=>t("div",{class:"actioner-tips_header"},[t("span",null,"\u6E29\u99A8\u63D0\u793A")],-1)),xm=bt(()=>t("div",{class:"actioner-tips_body"},[t("p",{class:"sandbox_info"},"\u6B64\u64CD\u4F5C\u4F1A\u5C06\u4F1A\u5220\u9664\u8BE5\u5206\u533A\u5168\u90E8\u6570\u636E\uFF0C\u5E76\u683C\u5F0F\u5316\u6210EXT4\uFF0C\u968F\u540E\u81EA\u52A8\u91CD\u542F\u8FDB\u5165\u6C99\u7BB1\u6A21\u5F0F\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F")],-1)),km={key:2,class:"actioner-tips"},wm=bt(()=>t("div",{class:"actioner-tips_header"},[t("span",null,"\u9519\u8BEF")],-1)),ym={class:"actioner-tips_body"},Fm={class:"sandbox_info"},Em=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0);y("disk");const n=y(""),s=y(3),c=y(""),p=y([]),f=y(""),d=y(null);(()=>{S.Nas.SandboxDisks.GET().then(x=>{var C;if(x!=null&&x.data&&(C=x.data)!=null&&C.result){d.value=x.data.result;return}throw"\u52A0\u8F7D\u78C1\u76D8\u4FE1\u606F\u5931\u8D25"}).catch(x=>{n.value=x,o.value=3})})();const u=()=>S.System.Reboot.POST({name:c.value,path:f.value}).then(x=>{var C;if(!(x!=null&&x.data&&(((C=x==null?void 0:x.data)==null?void 0:C.success)||0)==0))throw"\u672A\u77E5\u9519\u8BEF"}),m=x=>{var C,A;f.value="",p.value=c.value&&((A=(C=d.value)==null?void 0:C.disks.find(D=>D.path==c.value))==null?void 0:A.childrens)||[]},b=()=>{s.value>0&&(s.value-=1,window.setTimeout(b,1e3))},_=x=>{x.preventDefault(),a.Close&&a.Close()},v=()=>{new Promise((x,C)=>{const A="/luci-static/resources/icons/loading.gif",D=()=>{window.setTimeout($,2e3)},$=()=>{const O=new Image;O.onload=x,O.onerror=D,O.src=A};window.setTimeout($,1e4)}).then(()=>{window.setTimeout(()=>{location.reload()},2e3)})},g=x=>{const C=F.Loading("\u914D\u7F6E\u6C99\u7BB1\u91CD\u542F\u4E2D...");S.Nas.Sandbox.POST({path:f.value}).then(A=>{var D;if(A!=null&&A.data){if((A.data.success||0)==0)return o.value=2,window.setTimeout(b,1e3),u();if((D=A.data)!=null&&D.error)throw A.data.error}throw"\u672A\u77E5\u9519\u8BEF"}).then(v).catch(A=>F.Warning(A)).finally(()=>C.Close())},k=()=>{o.value=0};return(x,C)=>{const A=Q("icon-loading");return i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0||o.value==2?(i(),r("div",Wf,[Hf,t("div",Zf,[Jf,o.value==0?(i(),r(L,{key:0},[d.value?E("",!0):(i(),r("div",Xf,[B(A,{size:38,color:"currentColor"}),Kf])),d.value&&d.value.disks.length==0?(i(),r("div",Qf,[B(gt),tm])):E("",!0),d.value&&d.value.disks.length>0?(i(),r(L,{key:2},[t("div",em,[am,t("div",om,[z(t("select",{name:"",id:"",onChange:m,"onUpdate:modelValue":C[0]||(C[0]=D=>c.value=D)},[nm,(i(!0),r(L,null,R(d.value.disks,(D,$)=>(i(),r("option",{value:D.path,key:$},h(D.venderModel)+"\uFF08"+h(D.size)+"\uFF09 ",9,im))),128))],544),[[K,c.value]])])]),t("div",rm,[sm,t("div",dm,[z(t("select",{name:"",id:"","onUpdate:modelValue":C[1]||(C[1]=D=>f.value=D)},[um,(i(!0),r(L,null,R(p.value,(D,$)=>(i(),r("option",{value:D.path,key:$,disabled:D.sizeInt<(1<<30)*1||D.isSystemRoot},h(D.name)+"\uFF08"+h(D.filesystem||"\u672A\u683C\u5F0F\u5316")+"\uFF09"+h(D.total),9,lm))),128))],512),[[K,f.value]])])]),t("div",cm,[B(gt),pm])],64)):E("",!0)],64)):E("",!0),o.value==2?(i(),r(L,{key:1},[t("p",fm,[mm,t("span",null,"\uFF08"+h(s.value)+"s\uFF09",1)]),bm],64)):E("",!0)]),o.value==0?(i(),r("div",vm,[t("button",{class:"cbi-button cbi-button-apply app-btn",disabled:!f.value,onClick:C[2]||(C[2]=D=>o.value=1)},"\u5F00\u542F\u6C99\u7BB1",8,gm),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:_},"\u53D6\u6D88")])):E("",!0)])):E("",!0),o.value==1?(i(),r("div",_m,[hm,xm,t("div",{class:"actioner-tips_footer"},[t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:g},"\u7EE7\u7EED"),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:k},"\u53D6\u6D88")])])):E("",!0),o.value==3?(i(),r("div",km,[wm,t("div",ym,[t("p",Fm,h(n.value),1)]),t("div",{class:"actioner-tips_footer"},[t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:k},"\u53D6\u6D88")])])):E("",!0)]),_:1},8,["Close"])}}});var Cm=Y(Em,[["__scopeId","data-v-0384f3ac"]]);const $m=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Cm,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},ba=e=>(N("data-v-4db2efb4"),e=e(),q(),e),Dm={key:0,class:"actioner-dns"},Bm=ba(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u6C99\u7BB1\u6A21\u5F0F\u914D\u7F6E\u5411\u5BFC")],-1)),Ym=ba(()=>t("div",{class:"actioner-dns_body"},[t("p",{class:"sandbox_info"},"\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\u62A4 Docker \u548C\u786C\u76D8\u7684\u6570\u636E"),t("div",{class:"sandbox_environment"},[t("p",null,"\u5F53\u524D\u5904\u4E8E\u6C99\u7BB1\u73AF\u5883\uFF1A"),t("p",null,"1\u3001\u70B9\u51FB\u201C\u63D0\u4EA4\u201D\u53EF\u5C06\u53D8\u66F4\u5408\u5E76\u5230\u975E\u6C99\u7BB1\u73AF\u5883"),t("p",null,"2\u3001\u70B9\u51FB\u201C\u91CD\u7F6E\u201D\u53EF\u5C06\u6C99\u7BB1\u6062\u590D\u5230\u521D\u59CB\u72B6\u6001"),t("p",null,"3\u3001\u70B9\u51FB\u201C\u9000\u51FA\u201D\u53EF\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\uFF0C\u5E76\u653E\u5F03\u6C99\u7BB1\u4E2D\u7684\u6570\u636E")]),t("div",{class:"sandbox_environment_info"},[U("\u4EE5\u4E0A\u64CD\u4F5C\u90FD\u5C06\u91CD\u542F\u8BBE\u5907\uFF0C\u8BBE\u5907\u91CD\u542F\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u5237\u65B0\u9875\u9762\u3002\u5982\u679C IP \u53D8\u5316\u53EF\u80FD\u9700\u8981"),t("span",{class:"sandbox_environment_reboot"},"\u624B\u52A8\u5728\u5730\u5740\u680F\u8F93\u5165\u5730\u5740"),t("p",{class:"sandbox_environment_tex"},[U(" \u5982\u9700"),t("b",null,"\u4E34\u65F6"),U("\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\uFF0C\u8BF7\u5C06\u8BBE\u5907\u5173\u673A\u540E\u62D4\u51FA\u76F8\u5173\u78C1\u76D8\uFF0C\u542F\u52A8\u524D\u63D2\u5165\u76F8\u5173\u78C1\u76D8\u53EF\u518D\u6B21\u8FDB\u5165\u6C99\u7BB1\u3002"),t("br"),U(" \u6CE8\u610F\u4E34\u65F6\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\u4EE5\u540E\u5347\u7EA7\u56FA\u4EF6\u4F1A\u5BFC\u81F4\u4E4B\u524D\u7684\u6C99\u7BB1\u6570\u636E\u65E0\u6548 ")])])],-1)),Am={class:"actioner-dns_footer"},Sm=["disabled"],zm=["disabled"],Pm=["disabled"],Tm=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0),n=y(!1),s=()=>{new Promise((l,u)=>{const m="/luci-static/resources/icons/loading.gif",b=()=>{window.setTimeout(_,2e3)},_=()=>{const v=new Image;v.onload=l,v.onerror=b,v.src=m};window.setTimeout(_,1e4)}).then(()=>{window.setTimeout(()=>{location.reload()},2e3)})},c=()=>{n.value=!0;const l=F.Loading("\u63D0\u4EA4\u4E2D...");S.Nas.SandboxCommit.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D...");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},p=()=>{n.value=!0;const l=F.Loading("\u91CD\u7F6E\u4E2D...");S.Nas.SandboxReset.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D... \u82E5\u9875\u9762\u957F\u65F6\u95F4\u672A\u5237\u65B0\u53EF\u80FD\u9700\u8981\u624B\u52A8\u586B\u5199\u5730\u5740");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},f=()=>{if(!confirm("\u786E\u5B9A\u653E\u5F03\u6C99\u7BB1\u4E2D\u7684\u6570\u636E\uFF1F\u518D\u6B21\u8FDB\u5165\u6C99\u7BB1\u9700\u8981\u91CD\u65B0\u683C\u5F0F\u5316\u76F8\u5E94\u78C1\u76D8\u5206\u533A"))return;n.value=!0;const l=F.Loading("\u6267\u884C\u4E2D...");S.Nas.SandboxExit.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D... \u82E5\u9875\u9762\u957F\u65F6\u95F4\u672A\u5237\u65B0\u53EF\u80FD\u9700\u8981\u624B\u52A8\u586B\u5199\u5730\u5740");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},d=l=>{l.preventDefault(),a.Close&&a.Close()};return(l,u)=>(i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0?(i(),r("div",Dm,[Bm,Ym,t("div",Am,[t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:c,disabled:n.value},"\u63D0\u4EA4",8,Sm),t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:p,disabled:n.value},"\u91CD\u7F6E",8,zm),t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:f,disabled:n.value},"\u9000\u51FA",8,Pm),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:d},"\u53D6\u6D88")])])):E("",!0)]),_:1},8,["Close"]))}});var Im=Y(Tm,[["__scopeId","data-v-4db2efb4"]]);const Lm=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Im,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},Mm={class:"nav-container"},Om=["onClick"],Nm={key:0,class:"btn_styles color3 app-update-button",onclick:"window.location.href='/cgi-bin/luci/admin/system/ota'"},qm=U(" \u56FA\u4EF6\u66F4\u65B0 "),Vm={key:0,style:{display:"inline-block"}},jm={key:1},Rm=["disabled"],Gm=U(" DNS\u914D\u7F6E "),Um={key:0,style:{display:"inline-block"}},Wm=P({setup(e){const a=Ce(),o=le(),n=G(()=>o.status);y(!1),y(!0);const s=y(),c=()=>{oa()},p=()=>{$m()},f=()=>{Lm()},d=()=>{alert("\u8BE5\u56FA\u4EF6\u4E0D\u652F\u6301\u6C99\u7BB1\u6A21\u5F0F")},l=()=>{Uf()},u=()=>{ra()},m=()=>{window.open(`http://${window.location.hostname}:7681/`,"_blank")};return Kt("sandbox")&&S.Nas.GetSandbox.GET().then(_=>{var v,g,k;_!=null&&_.data&&((((v=_==null?void 0:_.data)==null?void 0:v.success)||0)==0?(g=_==null?void 0:_.data)!=null&&g.result&&(s.value=_.data.result):(k=_==null?void 0:_.data)!=null&&k.error&&alert(_.data.error))}).catch(_=>F.Warning(_)),(b,_)=>{var k,x,C,A,D,$;const v=Q("router-link"),g=Q("icon-loading");return i(),r("div",Mm,[B(v,{to:"/network",custom:""},{default:V(({navigate:O})=>[t("button",{class:"btn_styles color1",onClick:O},"\u7F51\u7EDC\u5411\u5BFC",8,Om)]),_:1}),t("button",{class:"btn_styles color2 app-btn-ttyd",onClick:m},"\u7EC8\u7AEF"),w(Kt)("ota")?(i(),r("button",Nm,[qm,w(a).checkUpdate==null?(i(),r("span",Vm,[B(g,{size:"0.8em",color:"currentColor"})])):(k=w(a).checkUpdate)!=null&&k.needUpdate?(i(),r("i",jm)):E("",!0)])):E("",!0),t("button",{class:"btn_styles color4",onClick:l},"\u5185\u7F51\u914D\u7F6E"),t("button",{class:"btn_styles color5",onClick:c,disabled:!((x=w(n))!=null&&x.proto)},[Gm,(C=w(n))!=null&&C.proto?E("",!0):(i(),r("span",Um,[B(g,{size:"0.8em",color:"currentColor"})]))],8,Rm),t("button",{class:"btn_styles color1",onClick:u},"\u8F6F\u4EF6\u6E90\u914D\u7F6E"),w(Kt)("sandbox")?(i(),r(L,{key:1},[((A=s.value)==null?void 0:A.status)=="unsupport"?(i(),r("button",{key:0,class:"btn_styles color2",onClick:d},"\u5F00\u542F\u6C99\u7BB1")):((D=s.value)==null?void 0:D.status)=="stopped"?(i(),r("button",{key:1,class:"btn_styles color3",onClick:p},"\u5F00\u542F\u6C99\u7BB1")):(($=s.value)==null?void 0:$.status)=="running"?(i(),r("button",{key:2,class:"btn_styles color4",onClick:f},"\u6C99\u7BB1\u5DF2\u5F00\u542F")):E("",!0)],64)):E("",!0)])}}});var Hm=Y(Wm,[["__scopeId","data-v-82a27618"]]);const _e=e=>(N("data-v-0a2eed64"),e=e(),q(),e),Zm={id:"page"},Jm=_e(()=>t("em",null,null,-1)),Xm=_e(()=>t("em",null,null,-1)),Km=_e(()=>t("em",null,null,-1)),Qm=_e(()=>t("em",null,null,-1)),t9=P({setup(e){return Qa(),(a,o)=>(i(),r("div",Zm,[Jm,B(Zd),Xm,B(Hm),B(C7),Km,B(af),Qm]))}});var e9=Y(t9,[["__scopeId","data-v-0a2eed64"]]);const a9={};function o9(e,a){const o=Q("router-view");return i(),M(o)}var n9=Y(a9,[["render",o9]]);const i9={},r9={width:"136px",height:"136px",viewBox:"0 0 136 136",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},s9=Mt('
${g.seriesName}: ${l(g.value)}/s`}}},xAxis:{type:"category",boundaryGap:!1,splitLine:{lineStyle:{color:["#999"]},show:!1},name:"",show:!1,nameGap:0,nameTextStyle:{height:0,lineHeight:0,padding:0}},title:{text:"\u6D41\u91CF\u7EDF\u8BA1",textStyle:{fontSize:12,color:"rgba(0, 0, 0, 0.6)"},top:"10px",left:"10px"},yAxis:{type:"value",name:"",minInterval:1e4,interval:1e3,axisLabel:{formatter:function(v,g){return`${l(v)}/s`},color:"#fff",show:!1},nameTextStyle:{color:"#fff"},splitLine:{lineStyle:{color:["#999"]},show:!1}},series:[{name:"\u4E0B\u8F7D",data:s.value,type:"line",smooth:!0,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(32, 199, 247, 1)"},{offset:1,color:"rgba(32, 199, 247, 0.1)"}],global:!1}}},{name:"\u4E0A\u4F20",data:n.value,type:"line",smooth:!0,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(85, 58, 254, 1)"},{offset:1,color:"rgba(85, 58, 254, 0.1)"}],global:!1}}}],legend:{padding:0,align:"right",top:"10px",selected:{\u4E0A\u4F20:!0,\u4E0B\u8F7D:!0},textStyle:{color:"rgba(0, 0, 0, 0.6)"},itemStyle:{color:"#5e72e4"},lineStyle:{color:"#333"}},grid:{left:"2%",right:"2%",bottom:"0%",top:"10%",containLabel:!0}}),m);return Ft(()=>{setTimeout(()=>T(this,null,function*(){if(u.value){yield f();const _=b(u.value),v=u.value;_.resize({width:v.clientWidth,height:v.clientHeight}),window.addEventListener("resize",()=>{_.resize({width:v.clientWidth,height:v.clientHeight})});const g=()=>T(this,null,function*(){m!=null&&(yield f(),m!=null&&(_.setOption({series:[{name:"\u4E0B\u8F7D",data:s.value,type:"line",areaStyle:{},smooth:!0},{name:"\u4E0A\u4F20",data:n.value,type:"line",areaStyle:{},smooth:!0}]}),setTimeout(g,5e3)))});setTimeout(g,5e3)}}),900)}),Vt(()=>{m!=null&&(m.dispose(),m=null)}),(_,v)=>(i(),r("div",Yi,[t("div",{ref_key:"el",ref:u,class:"echart"},null,512),t("div",Ai,[w(c)?(i(),r("span",Si,"\u4E0A\u4F20: "+h(w(c)),1)):E("",!0),w(p)?(i(),r("span",zi,"\u4E0B\u8F7D: "+h(w(p)),1)):E("",!0)])]))}});var Ti=Y(Pi,[["__scopeId","data-v-652b014f"]]);const Ii={},Li={t:"1649668202191",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2338","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"28px",height:"28px"},Mi=t("path",{d:"M288 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z","p-id":"2339",fill:"#666"},null,-1),Oi=t("path",{d:"M512 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z","p-id":"2340",fill:"#666"},null,-1),Ni=t("path",{d:"M736 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z","p-id":"2341",fill:"#666"},null,-1),qi=[Mi,Oi,Ni];function Vi(e,a){return i(),r("svg",Li,qi)}var $t=Y(Ii,[["render",Vi]]);let se=0;const ji={props:{type:String,message:String|Function,Close:Function,countdown:Number},data(){return{show:!1,remain:0}},mounted(){if(window.setTimeout(()=>{this.show=!0},0),this.countdown){this.remain=this.countdown;const e=()=>{this.show&&this.remain>0&&(this.remain=this.remain-1,se=window.setTimeout(e,1e3))};se=window.setTimeout(e,1e3)}},computed:{Message(){return this.message+(this.countdown?" "+this.remain+"s":"")}},methods:{Stop(){this.type!="loading"&&(this.show=!1,se!=0&&clearTimeout(se),this.Close())}}},ce=e=>(N("data-v-6935a479"),e=e(),q(),e),Ri={key:0,class:"loading icon"},Gi=ce(()=>t("svg",{t:"1631799919469",class:"icon",viewBox:"0 0 1047 1047",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3453",width:"128",height:"128"},[t("path",{d:"M522.695111 1.991111c-26.339556 0.170667-47.416889 21.475556-47.672889 48.753778-0.284444 26.453333-0.056889 52.963556-0.056889 79.445333 0 27.249778-0.369778 54.528 0.113778 81.777778 0.483556 27.050667 22.016 47.132444 49.351111 46.904889a47.786667 47.786667 0 0 0 47.729778-47.445333c0.284444-53.76 0.284444-107.52-0.028444-161.251556-0.170667-27.676444-21.902222-48.355556-49.436445-48.184889m-195.896889 88.092445c-8.334222-14.222222-21.646222-21.276444-38.314666-21.333334-35.128889 0-56.576 36.949333-38.968889 68.152889a11616.995556 11616.995556 0 0 0 78.961777 137.614222 44.942222 44.942222 0 0 0 61.838223 16.896c21.304889-12.202667 29.667556-38.968889 17.379555-60.871111-26.453333-47.104-53.560889-93.866667-80.896-140.458666m-228.693333 234.524444c44.316444 25.799111 88.746667 51.342222 133.176889 76.970667 6.712889 3.896889 13.681778 6.912 21.703111 6.428444 20.138667 0.142222 35.953778-11.946667 41.301333-31.573333 5.006222-18.261333-2.673778-36.721778-20.224-46.990222-44.629333-26.026667-89.372444-51.882667-134.115555-77.710223-22.528-12.999111-47.815111-7.025778-59.818667 13.909334-12.231111 21.248-4.977778 45.624889 17.948444 58.965333m34.161778 235.975111c26.396444 0 52.821333 0.199111 79.217778-0.085333 23.409778-0.256 39.139556-16.412444 38.798222-39.139556-0.341333-21.617778-16.924444-37.347556-39.594666-37.376-51.655111-0.056889-103.310222-0.056889-154.965334 0.028445-24.177778 0.056889-40.704 15.985778-40.561778 38.684444 0.142222 22.186667 16.583111 37.745778 40.192 37.859556 25.656889 0.142222 51.285333 0.028444 76.913778 0m151.722667 100.238222a34.247111 34.247111 0 0 0-46.876445-12.942222 13764.778667 13764.778667 0 0 0-139.008 80.583111c-11.093333 6.485333-16.327111 16.867556-16.497777 25.372444 0.085333 30.549333 27.249778 47.957333 50.403555 35.072 47.160889-26.197333 93.724444-53.475556 140.145778-80.924444 17.180444-10.154667 21.504-30.378667 11.832889-47.160889m91.875555 101.660444c-14.250667-4.067556-27.619556 1.422222-35.84 15.644445a24375.466667 24375.466667 0 0 0-77.312 134.485333c-10.012444 17.550222-5.859556 35.669333 9.784889 45.027556 16.014222 9.557333 34.247111 4.039111 44.714667-13.994667 25.543111-44.088889 50.915556-88.263111 76.373333-132.352 3.299556-5.745778 5.688889-11.690667 5.745778-14.933333 0-17.834667-9.272889-29.866667-23.466667-33.877334m147.456 44.288c-16.384 0.085333-27.306667 11.918222-27.448888 30.151111-0.142222 25.372444-0.028444 50.716444-0.028445 76.060445h-0.085333c0 26.112-0.113778 52.252444 0.056889 78.364444 0.113778 18.261333 11.064889 30.065778 27.448889 30.208 16.952889 0.142222 28.046222-11.832889 28.103111-30.748444 0.113778-51.086222 0.142222-102.172444 0.056889-153.258667 0-18.773333-11.207111-30.862222-28.103112-30.776889m177.208889-26.112c-7.509333-12.8-21.902222-16.014222-33.792-8.874666a23.722667 23.722667 0 0 0-8.533333 32.995555c26.282667 46.279111 52.906667 92.330667 79.644444 138.353778 4.494222 7.765333 11.633778 11.946667 20.906667 11.804444 18.545778-0.142222 30.520889-19.342222 21.219556-35.868444-26.026667-46.392889-52.650667-92.444444-79.473778-138.410667m239.957333-41.187555c-45.283556-26.254222-90.595556-52.48-135.964444-78.648889-4.693333-2.702222-9.728-4.323556-15.36-2.958222-9.102222 2.247111-14.933333 8.049778-16.497778 17.095111-1.877333 10.894222 3.84 18.204444 12.885333 23.438222 29.809778 17.180444 59.562667 34.417778 89.344 51.598222 15.217778 8.789333 30.236444 17.976889 45.738667 26.225778 14.677333 7.793778 31.061333-2.048 31.061333-18.033778-0.056889-8.448-4.096-14.592-11.207111-18.716444m48.867556-234.638222c-24.888889-0.085333-49.749333 0-74.609778 0v-0.085334c-25.258667 0-50.517333-0.056889-75.776 0.028445-13.425778 0.056889-20.963556 6.343111-21.162667 17.294222-0.199111 11.150222 7.082667 17.521778 20.679111 17.550222 50.488889 0.113778 100.977778 0.142222 151.495112 0.085333 13.368889 0 21.191111-6.485333 21.390222-17.152 0.227556-10.808889-8.106667-17.664-22.016-17.720888m-187.960889-127.146667c45.084444-26.026667 90.140444-52.110222 135.168-78.222222 4.864-2.844444 8.248889-6.855111 8.135111-12.942223-0.142222-11.036444-11.207111-17.436444-21.504-11.548444-45.511111 26.055111-90.851556 52.394667-136.135111 78.819556-7.68 4.494222-10.524444 11.52-5.575111 19.569777 4.835556 7.850667 12.088889 8.817778 19.911111 4.323556m-122.311111-115.114667c5.205333-0.256 8.220444-3.413333 10.609778-7.651555 4.920889-8.647111 10.040889-17.208889 14.990222-25.827556 20.48-35.555556 40.931556-71.025778 61.297778-106.609778 5.091556-8.874667 3.015111-16.668444-4.778667-18.517333-7.68-1.848889-10.894222 3.697778-14.051556 9.159111l-68.778666 119.495111c-2.844444 4.977778-6.030222 9.870222-8.305778 15.104-3.128889 7.196444 1.678222 14.648889 9.045333 14.848","p-id":"3454"})],-1)),Ui=[Gi],Wi={key:1,class:"success icon"},Hi=ce(()=>t("svg",{t:"1632451272305",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2204",width:"128",height:"128"},[t("path",{d:"M1001.305115 275.874141 431.461709 845.718571c-28.221762 28.221762-73.977875 28.221762-102.20066 0L22.661116 539.116591c-28.222785-28.221762-28.222785-73.979922 0-102.20066 28.221762-28.221762 73.977875-28.221762 102.20066 0l255.500115 255.502162 518.743588-518.743588c28.221762-28.221762 73.977875-28.221762 102.199637 0C1029.5279 201.89422 1029.5279 247.65238 1001.305115 275.874141z","p-id":"2205"})],-1)),Zi=[Hi],Ji={key:2,class:"error icon"},Xi=ce(()=>t("svg",{t:"1632451325789",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2204",width:"128",height:"128"},[t("path",{d:"M823.04 840.32 524.16 540.16l296.32-294.4c12.8-12.8 12.8-33.28 0-45.44-12.8-12.8-33.28-12.8-46.08 0L478.08 494.08 184.96 200.32c-12.8-12.8-33.28-12.8-45.44 0s-12.8 33.28 0 45.44l292.48 293.76-302.72 300.8c-12.8 12.8-12.8 33.28 0 45.44 12.8 12.8 33.28 12.8 46.08 0l302.72-300.16 299.52 300.16c12.8 12.8 33.28 12.8 45.44 0C835.2 873.6 835.2 853.12 823.04 840.32z","p-id":"2205"})],-1)),Ki=[Xi],Qi={key:3,class:"warning icon"},tr=ce(()=>t("svg",{t:"1632451401172",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1638",width:"128",height:"128"},[t("path",{d:"M512 1021.45211835a60.32985613 60.32985613 0 1 1 60.32985613-60.32985611 60.32985613 60.32985613 0 0 1-60.32985613 60.32985611z m86.85823451-924.97400238L572.32985613 719.80283775a60.32985613 60.32985613 0 0 1-120.65971226 0l-26.52837838-623.32472178c-0.16758294-2.22885301-0.28489098-4.49122263-0.284891-6.78710881a87.14312551 87.14312551 0 0 1 174.28625102 0c0 2.2958862-0.11730806 4.5582558-0.284891 6.78710881z","p-id":"1639"})],-1)),er=[tr];function ar(e,a,o,n,s,c){return i(),M(xt,{name:"el-fade-in-linear"},{default:V(()=>[s.show?(i(),r("div",{key:0,class:"toast",onClick:a[1]||(a[1]=p=>c.Stop())},[o.type=="loading"?(i(),r("div",Ri,Ui)):o.type=="success"?(i(),r("div",Wi,Zi)):o.type=="error"?(i(),r("div",Ji,Ki)):o.type=="warning"?(i(),r("div",Qi,er)):E("",!0),t("div",{class:"message",onClick:a[0]||(a[0]=nt(()=>{},["stop"]))},h(c.Message),1)])):E("",!0)]),_:1})}var or=Y(ji,[["render",ar],["__scopeId","data-v-6935a479"]]);const Xt=new Map,jt=e=>{const a=tt(or,at(J({},e),{Close:()=>{n()}})),o=document.createElement("div");document.body.append(o),a.mount(o);const n=()=>{o.remove(),Xt.get(a._uid)&&Xt.delete(a._uid)};return e.type=="loading"&&Xt.set(a._uid,{Close:n}),(e==null?void 0:e.duration)==0||((e==null?void 0:e.duration)>0?setTimeout(()=>{n()},e==null?void 0:e.duration):setTimeout(()=>{n()},3e3)),{Close:n}},F=e=>jt(e);F.Loading=(e,a)=>jt({type:"loading",message:e||"\u52A0\u8F7D\u4E2D...",duration:0,countdown:a||0});F.Success=e=>jt({type:"success",message:e});F.Error=e=>jt({type:"error",message:e,duration:0});F.Warning=e=>jt({type:"warning",message:e});F.Message=e=>jt({message:e});F.Clear=()=>{Xt.forEach((e,a)=>{e.Close(),Xt.delete(a)})};const ct={installApp:(e,a)=>new Promise((o,n)=>{let s=0;S.App.Install.POST({name:e}).then(()=>{const c=setTimeout(()=>{s==0&&(s=1,o(!1))},(a||60)*1e3),p=()=>{s==0&&S.App.Check.POST({name:e}).then(f=>{if(s==0&&f!=null&&f.data){const{result:d}=f.data;if((d==null?void 0:d.status)=="installed"){clearTimeout(c),s=1,o(!0);return}}}).catch(f=>{}).finally(()=>{s==0&&setTimeout(p,3e3)})};setTimeout(p,3e3)}).catch(c=>{s==0&&(s=1,n("\u5B89\u88C5\u5931\u8D25\uFF0C"+c))})}),checkAndInstallApp:(e,a,o)=>T(Qt,null,function*(){let n=F.Loading("\u68C0\u67E5\u4E2D...");try{const s=yield S.App.Check.POST({name:e});if(n.Close(),s!=null&&s.data){const{result:c,error:p}=s.data;if(p)F.Warning(p);else if(c){if(c.status=="installed")return!0;if(confirm(`\u68C0\u6D4B\u5230\u4F60\u5C1A\u672A\u5B89\u88C5 ${a} \u63D2\u4EF6,\u662F\u5426\u5B89\u88C5\uFF1F`)){n=F.Loading("\u6B63\u5728\u5B89\u88C5\u4E2D...");const f=yield ct.installApp(o||e);if(n.Close(),f)return!0;F.Error("\u5B89\u88C5\u5931\u8D25\u6216\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u8F6F\u4EF6\u6E90\u6216\u7A0D\u5019\u91CD\u8BD5")}}else F.Warning("\u68C0\u67E5\u63D2\u4EF6\u72B6\u6001\u5931\u8D25")}return!1}catch(s){return n.Close(),F.Warning(s),!1}}),installAndGo:(e,a,o,n)=>T(Qt,null,function*(){(yield ct.checkAndInstallApp(e,a,n))&&(location.href=o)})},nr={},ir={t:"1640746738262",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1216",width:"128",height:"128"},rr=t("path",{d:"M511.232 438.8352L112.9984 40.6016A51.2 51.2 0 0 0 40.6016 112.9984L438.784 511.232 40.6016 909.4656a51.2 51.2 0 1 0 72.3968 72.448l398.2336-398.2848 398.2336 398.2848a51.2 51.2 0 1 0 72.448-72.448l-398.2848-398.2336 398.2848-398.2336A51.2 51.2 0 0 0 909.4656 40.6016L511.232 438.784z","p-id":"1217"},null,-1),sr=[rr];function dr(e,a){return i(),r("svg",ir,sr)}var ur=Y(nr,[["render",dr]]);const lr=e=>(N("data-v-428d873e"),e=e(),q(),e),cr={id:"actioner"},pr={key:0,class:"action-container"},fr={class:"action-container_header"},mr=lr(()=>t("div",null,null,-1)),br={class:"title"},vr={class:"action-container_body"},gr=P({props:{Close:{type:Function},type:{type:Number},title:String},setup(e){const a=e,o=y(!1);Ft(()=>{o.value=!0,document.body.setAttribute("lock-scroll","true")}),Vt(()=>{document.body.removeAttribute("lock-scroll")});const n=()=>{a.Close&&(o.value=!1,setTimeout(()=>{a.Close&&a.Close()},300))};return(s,c)=>(i(),r("div",cr,[t("div",{class:"bg",onClick:n}),e.type!=null?Dt(s.$slots,"default",{key:0},void 0,!0):(i(),r(L,{key:1},[o.value?(i(),r("div",pr,[t("div",fr,[mr,t("div",br,h(e.title),1),t("button",{class:"close",title:"\u5173\u95ED",onClick:n},[B(ur)])]),t("div",vr,[Dt(s.$slots,"default",{},void 0,!0)])])):E("",!0)],64))]))}});var _r=Y(gr,[["__scopeId","data-v-428d873e"]]);const et=P({props:{Close:{type:Function},type:{type:Number},title:String},setup(e){return(a,o)=>(i(),M(_r,{Close:e.Close,type:e.type,title:e.title},{default:V(()=>[Dt(a.$slots,"default")]),_:3},8,["Close","type","title"]))}}),Bt=e=>(N("data-v-c4cdcce6"),e=e(),q(),e),hr=["onSubmit"],xr=Bt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"DNS\u914D\u7F6E")],-1)),kr={class:"actioner-dns_body"},wr={class:"label-item"},yr=Bt(()=>t("div",{class:"label-item_key"},[t("span",null,"DNS\u9009\u9879")],-1)),Fr={class:"label-item_value"},Er=["disabled"],Cr=Bt(()=>t("option",{value:"manual"},"\u81EA\u5B9A\u4E49DNS",-1)),$r={class:"label-item"},Dr=Bt(()=>t("div",{class:"label-item_key"},"DNS\u670D\u52A1\u5668\u5730\u5740",-1)),Br={class:"label-item_value"},Yr=["onUpdate:modelValue"],Ar={class:"label-item"},Sr=Bt(()=>t("div",{class:"label-item_key"},[t("span",null,"DNS\u670D\u52A1\u5668\u5730\u5740")],-1)),zr={class:"label-item_value"},Pr={class:"label-item"},Tr=Bt(()=>t("div",{class:"label-item_key"},"\u5907\u7528DNS\u670D\u52A1\u5668\u5730\u5740",-1)),Ir={class:"label-item_value"},Lr={key:1,class:"label-message"},Mr={class:"actioner-dns_footer"},Or=["disabled"],Nr={key:1,class:"actioner-dns"},qr=Bt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"DNS\u914D\u7F6E")],-1)),Vr=Bt(()=>t("div",{class:"actioner-dns_body"},[t("div",{class:"config-message"},"DNS\u914D\u7F6E\u5DF2\u4FDD\u5B58")],-1)),jr=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0),n=le(),s=n.status,c=G(()=>n.status.proto!="static"),p=y({interfaceName:s.defaultInterface||"",dnsProto:s.dnsProto||"manual",manualDnsIp:s.dnsList||[]}),f=y(""),d=y(""),l=y(""),u=y(!1),m=()=>T(this,null,function*(){l.value="";let v={};switch(p.value.dnsProto){case"auto":break;case"manual":v.manualDnsIp=[],p.value.manualDnsIp!=null&&p.value.manualDnsIp.length>0?v.manualDnsIp=p.value.manualDnsIp:(v.manualDnsIp.push(f.value),d.value&&v.manualDnsIp.push(d.value));break}v.dnsProto=p.value.dnsProto,v.interfaceName=p.value.interfaceName;const g=F.Loading("\u914D\u7F6E\u4E2D...");try{const k=yield S.Guide.DnsConfig.POST(v);if(k!=null&&k.data){const{success:x,error:C}=k==null?void 0:k.data;C&&(l.value=C),(x==null||x==0)&&(F.Success("\u914D\u7F6E\u6210\u529F"),o.value=1)}}catch(k){l.value=k}g.Close()}),b=v=>{v.preventDefault(),a.Close&&a.Close()},_=v=>{location.reload()};return(v,g)=>(i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0?(i(),r("form",{key:0,class:"actioner-dns",onSubmit:nt(m,["prevent"])},[xr,t("div",kr,[t("div",wr,[yr,t("div",Fr,[z(t("select",{"onUpdate:modelValue":g[0]||(g[0]=k=>p.value.dnsProto=k)},[t("option",{value:"auto",disabled:!w(c)},"\u81EA\u52A8\u83B7\u53D6DNS",8,Er),Cr],512),[[K,p.value.dnsProto]])])]),p.value.dnsProto=="manual"?(i(),r(L,{key:0},[p.value.manualDnsIp!=null&&p.value.manualDnsIp.length>0?(i(!0),r(L,{key:0},R(p.value.manualDnsIp,(k,x)=>(i(),r("div",$r,[Dr,t("div",Br,[z(t("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165DNS\u5730\u5740","onUpdate:modelValue":C=>p.value.manualDnsIp[x]=C},null,8,Yr),[[W,p.value.manualDnsIp[x],void 0,{trim:!0}]])])]))),256)):(i(),r(L,{key:1},[t("div",Ar,[Sr,t("div",zr,[z(t("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165DNS\u5730\u5740",required:"","onUpdate:modelValue":g[1]||(g[1]=k=>f.value=k)},null,512),[[W,f.value,void 0,{trim:!0}]])])]),t("div",Pr,[Tr,t("div",Ir,[z(t("input",{type:"text",placeholder:"\u5907\u7528DNS\u5730\u5740","onUpdate:modelValue":g[2]||(g[2]=k=>d.value=k)},null,512),[[W,d.value,void 0,{trim:!0}]])])])],64))],64)):E("",!0),l.value?(i(),r("div",Lr,h(l.value),1)):E("",!0)]),t("div",Mr,[t("button",{class:"cbi-button cbi-button-apply app-btn",disabled:u.value},"\u786E\u8BA4",8,Or),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:b},"\u53D6\u6D88")])],40,hr)):o.value==1?(i(),r("div",Nr,[qr,Vr,t("div",{class:"actioner-dns_footer"},[t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:_},"\u5B8C\u6210")])])):E("",!0)]),_:1},8,["Close"]))}});var Rr=Y(jr,[["__scopeId","data-v-c4cdcce6"]]);const oa=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Rr,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},pe=e=>(N("data-v-0ae97e7e"),e=e(),q(),e),Gr={class:"action"},Ur={class:"action-body"},Wr=pe(()=>t("div",{class:"icon"},[t("svg",{t:"1642063181211",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5062",width:"128",height:"128","data-v-cda444e0":""},[t("path",{d:"M512 85.333333c235.648 0 426.666667 191.018667 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333z m-74.965333 550.4L346.453333 545.152a42.666667 42.666667 0 1 0-60.330666 60.330667l120.704 120.704a42.666667 42.666667 0 0 0 60.330666 0l301.653334-301.696a42.666667 42.666667 0 1 0-60.288-60.330667l-271.530667 271.488z",fill:"#52C41A","p-id":"5063","data-v-cda444e0":""})])],-1)),Hr=pe(()=>t("h2",{class:"title"},"\u670D\u52A1\u5DF2\u542F\u52A8",-1)),Zr={class:"info"},Jr=pe(()=>t("span",null,"\u524D\u5F80",-1)),Xr=["href"],Kr=pe(()=>t("span",null,"\u8FDB\u884C\u6D4B\u901F",-1)),Qr=P({props:{port:Number,Close:Function},setup(e){const a=e,o=G(()=>`http://${location.hostname}:${a.port}`),n=()=>{a.Close&&(a.Close(),location.reload())};return(s,c)=>(i(),M(et,{type:1},{default:V(()=>[B(xt,{name:"rotate",mode:"out-in"},{default:V(()=>[t("div",Gr,[t("div",Ur,[Wr,Hr,t("div",Zr,[Jr,t("a",{href:w(o),target:"_blank",rel:"noopener noreferrer"},h(w(o)),9,Xr),Kr]),t("div",{class:"btns"},[t("button",{class:"cbi-button cbi-button-remove app-btn app-back",type:"button",onClick:n},"\u5173\u95ED")])])])]),_:1})]),_:1}))}});var ts=Y(Qr,[["__scopeId","data-v-0ae97e7e"]]),es=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=tt(ts,at(J({},e),{Close:()=>{n()}}));o.mount(a);const n=()=>{o.unmount(),a.remove()};return{Close:n}};const $e=e=>(N("data-v-39248365"),e=e(),q(),e),as=$e(()=>t("div",{class:"app-container_status-label_iconer"},[t("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"},[t("defs",null,[t("filter",{id:"A","color-interpolation-filters":"sRGB"},[t("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 "}),t("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),t("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 "})]),t("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),t("g",{transform:"translate(0 -286.95)"},[t("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"}),t("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"}),t("g",{transform:"matrix(.1048 0 0 .1048 -6.0999 280.7)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[t("use",{"xlink:href":"#B"}),t("use",{"xlink:href":"#B",x:"73.04"}),t("use",{"xlink:href":"#B",x:"52.17"}),t("use",{"xlink:href":"#B",x:"41.74"}),t("use",{"xlink:href":"#B",x:"31.3"}),t("use",{"xlink:href":"#B",x:"20.87"}),t("use",{"xlink:href":"#B",x:"10.43"}),t("use",{"xlink:href":"#B",x:"62.61"})]),t("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)),os={class:"app-container_status-label_text"},ns=$e(()=>t("div",{class:"text_status"},"\u5DF2\u65AD\u5F00",-1)),is={class:"text_info"},rs=$e(()=>t("div",{class:"app-container_status-label_iconer"},[t("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"},[t("defs",null,[t("filter",{id:"A","color-interpolation-filters":"sRGB"},[t("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 "}),t("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),t("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 "})]),t("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),t("g",{transform:"translate(-.03 -287.07)"},[t("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"}),t("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"}),t("g",{transform:"matrix(.1048 0 0 .1048 -6.0697 280.81)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[t("use",{"xlink:href":"#B"}),t("use",{"xlink:href":"#B",x:"73.04"}),t("use",{"xlink:href":"#B",x:"52.17"}),t("use",{"xlink:href":"#B",x:"41.74"}),t("use",{"xlink:href":"#B",x:"31.3"}),t("use",{"xlink:href":"#B",x:"20.87"}),t("use",{"xlink:href":"#B",x:"10.43"}),t("use",{"xlink:href":"#B",x:"62.61"})]),t("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)),ss={class:"app-container_status-label_text"},ds={class:"text_info"},us=P({props:{item:{type:Object,required:!0},transform:{type:Number,default:0}},setup(e){const a=e,o=Ke(),n=y(null),s=p=>{const f=p.target,{left:d,top:l}=f.getBoundingClientRect();o.portitemStyle.show=!0,o.portitemStyle.left=d,o.portitemStyle.top=l,o.portitemStyle.portitem=a.item},c=p=>{o.portitemStyle.show=!1};return(p,f)=>(i(),r("div",{class:"app-container_status-label_bg",style:It(`transform: translateX(${e.transform}px);`),ref_key:"el",ref:n,onMouseenter:s,onMouseleave:c},[e.item.linkState=="DOWN"?(i(),r(L,{key:0},[as,t("div",os,[ns,t("div",is,h(e.item.name)+" "+h(e.item.interfaceNames?`(${e.item.interfaceNames.join(",").toLocaleUpperCase()})`:""),1)])],64)):(i(),r(L,{key:1},[rs,t("div",ss,[t("div",null,h(e.item.linkSpeed),1),t("div",ds,h(e.item.name)+" "+h(e.item.interfaceNames?`(${e.item.interfaceNames.join(",").toLocaleUpperCase()})`:""),1)])],64))],36))}});var na=Y(us,[["__scopeId","data-v-39248365"]]);const ia=e=>(N("data-v-3470ca08"),e=e(),q(),e),ls=ia(()=>t("span",null,h("<"),-1)),cs=[ls],ps=ia(()=>t("span",null,h(">"),-1)),fs=[ps],ms=P({props:{portList:{type:Array,required:!0}},setup(e){const a=y(),o=y(0),n=y(0),s=y(0),c=y(!1),p=()=>{if(s.value>=0){s.value=0;return}s.value+=100},f=()=>{if(s.value<=0-o.value+n.value){s.value=0-o.value+n.value;return}s.value-=100};return Ft(()=>{Ta(()=>{a.value&&(o.value=a.value.scrollWidth,n.value=a.value.clientWidth,c.value=o.value>n.value)})}),(d,l)=>(i(),r("div",{class:"app-interfaces",ref_key:"el",ref:a},[c.value?(i(),r(L,{key:0},[t("a",{class:"btn-f",onClick:p},cs),t("a",{class:"btn-r",onClick:f},fs)],64)):E("",!0),(i(!0),r(L,null,R(e.portList,(u,m)=>(i(),M(na,{item:u,transform:s.value},null,8,["item","transform"]))),256))],512))}});var bs=Y(ms,[["__scopeId","data-v-3470ca08"]]);const vs={},gs={width:"82px",height:"82px",viewBox:"0 0 82 82",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},_s=Mt('{let o=Ct(a),n=Ct(e)&o,s=~o,c;return s>=105?(c=n|s-5,n=n|100):s>=3?(c=n|s-1,n=n|2):(n=n|1,c=n),[He(n),He(c)]},sf=e=>ee.IPv4.subnetMaskFromPrefixLength(e).toString();var ht={isValidMask:of,isValidIP:af,isValidMaskRange:nf,calcMaskRange:rf,prefixToMask:sf};const mt=e=>(N("data-v-a0faa6f2"),e=e(),q(),e),df=["onSubmit"],uf=mt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u5185\u7F51\u914D\u7F6E")],-1)),lf={class:"actioner-dns_body"},cf={class:"label-item"},pf=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IPv4\u5730\u5740")],-1)),ff={class:"label-item_value"},mf={class:"label-item"},bf=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IPv4\u5B50\u7F51\u63A9\u7801")],-1)),vf={class:"label-item_value"},gf={key:0,class:"chose_dhcp"},_f={key:0,class:"dhcp_info"},hf={key:1,class:"dhcp_info"},xf={class:"label-item"},kf=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IP\u6C60\u8D77\u59CB\u5730\u5740")],-1)),wf={class:"label-item_value"},yf={class:"label-item"},Ff=mt(()=>t("div",{class:"label-item_key"},[t("span",null,"IP\u6C60\u7ED3\u675F\u5730\u5740")],-1)),Ef={class:"label-item_value"},Cf={class:"actioner-dns_footer"},$f=["disabled"],Df={key:1,class:"actioner-dns"},Bf=mt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u66F4\u6362\u914D\u7F6E")],-1)),Yf={class:"actioner-dns_body"},Af={key:0,class:"setting_status"},Sf=mt(()=>t("div",{class:"success_icon"},[t("svg",{t:"1642063181211",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5062",width:"128",height:"128"},[t("path",{d:"M512 85.333333c235.648 0 426.666667 191.018667 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333z m-74.965333 550.4L346.453333 545.152a42.666667 42.666667 0 1 0-60.330666 60.330667l120.704 120.704a42.666667 42.666667 0 0 0 60.330666 0l301.653334-301.696a42.666667 42.666667 0 1 0-60.288-60.330667l-271.530667 271.488z",fill:"#52C41A","p-id":"5063"})])],-1)),zf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u6210\u529F",-1)),Pf=["href"],Tf={key:1,class:"setting_status"},If=mt(()=>t("div",{class:"success_icon"},[t("svg",{t:"1642063200324",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5898",width:"128",height:"128"},[t("path",{d:"M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",fill:"#E84335","p-id":"5899"})])],-1)),Lf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u5931\u8D25",-1)),Mf=mt(()=>t("p",null,"\u8BF7\u5C1D\u8BD5\u91CD\u65B0\u914D\u7F6E",-1)),Of={key:2,class:"setting_status"},Nf=mt(()=>t("div",{class:"success_icon"},[t("svg",{width:"128px",height:"128px",viewBox:"0 0 128 128",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[t("g",{id:"icon_yellow",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t("g",{id:"Icon/Warning"},[t("rect",{id:"\u77E9\u5F62",fill:"#000000","fill-rule":"nonzero",opacity:"0",x:"0",y:"0",width:"128",height:"128"}),t("path",{d:"M64,8 C33.075,8 8,33.075 8,64 C8,94.925 33.075,120 64,120 C94.925,120 120,94.925 120,64 C120,33.075 94.925,8 64,8 Z M60,37 C60,36.45 60.45,36 61,36 L67,36 C67.55,36 68,36.45 68,37 L68,71 C68,71.55 67.55,72 67,72 L61,72 C60.45,72 60,71.55 60,71 L60,37 Z M64,92 C60.6875,92 58,89.3125 58,86 C58,82.6875 60.6875,80 64,80 C67.3125,80 70,82.6875 70,86 C70,89.3125 67.3125,92 64,92 Z",id:"\u5F62\u72B6",fill:"#FAAD14"})])])])],-1)),qf=mt(()=>t("div",{class:"config-message"},"\u914D\u7F6E\u8D85\u65F6",-1)),Vf=mt(()=>t("p",null,"\u8DEF\u7531\u5668 IP \u53EF\u80FD\u5DF2\u7ECF\u4FEE\u6539\u6210\u529F\u3002\u82E5\u5237\u65B0\u9875\u9762\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u8FDE\u63A5\u8DEF\u7531\u5668\uFF0C\u5426\u5219\u8BF7\u5C1D\u8BD5\u91CD\u65B0\u914D\u7F6E\u3002",-1)),jf=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0),n=y({lanIp:"",netMask:"255.255.255.0",enableDhcp:!1,dhcpStart:"",dhcpEnd:""});y("");const s=y(!1);y(!0),y(!1);const c=y(""),p=y(2),f=y(!1),d=y("timeout");let l=!0;(()=>{S.Guide.GetLan.GET().then(g=>{g.data.result&&(f.value=g.data.result.enableDhcp||!1,g.data.result.enableDhcp=!1,n.value=g.data.result,g.data.result.lanIp!==location.hostname&&(l=!1))})})();const m=()=>{const g=n.value;if(!ht.isValidIP(g.lanIp)){F.Warning("IPv4\u5730\u5740\u683C\u5F0F\u9519\u8BEF");return}if(!ht.isValidMask(g.netMask)){F.Warning("IPv4\u5B50\u7F51\u63A9\u7801\u683C\u5F0F\u9519\u8BEF");return}const k=ht.calcMaskRange(g.lanIp,g.netMask);g.dhcpStart=k[0],g.dhcpEnd=k[1],n.value=g},b=()=>{const g=n.value;if(!ht.isValidIP(g.lanIp)){F.Warning("IPv4\u5730\u5740\u683C\u5F0F\u9519\u8BEF");return}if(!ht.isValidMask(g.netMask)){F.Warning("IPv4\u5B50\u7F51\u63A9\u7801\u683C\u5F0F\u9519\u8BEF");return}if(g.enableDhcp&&!ht.isValidIP(g.dhcpStart)||!ht.isValidIP(g.dhcpEnd)||!ht.isValidMaskRange(g.lanIp,g.netMask,g.dhcpStart,g.dhcpEnd)){F.Warning("DHCP\u7684IP\u6C60\u683C\u5F0F\u9519\u8BEF\u6216\u8D85\u51FA\u5B50\u7F51\u8303\u56F4");return}const k=F.Loading("\u6B63\u5728\u914D\u7F6E\u2026\u8BF7\u7A0D\u7B49",30);let x=0;const C=D=>{d.value=D,o.value=1,x=1,k.Close()},A=()=>{const D=new Date().getTime()+3e4,$=l?location.protocol+"//"+g.lanIp+(location.port?":"+location.port:""):location.origin,O=$+"/luci-static/resources/icons/loading.gif",H=()=>{x==0&&(new Date().getTime()>D?C("timeout"):window.setTimeout(Z,2e3))},j=()=>{x==0&&(c.value=$+location.pathname,C("success"),window.setTimeout(()=>{p.value=1},1e3),window.setTimeout(()=>{location.href=c.value},2e3))},Z=()=>{if(x!=0)return;console.log("check online ",O);const _t=new Image;_t.onload=j,_t.onerror=H,_t.src=O};window.setTimeout(Z,5e3)};S.Guide.LanIp.POST(g).then(D=>{var $;if(D!=null&&D.data){if((D.data.success||0)==0)return;if(($=D.data)!=null&&$.error)throw D.data.error}throw"\u672A\u77E5\u9519\u8BEF"}).catch(D=>{x==0&&(C("fail"),F.Error(D))}),A(),window.setTimeout(()=>{x==0&&C("timeout")},3e4)},_=g=>{g.preventDefault(),a.Close&&a.Close()},v=g=>{location.reload()};return(g,k)=>(i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0?(i(),r("form",{key:0,class:"actioner-dns",onSubmit:nt(b,["prevent"])},[uf,t("div",lf,[t("div",cf,[pf,t("div",ff,[z(t("input",{type:"text",placeholder:"192.168.100.1","onUpdate:modelValue":k[0]||(k[0]=x=>n.value.lanIp=x),onChange:m},null,544),[[W,n.value.lanIp,void 0,{trim:!0}]])])]),t("div",mf,[bf,t("div",vf,[z(t("input",{type:"text",placeholder:"255.255.255.0","onUpdate:modelValue":k[1]||(k[1]=x=>n.value.netMask=x),onChange:m},null,544),[[W,n.value.netMask,void 0,{trim:!0}]])])]),f.value?(i(),r("div",gf,[B(ea,{modelValue:n.value.enableDhcp,"onUpdate:modelValue":k[2]||(k[2]=x=>n.value.enableDhcp=x)},{default:V(()=>[n.value.enableDhcp?(i(),r("span",_f,"\u4FEE\u6539DHCP\u670D\u52A1")):(i(),r("span",hf,"\u4FDD\u6301DHCP\u670D\u52A1\u8BBE\u7F6E"))]),_:1},8,["modelValue"])])):E("",!0),n.value.enableDhcp?(i(),r(L,{key:1},[t("div",xf,[kf,t("div",wf,[z(t("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":k[3]||(k[3]=x=>n.value.dhcpStart=x)},null,512),[[W,n.value.dhcpStart,void 0,{trim:!0}]])])]),t("div",yf,[Ff,t("div",Ef,[z(t("input",{type:"text",placeholder:"192.168.100.100","onUpdate:modelValue":k[4]||(k[4]=x=>n.value.dhcpEnd=x)},null,512),[[W,n.value.dhcpEnd,void 0,{trim:!0}]])])])],64)):E("",!0)]),t("div",Cf,[t("button",{class:"cbi-button cbi-button-apply app-btn",disabled:s.value},"\u786E\u8BA4",8,$f),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:_},"\u53D6\u6D88")])],40,df)):o.value==1?(i(),r("div",Df,[Bf,t("div",Yf,[d.value=="success"?(i(),r("div",Af,[Sf,zf,t("a",{href:c.value,class:"NewAdress"},h(p.value)+"s\u540E \u8DF3\u8F6C\u65B0\u5730\u5740",9,Pf)])):d.value=="fail"?(i(),r("div",Tf,[If,Lf,Mf,t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:v},"\u6211\u77E5\u9053\u4E86")])):d.value=="timeout"?(i(),r("div",Of,[Nf,qf,Vf,t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:v},"\u5237\u65B0\u9875\u9762")])):E("",!0)])])):E("",!0)]),_:1},8,["Close"]))}});var Rf=Y(jf,[["__scopeId","data-v-a0faa6f2"]]);const Gf=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Rf,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},bt=e=>(N("data-v-0384f3ac"),e=e(),q(),e),Uf={key:0,class:"actioner-dns"},Wf=bt(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u6C99\u7BB1\u6A21\u5F0F\u914D\u7F6E\u5411\u5BFC")],-1)),Hf={class:"actioner-dns_body"},Zf=bt(()=>t("p",{class:"sandbox_info"},"\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)),Jf={key:0,class:"disk_loading_icon"},Xf=bt(()=>t("span",{class:"disk_loading_info"},"\u6B63\u5728\u52A0\u8F7D\u4E2D...",-1)),Kf={key:1,class:"disk_tips"},Qf=bt(()=>t("span",null,"\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",-1)),tm={class:"label-item"},em=bt(()=>t("div",{class:"label-item_key"},[t("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)),am={class:"label-item_value"},om=bt(()=>t("option",{value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u78C1\u76D8",-1)),nm=["value"],im={class:"label-item"},rm=bt(()=>t("div",{class:"label-item_key"},[t("span",null,"\u76EE\u6807\u5206\u533A\uFF08\u5206\u533A\u5927\u5C0F\u987B\u5927\u4E8E2G\uFF0C\u5C06\u6B64\u5206\u533A\u4F5C\u4E3A\u5916\u90E8 overlay \u4F7F\u7528\uFF09")],-1)),sm={class:"label-item_value"},dm=bt(()=>t("option",{selected:"true",value:""},"\u8BF7\u9009\u62E9\u76EE\u6807\u5206\u533A",-1)),um=["value","disabled"],lm={class:"sandbox_tips"},cm=bt(()=>t("span",null,"\u6B64\u64CD\u4F5C\u4F1A\u5C06\u4F1A\u5220\u9664\u8BE5\u5206\u533A\u5168\u90E8\u6570\u636E",-1)),pm={class:"sandbox_info timeout"},fm=U("\u5373\u5C06\u91CD\u542F\u8BBE\u5907 "),mm=bt(()=>t("p",{class:"sandbox_roboot_tips"},[U("\u7B49\u5F85\u8BBE\u5907\u91CD\u542F\uFF0C\u91CD\u542F\u5B8C\u6210\u540E"),t("span",{class:"sandbox_roboot_refresh"},"\u8BF7\u5237\u65B0\u754C\u9762")],-1)),bm={key:0,class:"actioner-dns_footer"},vm=["disabled"],gm={key:1,class:"actioner-tips"},_m=bt(()=>t("div",{class:"actioner-tips_header"},[t("span",null,"\u6E29\u99A8\u63D0\u793A")],-1)),hm=bt(()=>t("div",{class:"actioner-tips_body"},[t("p",{class:"sandbox_info"},"\u6B64\u64CD\u4F5C\u4F1A\u5C06\u4F1A\u5220\u9664\u8BE5\u5206\u533A\u5168\u90E8\u6570\u636E\uFF0C\u5E76\u683C\u5F0F\u5316\u6210EXT4\uFF0C\u968F\u540E\u81EA\u52A8\u91CD\u542F\u8FDB\u5165\u6C99\u7BB1\u6A21\u5F0F\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F")],-1)),xm={key:2,class:"actioner-tips"},km=bt(()=>t("div",{class:"actioner-tips_header"},[t("span",null,"\u9519\u8BEF")],-1)),wm={class:"actioner-tips_body"},ym={class:"sandbox_info"},Fm=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0);y("disk");const n=y(""),s=y(3),c=y(""),p=y([]),f=y(""),d=y(null);(()=>{S.Nas.SandboxDisks.GET().then(x=>{var C;if(x!=null&&x.data&&(C=x.data)!=null&&C.result){d.value=x.data.result;return}throw"\u52A0\u8F7D\u78C1\u76D8\u4FE1\u606F\u5931\u8D25"}).catch(x=>{n.value=x,o.value=3})})();const u=()=>S.System.Reboot.POST({name:c.value,path:f.value}).then(x=>{var C;if(!(x!=null&&x.data&&(((C=x==null?void 0:x.data)==null?void 0:C.success)||0)==0))throw"\u672A\u77E5\u9519\u8BEF"}),m=x=>{var C,A;f.value="",p.value=c.value&&((A=(C=d.value)==null?void 0:C.disks.find(D=>D.path==c.value))==null?void 0:A.childrens)||[]},b=()=>{s.value>0&&(s.value-=1,window.setTimeout(b,1e3))},_=x=>{x.preventDefault(),a.Close&&a.Close()},v=()=>{new Promise((x,C)=>{const A="/luci-static/resources/icons/loading.gif",D=()=>{window.setTimeout($,2e3)},$=()=>{const O=new Image;O.onload=x,O.onerror=D,O.src=A};window.setTimeout($,1e4)}).then(()=>{window.setTimeout(()=>{location.reload()},2e3)})},g=x=>{const C=F.Loading("\u914D\u7F6E\u6C99\u7BB1\u91CD\u542F\u4E2D...");S.Nas.Sandbox.POST({path:f.value}).then(A=>{var D;if(A!=null&&A.data){if((A.data.success||0)==0)return o.value=2,window.setTimeout(b,1e3),u();if((D=A.data)!=null&&D.error)throw A.data.error}throw"\u672A\u77E5\u9519\u8BEF"}).then(v).catch(A=>F.Warning(A)).finally(()=>C.Close())},k=()=>{o.value=0};return(x,C)=>{const A=Q("icon-loading");return i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0||o.value==2?(i(),r("div",Uf,[Wf,t("div",Hf,[Zf,o.value==0?(i(),r(L,{key:0},[d.value?E("",!0):(i(),r("div",Jf,[B(A,{size:38,color:"currentColor"}),Xf])),d.value&&d.value.disks.length==0?(i(),r("div",Kf,[B(gt),Qf])):E("",!0),d.value&&d.value.disks.length>0?(i(),r(L,{key:2},[t("div",tm,[em,t("div",am,[z(t("select",{name:"",id:"",onChange:m,"onUpdate:modelValue":C[0]||(C[0]=D=>c.value=D)},[om,(i(!0),r(L,null,R(d.value.disks,(D,$)=>(i(),r("option",{value:D.path,key:$},h(D.venderModel)+"\uFF08"+h(D.size)+"\uFF09 ",9,nm))),128))],544),[[K,c.value]])])]),t("div",im,[rm,t("div",sm,[z(t("select",{name:"",id:"","onUpdate:modelValue":C[1]||(C[1]=D=>f.value=D)},[dm,(i(!0),r(L,null,R(p.value,(D,$)=>(i(),r("option",{value:D.path,key:$,disabled:D.sizeInt<(1<<30)*1||D.isSystemRoot},h(D.name)+"\uFF08"+h(D.filesystem||"\u672A\u683C\u5F0F\u5316")+"\uFF09"+h(D.total),9,um))),128))],512),[[K,f.value]])])]),t("div",lm,[B(gt),cm])],64)):E("",!0)],64)):E("",!0),o.value==2?(i(),r(L,{key:1},[t("p",pm,[fm,t("span",null,"\uFF08"+h(s.value)+"s\uFF09",1)]),mm],64)):E("",!0)]),o.value==0?(i(),r("div",bm,[t("button",{class:"cbi-button cbi-button-apply app-btn",disabled:!f.value,onClick:C[2]||(C[2]=D=>o.value=1)},"\u5F00\u542F\u6C99\u7BB1",8,vm),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:_},"\u53D6\u6D88")])):E("",!0)])):E("",!0),o.value==1?(i(),r("div",gm,[_m,hm,t("div",{class:"actioner-tips_footer"},[t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:g},"\u7EE7\u7EED"),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:k},"\u53D6\u6D88")])])):E("",!0),o.value==3?(i(),r("div",xm,[km,t("div",wm,[t("p",ym,h(n.value),1)]),t("div",{class:"actioner-tips_footer"},[t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:k},"\u53D6\u6D88")])])):E("",!0)]),_:1},8,["Close"])}}});var Em=Y(Fm,[["__scopeId","data-v-0384f3ac"]]);const Cm=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Em,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},ba=e=>(N("data-v-4db2efb4"),e=e(),q(),e),$m={key:0,class:"actioner-dns"},Dm=ba(()=>t("div",{class:"actioner-dns_header"},[t("span",null,"\u6C99\u7BB1\u6A21\u5F0F\u914D\u7F6E\u5411\u5BFC")],-1)),Bm=ba(()=>t("div",{class:"actioner-dns_body"},[t("p",{class:"sandbox_info"},"\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\u62A4 Docker \u548C\u786C\u76D8\u7684\u6570\u636E"),t("div",{class:"sandbox_environment"},[t("p",null,"\u5F53\u524D\u5904\u4E8E\u6C99\u7BB1\u73AF\u5883\uFF1A"),t("p",null,"1\u3001\u70B9\u51FB\u201C\u63D0\u4EA4\u201D\u53EF\u5C06\u53D8\u66F4\u5408\u5E76\u5230\u975E\u6C99\u7BB1\u73AF\u5883"),t("p",null,"2\u3001\u70B9\u51FB\u201C\u91CD\u7F6E\u201D\u53EF\u5C06\u6C99\u7BB1\u6062\u590D\u5230\u521D\u59CB\u72B6\u6001"),t("p",null,"3\u3001\u70B9\u51FB\u201C\u9000\u51FA\u201D\u53EF\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\uFF0C\u5E76\u653E\u5F03\u6C99\u7BB1\u4E2D\u7684\u6570\u636E")]),t("div",{class:"sandbox_environment_info"},[U("\u4EE5\u4E0A\u64CD\u4F5C\u90FD\u5C06\u91CD\u542F\u8BBE\u5907\uFF0C\u8BBE\u5907\u91CD\u542F\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u5237\u65B0\u9875\u9762\u3002\u5982\u679C IP \u53D8\u5316\u53EF\u80FD\u9700\u8981"),t("span",{class:"sandbox_environment_reboot"},"\u624B\u52A8\u5728\u5730\u5740\u680F\u8F93\u5165\u5730\u5740"),t("p",{class:"sandbox_environment_tex"},[U(" \u5982\u9700"),t("b",null,"\u4E34\u65F6"),U("\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\uFF0C\u8BF7\u5C06\u8BBE\u5907\u5173\u673A\u540E\u62D4\u51FA\u76F8\u5173\u78C1\u76D8\uFF0C\u542F\u52A8\u524D\u63D2\u5165\u76F8\u5173\u78C1\u76D8\u53EF\u518D\u6B21\u8FDB\u5165\u6C99\u7BB1\u3002"),t("br"),U(" \u6CE8\u610F\u4E34\u65F6\u9000\u51FA\u6C99\u7BB1\u73AF\u5883\u4EE5\u540E\u5347\u7EA7\u56FA\u4EF6\u4F1A\u5BFC\u81F4\u4E4B\u524D\u7684\u6C99\u7BB1\u6570\u636E\u65E0\u6548 ")])])],-1)),Ym={class:"actioner-dns_footer"},Am=["disabled"],Sm=["disabled"],zm=["disabled"],Pm=P({props:{Close:{type:Function,required:!0}},setup(e){const a=e,o=y(0),n=y(!1),s=()=>{new Promise((l,u)=>{const m="/luci-static/resources/icons/loading.gif",b=()=>{window.setTimeout(_,2e3)},_=()=>{const v=new Image;v.onload=l,v.onerror=b,v.src=m};window.setTimeout(_,1e4)}).then(()=>{window.setTimeout(()=>{location.reload()},2e3)})},c=()=>{n.value=!0;const l=F.Loading("\u63D0\u4EA4\u4E2D...");S.Nas.SandboxCommit.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D...");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},p=()=>{n.value=!0;const l=F.Loading("\u91CD\u7F6E\u4E2D...");S.Nas.SandboxReset.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D... \u82E5\u9875\u9762\u957F\u65F6\u95F4\u672A\u5237\u65B0\u53EF\u80FD\u9700\u8981\u624B\u52A8\u586B\u5199\u5730\u5740");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},f=()=>{if(!confirm("\u786E\u5B9A\u653E\u5F03\u6C99\u7BB1\u4E2D\u7684\u6570\u636E\uFF1F\u518D\u6B21\u8FDB\u5165\u6C99\u7BB1\u9700\u8981\u91CD\u65B0\u683C\u5F0F\u5316\u76F8\u5E94\u78C1\u76D8\u5206\u533A"))return;n.value=!0;const l=F.Loading("\u6267\u884C\u4E2D...");S.Nas.SandboxExit.POST().then(u=>{var m,b;if(u!=null&&u.data)if((((m=u==null?void 0:u.data)==null?void 0:m.success)||0)==0){F.Loading("\u8BBE\u5907\u91CD\u542F\u4E2D... \u82E5\u9875\u9762\u957F\u65F6\u95F4\u672A\u5237\u65B0\u53EF\u80FD\u9700\u8981\u624B\u52A8\u586B\u5199\u5730\u5740");return}else(b=u==null?void 0:u.data)!=null&&b.error&&alert(u.data.error);throw"\u672A\u77E5\u9519\u8BEF"}).then(s).catch(u=>{F.Error(u),n.value=!1}).finally(()=>l.Close())},d=l=>{l.preventDefault(),a.Close&&a.Close()};return(l,u)=>(i(),M(et,{Close:e.Close,type:1},{default:V(()=>[o.value==0?(i(),r("div",$m,[Dm,Bm,t("div",Ym,[t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:c,disabled:n.value},"\u63D0\u4EA4",8,Am),t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:p,disabled:n.value},"\u91CD\u7F6E",8,Sm),t("button",{class:"cbi-button cbi-button-apply app-btn",onClick:f,disabled:n.value},"\u9000\u51FA",8,zm),t("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:d},"\u53D6\u6D88")])])):E("",!0)]),_:1},8,["Close"]))}});var Tm=Y(Pm,[["__scopeId","data-v-4db2efb4"]]);const Im=()=>{const e=document.createElement("div");document.body.appendChild(e);const a=tt(Tm,{Close:()=>{o()}});a.mount(e);const o=()=>{a.unmount(),e.remove()};return{Close:o}},Lm={class:"nav-container"},Mm=["onClick"],Om={key:0,class:"btn_styles color3 app-update-button",onclick:"window.location.href='/cgi-bin/luci/admin/system/ota'"},Nm=U(" \u56FA\u4EF6\u66F4\u65B0 "),qm={key:0,style:{display:"inline-block"}},Vm={key:1},jm=["disabled"],Rm=U(" DNS\u914D\u7F6E "),Gm={key:0,style:{display:"inline-block"}},Um=P({setup(e){const a=Ce(),o=le(),n=G(()=>o.status);y(!1),y(!0);const s=y(),c=()=>{oa()},p=()=>{Cm()},f=()=>{Im()},d=()=>{alert("\u8BE5\u56FA\u4EF6\u4E0D\u652F\u6301\u6C99\u7BB1\u6A21\u5F0F")},l=()=>{Gf()},u=()=>{ra()},m=()=>{window.open(`http://${window.location.hostname}:7681/`,"_blank")};return Kt("sandbox")&&S.Nas.GetSandbox.GET().then(_=>{var v,g,k;_!=null&&_.data&&((((v=_==null?void 0:_.data)==null?void 0:v.success)||0)==0?(g=_==null?void 0:_.data)!=null&&g.result&&(s.value=_.data.result):(k=_==null?void 0:_.data)!=null&&k.error&&alert(_.data.error))}).catch(_=>F.Warning(_)),(b,_)=>{var k,x,C,A,D,$;const v=Q("router-link"),g=Q("icon-loading");return i(),r("div",Lm,[B(v,{to:"/network",custom:""},{default:V(({navigate:O})=>[t("button",{class:"btn_styles color1",onClick:O},"\u7F51\u7EDC\u5411\u5BFC",8,Mm)]),_:1}),t("button",{class:"btn_styles color2 app-btn-ttyd",onClick:m},"\u7EC8\u7AEF"),w(Kt)("ota")?(i(),r("button",Om,[Nm,w(a).checkUpdate==null?(i(),r("span",qm,[B(g,{size:"0.8em",color:"currentColor"})])):(k=w(a).checkUpdate)!=null&&k.needUpdate?(i(),r("i",Vm)):E("",!0)])):E("",!0),t("button",{class:"btn_styles color4",onClick:l},"\u5185\u7F51\u914D\u7F6E"),t("button",{class:"btn_styles color5",onClick:c,disabled:!((x=w(n))!=null&&x.proto)},[Rm,(C=w(n))!=null&&C.proto?E("",!0):(i(),r("span",Gm,[B(g,{size:"0.8em",color:"currentColor"})]))],8,jm),t("button",{class:"btn_styles color1",onClick:u},"\u8F6F\u4EF6\u6E90\u914D\u7F6E"),w(Kt)("sandbox")?(i(),r(L,{key:1},[((A=s.value)==null?void 0:A.status)=="unsupport"?(i(),r("button",{key:0,class:"btn_styles color2",onClick:d},"\u5F00\u542F\u6C99\u7BB1")):((D=s.value)==null?void 0:D.status)=="stopped"?(i(),r("button",{key:1,class:"btn_styles color3",onClick:p},"\u5F00\u542F\u6C99\u7BB1")):(($=s.value)==null?void 0:$.status)=="running"?(i(),r("button",{key:2,class:"btn_styles color4",onClick:f},"\u6C99\u7BB1\u5DF2\u5F00\u542F")):E("",!0)],64)):E("",!0)])}}});var Wm=Y(Um,[["__scopeId","data-v-82a27618"]]);const _e=e=>(N("data-v-0a2eed64"),e=e(),q(),e),Hm={id:"page"},Zm=_e(()=>t("em",null,null,-1)),Jm=_e(()=>t("em",null,null,-1)),Xm=_e(()=>t("em",null,null,-1)),Km=_e(()=>t("em",null,null,-1)),Qm=P({setup(e){return Qa(),(a,o)=>(i(),r("div",Hm,[Zm,B(Zd),Jm,B(Wm),B(E7),Xm,B(ef),Km]))}});var t9=Y(Qm,[["__scopeId","data-v-0a2eed64"]]);const e9={};function a9(e,a){const o=Q("router-view");return i(),M(o)}var o9=Y(e9,[["render",a9]]);const n9={},i9={width:"136px",height:"136px",viewBox:"0 0 136 136",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},r9=Mt('
Override rules here may be changed later. Use this only for experimental or pre-release features.'))
- o.modalonly = true
- o.monospace = true
- o.rows = 10
- o.validate = validate_object;
- }
-
s.tab('proxy', _('Proxy Settings'));
o = s.taboption('proxy', form.Value, 'tproxy_port_tcp', _('Transparent Proxy Port (TCP)'))
@@ -690,14 +674,6 @@ return view.extend({
o.datatype = 'port'
o.default = 1083
- if (firewall4) {
- o = s.taboption('proxy', form.DynamicList, 'uids_direct', _('Skip Proxy for uids'), _("Processes started by users with these uids won't be forwarded through Xray."))
- o.datatype = "integer"
-
- o = s.taboption('proxy', form.DynamicList, 'gids_direct', _('Skip Proxy for gids'), _("Processes started by users in groups with these gids won't be forwarded through Xray."))
- o.datatype = "integer"
- }
-
o = s.taboption('proxy', widgets.DeviceSelect, 'lan_ifaces', _("LAN Interface"))
o.noaliases = true
o.rmempty = false
@@ -869,9 +845,9 @@ return view.extend({
o.rmempty = false
o.depends("web_server_enable", "1")
- add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "vless", true, true, false, firewall4)
+ add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "vless", true, true, false)
- add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "trojan", true, false, false, firewall4)
+ add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "trojan", true, false, false)
o = s.taboption('xray_server', form.Value, 'web_server_password', _('UserId / Password'), _('Fill user_id for vmess / VLESS, or password for shadowsocks / trojan (also supports Xray UUID Mapping)'))
o.depends("web_server_enable", "1")
diff --git a/luci-app-xray/fw4/Makefile b/luci-app-xray/fw4/Makefile
new file mode 100644
index 000000000..a4eb3e96a
--- /dev/null
+++ b/luci-app-xray/fw4/Makefile
@@ -0,0 +1,67 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-xray-fw4
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=MPLv2
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=yichya tag
is ignored.
Override rules here may be changed later. Use this only for experimental or pre-release features.'))
+ o.modalonly = true
+ o.monospace = true
+ o.rows = 10
+ o.validate = validate_object;
+
+ s.tab('proxy', _('Proxy Settings'));
+
+ o = s.taboption('proxy', form.Value, 'tproxy_port_tcp', _('Transparent Proxy Port (TCP)'))
+ o.datatype = 'port'
+ o.default = 1080
+
+ o = s.taboption('proxy', form.Value, 'tproxy_port_udp', _('Transparent Proxy Port (UDP)'))
+ o.datatype = 'port'
+ o.default = 1081
+
+ o = s.taboption('proxy', form.Value, 'socks_port', _('Socks5 Proxy Port'))
+ o.datatype = 'port'
+ o.default = 1082
+
+ o = s.taboption('proxy', form.Value, 'http_port', _('HTTP Proxy Port'))
+ o.datatype = 'port'
+ o.default = 1083
+
+ o = s.taboption('proxy', form.DynamicList, 'uids_direct', _('Skip Proxy for uids'), _("Processes started by users with these uids won't be forwarded through Xray."))
+ o.datatype = "integer"
+
+ o = s.taboption('proxy', form.DynamicList, 'gids_direct', _('Skip Proxy for gids'), _("Processes started by users in groups with these gids won't be forwarded through Xray."))
+ o.datatype = "integer"
+
+ o = s.taboption('proxy', widgets.DeviceSelect, 'lan_ifaces', _("LAN Interface"))
+ o.noaliases = true
+ o.rmempty = false
+ o.nocreate = true
+
+ o = s.taboption('proxy', form.SectionValue, "access_control_lan_hosts", form.TableSection, 'lan_hosts', _('LAN Hosts Access Control'), _("Will not enable transparent proxy for these MAC addresses."))
+
+ ss = o.subsection;
+ ss.sortable = false
+ ss.anonymous = true
+ ss.addremove = true
+
+ o = ss.option(form.Value, "macaddr", _("MAC Address"))
+ L.sortedKeys(load_result[2].hosts).forEach(function (mac) {
+ o.value(mac, E([], [mac, ' (', E('strong', [load_result[2].hosts[mac].name || L.toArray(load_result[2].hosts[mac].ipaddrs || load_result[2].hosts[mac].ipv4)[0] || L.toArray(load_result[2].hosts[mac].ip6addrs || load_result[2].hosts[mac].ipv6)[0] || '?']), ')']));
+ });
+
+ o.datatype = "macaddr"
+ o.rmempty = false
+
+ o = ss.option(form.ListValue, "bypassed", _("Access Control Strategy"))
+ o.value("0", "Always forwarded")
+ o.value("1", "Always bypassed")
+ o.rmempty = false
+
+ s.tab('dns', _('DNS Settings'));
+
+ o = s.taboption('dns', form.Value, 'fast_dns', _('Fast DNS'), _("DNS for resolving outbound domains and following bypassed domains"))
+ o.datatype = 'or(ip4addr, ip4addrport)'
+ o.placeholder = "114.114.114.114"
+
+ if (geosite_existence) {
+ o = s.taboption('dns', form.DynamicList, "bypassed_domain_rules", _('Bypassed domain rules'), _('Specify rules like tag
is ignored. geosite:cn
or domain:bilibili.com
. See documentation for details.'))
+ } else {
+ o = s.taboption('dns', form.DynamicList, 'bypassed_domain_rules', _('Bypassed domain rules'), _('Specify rules like domain:bilibili.com
or see documentation for details.
In order to use Geosite rules you need a valid resource file /usr/share/xray/geosite.dat.
Compile your firmware again with data files to use Geosite rules, or download one and upload it to your router.'))
+ }
+ o.rmempty = true
+
+ o = s.taboption('dns', form.Value, 'secure_dns', _('Secure DNS'), _("DNS for resolving known polluted domains (specify forwarded domain rules here)"))
+ o.datatype = 'or(ip4addr, ip4addrport)'
+ o.placeholder = "1.1.1.1"
+
+ if (geosite_existence) {
+ o = s.taboption('dns', form.DynamicList, "forwarded_domain_rules", _('Forwarded domain rules'), _('Specify rules like geosite:geolocation-!cn
or domain:youtube.com
. See documentation for details.'))
+ } else {
+ o = s.taboption('dns', form.DynamicList, 'forwarded_domain_rules', _('Forwarded domain rules'), _('Specify rules like domain:youtube.com
or see documentation for details.
In order to use Geosite rules you need a valid resource file /usr/share/xray/geosite.dat.
Compile your firmware again with data files to use Geosite rules, or download one and upload it to your router.'))
+ }
+ o.rmempty = true
+
+ o = s.taboption('dns', form.Value, 'default_dns', _('Default DNS'), _("DNS for resolving other sites (not in the rules above) and DNS records other than A or AAAA (TXT and MX for example)"))
+ o.datatype = 'or(ip4addr, ip4addrport)'
+ o.placeholder = "8.8.8.8"
+
+ if (geosite_existence) {
+ o = s.taboption('dns', form.DynamicList, "blocked_domain_rules", _('Blocked domain rules'), _('Specify rules like geosite:category-ads
or domain:baidu.com
. See documentation for details.'))
+ } else {
+ o = s.taboption('dns', form.DynamicList, 'blocked_domain_rules', _('Blocked domain rules'), _('Specify rules like domain:baidu.com
or see documentation for details.
In order to use Geosite rules you need a valid resource file /usr/share/xray/geosite.dat.
Compile your firmware again with data files to use Geosite rules, or download one and upload it to your router.'))
+ }
+ o.rmempty = true
+
+ o = s.taboption('dns', form.Value, 'dns_port', _('Xray DNS Server Port'), _("Do not use port 53 (dnsmasq), port 5353 (mDNS) or other common ports"))
+ o.datatype = 'port'
+ o.default = 5300
+
+ o = s.taboption('dns', form.Value, 'dns_count', _('Extra DNS Server Ports'), _('Listen for DNS Requests on multiple ports (all of which serves as dnsmasq upstream servers).
For example if Xray DNS Server Port is 5300 and use 3 extra ports, 5300 - 5303 will be used for DNS requests.
Increasing this value may help reduce the possibility of temporary DNS lookup failures.'))
+ o.datatype = 'range(0, 50)'
+ o.default = 0
+
+ s.tab('transparent_proxy_rules', _('Transparent Proxy Rules'));
+
+ if (geoip_direct_code === "upgrade" || geoip_direct_code === void 0) {
+ if (geoip_existence) {
+ o = s.taboption('transparent_proxy_rules', form.DynamicList, 'geoip_direct_code_list', _('GeoIP Direct Code List'), _("Hosts in these GeoIP sets will not be forwarded through Xray. Remove all items to forward all non-private hosts."))
+ } else {
+ o = s.taboption('transparent_proxy_rules', form.DynamicList, 'geoip_direct_code_list', _('GeoIP Direct Code List'), _("Resource file /usr/share/xray/geoip.dat not exist. All network traffic will be forwarded.
Compile your firmware again with data files to use this feature, or
download one (maybe disable transparent proxy first) and upload it to your router."))
+ o.readonly = true
+ }
+ } else {
+ if (geoip_existence) {
+ o = s.taboption('transparent_proxy_rules', form.Value, 'geoip_direct_code', _('GeoIP Direct Code'), _("Hosts in this GeoIP set will not be forwarded through Xray.
Switching to new format (by selecting 'Unspecified') is recommended for multiple GeoIP options here,
and is required if you want to forward all non-private hosts. This legacy option will be removed later."))
+ } else {
+ o = s.taboption('transparent_proxy_rules', form.Value, 'geoip_direct_code', _('GeoIP Direct Code'), _("Resource file /usr/share/xray/geoip.dat not exist. All network traffic will be forwarded.
Compile your firmware again with data files to use this feature, or
download one (maybe disable transparent proxy first) and upload it to your router."))
+ o.readonly = true
+ }
+ }
+ o.value("cn", "cn")
+ o.value("telegram", "telegram")
+ o.datatype = "string"
+
+ o = s.taboption('transparent_proxy_rules', form.ListValue, 'routing_domain_strategy', _('Routing Domain Strategy'), _("Domain resolution strategy when matching domain against rules."))
+ o.value("AsIs", "AsIs")
+ o.value("IPIfNonMatch", "IPIfNonMatch")
+ o.value("IPOnDemand", "IPOnDemand")
+ o.default = "AsIs"
+ o.rmempty = false
+
+ o = s.taboption('transparent_proxy_rules', form.Value, 'mark', _('Socket Mark Number'), _('Avoid proxy loopback problems with local (gateway) traffic'))
+ o.datatype = 'range(1, 255)'
+ o.default = 255
+
+ o = s.taboption('transparent_proxy_rules', form.DynamicList, "wan_bp_ips", _("Bypassed IP"), _("Requests to these IPs won't be forwarded through Xray."))
+ o.datatype = "ip4addr"
+ o.rmempty = true
+
+ o = s.taboption('transparent_proxy_rules', form.DynamicList, "wan_fw_ips", _("Forwarded IP"))
+ o.datatype = "ip4addr"
+ o.rmempty = true
+
+ o = s.taboption('transparent_proxy_rules', form.SectionValue, "access_control_manual_tproxy", form.GridSection, 'manual_tproxy', _('Manual Transparent Proxy'), _('Compared to iptables REDIRECT, Xray could do NAT46 / NAT64 (for example accessing IPv6 only sites). See FakeDNS for details.'))
+
+ ss = o.subsection;
+ ss.sortable = false
+ ss.anonymous = true
+ ss.addremove = true
+
+ o = ss.option(form.Value, "source_addr", _("Source Address"))
+ o.datatype = "ipaddr"
+ o.rmempty = true
+
+ o = ss.option(form.Value, "source_port", _("Source Port"))
+ o.rmempty = true
+
+ o = ss.option(form.Value, "dest_addr", _("Destination Address"))
+ o.datatype = "host"
+ o.rmempty = true
+
+ o = ss.option(form.Value, "dest_port", _("Destination Port"))
+ o.datatype = "port"
+ o.rmempty = true
+
+ o = ss.option(form.ListValue, 'domain_strategy', _('Domain Strategy'))
+ o.value("UseIP")
+ o.value("UseIPv4")
+ o.value("UseIPv6")
+ o.default = "UseIP"
+ o.modalonly = true
+
+ o = ss.option(form.Flag, 'force_forward', _('Force Forward'), _('This destination must be forwarded through an outbound server.'))
+ o.modalonly = true
+
+ o = ss.option(form.ListValue, 'force_forward_server_tcp', _('Force Forward server (TCP)'))
+ o.depends("force_forward", "1")
+ o.datatype = "uciname"
+ for (const v of uci.sections(config_data, "servers")) {
+ o.value(v[".name"], v.alias || v.server + ":" + v.server_port)
+ }
+ o.modalonly = true
+
+ o = ss.option(form.ListValue, 'force_forward_server_udp', _('Force Forward server (UDP)'))
+ o.depends("force_forward", "1")
+ o.datatype = "uciname"
+ for (const v of uci.sections(config_data, "servers")) {
+ o.value(v[".name"], v.alias || v.server + ":" + v.server_port)
+ }
+ o.modalonly = true
+
+ s.tab('xray_server', _('HTTPS Server'));
+
+ o = s.taboption('xray_server', form.Flag, 'web_server_enable', _('Enable Xray HTTPS Server'), _("This will start a HTTPS server which serves both as an inbound for Xray and a reverse proxy web server."));
+
+ o = s.taboption('xray_server', form.Value, 'web_server_port', _('Xray HTTPS Server Port'), _("This port needs to be set accept input
manually in firewall settings."))
+ o.datatype = 'port'
+ o.default = 443
+ o.depends("web_server_enable", "1")
+
+ o = s.taboption('xray_server', form.ListValue, "web_server_protocol", _("Protocol"), _("Only protocols which support fallback are available. Note that REALITY does not support fallback right now."));
+ o.value("vless", "VLESS")
+ o.value("trojan", "Trojan")
+ o.rmempty = false
+ o.depends("web_server_enable", "1")
+
+ add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "vless", true, false)
+
+ add_flow_and_stream_security_conf(s, "xray_server", "web_server_protocol", "trojan", false, false)
+
+ o = s.taboption('xray_server', form.Value, 'web_server_password', _('UserId / Password'), _('Fill user_id for vmess / VLESS, or password for shadowsocks / trojan (also supports Xray UUID Mapping)'))
+ o.depends("web_server_enable", "1")
+
+ o = s.taboption('xray_server', form.Value, 'web_server_address', _('Default Fallback HTTP Server'), _("Only HTTP/1.1 supported here. For HTTP/2 upstream, use Fallback Servers below"))
+ o.datatype = 'hostport'
+ o.depends("web_server_enable", "1")
+
+ o = s.taboption('xray_server', form.SectionValue, "xray_server_fallback", form.GridSection, 'fallback', _('Fallback Servers'), _("Specify upstream servers here."))
+ o.depends({"web_server_enable": "1", "web_server_protocol": "trojan"})
+ o.depends({"web_server_enable": "1", "web_server_protocol": "vless", "vless_tls": "tls"})
+ o.depends({"web_server_enable": "1", "web_server_protocol": "vless", "vless_tls": "xtls"})
+
+ ss = o.subsection;
+ ss.sortable = false
+ ss.anonymous = true
+ ss.addremove = true
+
+ o = ss.option(form.Value, "name", _("SNI"))
+ o.rmempty = true
+
+ o = ss.option(form.Value, "alpn", _("ALPN"))
+ o.rmempty = true
+
+ o = ss.option(form.Value, "path", _("Path"))
+ o.rmempty = true
+
+ o = ss.option(form.Value, "xver", _("Xver"))
+ o.datatype = "uinteger"
+ o.rmempty = true
+
+ o = ss.option(form.Value, "dest", _("Destination Address"))
+ o.datatype = 'hostport'
+ o.rmempty = true
+
+ s.tab('extra_options', _('Extra Options'))
+
+ o = s.taboption('extra_options', form.ListValue, 'loglevel', _('Log Level'), _('Read Xray log in "System Log" or use logread
command.'))
+ o.value("debug")
+ o.value("info")
+ o.value("warning")
+ o.value("error")
+ o.value("none")
+ o.default = "warning"
+
+ o = s.taboption('extra_options', form.Flag, 'access_log', _('Enable Access Log'), _('Access log will also be written to System Log.'))
+
+ o = s.taboption('extra_options', form.Flag, 'dns_log', _('Enable DNS Log'), _('DNS log will also be written to System Log.'))
+
+ o = s.taboption('extra_options', form.Flag, 'xray_api', _('Enable Xray API Service'), _('Xray API Service uses port 8080 and GRPC protocol. Also callable via xray api
or ubus call xray
. See here for help.'))
+
+ o = s.taboption('extra_options', form.Flag, 'stats', _('Enable Statistics'), _('Enable statistics of inbounds / outbounds data. Use Xray API to query values.'))
+
+ o = s.taboption('extra_options', form.Flag, 'observatory', _('Enable Observatory'), _('Enable latency measurement for TCP and UDP outbounds. Support for balancers and strategy will be added later.'))
+
+ o = s.taboption('extra_options', form.Flag, 'metrics_server_enable', _('Enable Xray Metrics Server'), _("Enable built-in metrics server for pprof and expvar. See here for details."));
+
+ o = s.taboption('extra_options', form.Value, 'metrics_server_port', _('Xray Metrics Server Port'), _("Metrics may be sensitive so think twice before setting it as Default Fallback HTTP Server."))
+ o.depends("metrics_server_enable", "1")
+ o.datatype = 'port'
+ o.placeholder = '18888'
+
+ o = s.taboption('extra_options', form.Value, 'handshake', _('Handshake Timeout'), _('Policy: Handshake timeout when connecting to upstream. See here for help.'))
+ o.datatype = 'uinteger'
+ o.placeholder = 4
+ o.default = 4
+
+ o = s.taboption('extra_options', form.Value, 'conn_idle', _('Connection Idle Timeout'), _('Policy: Close connection if no data is transferred within given timeout. See here for help.'))
+ o.datatype = 'uinteger'
+ o.placeholder = 300
+ o.default = 300
+
+ o = s.taboption('extra_options', form.Value, 'uplink_only', _('Uplink Only Timeout'), _('Policy: How long to wait before closing connection after server closed connection. See here for help.'))
+ o.datatype = 'uinteger'
+ o.placeholder = 2
+ o.default = 2
+
+ o = s.taboption('extra_options', form.Value, 'downlink_only', _('Downlink Only Timeout'), _('Policy: How long to wait before closing connection after client closed connection. See here for help.'))
+ o.datatype = 'uinteger'
+ o.placeholder = 5
+ o.default = 5
+
+ o = s.taboption('extra_options', form.Value, 'buffer_size', _('Buffer Size'), _('Policy: Internal cache size per connection. See here for help.'))
+ o.datatype = 'uinteger'
+ o.placeholder = 512
+ o.default = 512
+
+ o = s.taboption('extra_options', form.SectionValue, "xray_bridge", form.TableSection, 'bridge', _('Bridge'), _('Reverse proxy tool. Currently only client role (bridge) is supported. See here for help.'))
+
+ ss = o.subsection;
+ ss.sortable = false
+ ss.anonymous = true
+ ss.addremove = true
+
+ o = ss.option(form.ListValue, "upstream", _("Upstream"))
+ o.datatype = "uciname"
+ for (const v of uci.sections(config_data, "servers")) {
+ o.value(v[".name"], v.alias || v.server + ":" + v.server_port)
+ }
+
+ o = ss.option(form.Value, "domain", _("Domain"))
+ o.rmempty = false
+
+ o = ss.option(form.Value, "redirect", _("Redirect address"))
+ o.datatype = "hostport"
+ o.rmempty = false
+
+ // if (Object.keys(optional_features).length > 0) {
+ // s.tab('optional_features', _('Optional Features'), _("Warning: all settings on this page are experimental, not guaranteed to be stable, and quite likely to be changed very frequently. Use at your own risk."))
+ // }
+
+ s.tab('custom_options', _('Custom Options'))
+ o = s.taboption('custom_options', form.TextValue, 'custom_config', _('Custom Configurations'), _('Check /var/etc/xray/config.json
for tags of generated inbounds and outbounds. See here for help'))
+ o.monospace = true
+ o.rows = 10
+ o.validate = validate_object
+
+ return m.render();
+ }
+});
diff --git a/luci-app-xray/root/etc/uci-defaults/xray b/luci-app-xray/root/etc/uci-defaults/xray
deleted file mode 100644
index c9f82487e..000000000
--- a/luci-app-xray/root/etc/uci-defaults/xray
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-uci get xray.@general[-1] >/dev/null 2>&1 || uci add xray general >/dev/null 2>&1
-uci commit xray
-uci -q batch <<-EOF >/dev/null
- delete ucitrack.@xray[-1]
- add ucitrack xray
- set ucitrack.@xray[-1].init=xray
- commit ucitrack
- delete firewall.xray
- set firewall.xray=include
- set firewall.xray.type=script
- set firewall.xray.path=/var/etc/xray.include
- set firewall.xray.reload=1
- commit firewall
-EOF
-exit 0
diff --git a/luci-app-xray/root/usr/share/xray/init.fw3 b/luci-app-xray/root/usr/share/xray/init.fw3
deleted file mode 100644
index 601ad9602..000000000
--- a/luci-app-xray/root/usr/share/xray/init.fw3
+++ /dev/null
@@ -1,31 +0,0 @@
-FIREWALL_INCLUDE="/usr/share/xray/firewall_include.lua"
-
-setup_firewall() {
- logger -st xray[$$] -p4 "Setting ipset rules..."
- lua /usr/share/xray/gen_ipset_rules.lua | ipset -! restore
- /etc/hotplug.d/iface/01-transparent-proxy-ipset
-
- logger -st xray[$$] -p4 "Generating firewall rules..."
- /usr/bin/lua ${FIREWALL_INCLUDE} enable > $(uci get firewall.xray.path)
-
- logger -st xray[$$] -p4 "Triggering firewall restart..."
- /etc/init.d/firewall restart > /dev/null 2>&1
-}
-
-flush_firewall() {
- logger -st xray[$$] -p4 "Flushing firewall rules..."
- /usr/bin/lua ${FIREWALL_INCLUDE} flush > $(uci get firewall.xray.path)
-
- logger -st xray[$$] -p4 "Triggering firewall restart..."
- /etc/init.d/firewall restart > /dev/null 2>&1
-
- logger -st xray[$$] -p4 "Flushing ipset rules..."
- for setname in $(ipset -n list | grep "tp_spec"); do
- ipset -! destroy $setname
- done
- /etc/hotplug.d/iface/01-transparent-proxy-ipset
-}
-
-impl_gen_config_file() {
- /usr/bin/lua /usr/share/xray/gen_config.lua > /var/etc/xray/config.json
-}
diff --git a/luci-app-xray/root/usr/share/xray/init.fw4 b/luci-app-xray/root/usr/share/xray/init.fw4
deleted file mode 100644
index 26392e0c3..000000000
--- a/luci-app-xray/root/usr/share/xray/init.fw4
+++ /dev/null
@@ -1,33 +0,0 @@
-FIREWALL_INCLUDE="/usr/share/xray/firewall_include.ut"
-
-setup_firewall() {
- ip rule add fwmark 251 lookup 251
- ip rule add fwmark 252 lookup 252
- ip route add local default dev lo table 251
- ip route add local default dev lo table 252
-
- logger -st xray[$$] -p4 "Generating firewall4 rules..."
- /usr/bin/utpl ${FIREWALL_INCLUDE} > /var/etc/xray/firewall_include.nft
-
- logger -st xray[$$] -p4 "Triggering firewall4 restart..."
- /etc/init.d/firewall restart
- /etc/hotplug.d/iface/01-transparent-proxy-ipset
-}
-
-flush_firewall() {
- ip rule del fwmark 251 lookup 251
- ip rule del fwmark 252 lookup 252
- ip route del local default dev lo table 251
- ip route del local default dev lo table 252
-
- logger -st xray[$$] -p4 "Flushing firewall4 rules..."
- rm -f /var/etc/xray/firewall_include.nft
-
- logger -st xray[$$] -p4 "Triggering firewall4 restart..."
- /etc/init.d/firewall restart
- /etc/hotplug.d/iface/01-transparent-proxy-ipset
-}
-
-impl_gen_config_file() {
- /usr/bin/ucode /usr/share/xray/gen_config.uc > /var/etc/xray/config.json
-}
diff --git a/luci-app-xray/shared/Makefile b/luci-app-xray/shared/Makefile
new file mode 100644
index 000000000..fa0a15dd2
--- /dev/null
+++ b/luci-app-xray/shared/Makefile
@@ -0,0 +1,98 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-xray-shared
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=MPLv2
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=yichya