2023-04-17 16:22:41 +08:00
|
|
|
var ha=Object.defineProperty,xa=Object.defineProperties;var ka=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var wa=Object.prototype.hasOwnProperty,ya=Object.prototype.propertyIsEnumerable;var ke=(e,a,o)=>a in e?ha(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o,J=(e,a)=>{for(var o in a||(a={}))wa.call(a,o)&&ke(e,o,a[o]);if(je)for(var o of je(a))ya.call(a,o)&&ke(e,o,a[o]);return e},at=(e,a)=>xa(e,ka(a));var Fa=(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{f(o.next(d))}catch(l){s(l)}},p=d=>{try{f(o.throw(d))}catch(l){s(l)}},f=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,p);f((o=o.apply(e,a)).next())});import{d as te,a as P,c as G,u as w,o as i,b as r,e as t,t as h,n as It,f as E,r as Q,g as B,h as ot,i as Dt,w as z,v as Lt,j as Ea,k as M,l as V,m as y,p as Ca,q as Ft,s as K,F as L,x as R,y as W,z as N,A as q,B as Mt,C as $a,D as Vt,E as Da,G as Ba,H as Ya,I as Aa,J as Sa,K as za,L as Pa,M as nt,T as xt,N as tt,O as Ta,P as it,Q as wt,R as U,S as ft,U as ee,V as Fe,W as Ia,X as La,Y as ue,Z as Ma,_ as Oa,$ as Na,a0 as qa}from"./vendor.js?v=c0f4c287";var Ry=Fa(Qt=>{const Va=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 p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&n(p)}).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)}};Va();const ja=(e,a)=>T(Qt,null,function*(){return new Promise((o,n)=>T(Qt,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 f=yield fetch(a,o),d=J({},f);d.data=yield f.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 f=yield fetch(a,o),d=J({},f);d.data=yield f.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 Re=!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"&&(Re||(Re=!0,alert("\u767B\u5F55\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55"),location.reload())),o))),Ga={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-17 16:22:41 +08:00
|
|
|
`+n.value,disabled:""},null,8,qx)]),t("div",Vx,[t("div",{class:"close",onClick:d,disabled:o.value},"\u5173\u95ED",8,jx),o.value?E("",!0):(i(),r("div",{key:0,class:"next",onClick:l,disabled:o.value},"\u8FD0\u884C",8,Rx))])])]),_:1}))}});var Ux=Y(Gx,[["__scopeId","data-v-3f7c551e"]]);const qt=e=>(N("data-v-7d3ebf99"),e=e(),q(),e),Wx={class:"actioner-container"},Hx={class:"actioner-container_header"},Zx={class:"tabs"},Jx=qt(()=>t("a",null,"\u8BBE\u5907\u4FE1\u606F",-1)),Xx=[Jx],Kx=qt(()=>t("a",null,"\u5C5E\u6027",-1)),Qx=[Kx],tk=qt(()=>t("a",null,"\u81EA\u68C0\u65E5\u5FD7",-1)),ek=[tk],ak=qt(()=>t("a",null,"\u6269\u5C55\u4FE1\u606F",-1)),ok=[ak],nk={class:"actioner-container_body"},ik={key:0,class:"table"},rk={class:"tr"},sk=qt(()=>t("td",{class:"td left"},"\u8BBE\u5907",-1)),dk={class:"td left"},uk={class:"tr"},lk=qt(()=>t("td",{class:"td left"},"\u578B\u53F7",-1)),ck={class:"td left"},pk={class:"tr"},fk=qt(()=>t("td",{class:"td left"},"\u5E8F\u53F7",-1)),mk={class:"td left"},bk=["value"],vk=["value"],gk=["value"],_k={class:"actioner-container_footer"},hk=["disabled"],xk=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":f();break;case"extend":l();break}},c=()=>{o.value=!0,a.close()},p=it({log:"",attribute:"",extend:""}),f=()=>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&&(p.log=m.result),b&&(p.log=b)}}catch(u){p.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&&(p.attribute=m.result),b&&(p.attribute=b)}}catch(u){p.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&&(p.extend=m.result),b&&(p.extend=b)}}catch(u){p.extend=u}});return(u,m)=>(i(),M(he,null,{default:V(()=>[t("div",Wx,[t("div",Hx,[t("ul",Zx,[t("li",{class:ot({"active cbi-tab":n.value=="info"}),onClick:m[0]||(m[0]=b=>s("info"))},Xx,2),t("li",{class:ot({"active cbi-tab":n.value=="attribute"}),onClick:m[1]||(m[1]=b=>s("attribute"))},Qx,2),t("li",{class:ot({"active cbi-tab":n.value=="log"}),onClick:m[2]||(m[2]=b=>s("log"))},ek,2),t("li",{class:ot({"active cbi-tab":n.value=="extend"}),onClick:m[3]||(m[3]=b=>s("extend"))},ok,2)])]),t("div",nk,[n.value=="info"?(i(),r("table",ik,[t("tr",rk,[sk,t("td",dk,h(e.disk.path),1)]),t("tr",uk,[lk,t("td",ck,h(e.disk.model),1)]),t("tr",pk,[fk,t("td",mk,h(e.disk.serial),1)])])):n.value=="attribute"?(i(),r("textarea",{key:1,disabled:"",value:w(p).attribute},null,8,bk)):n.value=="log"?(i(),r("textarea",{key:2,disabled:"",value:w(p).log},null,8,vk)):n.value=="extend"?(i(),r("textarea",{key:3,disabled:"",value:w(p).extend},null,8,gk)):E("",!0)]),t("div",_k,[t("div",{class:"close",onClick:c,disabled:o.value},"\u5173\u95ED",8,hk)])])]),_:1}))}});var kk=Y(xk,[["__scopeId","data-v-7d3ebf99"]]);const wk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=B(Wh,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},yk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=B(Ix,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Fk=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=B(Ux,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Ek=e=>{const a=document.createElement("div");document.body.appendChild(a);const o=B(kk,at(J({},e),{close:()=>{n()}})),n=()=>{a.remove()};ue(o,a)},Ck={class:"cbi-section"},$k={class:"cbi-value"},Dk=t("label",{class:"cbi-value-title"}," \u542F\u7528 ",-1),Bk={class:"cbi-value-field"},Yk={class:"cbi-checkbox"},Ak=["value"],Sk={class:"cbi-value"},zk=t("label",{class:"cbi-value-title"}," \u7535\u6E90\u6A21\u5F0F ",-1),Pk={class:"cbi-value-field"},Tk={class:"cbi-checkbox"},Ik=t("option",{value:"never"},"\u6C38\u4E0D",-1)
|