kenzok8-package/luci-app-istorex/htdocs/luci-static/istorex/chunk.7deee291.js
2024-02-20 00:22:53 +08:00

2 lines
14 KiB
JavaScript

var f=(n,u,c)=>new Promise((l,o)=>{var d=s=>{try{p(c.next(s))}catch(e){o(e)}},F=s=>{try{p(c.throw(s))}catch(e){o(e)}},p=s=>s.done?l(s.value):Promise.resolve(s.value).then(d,F);p((c=c.apply(n,u)).next())});import{d as $,M as b,s as M,r as N,o as h,c as y,a as t,b as S,_ as A,T as v,C as z,p as g,q as x,l as O,g as q,n as G,j as H,v as W,x as C,A as T,z as U,D as V,e as E,w as L,N as R,S as j}from"./index.js?v=5b4be379";const P=n=>(g("data-v-7b2637d8"),n=n(),x(),n),J=P(()=>t("div",{class:"f"},[t("div",{class:"titleMain"},"\u4E92\u8054\u7F51"),t("div",{class:"titleSub"},"\u8054\u673A\u7C7B\u578B")],-1)),K={class:"r"},Q=P(()=>t("div",{class:"title"}," \u8BF7\u5728\u4EE5\u4E0B\u9009\u9879\u4E2D\u9009\u62E9\u7F51\u7EDC\u8FDE\u63A5\u7C7B\u578B\u3002\u82E5\u60A8\u4E0D\u77E5\u9053\u7F51\u7EDC\u8FDE\u63A5\u7C7B\u578B\uFF0C\u8BF7\u54A8\u8BE2\u60A8\u7684\u7F51\u7EDC\u670D\u52A1\u4F9B\u5E94\u5546\uFF08ISP\uFF09\u3002 ",-1)),X={class:"selector-container"},Y=P(()=>t("div",{class:"select-bar"}," \u81EA\u52A8\u8054\u7F51\uFF08\u52A8\u6001IP\uFF09 ",-1)),Z={class:"narrow-container"},tt=P(()=>t("div",{class:"select-bar"}," \u62E8\u53F7\u8054\u7F51\uFF08PPPoE\uFF09 ",-1)),et={class:"narrow-container"},st={class:"btns"},at=$({__name:"router",props:{setup:{type:String,required:!0}},emits:["update:setup"],setup(n,{emit:u}){const c=b(),l=()=>{u("update:setup","wizard")},o=()=>{u("update:setup","router-pppoe")},d=M(!1),F=()=>f(this,null,function*(){const s={wanProto:"dhcp",dnsProto:"auto"};d.value=!0;const e=v.Loading("\u4FDD\u5B58\u4E2D...");try{const a=yield z.Guide.ClientModel.POST(s);if(a!=null&&a.data){const{success:_,error:D}=a==null?void 0:a.data;if(D)throw D;(_==null||_==0)&&(yield p())}}catch(a){v.Error(`${a}`)}finally{d.value=!1,e.Close()}}),p=()=>f(this,null,function*(){const s=v.Loading("\u914D\u7F6E\u4E2D...");try{const e=yield z.Istorex.Updata.POST({model:"router"});if(e.data){const{success:a,error:_}=e.data;if(_)throw _;a===0&&c.push({path:"/router"})}}catch(e){v.Error(`${e}`)}finally{s.Close()}});return(s,e)=>{const a=N("icon-right");return h(),y("form",null,[J,t("div",K,[Q,t("div",X,[t("div",{class:"selector-container_item",onClick:e[0]||(e[0]=_=>F())},[Y,t("div",Z,[S(a)])]),t("div",{class:"selector-container_item",onClick:e[1]||(e[1]=_=>o())},[tt,t("div",et,[S(a)])])]),t("div",st,[t("button",{class:"back",type:"button",onClick:e[2]||(e[2]=_=>l())},"\u4E0A\u4E00\u6B65"),t("button",{class:"next",type:"button",onClick:e[3]||(e[3]=_=>p())}," \u4E0D\u914D\u7F6E\uFF0C\u8FDB\u5165\u4E3B\u754C\u9762 ")])])])}}});var ot=A(at,[["__scopeId","data-v-7b2637d8"]]);const ut={},nt={class:"main"};function lt(n,u){return h(),y("div",nt)}var it=A(ut,[["render",lt]]);const r=n=>(g("data-v-041c9ebc"),n=n(),x(),n),dt={id:"wizard"},rt={class:"wizard_title"},ct={class:"wizard_body"},pt={class:"wizard-item_icon"},_t={t:"1654871923674",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1414",width:"128",height:"128",style:{padding:"5px"}},ht=r(()=>t("path",{d:"M247.466667 76.8h25.6l51.2 307.2h-25.6L247.466667 76.8zM762.453333 76.8h25.6L742.4 385.706667h-25.6L762.453333 76.8z",fill:"#96CAFF","p-id":"1415"},null,-1)),vt=r(()=>t("path",{d:"M275.2 409.6H324.266667L256.938667 51.2H230.4zM230.4 25.6h26.538667a25.6 25.6 0 0 1 25.173333 20.906667l67.242667 358.4A25.6 25.6 0 0 1 324.266667 435.2h-49.066667a25.6 25.6 0 0 1-25.6-22.442667L204.8 54.357333A25.6 25.6 0 0 1 227.242667 25.6zM785.066667 51.2l-44.885334 358.4H691.2l67.242667-358.4z m0-25.6h-26.624a25.6 25.6 0 0 0-25.173334 20.906667l-67.157333 358.4A25.6 25.6 0 0 0 691.2 435.2h48.981333a25.6 25.6 0 0 0 25.6-22.442667l44.885334-358.4A25.6 25.6 0 0 0 788.138667 25.6z",fill:"#175AA7","p-id":"1416"},null,-1)),ft=r(()=>t("path",{d:"M59.733333 665.6h930.133334a8.533333 8.533333 0 0 1 8.533333 8.533333v162.133334a8.533333 8.533333 0 0 1-8.533333 8.533333H59.733333a8.533333 8.533333 0 0 1-8.533333-8.533333V674.133333a8.533333 8.533333 0 0 1 8.533333-8.533333z",fill:"#96CAFF","p-id":"1417"},null,-1)),Ft=r(()=>t("path",{d:"M460.8 768h25.6v-25.6h-25.6z m-25.6-51.2h76.8v76.8h-76.8zM716.8 768h25.6v-25.6h-25.6z m-25.6-51.2h76.8v76.8h-76.8zM588.8 768h25.6v-25.6h-25.6z m-25.6-51.2h76.8v76.8h-76.8zM844.8 768h25.6v-25.6h-25.6z m-25.6-51.2h76.8v76.8h-76.8z",fill:"#175AA7","p-id":"1418"},null,-1)),mt=r(()=>t("path",{d:"M153.6 844.8h68.693333l-25.6 76.8H179.2l-25.6-76.8z",fill:"#96CAFF","p-id":"1419"},null,-1)),wt=r(()=>t("path",{d:"M203.434667 844.8h8.533333l12.629333 17.493333-2.730666 8.106667h-26.965334z m-74.069334 0h-8.533333l-12.629333 17.493333 2.730666 8.106667h26.965334z m17.066667 51.2h39.936l8.533333-25.6h-57.002666zM102.4 844.8h128l-25.6 76.8h-76.8z",fill:"#175AA7","p-id":"1420"},null,-1)),zt=r(()=>t("path",{d:"M844.8 844.8h68.693333l-25.6 76.8H870.4l-25.6-76.8z",fill:"#96CAFF","p-id":"1421"},null,-1)),Dt=r(()=>t("path",{d:"M913.066667 870.4l2.730666-8.106667-12.629333-17.493333h-8.533333l-8.533334 25.6z m-92.501334-25.6h-8.533333l-12.629333 17.493333 2.730666 8.106667h26.965334z m17.066667 51.2h39.936l8.533333-25.6h-57.002666zM793.6 844.8h128l-25.6 76.8h-76.8zM204.8 768h25.6v25.6h-25.6zM281.6 768h25.6v25.6h-25.6zM128 768h25.6v25.6h-25.6zM358.4 768h25.6v25.6h-25.6zM204.8 716.8h25.6v25.6h-25.6zM281.6 716.8h25.6v25.6h-25.6zM128 716.8h25.6v25.6h-25.6zM358.4 716.8h25.6v25.6h-25.6z",fill:"#175AA7","p-id":"1422"},null,-1)),yt=r(()=>t("path",{d:"M69.12 640l176.128-249.941333A76.8 76.8 0 0 1 307.2 358.4h441.6A76.8 76.8 0 0 1 810.666667 390.058667L986.026667 640",fill:"#B3D9FF","p-id":"1423"},null,-1)),Et=r(()=>t("path",{d:"M742.4 358.4l187.050667 256.597333h57.941333L805.290667 358.4H742.4z",fill:"#96CAFF","p-id":"1424"},null,-1)),At=r(()=>t("path",{d:"M51.2 640a25.6 25.6 0 0 0-25.6 25.6v153.6a25.6 25.6 0 0 0 25.6 25.6h921.6a25.6 25.6 0 0 0 25.6-25.6V665.6a25.6 25.6 0 0 0-25.6-25.6z m0-25.6h921.6a51.2 51.2 0 0 1 51.2 51.2v153.6a51.2 51.2 0 0 1-51.2 51.2H51.2a51.2 51.2 0 0 1-51.2-51.2V665.6a51.2 51.2 0 0 1 51.2-51.2z",fill:"#175AA7","p-id":"1425"},null,-1)),$t=r(()=>t("path",{d:"M167.936 451.84L186.197333 426.666667l15.786667-21.674667A51.2 51.2 0 0 1 243.370667 384h536.149333a51.2 51.2 0 0 1 41.386667 21.077333L985.429333 640h31.232L841.642667 390.058667A76.8 76.8 0 0 0 779.52 358.4H243.370667a76.8 76.8 0 0 0-62.122667 31.658667l-34.133333 47.104L5.12 640h31.232z",fill:"#175AA7","p-id":"1426"},null,-1)),bt=[ht,vt,ft,Ft,mt,wt,zt,Dt,yt,Et,At,$t],Mt=r(()=>t("div",{class:"wizard-item_name"}," \u8DEF\u7531\u6A21\u5F0F ",-1)),Bt=r(()=>t("div",{class:"wizard-item_icon"},[t("svg",{t:"1658387243046",class:"icon",viewBox:"0 0 1137 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"40015",width:"128",height:"128"},[t("path",{d:"M0.967111 0.967111h1135.445333V244.622222H0.967111z",fill:"#5B8FD9","p-id":"40016"}),t("path",{d:"M606.037333 122.766222a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#FE6D68","p-id":"40017"}),t("path",{d:"M771.015111 122.766222a47.160889 47.160889 0 1 0 94.321778 0 47.160889 47.160889 0 0 0-94.321778 0z",fill:"#F9D65D","p-id":"40018"}),t("path",{d:"M932.124444 122.766222a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#68D279","p-id":"40019"}),t("path",{d:"M0.967111 370.289778h1135.445333v243.598222H0.967111z",fill:"#5B8FD9","p-id":"40020"}),t("path",{d:"M606.037333 488.106667a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#FE6D68","p-id":"40021"}),t("path",{d:"M771.015111 488.106667a47.160889 47.160889 0 1 0 94.321778 0 47.160889 47.160889 0 0 0-94.321778 0z",fill:"#F9D65D","p-id":"40022"}),t("path",{d:"M932.124444 488.106667a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#68D279","p-id":"40023"}),t("path",{d:"M0.967111 735.687111h1135.445333v243.541333H0.967111z",fill:"#5B8FD9","p-id":"40024"}),t("path",{d:"M606.037333 857.486222a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#FE6D68","p-id":"40025"}),t("path",{d:"M771.015111 857.486222a47.160889 47.160889 0 1 0 94.321778 0 47.160889 47.160889 0 0 0-94.321778 0z",fill:"#F9D65D","p-id":"40026"}),t("path",{d:"M932.124444 857.486222a47.160889 47.160889 0 1 0 94.264889 0 47.160889 47.160889 0 0 0-94.264889 0z",fill:"#68D279","p-id":"40027"})])],-1)),Ct=r(()=>t("div",{class:"wizard-item_name"}," NAS\u6A21\u5F0F ",-1)),gt=[Bt,Ct],xt=$({__name:"wizard",props:{setup:{type:String,required:!0}},emits:["update:setup"],setup(n,{emit:u}){const c=M(!1),l=b(),o=()=>f(this,null,function*(){c.value||(yield F("router"))}),d=()=>f(this,null,function*(){c.value||(yield F("next-nas"))}),F=p=>f(this,null,function*(){c.value=!0;try{const s=yield z.Istorex.Updata.POST({model:p});if(s.data){const{success:e,error:a}=s.data;if(a)throw a;e===0&&l.push({path:`/${p}`})}}catch(s){v.Error(`${s}`)}finally{c.value=!1}});return(p,s)=>(h(),y("div",dt,[t("h1",rt,O(q(G).HostName)+" \u5411\u5BFC\u6A21\u5F0F",1),t("div",ct,[t("div",{class:"wizard-item",onClick:s[0]||(s[0]=e=>o())},[t("div",pt,[(h(),y("svg",_t,bt))]),Mt]),t("div",{class:"wizard-item",onClick:s[1]||(s[1]=e=>d())},gt)])]))}});var Pt=A(xt,[["__scopeId","data-v-041c9ebc"]]);const k=n=>(g("data-v-72afa128"),n=n(),x(),n),St=k(()=>t("div",{class:"title"},[t("span",null,"PPPoE \u4E0A\u7F51"),U(" \u8F93\u5165\u7528\u6237\u8D26\u53F7\u548C\u5BC6\u7801 ")],-1)),kt={class:"form-item"},It=k(()=>t("span",{class:"name"}," \u7528\u6237\u540D ",-1)),Tt={class:"form-item"},Vt=k(()=>t("span",{class:"name"},"\u5BC6\u7801",-1)),Lt={class:"btns"},Ht=["disabled"],Ut=["disabled"],Nt=$({__name:"router-pppoe",props:{setup:{type:String,required:!0}},emits:["update:setup"],setup(c,l){return f(this,arguments,function*(n,{emit:u}){let o,d;const F=b(),p=()=>{u("update:setup","router")},s=H({account:"",password:""}),e=M(!1),a=()=>f(this,null,function*(){e.value=!0;try{const m=yield z.Guide.Pppoe.GET(),{result:i}=m.data;i&&(s.account=i.account||"",s.password=i.password||"")}catch(m){}finally{}e.value=!1});[o,d]=W(()=>a()),yield o,d();const _=()=>f(this,null,function*(){if(s.account==""){v.Warning("\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A");return}if(s.password==""){v.Warning("\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");return}e.value=!0;const m=v.Loading("\u4FDD\u5B58\u4E2D...");try{const i=yield z.Guide.Pppoe.POST({account:s.account,password:s.password});if(i.data){const{error:w,success:I}=i.data;if(w)throw w;(I==null||I==0)&&(yield D())}}catch(i){v.Error(`${i}`)}finally{e.value=!1,m.Close()}}),D=()=>f(this,null,function*(){e.value=!0;try{const m=yield z.Istorex.Updata.POST({model:"router"});if(m.data){const{success:i,error:w}=m.data;if(w)throw w;i===0&&F.push({path:"/router"})}}catch(m){v.Error(`${m}`)}finally{e.value=!1}});return(m,i)=>(h(),y("form",null,[St,t("div",kt,[It,t("label",null,[C(t("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7","onUpdate:modelValue":i[0]||(i[0]=w=>s.account=w)},null,512),[[T,s.account,void 0,{trim:!0}]])])]),t("div",Tt,[Vt,t("label",null,[C(t("input",{type:"password",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801","onUpdate:modelValue":i[1]||(i[1]=w=>s.password=w)},null,512),[[T,s.password,void 0,{trim:!0}]])])]),t("div",Lt,[t("button",{class:"back",type:"button",disabled:e.value,onClick:i[2]||(i[2]=w=>p())},"\u4E0A\u4E00\u6B65",8,Ht),t("button",{class:"next",type:"button",disabled:e.value,onClick:_},"\u4FDD\u5B58\u5E94\u7528",8,Ut)])]))})}});var Ot=A(Nt,[["__scopeId","data-v-72afa128"]]);const B=n=>(g("data-v-56e86acc"),n=n(),x(),n),qt=B(()=>t("div",{class:"title"},[t("span",null,"DHCP\u914D\u7F6E"),U(" \u81EA\u52A8\u8054\u7F51 ")],-1)),Gt={class:"form-item"},Wt=B(()=>t("span",{class:"name"}," IP\u5730\u5740 ",-1)),Rt=B(()=>t("option",{value:"dhcp"},"\u81EA\u52A8\u83B7\u53D6",-1)),jt=[Rt],Jt={class:"form-item"},Kt=B(()=>t("span",{class:"name"}," DNS ",-1)),Qt=B(()=>t("option",{value:"auto"},"\u81EA\u52A8\u83B7\u53D6",-1)),Xt=[Qt],Yt={class:"btns"},Zt=["disabled"],t6=["disabled"],e6=$({__name:"router-dhcp",props:{setup:{type:String,required:!0}},emits:["update:setup"],setup(n,{emit:u}){const c=b(),l=()=>{u("update:setup","router")},o=M(!1),d=H({wanProto:"dhcp",dnsProto:"auto"}),F=()=>f(this,null,function*(){const s={wanProto:d.wanProto,dnsProto:d.dnsProto};o.value=!0;const e=v.Loading("\u4FDD\u5B58\u4E2D...");try{const a=yield z.Guide.ClientModel.POST(s);if(a!=null&&a.data){const{success:_,error:D}=a==null?void 0:a.data;if(D)throw D;(_==null||_==0)&&(yield p())}}catch(a){v.Error(`${a}`)}finally{o.value=!1,e.Close()}}),p=()=>f(this,null,function*(){o.value=!0;try{const s=yield z.Istorex.Updata.POST({model:"router"});if(s.data){const{success:e,error:a}=s.data;if(a)throw a;e===0&&c.push({path:"/router"})}}catch(s){v.Error(`${s}`)}finally{o.value=!1}});return(s,e)=>(h(),y("form",null,[qt,t("div",Gt,[Wt,t("label",null,[C(t("select",{"onUpdate:modelValue":e[0]||(e[0]=a=>d.wanProto=a),disabled:""},jt,512),[[V,d.wanProto]])])]),t("div",Jt,[Kt,t("label",null,[C(t("select",{"onUpdate:modelValue":e[1]||(e[1]=a=>d.dnsProto=a),disabled:""},Xt,512),[[V,d.dnsProto]])])]),t("div",Yt,[t("button",{class:"back",type:"button",disabled:o.value,onClick:e[2]||(e[2]=a=>l())},"\u4E0A\u4E00\u6B65",8,Zt),t("button",{class:"next",type:"button",disabled:o.value,onClick:F},"\u4FDD\u5B58\u5E94\u7528",8,t6)])]))}});var s6=A(e6,[["__scopeId","data-v-56e86acc"]]);const a6={id:"main"},o6=$({__name:"index",setup(n){b();const u=M("wizard");return(c,l)=>(h(),y("div",a6,[(h(),E(j,null,{default:L(()=>[S(R,{name:"slide-top"},{default:L(()=>[u.value=="nas"?(h(),E(it,{key:0,setup:u.value,"onUpdate:setup":l[0]||(l[0]=o=>u.value=o)},null,8,["setup"])):u.value=="router"?(h(),E(ot,{key:1,setup:u.value,"onUpdate:setup":l[1]||(l[1]=o=>u.value=o)},null,8,["setup"])):u.value=="router-pppoe"?(h(),E(Ot,{key:2,setup:u.value,"onUpdate:setup":l[2]||(l[2]=o=>u.value=o)},null,8,["setup"])):u.value=="router-dhcp"?(h(),E(s6,{key:3,setup:u.value,"onUpdate:setup":l[3]||(l[3]=o=>u.value=o)},null,8,["setup"])):(h(),E(Pt,{key:4,setup:u.value,"onUpdate:setup":l[4]||(l[4]=o=>u.value=o)},null,8,["setup"]))]),_:1})]),_:1}))]))}});var l6=A(o6,[["__scopeId","data-v-06e7b595"]]);export{l6 as default};