small-package/luci-app-quickstart/htdocs/luci-static/quickstart/index.js

4 lines
329 KiB
JavaScript
Raw Normal View History

2023-08-22 16:22:05 +08:00
var xa=Object.defineProperty,ka=Object.defineProperties;var wa=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var ya=Object.prototype.hasOwnProperty,Fa=Object.prototype.propertyIsEnumerable;var ke=(e,a,o)=>a in e?xa(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o,J=(e,a)=>{for(var o in a||(a={}))ya.call(a,o)&&ke(e,o,a[o]);if(Ge)for(var o of Ge(a))Fa.call(a,o)&&ke(e,o,a[o]);return e},at=(e,a)=>ka(e,wa(a));var Ea=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var Zt=(e,a,o)=>(ke(e,typeof a!="symbol"?a+"":a,o),o);var T=(e,a,o)=>new Promise((n,s)=>{var c=d=>{try{p(o.next(d))}catch(l){s(l)}},f=d=>{try{p(o.throw(d))}catch(l){s(l)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,f);p((o=o.apply(e,a)).next())});import{d as Qt,a as P,c as R,u as k,o as i,b as r,e as t,t as h,n as Tt,f as E,r as X,g as D,h as ot,i as Dt,w as z,v as It,j as Ca,k as M,l as V,m as y,p as $a,q as Ft,s as Q,F as L,x as j,y as W,z as O,A as N,B as Lt,C as Da,D as Gt,E as Ba,G as Ya,H as Aa,I as Sa,J as za,K as Pa,L as Ta,M as nt,T as kt,N as tt,O as Ia,P as it,Q as wt,R as U,S as ft,U as te,V as Fe,W as La,X as Ma,Y as ue,Z as Oa,_ as Na,$ as qa,a0 as Va}from"./vendor.js?v=c0f4c287";var tF=Ea(Kt=>{const Ga=function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&n(f)}).observe(document,{childList:!0,subtree:!0});function o(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerpolicy&&(c.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?c.credentials="include":s.crossorigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(s){if(s.ep)return;s.ep=!0;const c=o(s);fetch(s.href,c)}};Ga();const ja=(e,a)=>T(Kt,null,function*(){return new Promise((o,n)=>T(Kt,null,function*(){try{const s=yield fetch(e,a);if(Math.floor(s.status/100)!=2)throw s.status+" "+s.statusText;const c=J({},s);c.data=yield s.json(),o(c)}catch(s){const c=s;n("\u7F51\u7EDC\u5F02\u5E38\uFF1A"+((c==null?void 0:c.message)||s))}}))});class Ee{constructor(a){Zt(this,"config",{baseURL:"",headers:{}});Zt(this,"useRequest",a=>a);Zt(this,"useResponse",a=>a);Zt(this,"useError",a=>a);a.baseURL&&(this.config.baseURL=a.baseURL),a.headers&&(this.config.headers=a.headers)}static create(a){return new Ee(a)}Do(a,o){return T(this,null,function*(){return new Promise((n,s)=>T(this,null,function*(){try{const c=this.useRequest({baseURL:this.config.baseURL,headers:this.config.headers});a=`${c.baseURL||""}${a}`,o.headers==null&&(o.headers={}),c.headers&&(o.headers=J({},c.headers));const p=yield fetch(a,o),d=J({},p);d.data=yield p.json(),n(this.useResponse(d))}catch(c){this.useError(c),s(c)}}))})}TEXT(a,o){return T(this,null,function*(){return new Promise((n,s)=>T(this,null,function*(){try{const c=this.useRequest({baseURL:this.config.baseURL,headers:this.config.headers});a=`${c.baseURL||""}${a}`,o.headers==null&&(o.headers={}),c.headers&&(o.headers=J({},c.headers));const p=yield fetch(a,o),d=J({},p);d.data=yield p.text(),n(d)}catch(c){this.useError(c),s(c)}}))})}interceptors(){const a=this;return{requset:{use(o){a.useRequest=o}},response:{use(o,n){a.useResponse=o,n&&(a.useError=n)}}}}}const Xe=Ee.create({});Xe.interceptors().requset.use(e=>e);Xe.interceptors().response.use(e=>(e.data&&e.data.success==null&&e.data.success==0,e));const Ra="/cgi-bin/luci/istore";let je=!1;const I=(e,a)=>(e.indexOf("//")==-1&&(e=`${Ra}${e}`),ja(e,a).then(o=>(o!=null&&o.data&&o.data.success==-1001&&o.data.error=="Forbidden"&&(je||(je=!0,alert("\u767B\u5F55\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55"),location.reload())),o))),Ua={Statistics:{GET(){return I("/u/network/statistics/",{method:"GET"})}},Status:{GET(){return I("/u/network/status/",{method:"GET"})}},Device:{List:{GET(){return I("/network/device/list/",{method:"GET"})}}},Homebox:{Enable:{POST(){retur
2023-04-07 16:21:24 +08:00
`+c.value+`
2023-08-22 16:22:05 +08:00
`+n.value,disabled:""},null,8,Xx)]),t("div",Kx,[t("div",{class:"close",onClick:d,disabled:o.value},"\u5173\u95ED",8,Qx),o.value?E("",!0):(i(),r("div",{key:0,class:"next",onClick:l,disabled:o.value},"\u8FD0\u884C",8,tk))])])]),_:1}))}});var ak=Y(ek,[["__scopeId","data-v-3f7c551e"]]);const qt=e=>(O("data-v-7d3ebf99"),e=e(),N(),e),ok={class:"actioner-container"},nk={class:"actioner-container_header"},ik={class:"tabs"},rk=qt(()=>t("a",null,"\u8BBE\u5907\u4FE1\u606F",-1)),sk=[rk],dk=qt(()=>t("a",null,"\u5C5E\u6027",-1)),uk=[dk],lk=qt(()=>t("a",null,"\u81EA\u68C0\u65E5\u5FD7",-1)),ck=[lk],pk=qt(()=>t("a",null,"\u6269\u5C55\u4FE1\u606F",-1)),fk=[pk],mk={class:"actioner-container_body"},bk={key:0,class:"table"},vk={class:"tr"},gk=qt(()=>t("td",{class:"td left"},"\u8BBE\u5907",-1)),_k={class:"td left"},hk={class:"tr"},xk=qt(()=>t("td",{class:"td left"},"\u578B\u53F7",-1)),kk={class:"td left"},wk={class:"tr"},yk=qt(()=>t("td",{class:"td left"},"\u5E8F\u53F7",-1)),Fk={class:"td left"},Ek=["value"],Ck=["value"],$k=["value"],Dk={class:"actioner-container_footer"},Bk=["disabled"],Yk=P({props:{close:{type:Function,required:!0},disk:{type:Object,required:!0}},setup(e){const a=e,o=y(!1),n=y("info"),s=u=>{switch(n.value=u,u){case"info":break;case"attribute":d();break;case"log":p();break;case"extend":l();break}},c=()=>{o.value=!0,a.close()},f=it({log:"",attribute:"",extend:""}),p=()=>T(this,null,function*(){try{const u=yield S.Smart.Test.Result.POST({type:"selftest",devicePath:a.disk.path||""});if(u.data){const{result:m,error:b}=u.data;m&&m.result&&(f.log=m.result),b&&(f.log=b)}}catch(u){f.log=u}}),d=()=>T(this,null,function*(){try{const u=yield S.Smart.Attribute.Result.POST({devicePath:a.disk.path||""});if(u.data){const{result:m,error:b}=u.data;m&&m.result&&(f.attribute=m.result),b&&(f.attribute=b)}}catch(u){f.attribute=u}}),l=()=>T(this,null,function*(){try{const u=yield S.Smart.Extend.Result.POST({devicePath:a.disk.path||""});if(u.data){const{result:m,error:b}=u.data;m&&m.result&&(f.extend=m.result),b&&(f.extend=b)}}catch(u){f.extend=u}});return(u,m)=>(i(),M(he,null,{default:V(()=>[t("div",ok,[t("div",nk,[t("ul",ik,[t("li",{class:ot({"active cbi-tab":n.value=="info"}),onClick:m[0]||(m[0]=b=>s("info"))},sk,2),t("li",{class:ot({"active cbi-tab":n.value=="attribute"}),onClick:m[1]||(m[1]=b=>s("attribute"))},uk,2),t("li",{class:ot({"active cbi-tab":n.value=="log"}),onClick:m[2]||(m[2]=b=>s("log"))},ck,2),t("li",{class:ot({"active cbi-tab":n.value=="extend"}),onClick:m[3]||(m[3]=b=>s("extend"))},fk,2)])]),t("div",mk,[n.value=="info"?(i(),r("table",bk,[t("tr",vk,[gk,t("td",_k,h(e.disk.path),1)]),t("tr",hk,[xk,t("td",kk,h(e.disk.model),1)]),t("tr",wk,[yk,t("td",Fk,h(e.disk.serial),1)])])):n.value=="attribute"?(i(),r("textarea",{key:1,disabled:"",value:k(f).attribute},null,8,Ek)):n.value=="log"?(i(),r("textarea",{key:2,disabled:"",value:k(f).log},null,8,Ck)):n.value=="extend"?(i(),r("textarea",{key:3,disabled:"",value:k(f).extend},null,8,$k)):E("",!0)]),t("div",Dk,[t("div",{class:"close",onClick:c,disabled:o.value},"\u5173\u95ED",8,Bk)])])]),_:1}))}});var Ak=Y(Yk,[["__scopeId","data-v-7d3ebf99"]]);const Sk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=D(ox,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},zk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=D(Ux,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Pk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=D(ak,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Tk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=D(Ak,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Ik={class:"cbi-section"},Lk={class:"cbi-value"},Mk=t("label",{class:"cbi-value-title"}," \u542F\u7528 ",-1),Ok={class:"cbi-value-field"},Nk={class:"cbi-checkbox"},qk=["value"],Vk={class:"cbi-value"},Gk=t("label",{class:"cbi-value-title"}," \u7535\u6E90\u6A21\u5F0F ",-1),jk={class:"cbi-value-field"},Rk={class:"cbi-checkbox"},Uk=t("option",{value:"never"},"\u6C38\u4E0D",-1)