const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["luci-static/quickstart/FastnetInstallDialog.js","luci-static/quickstart/app.js","luci-static/quickstart/vendor.js","luci-static/quickstart/installClient.js"])))=>i.map(i=>d[i]);
var kr=Object.defineProperty,wr=Object.defineProperties;var $r=Object.getOwnPropertyDescriptors;var ms=Object.getOwnPropertySymbols;var _l=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable;var fs=Math.pow,co=(s,t,n)=>t in s?kr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,ye=(s,t)=>{for(var n in t||(t={}))_l.call(t,n)&&co(s,n,t[n]);if(ms)for(var n of ms(t))yl.call(t,n)&&co(s,n,t[n]);return s},Ne=(s,t)=>wr(s,$r(t));var kl=(s,t)=>{var n={};for(var l in s)_l.call(s,l)&&t.indexOf(l)<0&&(n[l]=s[l]);if(s!=null&&ms)for(var l of ms(s))t.indexOf(l)<0&&yl.call(s,l)&&(n[l]=s[l]);return n};var Nn=(s,t,n)=>co(s,typeof t!="symbol"?t+"":t,n);var B=(s,t,n)=>new Promise((l,u)=>{var c=v=>{try{p(n.next(v))}catch(h){u(h)}},r=v=>{try{p(n.throw(v))}catch(h){u(h)}},p=v=>v.done?l(v.value):Promise.resolve(v.value).then(c,r);p((n=n.apply(s,t)).next())});import{defineComponent as X,computed as R,openBlock as i,createElementBlock as d,normalizeStyle as pt,createElementVNode as e,toDisplayString as a,unref as o,createCommentVNode as T,resolveComponent as At,createVNode as G,renderSlot as Ct,withDirectives as W,vModelCheckbox as gt,createBlock as Y,withCtx as pe,ref as x,watch as We,onMounted as nt,Fragment as V,renderList as oe,vModelSelect as Be,vModelText as Oe,createStaticVNode as Hn,shallowRef as Na,nextTick as ot,onUnmounted as lt,Teleport as Fo,withModifiers as Ge,normalizeClass as _e,withKeys as Qt,reactive as Xe,readonly as Cr,markRaw as Kn,onErrorCaptured as Sr,resolveDynamicComponent as Aa,mergeProps as Zl,inject as ba,Transition as fn,createApp as cn,createTextVNode as ue,provide as ma,TransitionGroup as xr,toRef as uo,onBeforeUnmount as ga,vShow as Bs,vModelRadio as Mt,createSlots as Pr,defineAsyncComponent as Tr,h as vo,isRef as Mr,Suspense as Er,render as Us,withAsyncContext as Ir,useCssVars as Dr,vModelDynamic as Lr}from"/luci-static/quickstart/card-runtime-v1.js";import{a as Ar,c as Nr,d as Fs,u as Yl,i as Or,b as zr,e as qr,f as Ql,g as Xl,h as Rr,j as ei,k as as,l as ta,o as ti,m as Vr,n as ss,p as Br,q as Ur,r as Fr}from"./vendor.js?v=B46K-l76";const Bn={language:void 0,numberFormat:new Intl.NumberFormat("en",{notation:"compact"})},tj=s=>B(null,null,function*(){const t=window.vue_lang||(navigator.language.toLowerCase().startsWith("zh")?"zh-cn":"en");let n={};const l=window.vue_lang_data||(t==="zh-cn"?"":`/luci-static/quickstart/i18n/${t}.json`);if(l)try{const r=yield Ar({url:l,method:"GET"});r.data&&(n=r.data)}catch(r){console.log(r)}const u=Nr({defaultLanguage:t,mutedLanguages:["zh-cn"],translations:n,setGlobalProperties:!1,provideDirective:!1,provideComponent:!1});s.use(u),Bn.language=u;const{$gettext:c}=u;window.$i18n=c;try{Bn.numberFormat=new Intl.NumberFormat(t,{notation:"compact"})}catch(r){console.error("Intl.NumberFormat unsupported lang",t,r)}}),Ae=()=>{if(Bn.language)return Bn.language;throw new Error("I18N Uninitialized!")},Hs=()=>({$gettext:(s,t,n)=>{if(Bn.language)return Bn.language.$gettext(s,t,n);throw new Error("I18N Uninitialized!")},$ngettext:(s,t,n,l,u)=>{if(Bn.language)return Bn.language.$ngettext(s,t,n,l,u);throw new Error("I18N Uninitialized!")}}),bs=s=>typeof s=="number"?Bn.numberFormat.format(s):"?",{$gettext:Hr}=Hs(),ni=(s,t)=>B(null,null,function*(){return new Promise((n,l)=>B(null,null,function*(){try{const u=yield fetch(s,t);if(Math.floor(u.status/100)!=2)throw u.status+" "+u.statusText;const c=ye({},u);c.data=yield u.json(),n(c)}catch(u){const c=u;l(Hr("网络异常:")+((c==null?void 0:c.message)||u))}}))});class Ho{constructor(t){Nn(this,"config",{baseURL:"",headers:{}});Nn(this,"useRequest",t=>t);Nn(this,"useResponse",t=>t);Nn(this,"useError",t=>t);t.baseURL&&(this.config.baseURL=t.baseURL),t.headers&&(this.config.headers=t.headers)}static create(t){return new Ho(t)}Do(t,n){return B(this,null,function*(){return new Promise((l,u)=>B(this,null,function*(){try{const c=this.useRequest({baseURL:this.config.baseURL,headers:this.config.headers});t=`${c.baseURL||""}${t}`,n.headers==null&&(n.headers={}),c.headers&&(n.headers=ye({},c.headers));const p=yield fetch(t,n),v=ye({},p);v.data=yield p.json(),l(this.useResponse(v))}catch(c){this.useError(c),u(c)}}))})}TEXT(t,n){return B(this,null,function*(){return new Promise((l,u)=>B(this,null,function*(){try{const c=this.useRequest({baseURL:this.config.baseURL,headers:this.config.headers});t=`${c.baseURL||""}${t}`,n.headers==null&&(n.headers={}),c.headers&&(n.headers=ye({},c.headers));const p=yield fetch(t,n),v=ye({},p);v.data=yield p.text(),l(v)}catch(c){this.useError(c),u(c)}}))})}interceptors(){const t=this;return{requset:{use(n){t.useRequest=n}},response:{use(n,l){t.useResponse=n,l&&(t.useError=l)}}}}}const ai=Ho.create({});ai.interceptors().requset.use((s=>s));ai.interceptors().response.use((s=>(s.data&&s.data.success==null&&s.data.success==0,s)));const{$gettext:si}=Hs(),Gr="/cgi-bin/luci/istore",jr="/cgi-bin/luci/admin";let Ms=!1;const Pe=(s,t)=>{if(!["GET","HEAD","OPTIONS"].includes((t.method||"GET").toUpperCase())){const n=new Headers(t.headers);n.has("Content-Type")||n.set("Content-Type","application/json"),t=Ne(ye({},t),{headers:n})}return s.indexOf("//")==-1&&(s=`${Gr}${s}`),ni(s,t).then(n=>(n!=null&&n.data&&n.data.success==-1001&&n.data.error=="Forbidden"&&(Ms||(Ms=!0,alert(si("登录过期,请重新登录")),location.reload())),n))},Wr=(s,t)=>(s.indexOf("//")==-1&&(s=`${jr}${s}`),ni(s,t).then(n=>(n!=null&&n.data&&n.data.success==-1001&&n.data.error=="Forbidden"&&(Ms||(Ms=!0,alert(si("登录过期,请重新登录")),location.reload())),n))),Jr={Statistics:{GET(){return Pe("/u/network/statistics/",{method:"GET"})}},Status:{GET(){return Pe("/u/network/status/",{method:"GET"})}},Device:{List:{GET(){return Pe("/network/device/list/",{method:"GET"})}}},Homebox:{Enable:{POST(){return Pe("/network/homebox/enable/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"}})}}},CheckPublickNet:{POST(s){return Pe("/network/checkPublicNet/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GetInterfaceConfig:{GET(){return Pe("/network/interface/config/",{method:"GET",headers:{"Content-Type":"application/json;charset=utf-8"}})}},POSTInterfaceConfig:{POST(s){return Pe("/network/interface/config/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},PortList:{GET(){return Pe("/network/port/list/",{method:"GET",headers:{"Content-Type":"application/json;charset=utf-8"}})}}},Kr={Version:{GET(){return Pe("/u/system/version/",{method:"GET"})}},CheckUpdate:{GET(){return Pe("/system/check-update/",{method:"GET"})}},AutoCheckUpdate:{POST(s){return Pe("/system/auto-check-update/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Reboot:{POST(){return Pe("/system/reboot/",{method:"POST"})}},Status:{GET(){return Pe("/system/status/",{method:"GET"})}}},Zr={Disk:{Status:{GET(){return Pe("/nas/disk/status/",{method:"GET"})}},Erase:{POST(s){return Pe("/nas/disk/erase",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Init:{POST:s=>Pe("/nas/disk/init/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})},InitRest:{POST:s=>Pe("/nas/disk/initrest/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})},Partition:{Format:{POST:s=>Pe("/nas/disk/partition/format",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})},Mount:{POST:s=>Pe("/nas/disk/partition/mount",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},Service:{Status:{GET(){return Pe("/u/nas/service/status/",{method:"GET"})}}},Linkease:{Enable:{POST(){return Pe("/u/nas/linkease/enable",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"}})}}},Sandbox:{POST(s){return Pe("/nas/sandbox/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GetSandbox:{GET(){return Pe("/nas/sandbox/",{method:"GET"})}},SandboxDisks:{GET(){return Pe("/nas/sandbox/disks/",{method:"GET"})}},SandboxCommit:{POST(){return Pe("/u/nas/sandbox/commit/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify({})})}},SandboxReset:{POST(){return Pe("/nas/sandbox/reset/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"}})}},SandboxExit:{POST(){return Pe("/nas/sandbox/exit/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"}})}}},Yr={User:{List:{GET(){return Pe("/share/user/list/",{method:"GET"})}},Create:{POST(s){return Pe("/share/user/create/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Update:{POST(s){return Pe("/share/user/update/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},Service:{List:{GET(){return Pe("/share/service/list/",{method:"GET"})}},Create:{POST(s){return Pe("/share/service/create/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Update:{POST(s){return Pe("/share/service/update/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}}},Qr={Check:{POST(s){return Pe("/app/check/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Install:{POST(s){return Pe("/app/install/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},Xr={Pppoe:{GET(){return Pe("/guide/pppoe/",{method:"GET"})},POST(s){return Pe("/guide/pppoe/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DnsConfig:{GET(){return Pe("/guide/dns-config/",{method:"GET"})},POST(s){return Pe("/guide/dns-config/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DhcpClient:{POST(s){return Pe("/guide/dhcp-client/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},ClientModel:{GET(){return Pe("/guide/client-mode/",{method:"GET"})},POST(s){return Pe("/guide/client-mode/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GatewayRouter:{POST(s){return Pe("/guide/gateway-router/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DockerStatus:{GET(){return Pe("/guide/docker/status/",{method:"GET"})}},DockerPartitionList:{GET(){return Pe("/guide/docker/partition/list/",{method:"GET"})}},DockerTransfer:{POST(s){return Pe("/guide/docker/transfer/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DockerSwitch:{POST(s){return Pe("/guide/docker/switch/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DownloadService:{Status:{GET(){return Pe("/guide/download-service/status/",{method:"GET"})}}},DownloadPartition:{List:{GET(){return Pe("/guide/download/partition/list/",{method:"GET"})}}},Aria2Init:{POST(s){return Pe("/guide/aria2/init/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},qbitorrentInit:{POST(s){return Pe("/guide/qbittorrent/init/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},transmissionInit:{POST(s){return Pe("/guide/transmission/init/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GetLan:{GET(){return Pe("/guide/lan/",{method:"GET"})}},LanIp:{POST(s){return Pe("/guide/lan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},SoftSource:{POST(s){return Pe("/guide/soft-source/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GetSoftSource:{GET(){return Pe("/guide/soft-source/",{method:"GET"})}},SoftSourceList:{GET(){return Pe("/guide/soft-source/list/",{method:"GET"})}},PostDdns:{POST(s){return Pe("/u/guide/ddns/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},GetDdns:{GET(){return Pe("/u/guide/ddns/",{method:"GET"})}},Ddnsto:{POST(s){return Pe("/guide/ddnsto/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},DdntoConfig:{GET(){return Pe("/guide/ddnsto/config/",{method:"GET"})}},DdnstoAddress:{POST(s){return Pe("/guide/ddnsto/address/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},ec={Create:{POST(s){return Pe("/raid/create/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Delete:{POST(s){return Pe("/raid/delete/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Add:{POST(s){return Pe("/raid/add/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Remove:{POST(s){return Pe("/raid/remove/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Recover:{POST(s){return Pe("/raid/recover/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Detail:{POST(s){return Pe("/raid/detail/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},List:{GET(){return Pe("/raid/list/",{method:"GET"})}},CreateList:{GET(){return Pe("/raid/create/list/",{method:"GET"})}},Autofix:{POST(){return Pe("/raid/autofix/",{method:"POST"})}}},tc={Log:{GET(){return Pe("/smart/log/",{method:"GET"})}},List:{GET(){return Pe("/u/smart/list/",{method:"GET"})}},Config:{GET(){return Pe("/smart/config/",{method:"GET"})},POST(s){return Pe("/smart/config/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}},Test:{POST(s){return Pe("/u/smart/test/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})},Result:{POST(s){return Pe("/smart/test/result/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},Attribute:{Result:{POST(s){return Pe("/smart/attribute/result/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}},Extend:{Result:{POST(s){return Pe("/smart/extend/result/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(s)})}}}},nc={List:{GET(){return Pe("/wireless/list-iface/",{method:"GET"})}},Switch:{POST(s){return Pe("/wireless/enable-iface/",{body:JSON.stringify(s),method:"POST"})}},Power:{POST(s){return Pe("/wireless/set-device-power/",{body:JSON.stringify(s),method:"POST"})}},Edit:{POST(s){return Pe("/wireless/edit-iface/",{body:JSON.stringify(s),method:"POST"})}},Setup:{POST(s){return Pe("/wireless/setup/",{body:JSON.stringify(s),method:"POST"})}}},ac={getInstalled:{GET(){return Wr("/store/installed/",{method:"GET"})}},needSetup:{GET(){return Pe("/guide/need/setup/",{method:"GET"})}},setPassword:{POST(s){return Pe("/system/setPassword/",{body:JSON.stringify(s),method:"POST"})}},completeGuide:{POST(){return Pe("/guide/finish/setup/",{method:"POST"})}}},sc=Pe,Gs=s=>{const t=(n,l)=>{if(s==="all"&&(!["/lanctrl/v2/devices/","/lanctrl/v2/device-traffic/"].includes(n.split("?")[0])||l.method!=="GET"))return Promise.reject(new Error("请选择设备所属的局域网"));const u=n.includes("?")?"&":"?";return sc(s?`${n}${u}network=${encodeURIComponent(s)}`:n,l)};return{routerContextV2:{GET(){return t("/lanctrl/v2/router-context/",{method:"GET"})}},lanDeviceMigrationV2:{PLAN(){return t("/lanctrl/v2/migration/plan/",{method:"GET"})},APPLY(n){return t("/lanctrl/v2/migration/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},rateLimitMigrationV2:{PLAN(){return t("/lanctrl/v2/rate-limit-migration/plan/",{method:"GET"})},APPLY(n){return t("/lanctrl/v2/rate-limit-migration/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},ROLLBACK(n){return t("/lanctrl/v2/rate-limit-migration/rollback/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},capabilityActionV2:{PLAN(n){return t("/lanctrl/v2/capability-action/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/capability-action/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceInventoryV2:{GET(){return t("/lanctrl/v2/devices/",{method:"GET"})},POST(n){return t("/lanctrl/v2/devices/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceClassificationV2:{GET(n){return t(`/lanctrl/v2/device-classification/?deviceId=${encodeURIComponent(n)}`,{method:"GET"})},POST(n){return t("/lanctrl/v2/device-classification/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceProfileV2:{GET(n){return t(`/lanctrl/v2/device-profile/?deviceId=${encodeURIComponent(n)}`,{method:"GET"})},POST(n){return t("/lanctrl/v2/device-profile/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceTrafficV2:{GET(){return t("/lanctrl/v2/device-traffic/",{method:"GET"})}},devicePolicyV2:{GET(n){return t(`/lanctrl/v2/device-policy/?deviceId=${encodeURIComponent(n)}`,{method:"GET"})},POST(n){return t("/lanctrl/v2/device-policy/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceNetworkPolicyV2:{GET(n){return t(`/lanctrl/v2/device-network-policy/?deviceId=${encodeURIComponent(n)}`,{method:"GET"})},PLAN(n){return t("/lanctrl/v2/device-network-policy/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/device-network-policy/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceRestrictionsV2:{PLAN(n){return t("/lanctrl/v2/device-restrictions/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/device-restrictions/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},rateLimitSettingsV2:{PLAN(n){return t("/lanctrl/v2/rate-limit-settings/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/rate-limit-settings/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},gatewayTargetsV2:{GET(){return t("/lanctrl/v2/gateway-targets/",{method:"GET"})}},gatewayTargetV2:{PLAN(n){return t("/lanctrl/v2/gateway-target/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/gateway-target/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},REFERENCES(n){return t(`/lanctrl/v2/gateway-target-references/?targetId=${encodeURIComponent(n)}`,{method:"GET"})}},lanDhcpSettingsV2:{GET(){return t("/lanctrl/v2/lan-dhcp-settings/",{method:"GET"})},PLAN(n){return t("/lanctrl/v2/lan-dhcp-settings/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/lan-dhcp-settings/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},floatingGatewayV2:{GET(){return t("/lanctrl/v2/floating-gateway/",{method:"GET"})},PLAN(n){return t("/lanctrl/v2/floating-gateway/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/floating-gateway/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},DRILL(){return t("/lanctrl/v2/floating-gateway/drill-plan/",{method:"GET"})}},networkRulesV2:{GET(){return t("/lanctrl/v2/network-rules/",{method:"GET"})},PLAN(n){return t("/lanctrl/v2/network-rules/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},APPLY(n){return t("/lanctrl/v2/network-rules/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},deviceGroupsV2:{GET(){return t("/lanctrl/v2/device-groups/",{method:"GET"})},POST(n){return t("/lanctrl/v2/device-groups/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},trafficInsightsV2:{GET(n,l){return t(`/lanctrl/v2/traffic-insights/?deviceId=${encodeURIComponent(n)}&range=${encodeURIComponent(l)}`,{method:"GET"})},QUOTA(n){return t("/lanctrl/v2/traffic-quota/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},advancedNetworkV2:{GET(n){return t(`/lanctrl/v2/advanced-network/?deviceId=${encodeURIComponent(n)}`,{method:"GET"})},PROBE(n){return t("/lanctrl/v2/management-probe/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},WEBHOOK(n){return t("/lanctrl/v2/network-webhook/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},EXPORT(){return t("/lanctrl/v2/policy-bundle/",{method:"GET"})},IMPORT_PLAN(n){return t("/lanctrl/v2/policy-import/plan/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})},IMPORT_APPLY(n){return t("/lanctrl/v2/policy-import/apply/",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify(n)})}},devicePolicyRulesV2:{GET(){return t("/lanctrl/v2/device-policy/rules/",{method:"GET"})}},listDevices:{GET(){return t("/lanctrl/listDevices/",{method:"GET"})}},staticDeviceConfig:{POST(n){return t("/lanctrl/staticDeviceConfig/",{body:JSON.stringify(n),method:"POST"})}},globalConfigs:{GET(n){return t("/lanctrl/globalConfigs/",{method:"GET",signal:n})}},speedLimitConfig:{POST(n){return t("/lanctrl/speedLimitConfig/",{body:JSON.stringify(n),method:"POST"})}},listStaticDevices:{GET(){return t("/lanctrl/listStaticDevices/",{method:"GET"})}},listSpeedLimitedDevices:{GET(){return t("/lanctrl/listSpeedLimitedDevices/",{method:"GET"})}},dhcpGatewayConfig:{POST(n){return t("/lanctrl/dhcpGatewayConfig/",{body:JSON.stringify(n),method:"POST"})}},dhcpTagsConfig:{POST(n){return t("/lanctrl/dhcpTagsConfig/",{body:JSON.stringify(n),method:"POST"})}},enableSpeedLimit:{POST(n){return t("/lanctrl/enableSpeedLimit/",{body:JSON.stringify(n),method:"POST"})}},enableFloatGateway:{POST(n){return t("/lanctrl/enableFloatGateway/",{body:JSON.stringify(n),method:"POST"})}},speedsForDevices:{GET(){return t("/lanctrl/speedsForDevices/",{method:"GET"})}},speedsForOneDevice:{POST(n){return t("/lanctrl/speedsForOneDevice/",{body:JSON.stringify(n),method:"POST"})}}}},oi=Gs(),oc={GET(){return Pe("/system/module-settings/",{method:"GET"})},POST(s){return Pe("/system/module-settings/",{body:JSON.stringify(s),method:"POST"})}},lc=Object.freeze(Object.defineProperty({__proto__:null,App:Qr,DeviceMangement:oi,Guide:Xr,GuidePage:ac,ModuleSettings:oc,Nas:Zr,Network:Jr,Quickwifi:nc,Raid:ec,Share:Yr,Smart:tc,System:Kr,createDeviceManagement:Gs},Symbol.toStringTag,{value:"Module"})),we=ye({},lc),li=Fs("app",{state:()=>({portitemStyle:{show:!1,left:0,top:0,portitem:{name:"",macAddress:"",linkSpeed:"",linkState:"",rx_packets:"",tx_packets:"",interfaceNames:[],master:"",duplex:""}}})}),ic=Fs("nas",{state:()=>({webdav:{}})}),os=Fs("network",{state:()=>({status:{},deviceList:{}}),getters:{},actions:{updateNetworkStatus(s){this.status=s},requestDeviceList(){we.Network.Device.List.GET().then(s=>{if(s!=null&&s.data){const{result:t}=s==null?void 0:s.data;t&&(this.deviceList=t)}})},incrTime(){this.status.uptimeStamp&&this.status.uptimeStamp++}}}),Oa=Fs("system",{state:()=>({version:{},checkUpdate:null,updateChecked:!1,systemStatus:{}}),getters:{},actions:{incrTime(){var s;(s=this.systemStatus)!=null&&s.uptime&&this.systemStatus.uptime++},requestVersion(){we.System.Version.GET().then(s=>{var t;(t=s==null?void 0:s.data)!=null&&t.result&&(this.version=s.data.result)})},requestCheckUpdate(){this.updateChecked||(this.updateChecked=!0,we.System.CheckUpdate.GET().then(s=>{var t;(t=s==null?void 0:s.data)!=null&&t.result&&(this.checkUpdate=s.data.result)}).finally(()=>{this.checkUpdate==null&&(this.checkUpdate={needUpdate:!1,msg:"skip"})}))},updateSystemStatus(s){this.systemStatus=s}}}),rc=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=li(),u=R(()=>l.portitemStyle.portitem),c=R(()=>l.portitemStyle.show),r=R(()=>({bottom:`calc(100% - ${l.portitemStyle.top}px)`,left:`${l.portitemStyle.left}px`})),p=g=>{switch(g){case"full":return t("全双工");case"half":return t("半双工")}},v=g=>{l.portitemStyle.show=!0},h=g=>{l.portitemStyle.show=!1};return(g,b)=>c.value?(i(),d("div",{key:0,class:"disk-item-tooltip",style:pt(r.value),onMouseenter:v,onMouseleave:h},[e("div",null,a(p(u.value.duplex)),1),e("div",null,a(o(t)("名称:"))+a(u.value.name||"--"),1),e("div",null,a(o(t)("MAC:"))+a(u.value.macAddress||"--"),1),e("div",null,a(o(t)("接收:"))+a(u.value.rx_packets||"--"),1),e("div",null,a(o(t)("发送:"))+a(u.value.tx_packets||"--"),1)],36)):T("",!0)}}),le=(s,t)=>{const n=s.__vccOpts||s;for(const[l,u]of t)n[l]=u;return n},cc=le(rc,[["__scopeId","data-v-4cfdbcec"]]),dc={id:"main"},uc=X({__name:"App",setup(s){return(t,n)=>{const l=At("router-view");return i(),d("div",dc,[G(l),G(cc)])}}}),nj=le(uc,[["__scopeId","data-v-425e333d"]]),vc={},pc={t:"1640593669834",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"54870",width:"128",height:"128"};function hc(s,t){return i(),d("svg",pc,[...t[0]||(t[0]=[e("path",{d:"M148.7872 57.4464h177.152c64.9216 0 118.0672 53.1456 118.0672 118.0672v295.2192H148.7872C83.8656 470.7328 30.72 417.5872 30.72 352.5632v-177.152C30.72 110.592 83.8656 57.4464 148.7872 57.4464z m0 531.3536h295.2192v295.2192c0 64.9216-53.1456 118.0672-118.0672 118.0672h-177.152C83.8656 1001.984 30.72 948.9408 30.72 883.9168v-177.152C30.72 641.9456 83.8656 588.8 148.7872 588.8z m0 0M768.7168 559.2064L562.0736 346.7264c-23.6544-17.7152-35.4304-53.1456-35.4304-82.6368s11.776-59.0848 35.4304-82.6368L686.08 57.4464C733.2864 10.24 810.0864 10.24 851.3536 57.4464l124.0064 124.0064c23.6544 23.6544 35.4304 53.1456 35.4304 82.6368s-11.776 59.0848-35.4304 82.6368L768.7168 559.2064z m0-478.208c-17.7152 0-29.4912 5.9392-41.3696 17.7152l-123.904 124.0064c-11.776 11.776-17.7152 23.6544-17.7152 41.3696s5.9392 29.4912 17.7152 41.3696l165.2736 165.2736 165.2736-165.2736c11.776-11.776 17.7152-23.6544 17.7152-41.3696s-5.9392-29.4912-17.7152-41.3696L809.984 98.7136c-11.776-11.776-23.552-17.7152-41.2672-17.7152z m0 0","p-id":"54871"},null,-1),e("path",{d:"M562.0736 588.8h295.2192c64.9216 0 118.0672 53.1456 118.0672 118.0672v177.152c0 64.9216-53.1456 118.0672-118.0672 118.0672h-177.152c-64.9216 0-118.0672-53.1456-118.0672-118.0672V588.8z m0 0","p-id":"54872"},null,-1)])])}const aj=le(vc,[["render",hc]]),mc={},fc={t:"1640598743438",class:"icon",viewBox:"0 0 1036 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"65341",width:"128",height:"128"};function bc(s,t){return i(),d("svg",fc,[...t[0]||(t[0]=[e("path",{d:"M984.177778 432.355556l-45.511111 0c-22.755556 0-45.511111-17.066667-51.2-39.822222l-28.444444-68.266667C847.644444 312.888889 853.333333 284.444444 870.4 267.377778l34.133333-34.133333c17.066667-17.066667 17.066667-39.822222 0-56.888889l-56.888889-56.888889c-17.066667-17.066667-39.822222-17.066667-56.888889 0l-34.133333 34.133333C739.555556 170.666667 711.111111 176.355556 694.044444 164.977778L625.777778 136.533333c-22.755556-5.688889-39.822222-28.444444-39.822222-51.2L585.955556 39.822222c0-22.755556-17.066667-39.822222-39.822222-39.822222L472.177778 0C449.422222 0 432.355556 17.066667 432.355556 39.822222l0 45.511111c0 22.755556-17.066667 45.511111-39.822222 51.2L329.955556 164.977778C312.888889 176.355556 284.444444 170.666667 267.377778 153.6L233.244444 119.466667c-17.066667-17.066667-39.822222-17.066667-56.888889 0l-56.888889 56.888889c-17.066667 17.066667-17.066667 39.822222 0 56.888889l34.133333 34.133333C170.666667 284.444444 176.355556 312.888889 164.977778 329.955556L136.533333 398.222222C130.844444 415.288889 108.088889 432.355556 85.333333 432.355556l-45.511111 0C17.066667 432.355556 0 449.422222 0 472.177778l0 79.644444c0 22.755556 17.066667 39.822222 39.822222 39.822222l45.511111 0c22.755556 0 45.511111 17.066667 51.2 39.822222l28.444444 68.266667C176.355556 711.111111 170.666667 739.555556 153.6 756.622222l-34.133333 34.133333c-17.066667 17.066667-17.066667 39.822222 0 56.888889l56.888889 56.888889c17.066667 17.066667 39.822222 17.066667 56.888889 0l34.133333-34.133333C284.444444 853.333333 312.888889 847.644444 329.955556 859.022222L398.222222 887.466667c22.755556 5.688889 39.822222 28.444444 39.822222 51.2l0 45.511111c0 22.755556 17.066667 39.822222 39.822222 39.822222l79.644444 0c22.755556 0 39.822222-17.066667 39.822222-39.822222l0-45.511111c0-22.755556 17.066667-45.511111 39.822222-51.2l68.266667-28.444444c17.066667-11.377778 45.511111-5.688889 62.577778 11.377778l34.133333 34.133333c17.066667 17.066667 39.822222 17.066667 56.888889 0l56.888889-56.888889c17.066667-17.066667 17.066667-39.822222 0-56.888889l-34.133333-34.133333c-17.066667-17.066667-17.066667-45.511111-11.377778-62.577778l28.444444-68.266667c5.688889-22.755556 28.444444-39.822222 51.2-39.822222l45.511111 0c22.755556 0 39.822222-17.066667 39.822222-39.822222L1035.377778 472.177778C1024 449.422222 1006.933333 432.355556 984.177778 432.355556L984.177778 432.355556zM711.111111 512c0 108.088889-91.022222 199.111111-199.111111 199.111111-108.088889 0-199.111111-85.333333-199.111111-199.111111 0-108.088889 85.333333-199.111111 199.111111-199.111111C620.088889 312.888889 711.111111 403.911111 711.111111 512L711.111111 512zM711.111111 512","p-id":"65342"},null,-1)])])}const sj=le(mc,[["render",bc]]),gc={},_c={t:"1640599890701",class:"icon",viewBox:"0 0 1565 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"76947",width:"128",height:"128"};function yc(s,t){return i(),d("svg",_c,[...t[0]||(t[0]=[e("path",{d:"M1206.477959 299.331595c-27.357038 0-53.867311 3.354494-79.465683 9.151581C1078.518669 130.792698 916.428217 0 723.365689 0 492.068443 0 304.575027 187.493416 304.575027 418.790662c0 16.055976 1.074741 31.786273 2.865975 47.386299-9.184149-0.911901-18.400865-1.40042-27.812989-1.40042C125.191018 464.743973 0 589.934991 0 744.371987c0 154.469563 125.191018 279.628013 279.595446 279.628013 59.990077 0 221.233764 0 394.527575 0l0-302.295274L496.986197 721.704726l285.457668-339.031868 285.457668 339.031868-177.136823 0 0 302.295274c139.748871 0 262.204185 0 315.71325 0 197.947713 0 358.40977-168.34349 358.40977-366.291203S1404.425673 299.331595 1206.477959 299.331595z","p-id":"76948"},null,-1)])])}const oj=le(gc,[["render",yc]]),kc={},wc={t:"1640599792937",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"68605",width:"128",height:"128"};function $c(s,t){return i(),d("svg",wc,[...t[0]||(t[0]=[e("path",{d:"M512 825.6c-211.2 0-377.6-57.6-377.6-128l0 0L134.4 896l0 0c6.4 70.4 172.8 128 377.6 128 204.8 0 371.2-57.6 377.6-128l0 0 0-204.8 0 0C889.6 768 723.2 825.6 512 825.6L512 825.6z","p-id":"68606"},null,-1),e("path",{d:"M512 544c-211.2 0-377.6-57.6-377.6-128l0 0 0 204.8 0 0c6.4 70.4 172.8 128 377.6 128 204.8 0 371.2-57.6 377.6-128l0 0L889.6 416l0 0C889.6 486.4 723.2 544 512 544L512 544z","p-id":"68607"},null,-1),e("path",{d:"M889.6 128 889.6 128c0-70.4-166.4-128-377.6-128C300.8 0 134.4 57.6 134.4 128l0 0 0 0 0 204.8 0 0c6.4 70.4 172.8 128 377.6 128 204.8 0 371.2-57.6 377.6-128l0 0L889.6 128 889.6 128 889.6 128zM512 217.6c-153.6 0-281.6-44.8-281.6-96 0-51.2 128-96 281.6-96 153.6 0 281.6 44.8 281.6 96C793.6 179.2 665.6 217.6 512 217.6L512 217.6z","p-id":"68608"},null,-1)])])}const lj=le(kc,[["render",$c]]),Cc={},Sc={t:"1640575557247",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4211",width:"128",height:"128"};function xc(s,t){return i(),d("svg",Sc,[...t[0]||(t[0]=[e("path",{d:"M560 800l-10.464-416h-75.072L464 800h96z m-14.144-493.984c9.44-9.312 14.144-20.672 14.144-34.016 0-13.6-4.704-24.992-14.144-34.208A46.784 46.784 0 0 0 512 224c-13.12 0-24.448 4.608-33.856 13.792A45.856 45.856 0 0 0 464 272c0 13.344 4.704 24.704 14.144 34.016 9.408 9.312 20.704 13.984 33.856 13.984 13.12 0 24.448-4.672 33.856-13.984zM512 32C246.912 32 32 246.912 32 512c0 265.088 214.912 480 480 480 265.088 0 480-214.912 480-480 0-265.088-214.912-480-480-480z m0 64c229.76 0 416 186.24 416 416s-186.24 416-416 416S96 741.76 96 512 282.24 96 512 96z","p-id":"4212"},null,-1)])])}const ij=le(Cc,[["render",xc]]),Pc={},Tc={t:"1640681742480",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"80687",width:"128",height:"128"};function Mc(s,t){return i(),d("svg",Tc,[...t[0]||(t[0]=[e("path",{d:"M899.892468 123.889088c0-44.342099-36.286708-80.620486-80.624646-80.620486H204.728017C160.385918 43.268602 124.107532 79.546988 124.107532 123.889088v802.847056c0 44.342099 36.278386 80.620486 80.620485 80.620486h614.539805c44.337938 0 80.624646-36.278386 80.624646-80.620486V123.889088z",fill:"#D0D0DB","p-id":"80688"},null,-1),e("path",{d:"M169.8768 977.7772V174.930143c0-44.342099 36.278386-80.620486 80.620486-80.620485h614.539804c9.936092 0 19.426974 1.905666 28.239639 5.23434-11.525534-30.507298-40.996782-52.389169-75.398629-52.389169H203.342457c-44.342099 0-80.620486 36.278386-80.620486 80.620486v802.851217c0 34.410168 21.881871 63.873094 52.385008 75.381985A79.730065 79.730065 0 0 1 169.8768 977.7772z",fill:"#FFFFFF","p-id":"80689"},null,-1),e("path",{d:"M820.657543 40.497481H206.117739c-44.342099 0-80.620486 36.278386-80.620486 80.620485v802.847057c0 44.342099 36.278386 80.620486 80.620486 80.620486h614.539804c44.337938 0 80.624646-36.278386 80.624647-80.620486V121.117966c0-44.342099-36.286708-80.620486-80.624647-80.620485z m19.60173 828.785749c0 40.846992-33.43237 74.279362-74.287684 74.279361H199.780776c-40.855313 0-74.279362-33.424048-74.279362-74.279361V129.593603c0-40.855313 33.424048-74.279362 74.279362-74.279362h566.203296c40.842831 0 74.283522 33.424048 74.283522 74.279362l-0.008321 739.689627z",fill:"#6E6E96","p-id":"80690"},null,-1),e("path",{d:"M815.106979 1024H200.567175C146.933914 1024 103.303319 980.369405 103.303319 926.736144V123.889088C103.303319 70.255827 146.933914 26.625232 200.567175 26.625232h614.539804c53.633261 0 97.268017 43.630595 97.268017 97.263856v802.847056c0 53.633261-43.634756 97.263856-97.268017 97.263856zM200.567175 59.911972C165.287391 59.911972 136.590059 88.609303 136.590059 123.889088v802.847056c0 35.279784 28.697331 63.977115 63.977116 63.977115h614.539804c35.279784 0 63.981276-28.697331 63.981276-63.977115V123.889088c0-35.279784-28.701492-63.977115-63.981276-63.977116H200.567175z",fill:"#6E6E96","p-id":"80691"},null,-1),e("path",{d:"M301.946104 941.515457h429.985632v65.841173H301.946104z",fill:"#8A8AA1","p-id":"80692"},null,-1),e("path",{d:"M731.931736 1024H301.946104a16.64337 16.64337 0 0 1-16.64337-16.64337V941.515457a16.64337 16.64337 0 0 1 16.64337-16.64337h429.985632a16.64337 16.64337 0 0 1 16.64337 16.64337v65.841173a16.64337 16.64337 0 0 1-16.64337 16.64337z m-413.342262-33.286741h396.698892v-32.554432H318.589474v32.554432z",fill:"#6E6E96","p-id":"80693"},null,-1),e("path",{d:"M337.230049 960.318304h20.804213v47.038326h-20.804213zM386.565159 960.318304h20.804213v47.038326h-20.804213zM435.891948 960.318304h20.804213v47.038326h-20.804213zM485.231219 960.318304h20.804213v47.038326h-20.804213zM534.558008 960.318304h20.804213v47.038326h-20.804213zM583.897279 960.318304h20.804213v47.038326h-20.804213zM633.224068 960.318304h20.804213v47.038326h-20.804213zM682.563339 960.318304h20.804213v47.038326h-20.804213z",fill:"#FFE599","p-id":"80694"},null,-1),e("path",{d:"M219.153659 140.794591m-26.874883 0a26.874882 26.874882 0 1 0 53.749765 0 26.874882 26.874882 0 1 0-53.749765 0Z",fill:"#ADADD1","p-id":"80695"},null,-1),e("path",{d:"M219.153659 184.312843c-23.995579 0-43.518252-19.522673-43.518253-43.518252s19.522673-43.518252 43.518253-43.518253 43.518252 19.522673 43.518252 43.518253-19.522673 43.518252-43.518252 43.518252z m0-53.749764c-5.642103 0-10.231512 4.589409-10.231512 10.231512s4.589409 10.231512 10.231512 10.231512 10.231512-4.589409 10.231511-10.231512-4.589409-10.231512-10.231511-10.231512z",fill:"#6E6E96","p-id":"80696"},null,-1),e("path",{d:"M801.28466 140.794591m-26.870721 0a26.870721 26.870721 0 1 0 53.741442 0 26.870721 26.870721 0 1 0-53.741442 0Z",fill:"#ADADD1","p-id":"80697"},null,-1),e("path",{d:"M801.28466 184.308683c-23.995579 0-43.514092-19.518512-43.514091-43.514092s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514092z m0-53.741443c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"80698"},null,-1),e("path",{d:"M801.280499 905.23291m-26.870721 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"80699"},null,-1),e("path",{d:"M801.280499 948.747001c-23.995579 0-43.514092-19.518512-43.514091-43.514091s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"80700"},null,-1),e("path",{d:"M219.153659 905.23291m-26.870722 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"80701"},null,-1),e("path",{d:"M219.153659 948.747001c-23.995579 0-43.514092-19.518512-43.514092-43.514091s19.518512-43.514092 43.514092-43.514092 43.514092 19.518512 43.514091 43.514092-19.522673 43.514092-43.514091 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"80702"},null,-1),e("path",{d:"M520.972857 777.43263c-142.542145 0-258.508988-115.971004-258.508988-258.52147a16.64337 16.64337 0 0 1 33.28674 0c0 124.19699 101.033579 225.23473 225.222248 225.23473s225.222248-101.03774 225.222248-225.23473c0-124.188668-101.033579-225.218087-225.222248-225.218087a16.64337 16.64337 0 0 1 0-33.286741c142.542145 0 258.508988 115.966843 258.508988 258.504828 0 142.550466-115.966843 258.521471-258.508988 258.52147z",fill:"#6E6E96","p-id":"80703"},null,-1),e("path",{d:"M520.968696 518.919481m-83.312551 0a83.312551 83.312551 0 1 0 166.625102 0 83.312551 83.312551 0 1 0-166.625102 0Z",fill:"#A9A9BA","p-id":"80704"},null,-1),e("path",{d:"M520.968696 618.875402c-55.114521 0-99.955921-44.83724-99.955921-99.95176 0-55.118682 44.8414-99.955921 99.955921-99.955921s99.95176 44.8414 99.95176 99.955921c0 55.11036-44.83724 99.95176-99.95176 99.95176z m0-166.625101c-36.761044 0-66.669181 29.908136-66.66918 66.66918s29.908136 66.66502 66.66918 66.66502 66.66502-29.908136 66.66502-66.66502c0-36.761044-29.903976-66.669181-66.66502-66.66918z",fill:"#6E6E96","p-id":"80705"},null,-1),e("path",{d:"M301.946104 941.515457h429.985632v36.977408H301.946104z",fill:"#6E6E96","p-id":"80706"},null,-1)])])}const rj=le(Pc,[["render",Mc]]),Ec={},Ic={t:"1640775712185",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2996",width:"128",height:"128"};function Dc(s,t){return i(),d("svg",Ic,[...t[0]||(t[0]=[e("path",{d:"M894.185422 128.023792 129.814578 445.743994 445.99982 577.744353 571.860343 893.929596Z","p-id":"2997"},null,-1)])])}const cj=le(Ec,[["render",Dc]]),Lc={class:"progress"},Ac=X({__name:"index",props:{value:{type:Number,required:!0},text:{type:String}},setup(s){const t=s,n=R(()=>t.value<60?"#2fc867":t.value<75?"#fdd835":t.value<90?"#f97316":"#dc2626");return(l,u)=>(i(),d("div",Lc,[e("div",{class:"progress-value",style:pt({width:`${s.value}%`,backgroundColor:n.value})},[e("span",null,a(s.text),1)],4),Ct(l.$slots,"default",{},void 0,!0)]))}}),Nc=le(Ac,[["__scopeId","data-v-65fc8e99"]]),Oc={},zc={height:"32",width:"64",t:"1649907260906",viewBox:"-8 248 1045 537",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2793","xmlns:xlink":"http://www.w3.org/1999/xlink"};function qc(s,t){return i(),d("svg",zc,[...t[0]||(t[0]=[e("path",{d:"M764.904497 251.418146 259.086289 251.418146c-143.076626 0-259.065314 115.989711-259.065314 259.065314 0 143.077649 115.988688 259.063267 259.065314 259.063267l505.818207 0c143.074579 0 259.063267-115.985618 259.063267-259.063267C1023.967764 367.407857 907.980099 251.418146 764.904497 251.418146zM764.904497 747.164974c-130.507356 0-236.682537-106.175181-236.682537-236.682537S634.397141 273.798876 764.904497 273.798876s236.683561 106.176205 236.683561 236.683561S895.411853 747.164974 764.904497 747.164974z","p-id":"2794",fill:"#52C41A"},null,-1)])])}const Rc=le(Oc,[["render",qc]]),Vc={},Bc={height:"32",width:"64",t:"1649907515643",viewBox:"-8 248 1045 537",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2971","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Uc(s,t){return i(),d("svg",Bc,[...t[0]||(t[0]=[e("path",{d:"M764.867148 249.793136 259.0735 249.793136c-143.070486 0-259.052011 115.984594-259.052011 259.052011 0 143.07151 115.982548 259.050987 259.052011 259.050987l505.793648 0c143.067416 0 259.050987-115.979478 259.050987-259.050987C1023.917112 365.778754 907.933541 249.793136 764.867148 249.793136zM259.0735 745.516428c-130.501216 0-236.671281-106.172111-236.671281-236.671281 0-130.501216 106.170065-236.671281 236.671281-236.671281S495.744781 378.344954 495.744781 508.84617C495.744781 639.34534 389.574716 745.516428 259.0735 745.516428z","p-id":"2972",fill:"#999"},null,-1)])])}const Fc=le(Vc,[["render",Uc]]),Hc={class:"checkbox_switch"},Gc={class:"checkbox_switch_on"},jc={class:"checkbox_switch_off"},Wc=X({__name:"index",props:{modelValue:{type:Boolean,required:!0}},emits:["update:modelValue"],setup(s,{emit:t}){const n=s,l=t,u=R({get:()=>n.modelValue.valueOf(),set:c=>l("update:modelValue",c)});return(c,r)=>(i(),d("label",Hc,[W(e("input",{type:"checkbox","onUpdate:modelValue":r[0]||(r[0]=p=>u.value=p)},null,512),[[gt,u.value]]),e("span",Gc,[G(Rc)]),e("span",jc,[G(Fc)]),Ct(c.$slots,"default",{},void 0,!0)]))}}),Jc=le(Wc,[["__scopeId","data-v-ffd6a79a"]]),Kc={},Zc={t:"1641369474206",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7685",width:"128",height:"128"};function Yc(s,t){return i(),d("svg",Zc,[...t[0]||(t[0]=[e("path",{d:"M757.76 637.44l-218.88 245.76c-14.72 16.64-40.32 16.64-54.4 0L265.6 637.44C244.48 613.76 261.12 576 293.12 576l437.76 0C762.24 576 779.52 613.76 757.76 637.44z","p-id":"7686"},null,-1)])])}const dj=le(Kc,[["render",Yc]]),Qc={},Xc={t:"1641369492518",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7831",width:"128",height:"128"};function ed(s,t){return i(),d("svg",Xc,[...t[0]||(t[0]=[e("path",{d:"M758.4 385.92 539.52 140.16c-14.72-16.64-40.32-16.64-54.4 0L266.24 385.92C244.48 409.6 261.76 448 293.12 448l437.76 0C762.88 448 779.52 409.6 758.4 385.92z","p-id":"7832"},null,-1)])])}const uj=le(Qc,[["render",ed]]),td={};function nd(s,t){return i(),d("article",null,[Ct(s.$slots,"default",{},void 0,!0)])}const ad=le(td,[["render",nd],["__scopeId","data-v-ba023651"]]),sd={class:"cover"},od={class:"thumbnail"},ld=X({__name:"item",emits:["click"],setup(s,{emit:t}){const n=t,l=()=>{n("click")};return(u,c)=>(i(),Y(ad,null,{default:pe(()=>[e("a",{onClick:l},[e("div",sd,[e("div",od,[Ct(u.$slots,"default",{},void 0,!0)])])])]),_:3}))}}),vj=le(ld,[["__scopeId","data-v-46fa4d41"]]),id={class:"select-editable"},rd={selected:"",value:""},cd=["value"],dd={value:"useInput"},ud=["placeholder"],vd=X({__name:"index",props:{modelValue:{type:String,required:!0},title:{type:String,default:""},options:{type:Array,default:[]}},emits:["update:modelValue"],setup(s,{emit:t}){const{$gettext:n,$ngettext:l}=Ae(),u=s,c=x(""),r=x(""),p=t,v=R({get:()=>u.modelValue.valueOf(),set:m=>p("update:modelValue",m)}),h=m=>{m===c.value||c.value==="useInput"&&m===r.value||(m===""||u.options.some(f=>f.key===m)?c.value=m:(r.value=m,c.value="useInput"))};We(()=>u.modelValue,m=>{h(m)}),nt(()=>{const m=v.value;h(m)});const g=m=>{c.value==="useInput"?v.value=r.value:v.value=c.value},b=m=>{v.value=r.value};return(m,f)=>(i(),d("label",null,[e("div",id,[W(e("select",{"onUpdate:modelValue":f[0]||(f[0]=k=>c.value=k),autocomplete:"off",onChange:g},[e("option",rd,a(o(n)("请选择%{title}",{title:s.title})),1),(i(!0),d(V,null,oe(s.options,(k,$)=>(i(),d("option",{value:k.key,key:$},a(k.value||k.key),9,cd))),128)),e("option",dd,a(o(n)("- -自定义- -")),1)],544),[[Be,c.value,void 0,{trim:!0}]]),c.value=="useInput"?W((i(),d("input",{key:0,type:"text","onUpdate:modelValue":f[1]||(f[1]=k=>r.value=k),required:"",placeholder:o(n)("请输入%{title}",{title:s.title}),onChange:b},null,40,ud)),[[Oe,r.value,void 0,{trim:!0}]]):T("",!0)])]))}}),Ta=le(vd,[["__scopeId","data-v-eb59d03b"]]),pd={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"},hd=X({__name:"loading",props:{size:{type:[Number,String],default:50},color:{type:String,default:"#fff"}},setup(s){const t=n=>{if(n==null)return;if(typeof n=="number")return n+"px";const l=n.toString();return parseInt(l)+""==l?l+"px":l};return(n,l)=>(i(),d("div",{class:"quick-loading",style:pt({width:t(s.size),height:t(s.size)})},[(i(),d("svg",pd,[e("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",style:pt({fill:s.color})},null,4)]))],4))}}),md=le(hd,[["__scopeId","data-v-95233f61"]]),fd={},bd={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":""};function gd(s,t){return i(),d("svg",bd,[...t[0]||(t[0]=[e("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":""},null,-1)])])}const _d=le(fd,[["render",gd]]),yd={},kd={width:"128",height:"128",viewBox:"0 0 50 50",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function wd(s,t){return i(),d("svg",kd,[...t[0]||(t[0]=[Hn('',1)])])}const $d=le(yd,[["render",wd]]),Cd=["href","title"],Sd=X({__name:"index",props:{type:{}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>{switch(l.type){case"disk":return"https://www.linkease.com/rd/8myYAEVA/";case"store":return"https://www.linkease.com/rd/1F58VUTT/";case"docker":return"https://www.linkease.com/rd/2Q28MDtf/";case"download":return"https://www.linkease.com/rd/1tJo1KX-/";case"ddns":return"https://www.linkease.com/rd/3yFiX5-X/";case"network-interface":return"https://www.linkease.com/rd/3ca51a3G/"}});return(c,r)=>(i(),d("a",{href:u.value,target:"_blank",title:o(t)("跳转教程")},[...r[0]||(r[0]=[e("svg",{t:"1684144670421",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4343"},[e("path",{d:"M512 74.666667c241.066667 0 437.333333 196.266667 437.333333 437.333333S753.066667 949.333333 512 949.333333 74.666667 753.066667 74.666667 512 270.933333 74.666667 512 74.666667zM512 704c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666666 42.666667-19.2 42.666667-42.666666-19.2-42.666667-42.666667-42.666667z m0-458.666667c-76.8 0-138.666667 61.866667-138.666667 138.666667 0 17.066667 14.933333 32 32 32s32-14.933333 32-32c0-40.533333 34.133333-74.666667 74.666667-74.666667s74.666667 34.133333 74.666667 74.666667c0 2.133333 0 6.4-2.133334 10.666667-6.4 14.933333-19.2 32-40.533333 51.2-10.666667 10.666667-21.333333 19.2-34.133333 27.733333-2.133333 2.133333-6.4 4.266667-8.533334 6.4l-6.4 4.266667c-8.533333 6.4-14.933333 17.066667-14.933333 27.733333v108.8c2.133333 17.066667 14.933333 29.866667 32 29.866667h2.133333c17.066667-2.133333 29.866667-14.933333 29.866667-32v-89.6l12.8-10.666667c10.666667-8.533333 19.2-17.066667 29.866667-25.6 27.733333-25.6 46.933333-49.066667 57.6-74.666667 4.266667-10.666667 6.4-23.466667 6.4-34.133333 0-76.8-61.866667-138.666667-138.666667-138.666667z",fill:"#666666","p-id":"4344"})],-1)])],8,Cd))}}),xd=le(Sd,[["__scopeId","data-v-b6321046"]]),Pd={install:s=>{s.component("icon-loading",md),s.component("icon-success",_d),s.component("icon-error",$d),s.component("GlHelp",xd)}},Go="quickstart.theme.preference",ii="(prefers-color-scheme: dark)",xo=new Set;let an=null,qn="light",Za=null,wl=null,$l=!1;function jo(s){return s==="system"||s==="normal"?"system":s==="light"||s==="dark"?s:null}function Td(s,t){return s==="system"?t?"dark":"light":s}function Md(s){return s==="system"?"normal":s}function Ed(){try{return jo(window.localStorage.getItem(Go))}catch(s){return null}}function ri(){return jo(document.body.getAttribute("theme"))||"system"}function ci(s){try{window.localStorage.setItem(Go,s)}catch(t){}}function Id(){const s={preference:an,effective:qn};xo.forEach(t=>t(s)),window.dispatchEvent(new CustomEvent("quickstart-theme-change",{detail:s}))}function ls(s=!1){var l;const t=Td(an,(l=Za==null?void 0:Za.matches)!=null?l:window.matchMedia(ii).matches),n=t!==qn;qn=t,document.body.dataset.quickstartTheme=qn,document.documentElement.dataset.quickstartTheme=qn,document.documentElement.style.colorScheme=qn,(n||s)&&Id()}function Wo(){const s=Md(an);document.body.getAttribute("theme")!==s&&document.body.setAttribute("theme",s)}function Dd(){an==="system"&&ls()}function Ld(){const s=ri();s!==an&&(an=s,ci(s),ls(!0))}function Ad(s){if(s.key!==Go)return;const t=jo(s.newValue)||"system";t!==an&&(an=t,Wo(),ls(!0))}function js(){return $l?{preference:an,effective:qn}:($l=!0,Za=window.matchMedia(ii),an=Ed()||ri(),Wo(),ls(!0),Za.addEventListener("change",Dd),wl=new MutationObserver(Ld),wl.observe(document.body,{attributes:!0,attributeFilter:["theme"]}),window.addEventListener("storage",Ad),{preference:an,effective:qn})}function di(){return js().preference}function Ws(){return js().effective}function Nd(s){return js(),an=s,ci(s),Wo(),ls(!0),{preference:an,effective:qn}}function is(s){const t=js();return xo.add(s),s(t),()=>xo.delete(s)}const $s=()=>Ws()==="dark",Od="modulepreload",zd=function(s){return"/"+s},Cl={},Po=function(t,n,l){let u=Promise.resolve();if(n&&n.length>0){let v=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),p=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));u=v(n.map(h=>{if(h=zd(h),h in Cl)return;Cl[h]=!0;const g=h.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const m=document.createElement("link");if(m.rel=g?"stylesheet":Od,g||(m.as="script"),m.crossOrigin="",m.href=h,p&&m.setAttribute("nonce",p),document.head.appendChild(m),g)return new Promise((f,k)=>{m.addEventListener("load",f),m.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function c(r){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=r,window.dispatchEvent(p),!p.defaultPrevented)throw r}return u.then(r=>{for(const p of r||[])p.status==="rejected"&&c(p.reason);return t().catch(c)})},ui=Symbol("quickstart-card-installer"),qd="quickstart-card-v1",vi=/^plugin\.[a-z][a-z0-9-]{0,47}$/,Jo=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),Sl=(s,t)=>Jo(s)&&Object.keys(s).length===t.length&&t.every(n=>Object.prototype.hasOwnProperty.call(s,n)),xl=(s,t,n)=>Number.isInteger(s)&&s>=t&&s<=n;function pi(s){const t=s,n=()=>{throw new Error("invalid_card_manifest")};Sl(t,["schemaVersion","id","title","glyph","abi","version","entry","apiBase","forms","stacked"])||n(),(t.schemaVersion!==1||t.abi!==qd||typeof t.id!="string"||!vi.test(t.id))&&n(),(typeof t.title!="string"||!t.title.trim()||Array.from(t.title).length>64||/[\x00-\x1f\x7f]/.test(t.title))&&n(),(typeof t.version!="string"||!/^[A-Za-z0-9.+-]{1,64}$/.test(t.version)||typeof t.glyph!="string"||!/^[a-z-]{1,32}$/.test(t.glyph))&&n(),(typeof t.entry!="string"||!/^\/luci-static\/[a-z][a-z0-9-]*\/(?:[a-zA-Z0-9_-]+\/)*[a-zA-Z0-9_-]+\.[a-f0-9]{8,64}\.js$/.test(t.entry))&&n(),(typeof t.apiBase!="string"||!/^\/cgi-bin\/luci\/admin\/services\/[a-z][a-z0-9-]*\/card$/.test(t.apiBase))&&n(),(!Jo(t.forms)||!Object.keys(t.forms).length||Object.keys(t.forms).some(l=>!["standard","summary"].includes(l)))&&n();for(const l of Object.values(t.forms))(!Sl(l,["minWidth","minHeight"])||!xl(l.minWidth,240,1200)||!xl(l.minHeight,100,1600))&&n();return(!Array.isArray(t.stacked)||new Set(t.stacked).size!==t.stacked.length||t.stacked.some(l=>l!=="summary"||!t.forms[l]))&&n(),new TextEncoder().encode(JSON.stringify(t)).length>8192&&n(),JSON.parse(JSON.stringify(t))}function Rd(s){if(!Array.isArray(s)||s.length>32||new TextEncoder().encode(JSON.stringify(s)).length>65536)throw new Error("invalid_card_registry");const t=new Map;for(const n of s)Jo(n)&&typeof n.id=="string"&&t.set(n.id,(t.get(n.id)||0)+1);return s.flatMap(n=>{try{const l=pi(n);return t.get(l.id)===1?[l]:[]}catch(l){return[]}})}const hi=[{id:"plugin.fastnet",zh:"外网测速",en:"Internet speed",glyph:"activity",description:"检测外网速率、NAT 和 IPv6",package:"app-meta-fastnet",minWidth:280,minHeight:260,singleHeight:280}],Es=new Map;function Is(s){return Es.get(s)}function Vd(s){Es.clear();for(const t of s)Es.set(t.id,t)}function mi(s){const t=hi.find(u=>u.id===s),n=Es.get(s),l=(n==null?void 0:n.forms.standard)||(n==null?void 0:n.forms.summary);return{id:s,zh:(n==null?void 0:n.title)||(t==null?void 0:t.zh)||"插件模块",en:(t==null?void 0:t.en)||(n==null?void 0:n.title)||"Plugin module",glyph:(n==null?void 0:n.glyph)||(t==null?void 0:t.glyph)||"grid",minWidth:(l==null?void 0:l.minWidth)||(t==null?void 0:t.minWidth)||240,minHeight:(l==null?void 0:l.minHeight)||(t==null?void 0:t.minHeight)||260,singleHeight:(l==null?void 0:l.minHeight)||(t==null?void 0:t.singleHeight)||280,extra:!0}}const To=new Map;function Bd(s){if(To.clear(),!!Array.isArray(s))for(const t of s.slice(0,32))t&&/^plugin\.[a-z][a-z0-9-]{0,47}$/.test(t.id)&&["unsupported_abi","unsupported_protocol"].includes(t.code)&&To.set(t.id,t.code)}function Ka(s){return To.has(s)}function Ud(s=fetch){let t,n;return{read(l=!1){if(t)return t;if(n&&!l)return Promise.resolve(n);const u=new AbortController,c=setTimeout(()=>u.abort(),8e3);return t=B(null,null,function*(){var h;const r=yield s("/cgi-bin/luci/istore/home/v1/cards/",{credentials:"same-origin",signal:u.signal,cache:"no-store"});if(!r.ok||!((h=r.headers.get("Content-Type"))!=null&&h.includes("application/json")))throw Error("card_discovery_unavailable");const p=yield r.text();if(new TextEncoder().encode(p).length>65536)throw Error("card_registry_too_large");const v=JSON.parse(p);if(v.schemaVersion!==1)throw Error("card_registry_incompatible");return n=Rd(v.cards),Vd(n),Bd(v.issues),n}).finally(()=>{clearTimeout(c),t=void 0}),t}}}const Fd=Ud(),Mo=Na([]),Eo=Na(""),Io=Na("unknown");function Hd(s=!1){return B(this,null,function*(){try{Mo.value=yield Fd.read(s),Io.value="ready",Eo.value=""}catch(t){Io.value="unavailable",Eo.value="无法确认插件注册信息"}return Mo.value})}function Ko(){return{cards:Mo,error:Eo,state:Io,discover:Hd}}const Gd={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.65","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},jd=["d"],Qe=X({__name:"HomeGlyph",props:{name:{}},setup(s){const t={activity:["M2 12h4l3-8 5 16 3-8h5"],devices:["M3 3h13v10H3z M7 17h5 M9 13v4 M17 8h4v12h-7v-4 M17 17h1"],network:["M9 3h6v5H9z M3 16h6v5H3z M15 16h6v5h-6z M12 8v4 M6 16v-4h12v4"],disk:["M5 3h14v18H5z M8 7h8 M8 11h8 M16 17h.01"],layers:["m12 3 10 5-10 5L2 8z M2 12l10 5 10-5 M2 16l10 5 10-5"],chip:["M6 6h12v12H6z M9 9h6v6H9z M9 2v4 M15 2v4 M9 18v4 M15 18v4 M2 9h4 M2 15h4 M18 9h4 M18 15h4"],grid:["M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z"],arrow:["M5 12h14 M14 7l5 5-5 5"],tune:["M4 7h16 M4 17h16 M8 4v6 M16 14v6"],shield:["m12 2 8 3v6c0 5-5 9-8 11-3-2-8-6-8-11V5z M8 11l3 3 5-6"],globe:["M2 12h20 M12 2c6 6 6 14 0 20-6-6-6-14 0-20 M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20"],terminal:["m5 7 5 5-5 5 M13 17h6"],download:["M12 3v12 M7 10l5 5 5-5 M3 16v5h18v-5"],folder:["M3 6h7l2 3h9v11H3z"],check:["m5 12 4 4L19 6"],clock:["M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18","M12 7v5l3 2"],power:["M12 3v9","M6.5 5.5a9 9 0 1 0 11 0"]};return(n,l)=>(i(),d("svg",Gd,[(i(!0),d(V,null,oe(t[s.name]||t.grid,(u,c)=>(i(),d("path",{key:c,d:u},null,8,jd))),128))]))}}),Wd={class:"widget-action-icon","data-widget-action-icon":"","aria-hidden":"true"},Jd={class:"widget-action-label","data-widget-action-label":""},Kd=X({__name:"WidgetPrimaryAction",props:{icon:{}},emits:["click"],setup(s){return(t,n)=>(i(),d("button",{type:"button",class:"widget-primary-action","data-widget-primary-action":"",onClick:n[0]||(n[0]=l=>t.$emit("click",l))},[e("span",Wd,[Ct(t.$slots,"icon",{},()=>[G(Qe,{name:s.icon},null,8,["name"])],!0)]),e("span",Jd,[Ct(t.$slots,"default",{},void 0,!0)])]))}}),_a=le(Kd,[["__scopeId","data-v-2a34e862"]]),Zd=["aria-label"],Yd={key:0},Qd={class:"network-dialog-actions"},Xd=["href"],eu=["aria-label"],tu={class:"network-dialog-body"},nu=X({__name:"NetworkWidgetDialog",props:{title:{},wide:{type:Boolean},headerAction:{}},emits:["close"],setup(s,{emit:t}){const n=t,l=window.vue_lang==="en",u=x(null);let c=null,r="";const p=()=>{var h;return Array.from(((h=u.value)==null?void 0:h.querySelectorAll('button:not(:disabled),a[href],input:not(:disabled),select:not(:disabled),iframe,[tabindex="0"]'))||[]).filter(g=>g.getClientRects().length)};function v(h){var g;if(h.key==="Escape")h.preventDefault(),h.stopPropagation(),n("close");else if(h.key==="Tab"){const b=p(),m=b[0],f=b[b.length-1];m?h.shiftKey&&(document.activeElement===m||document.activeElement===u.value)?(h.preventDefault(),f.focus()):!h.shiftKey&&(document.activeElement===f||document.activeElement===u.value)&&(h.preventDefault(),m.focus()):(h.preventDefault(),(g=u.value)==null||g.focus())}}return nt(()=>B(null,null,function*(){var h;c=document.activeElement,r=document.body.style.overflow,document.body.style.overflow="hidden",yield ot(),(h=u.value)==null||h.focus()})),lt(()=>{document.body.style.overflow=r,c!=null&&c.isConnected&&c.focus({preventScroll:!0})}),(h,g)=>(i(),Y(Fo,{to:"body"},[e("div",{class:"network-dialog-shade",onClick:g[1]||(g[1]=Ge(b=>h.$emit("close"),["self"]))},[e("section",{ref_key:"element",ref:u,class:_e(["network-dialog home-semantic-colors",{"network-dialog-wide":s.wide}]),role:"dialog","aria-modal":"true","aria-label":s.title,tabindex:"-1",onKeydown:v},[e("header",null,[e("div",null,[s.wide?T("",!0):(i(),d("small",Yd,"QUICKSTART")),e("h2",null,a(s.title),1)]),e("div",Qd,[s.headerAction?(i(),d("a",{key:0,"data-network-dialog-open":"",href:s.headerAction.href,target:"_blank",rel:"noopener"},a(s.headerAction.label)+" ↗",9,Xd)):T("",!0),e("button",{"data-network-dialog-close":"",onClick:g[0]||(g[0]=b=>h.$emit("close")),"aria-label":l?"Close details":"关闭详情"},"×",8,eu)])]),e("div",tu,[Ct(h.$slots,"default",{},void 0,!0)])],42,Zd)])]))}}),na=le(nu,[["__scopeId","data-v-5faf698a"]]),au=["aria-label","aria-expanded","onKeydown"],su=["aria-label"],ou=["disabled","data-widget-menu-item","onClick"],lu=X({__name:"WidgetMenu",props:{label:{},items:{}},emits:["select"],setup(s,{emit:t}){const n=t,l=x(!1),u=x(null),c=x(null);function r(){return B(this,null,function*(){var b,m;l.value=!0,yield ot(),(m=(b=u.value)==null?void 0:b.querySelector("[role=menuitem]:not(:disabled)"))==null||m.focus()})}function p(){l.value?l.value=!1:r()}function v(b){var m;l.value=!1,(m=c.value)==null||m.focus({preventScroll:!0}),n("select",b)}function h(b){var m,f,k;if(b.key==="Escape")b.preventDefault(),b.stopPropagation(),l.value=!1,(m=c.value)==null||m.focus({preventScroll:!0});else if(["ArrowDown","ArrowUp","Home","End"].includes(b.key)){b.preventDefault();const $=Array.from(((f=u.value)==null?void 0:f.querySelectorAll("[role=menuitem]:not(:disabled)"))||[]),w=$.indexOf(document.activeElement);(k=$[b.key==="Home"?0:b.key==="End"?$.length-1:(w+(b.key==="ArrowDown"?1:-1)+$.length)%$.length])==null||k.focus()}else b.key==="Tab"&&(l.value=!1)}function g(b){var m;(m=u.value)!=null&&m.contains(b.target)||(l.value=!1)}return nt(()=>document.addEventListener("click",g)),lt(()=>document.removeEventListener("click",g)),(b,m)=>s.items.length?(i(),d("div",{key:0,class:"widget-menu",ref_key:"root",ref:u},[e("button",{ref_key:"trigger",ref:c,type:"button",class:"widget-menu-trigger","aria-label":s.label,"aria-haspopup":"menu","aria-expanded":l.value,onClick:p,onKeydown:Qt(Ge(r,["prevent"]),["down"]),"data-widget-more":""},"⋮",40,au),l.value?(i(),d("div",{key:0,class:"widget-menu-options",role:"menu","aria-label":s.label,onKeydown:h},[(i(!0),d(V,null,oe(s.items,f=>(i(),d("button",{key:f.id,type:"button",role:"menuitem",disabled:f.disabled,"data-widget-menu-item":f.id,onClick:k=>v(f.id)},a(f.label),9,ou))),128))],40,su)):T("",!0)],512)):T("",!0)}}),za=le(lu,[["__scopeId","data-v-a230b604"]]);class Pl extends Error{constructor(n,l="card_request_failed"){super(l);Nn(this,"status");this.status=n}}function iu(s,t,n,l={}){const u=Xe({preference:di(),effective:Ws()}),c=Xe({form:n}),r=Na(null),p=is(m=>Object.assign(u,m)),v=new Set;let h=!1;function g(k){return B(this,arguments,function*(m,f={}){var C,y,P,_,D,E;if(h)throw new Error("card_unmounted");if(!/^\/[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*\/?(?:\?[^#\x00-\x1f\x7f]*)?$/.test(m))throw new Error("invalid_card_path");const $=new AbortController;v.add($);const w=()=>$.abort();(C=f.signal)==null||C.addEventListener("abort",w,{once:!0}),(y=f.signal)!=null&&y.aborted&&w();const S=setTimeout(w,8e3);try{const A=new Headers(f.headers);f.body&&A.set("Content-Type","application/json");const U=((_=(P=window.L)==null?void 0:P.env)==null?void 0:_.token)||window.luci_token||window.token;let q=s+m;if(U&&f.method==="POST"){A.set("X-CSRF-Token",String(U));const F=q.indexOf("?"),Z=F<0?q:q.slice(0,F),Q=new URLSearchParams(F<0?"":q.slice(F+1));Q.set("token",String(U)),q=Z+"?"+Q.toString()}const z=yield fetch(q,Ne(ye({},f),{headers:A,signal:$.signal,credentials:"same-origin",cache:"no-store",redirect:"manual"}));if(z.type==="opaqueredirect")throw new Pl(401);if(!z.ok)throw new Pl(z.status);if(!((D=z.headers.get("Content-Type"))!=null&&D.includes("application/json")))throw new Error("invalid_card_response");const N=yield z.text();if(new TextEncoder().encode(N).length>8192)throw new Error("card_response_too_large");return JSON.parse(N)}finally{clearTimeout(S),v.delete($),(E=f.signal)==null||E.removeEventListener("abort",w)}})}function b(){var f;const m=r.value;r.value=null,(f=m==null?void 0:m.onClose)==null||f.call(m)}return{context:{theme:Cr(u),get form(){return c.form},apiBase:s,locale:t,request:g,components:l,openDetails(m,f={},k={}){h||(r.value=ye({component:m,props:f},k))}},details:r,closeDetails:b,setForm(m){c.form=m},dispose(){h=!0,p();for(const m of v)m.abort();v.clear(),r.value=null}}}const ru=s=>import(s);function cu(s=ru,t=15e3){const n=new Map,l=new Map;return function(c){const r=pi(c),p=r.entry,v=n.get(p);if(v)return v;const h=l.get(p)||0;if(h>3)return Promise.reject(new Error("card_reload_required"));let g;const b=new Promise((k,$)=>{g=setTimeout(()=>$(new Error("card_load_timeout")),t)}),m=h?p+"?qs-card-retry="+h:p,f=Promise.race([Promise.resolve().then(()=>s(m)),b]).then(k=>{const $=k.default;if(k.apiVersion!==1||!$||!(typeof $=="function"||typeof $=="object"&&(typeof $.setup=="function"||typeof $.render=="function")))throw new Error("card_export_incompatible");return k.default}).catch(k=>{throw n.delete(p),l.set(p,h+1),k}).finally(()=>clearTimeout(g));return n.set(p,f),f}}const du=cu(),uu=["aria-busy","data-card-state"],vu=["role"],pu=X({__name:"CardShell",props:{manifest:{},form:{},rediscover:{type:Function}},setup(s){const t=s,n=R(()=>window.vue_lang==="en"?mi(t.manifest.id).en:t.manifest.title),l=x(null),u=Na(null),c=x("waiting"),r=iu(t.manifest.apiBase,window.vue_lang||"zh-cn",t.form,{PrimaryAction:Kn(_a),Menu:Kn(za)});We(()=>t.form,f=>r.setForm(f));let p=!0,v=0,h=!1,g;function b(){return B(this,arguments,function*(f=t.manifest){const k=++v;c.value="loading";try{const $=yield du(f);p&&v===k&&(u.value=Kn($),c.value="ready")}catch($){if(!p||v!==k)return;if(!h&&t.rediscover){h=!0;try{const w=yield t.rediscover();if(p&&v===k&&w&&w.entry!==f.entry){yield b(w);return}}catch(w){}}p&&v===k&&(c.value="error")}})}function m(){u.value=null,b()}return Sr(()=>(u.value=null,c.value="error",!1)),nt(()=>{g=new IntersectionObserver(f=>{f.some(k=>k.isIntersecting)&&(g==null||g.disconnect(),b())},{rootMargin:"100px"}),l.value&&g.observe(l.value)}),lt(()=>{p=!1,v++,g==null||g.disconnect(),r.dispose()}),(f,k)=>(i(),d("section",{ref_key:"root",ref:l,class:"qs-card-shell","aria-busy":c.value==="loading","data-card-state":c.value},[u.value?(i(),Y(Aa(u.value),{key:0,context:o(r).context},null,8,["context"])):(i(),d("div",{key:1,class:"qs-card-placeholder",role:c.value==="error"?"status":void 0},[e("h2",null,a(n.value),1),e("p",null,a(c.value==="error"?"卡片暂时无法加载":"正在准备卡片…"),1),c.value==="error"?(i(),d("button",{key:0,onClick:m},"重试")):T("",!0)],8,vu)),o(r).details.value?(i(),Y(na,{key:2,title:n.value,wide:o(r).details.value.wide,"header-action":o(r).details.value.headerAction,onClose:k[1]||(k[1]=$=>o(r).closeDetails())},{default:pe(()=>[(i(),Y(Aa(o(r).details.value.component),Zl(o(r).details.value.props,{onClose:k[0]||(k[0]=$=>o(r).closeDetails())}),null,16))]),_:1},8,["title","wide","header-action"])):T("",!0)],8,uu))}}),Un=[{id:"traffic",zh:"网络流量",en:"Network traffic",glyph:"activity",minWidth:440,minHeight:280,singleHeight:300},{id:"connection",zh:"网络连接",en:"Connection & IP",glyph:"network",minWidth:300,minHeight:220,singleHeight:240},{id:"networkInterface",zh:"网络接口",en:"Network interfaces",glyph:"network",minWidth:280,minHeight:260,singleHeight:280,extra:!0},{id:"applications",zh:"应用工具",en:"Apps & tools",glyph:"grid",minWidth:240,minHeight:176,singleHeight:240},{id:"devices",zh:"设备列表",en:"LAN devices",glyph:"devices",minWidth:400,minHeight:300,singleHeight:340},{id:"system",zh:"系统信息",en:"System information",glyph:"chip",minWidth:260,minHeight:260,singleHeight:280},{id:"storage",zh:"磁盘信息",en:"Disks",glyph:"disk",minWidth:380,minHeight:280,singleHeight:330},{id:"sharing",zh:"存储服务",en:"Storage services",glyph:"folder",minWidth:280,minHeight:280,singleHeight:300},{id:"docker",zh:"Docker",en:"Docker",glyph:"layers",minWidth:280,minHeight:250,singleHeight:260,extra:!0},{id:"downloads",zh:"下载服务",en:"Downloads",glyph:"download",minWidth:280,minHeight:250,singleHeight:260,extra:!0},{id:"remote",zh:"远程域名",en:"Remote access",glyph:"globe",minWidth:280,minHeight:250,singleHeight:280,extra:!0}],rn=s=>s.startsWith("plugin.")?mi(s):Un.find(t=>t.id===s),Js=Symbol("quickstart-home-widget");function fa(s,t){const n=ba(Js,void 0);return n&&We(()=>({value:n.data[s],physical:s==="raid"?n.data.disks:void 0,bounded:n.bounded()}),l=>{l.value&&t(l.value)},{immediate:!0}),!!n}function qa(){return ba(Js,void 0)}const hu={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},mu=["fill"],fu=X({__name:"flow",props:{color:{type:String,default:"#2c2c2c"}},setup(s){return(t,n)=>(i(),d("svg",hu,[e("path",{d:"M879.674 544.51l-158.254-0.221c-8.534 2.287-17.305-2.776-19.588-11.307l-23.862-75.877-74.742 350.891c0 0-1.523 18.507-11.518 18.507s-26.9 0.281-26.9 0.281c-8.259 2.213-16.748-2.687-18.961-10.949l-92.741-457.648-70.305 330.634c-2.261 8.291-11.94 15.206-20.385 12.986l-24.876 0.339c-8.723 2.293-17.685-2.789-20.023-11.349L270.629 544.51 143.993 544.51c-8.831 0-15.993-7.159-15.993-15.993l0-31.986c0-8.831 7.162-15.993 15.993-15.993l157.429-0.516c9.565-0.304 17.685 0.788 20.023 9.351l24.386 76.092 68.642-358.907c0 0 3.4-10.894 14.397-10.894 10.994 0 34.107-0.448 34.107-0.448 8.262-2.213 16.751 2.687 18.965 10.949l91.912 454.126 67.948-326.182c2.213-8.262 8.707-15.161 16.965-12.948l27.316-0.333c8.531-2.287 17.301 2.776 19.588 11.31l46.665 148.4 127.337 0c8.835 0 15.993 7.162 15.993 15.993l0 31.986C895.667 537.352 888.508 544.51 879.674 544.51z","p-id":"5314",fill:s.color},null,8,mu)]))}}),{$gettext:Ua,$ngettext:gs}=Hs(),bu=s=>{},gu=()=>new Date().getTime(),_u=(s=0)=>{if(!Number.isFinite(s)||s<0)return"0 B";const t=1e3;if(s=t;r/=t)n*=t,l++;let u=[" KB"," MB"," GB"," TB"," PB"," EB"];return(s/100/(n/100)).toFixed(1)+u[l]},yu=s=>{if(s==null)return 0;if(s<1e4)return s;let n=parseInt(`${s/1e4}`),l=s%1e4;return`${n}万${l}`},ku=s=>{if(s)try{var t=new Date(s),n=t.getHours(),l=t.getMinutes(),u=t.getSeconds();return n<10&&(n=`0${n}`),l<10&&(l=`0${l}`),u<10&&(u=`0${u}`),`${n}:${l}:${u}`}catch(c){}return""},wu=s=>{if(s){let t=Math.floor(s/86400),n=Math.floor(s/3600)%24,l=Math.floor(s/60)%60,u=s%60;return(t>0?gs("%{ days }天","%{ days }天",t,{days:bs(t)}):"")+gs("%{ hours }小时","%{ hours }小时",n,{hours:bs(n)})+gs("%{ minutes }分","%{ minutes }分",l,{minutes:bs(l)})+gs("%{ seconds }秒","%{ seconds }秒",u,{seconds:bs(u)})}},$u=s=>/^\d+\.\d+\.\d+\.\d+$/.test(s),Cu=s=>s.length<3?Ua("用户名太短"):s.toLowerCase()!=s?Ua("用户名只能为小写"):new RegExp("^\\d").exec(s)?Ua("用户名不能以数字开头"):new RegExp("^_").exec(s)?Ua("用户名不能以_开头"):new RegExp("^[a-z0-9_]+$").exec(s)?!0:Ua("非法的用户名"),Su=(s,t)=>{let n=!0,l=null;const u=()=>{l=null,n&&s().finally(()=>{n&&(l=setTimeout(u,t))})};return l=setTimeout(u,0),()=>{n=!1,l!=null&&clearTimeout(l)}},xu=Object.freeze(Object.defineProperty({__proto__:null,UnixDate:gu,byteToSize:_u,checkIsIP:$u,checkSmabaUserName:Cu,dateForm:ku,easyInterval:Su,formatDate:bu,numberToSum:yu,stampForm:wu},Symbol.toStringTag,{value:"Module"})),Fn=ye({},xu),Pu={class:"title_box"},Tu={class:"display_flex"},Mu={class:"network_tag"},Eu={class:"tag_item"},Iu={class:"tag_item"},Du={class:"speed"},Lu={class:"speed_item"},Au={style:{color:"#1596fd"}},Nu={class:"speed_item"},Ou={style:{color:"#00a63e"}},zu=X({__name:"NetworkFlow",setup(s){const{$gettext:t}=Ae();Yl([Or,zr,qr,Ql,Xl,Rr]);const n=x(),l=q=>{var N;const z=(N=n.value)==null?void 0:N[q];return!z||z.startTime==0?"":h(z.startTime*1e3)+"-"+h(z.endTime*1e3)},u=R(()=>{var z;let q=[];return(z=n.value)==null||z.forEach(N=>{q.push({value:N.uploadSpeed})}),q}),c=R(()=>{var z;let q=[];return(z=n.value)==null||z.forEach(N=>{q.push({value:N.downloadSpeed})}),q}),r=R(()=>{var z;let q="";if(n.value){let N=((z=n.value)==null?void 0:z.length)||0;if(N>0){let F=n.value[N-1];q=g(F.uploadSpeed)+"/s"}}return q}),p=R(()=>{var z;let q="";if(n.value){let N=((z=n.value)==null?void 0:z.length)||0;if(N>0){let F=n.value[N-1];q=g(F.downloadSpeed)+"/s"}}return q});R(()=>{var z;let q=[];return(z=n.value)==null||z.forEach(N=>{q.push({value:N.downloadSpeed+N.uploadSpeed})}),q});const v=()=>B(null,null,function*(){var q;try{const z=yield we.Network.Statistics.GET();if(z.data&&(q=z.data.result)!=null&&q.items){const N=z.data.result.slots||10;if(z.data.result.items.lengthN?n.value=z.data.result.items.slice(N-z.data.result.items.length):n.value=z.data.result.items}}catch(z){console.log(z)}}),h=Fn.dateForm,g=Fn.byteToSize,b=x(),m=x();let f=null,k=null,$=null,w=null;const S=q=>{const z=$s();return k=z?"dark":"light",f=ei(q,z?"dark":"v5"),f.setOption({animation:!1,backgroundColor:z?"#2c2c2c":"#fff",color:["transparent","transparent"],tooltip:{trigger:"axis",formatter:N=>{if(Array.isArray(N)){let F="";N.length>0&&(F=l(N[0].axisValue));for(let Z=0;Z${N[Z].seriesName}: ${g(N[Z].value)}/s`;return F.toString()}else{const F=N;return`${l(F.axisValue)}
${F.seriesName}: ${g(F.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:"",textStyle:{fontSize:12,color:z?"#cccccc":"rgba(0, 0, 0, 0.6)"},top:"10px",left:"10px"},yAxis:{type:"value",name:"",minInterval:1e4,interval:1e3,axisLabel:{formatter:function(N,F){return`${g(N)}/s`},color:"#fff",show:!1},nameTextStyle:{color:"#fff"},splitLine:{lineStyle:{color:["#999"]},show:!1}},series:[{name:t("下载"),data:c.value,type:"line",symbol:"none",showSymbol:!1,symbolSize:0,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:t("上传"),data:u.value,type:"line",symbol:"none",showSymbol:!1,symbolSize:0,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}}}],grid:{left:"2%",right:"2%",bottom:"0%",top:"10%",containLabel:!0}}),f},C=()=>{if(!f||!b.value)return;const q=Math.max(b.value.clientWidth,50),z=Math.max(b.value.clientHeight,50);f.resize({width:q,height:z})};let y=!1,P;const _=fa("traffic",q=>{const z=Math.max(1,Math.min(60,q.slots||10)),N=q.items.slice(-z);n.value=[...Array.from({length:Math.max(0,z-N.length)},()=>({downloadSpeed:0,uploadSpeed:0,startTime:0,endTime:0})),...N]});function D(){var q;f&&(f.setOption({xAxis:{data:((q=n.value)==null?void 0:q.map((z,N)=>N))||[]},series:[{name:t("下载"),data:c.value},{name:t("上传"),data:u.value}]}),C())}function E(){!f||!b.value||(f.dispose(),f=null,S(b.value),D())}We(n,D);function A(){return B(this,null,function*(){if(y)try{document.hidden||(yield v()),y&&D()}finally{y&&(P=window.setTimeout(A,5e3))}})}let U=()=>{};return nt(()=>{y=!0,U=is(z=>{f&&k!==z.effective&&E()});const q=()=>B(null,null,function*(){_||(yield v()),!(!y||!b.value)&&(S(b.value),C(),w=C,window.addEventListener("resize",w),$=new ResizeObserver(C),m.value&&$.observe(m.value),$.observe(b.value),_||(P=window.setTimeout(A,5e3)))});P=window.setTimeout(()=>{q()},_?0:900)}),lt(()=>{y=!1,window.clearTimeout(P),U(),f==null||f.dispose(),f=null,w&&window.removeEventListener("resize",w),$==null||$.disconnect()}),(q,z)=>(i(),d("div",{class:"network_container",ref_key:"containerRef",ref:m},[e("div",Pu,[e("div",Tu,[G(fu,{color:"#20c7f7",class:"icon"}),e("span",null,a(o(t)("网络流量")),1)]),e("div",null,[e("div",Mu,[e("div",Eu,[z[0]||(z[0]=e("div",{class:"tag_dn"},null,-1)),e("span",null,a(o(t)("下载")),1)]),e("div",Iu,[z[1]||(z[1]=e("div",{class:"tag_up"},null,-1)),e("span",null,a(o(t)("上传")),1)])])])]),e("div",Du,[e("div",Lu,[e("span",null,a(o(t)("下载速度")),1),e("div",Au,a(p.value),1)]),e("div",Nu,[e("span",null,a(o(t)("上传速度")),1),e("div",Ou,a(r.value),1)])]),e("div",{ref_key:"el",ref:b,class:"echart"},null,512)],512))}}),qu=le(zu,[["__scopeId","data-v-cd24141c"]]),fi=["computer","phone","tablet","tv","network","smart-home","camera","gaming","storage","printer","wearable","unknown","desktop","laptop","smart-speaker","smart-bulb","thermostat","sensor","door-lock","robot-vacuum","air-conditioner","projector","set-top-box","game-console","handheld-game","home-server","network-switch","access-point","network-bridge","e-reader"],po=s=>typeof s=="string"&&fi.includes(s),Tl={computer:"通用电脑",phone:"手机",tablet:"平板电脑",tv:"电视",network:"无线路由器","smart-home":"智能家居",camera:"摄像头",gaming:"游戏设备",storage:"网络存储",printer:"打印机",wearable:"穿戴设备",unknown:"未知设备",desktop:"台式电脑",laptop:"笔记本电脑","smart-speaker":"智能音箱","smart-bulb":"智能灯",thermostat:"温控器",sensor:"传感器","door-lock":"智能门锁","robot-vacuum":"扫地机器人","air-conditioner":"空调",projector:"投影仪","set-top-box":"电视盒子","game-console":"游戏主机","handheld-game":"掌上游戏机","home-server":"家庭服务器","network-switch":"网络交换机","access-point":"无线接入点","network-bridge":"网络桥接器","e-reader":"电子阅读器"},bi=s=>`/luci-static/quickstart/device-icons/${s==="unknown"?"computer":s}.webp`,Ml=s=>bi(s),Ru=["aria-label","title"],Vu=["src"],Bu=X({__name:"deviceSceneIcon",props:{scene:{},label:{},iconKey:{}},setup(s){const t=s,n=Ml("computer"),l=()=>t.iconKey?bi(t.iconKey):Ml(t.scene),u=x(l());We(()=>[t.scene,t.iconKey],()=>{u.value=l()});const c=()=>{u.value=n};return(r,p)=>(i(),d("span",{class:"device-scene-icon",role:"img","aria-label":s.label,title:s.label},[e("img",{src:u.value,alt:"","aria-hidden":"true",decoding:"async",loading:"lazy",onError:c},null,40,Vu)],8,Ru))}}),Da=le(Bu,[["__scopeId","data-v-4334b243"]]),Ds=(s,t)=>({phone:t("手机"),computer:t("电脑"),tablet:t("平板"),tv:t("电视与影音"),network:t("网络设备"),"smart-home":t("智能家居"),camera:t("摄像头"),gaming:t("游戏设备"),storage:t("存储与服务器"),printer:t("打印机"),wearable:t("穿戴设备"),unknown:t("未知设备")})[s],Do=(s,t)=>{const n=s.displayName||s.hostname||"";return n||(s.brand?`${s.brand} ${s.classification.source==="fallback"?t("设备"):Ds(s.scene,t)}`:t("未命名设备"))},Lo=(s,t)=>s.presenceState==="never_seen"?t("尚未上线"):s.online?t("在线"):t("离线"),Uu=(s,t)=>{const n=r=>r.find(p=>p.family===4&&p.primary)||r.find(p=>p.family===4)||r.find(p=>p.primary)||r[0],l=r=>r.length>20?`${r.slice(0,6)}…${r.slice(-9)}`:r,u=n(s.addresses.current);if(u)return{kind:"current",text:l(u.address),description:`${t("当前IP")}:${u.address}`};const c=n(s.addresses.historical);return c?{kind:"historical",text:`${t("历史")} ${l(c.address)}`,description:`${t("历史地址")}:${c.address}`}:s.mac?{kind:"mac",text:s.mac,description:`${t("MAC地址")}:${s.mac}`}:{kind:"identity",text:`ID · ${s.deviceId.slice(-8)}`,description:`${t("地址待确认")} · ID:${s.deviceId}`}};let _s=0;const Fu={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 s=()=>{this.show&&this.remain>0&&(this.remain=this.remain-1,_s=window.setTimeout(s,1e3))};_s=window.setTimeout(s,1e3)}},computed:{Message(){return this.message+(this.countdown?" "+this.remain+"s":"")}},methods:{Stop(){this.type!="loading"&&(this.show=!1,_s!=0&&clearTimeout(_s),this.Close())}}},Hu={key:0,class:"loading icon"},Gu={key:1,class:"success icon"},ju={key:2,class:"error icon"},Wu={key:3,class:"warning icon"};function Ju(s,t,n,l,u,c){return i(),Y(fn,{name:"el-fade-in-linear"},{default:pe(()=>[u.show?(i(),d("div",{key:0,class:"toast",onClick:t[0]||(t[0]=r=>c.Stop())},[n.type=="loading"?(i(),d("div",Hu,[...t[1]||(t[1]=[e("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"},[e("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)])])):n.type=="success"?(i(),d("div",Gu,[...t[2]||(t[2]=[e("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"},[e("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)])])):n.type=="error"?(i(),d("div",ju,[...t[3]||(t[3]=[e("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"},[e("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)])])):n.type=="warning"?(i(),d("div",Wu,[...t[4]||(t[4]=[e("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"},[e("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)])])):T("",!0),e("div",{class:"message",onClick:Ge(()=>{},["stop"])},a(c.Message),1)])):T("",!0)]),_:1})}const Ku=le(Fu,[["render",Ju],["__scopeId","data-v-1bb2b3b2"]]),Ya=new Map,Ra=s=>{const t=cn(Ku,Ne(ye({},s),{Close:()=>{l()}})),n=document.createElement("div");document.body.append(n),t.mount(n);const l=()=>{n.remove(),Ya.get(t._uid)&&Ya.delete(t._uid)};return s.type=="loading"&&Ya.set(t._uid,{Close:l}),(s==null?void 0:s.duration)==0||((s==null?void 0:s.duration)>0?setTimeout(()=>{l()},s==null?void 0:s.duration):setTimeout(()=>{l()},3e3)),{Close:l}},ne=s=>Ra(s);ne.Loading=(s,t)=>Ra({type:"loading",message:s||"加载中...",duration:0,countdown:t||0});ne.Success=s=>Ra({type:"success",message:s});ne.Error=s=>Ra({type:"error",message:s,duration:0});ne.Warning=s=>Ra({type:"warning",message:s});ne.Message=s=>Ra({message:s});ne.Clear=()=>{Ya.forEach((s,t)=>{s.Close(),Ya.delete(t)})};const{$gettext:Ma}=Hs(),Xt={installApp:(s,t)=>new Promise((n,l)=>{let u=0;we.App.Install.POST({name:s}).then(()=>{const c=setTimeout(()=>{u==0&&(u=1,n(!1))},(t||60)*1e3),r=()=>{u==0&&we.App.Check.POST({name:s}).then(p=>{if(u==0&&p!=null&&p.data){const{result:v}=p.data;if((v==null?void 0:v.status)=="installed"){clearTimeout(c),u=1,n(!0);return}}}).catch(p=>{}).finally(()=>{u==0&&setTimeout(r,3e3)})};setTimeout(r,3e3)}).catch(c=>{u==0&&(u=1,l(Ma("安装失败,")+c))})}),checkAndInstallApp:(s,t,n,l)=>B(null,null,function*(){if(l&&!l())return!1;let u=ne.Loading(Ma("检查中..."));try{const c=yield we.App.Check.POST({name:s});if(u.Close(),l&&!l())return!1;if(c!=null&&c.data){const{result:r,error:p}=c.data;if(p)ne.Warning(p);else if(r){if(r.status=="installed")return!0;if(confirm(Ma("检测到你尚未安装 %{name} 插件,是否安装?",{name:t}))){u=ne.Loading(Ma("正在安装中..."));const v=yield Xt.installApp(n||s);if(u.Close(),v)return!0;ne.Error(Ma("安装失败或超时,请检查软件源或稍候重试"))}}else ne.Warning(Ma("检查插件状态失败"))}return!1}catch(c){return u.Close(),ne.Warning(c),!1}}),installAndGo:(s,t,n,l)=>B(null,null,function*(){(yield Xt.checkAndInstallApp(s,t,l))&&(location.href=n)})},Zu=["data-device-form"],Yu={class:"device-header-actions widget-action-group"},Qu={class:"inventory-heading"},Xu=["aria-label"],e1={key:0,class:"module-state"},t1={key:1,class:"module-state"},n1={key:1},a1={key:2,class:"module-state"},s1={key:1},o1={key:0,class:"module-notice"},l1={key:1,class:"canvas-devices"},i1=["onClick","data-canvas-device","title","aria-label"],r1=["data-device-address","title"],c1={dir:"ltr"},d1={key:4,class:"module-notice"},u1={class:"inventory-footer"},v1=X({__name:"DeviceWidget",props:{data:{},errors:{},devices:{},contextualActions:{type:Boolean},summaryLimit:{},diskLimit:{},summary:{type:Boolean}},emits:["navigate","device","retry"],setup(s,{emit:t}){const n=s,l=t,u=window.vue_lang==="en",c=(y,P)=>u?P:y,r=y=>u&&{手机:"Phone",电脑:"Computer",平板:"Tablet",电视与影音:"TV & media",网络设备:"Network",智能家居:"Smart home",摄像头:"Camera",游戏设备:"Gaming",存储与服务器:"Storage & server",打印机:"Printer",穿戴设备:"Wearable",未知设备:"Unknown device",未命名设备:"Unnamed device",在线:"Online",离线:"Offline",尚未上线:"Not yet seen",设备:"Device",当前IP:"Current IP",历史:"Prev.",历史地址:"Previous address",MAC地址:"MAC address",地址待确认:"Address unconfirmed"}[y]||y,p=R(()=>{var y;return n.devices.slice(0,(y=n.summaryLimit)!=null?y:6)}),v=R(()=>p.value.map(y=>{const P=Uu(y,r),_=[y.brand,y.classification.source==="fallback"?c("类型待确认","Type unconfirmed"):Ds(y.scene,r)].filter(Boolean).join(" · ");return{device:y,address:P,description:[Do(y,r),P.description,_,h(y)].join(" · ")}}));function h(y){return n.errors.inventory?c("上次记录","Last recorded"):Lo(y,r)}const g=R(()=>!n.data.inventory&&!n.errors.inventory),b=R(()=>n.errors.inventory==="permission"?c("登录或读取权限失效","Session or access expired"):c("设备清单暂不可用","Device inventory unavailable")),m=R(()=>{var y,P;return((P=(y=n.data.inventory)==null?void 0:y.health)==null?void 0:P.state)&&n.data.inventory.health.state!=="ready"}),f=R(()=>c("部分设备观测信息暂不完整。","Some device observations are incomplete.")),k=R(()=>{var y,P,_,D;return(y=n.data.routerContext)!=null&&y.multiLAN?c("地址与路线设置按各局域网分别管理。","Address and path settings are managed per LAN."):(_=(P=n.data.routerContext)==null?void 0:P.routeEditability)!=null&&_.editable?c("本机负责此局域网地址分配,可在设备详情设置固定地址与上网路线。","This router allocates LAN addresses. Configure reservations and Internet paths in device details."):((D=n.data.routerContext)==null?void 0:D.dhcpAuthority)==="external_observed"?c("本机不负责此局域网地址分配;固定地址与上网路线请到分配地址的主路由设置。","This router does not allocate LAN addresses. Use the allocating router for reservations and Internet paths."):c("地址分配方尚不明确;固定地址与上网路线暂为只读。","Address allocator unconfirmed. Reservations and Internet paths are read only.")}),$=R(()=>{var y;return((y=n.data.lanNetworks)==null?void 0:y.length)===1?n.data.lanNetworks[0].networkId:"all"}),w=y=>l("navigate",n.data.lanNetworks&&!n.data.lanLegacy?`${y}?network=${encodeURIComponent($.value)}`:y);function S(y){l("navigate",`/devicemanagement?device=${encodeURIComponent(y.deviceId)}&network=${encodeURIComponent(y.networkId||$.value)}`)}function C(){return B(this,null,function*(){(yield Xt.checkAndInstallApp("luci-app-oaf",c("应用过滤","App filtering")))&&window.location.assign("/cgi-bin/luci/admin/services/appfilter")})}return(y,P)=>(i(),d("article",{class:_e(["canvas-module module-devices",{"is-device-summary":s.summary}]),"data-device-form":s.summary?"summary":"standard","data-canvas-module":"devices"},[e("header",null,[e("div",null,[G(Qe,{name:"devices"}),e("h2",null,a(c("设备列表","Devices")),1)]),e("div",Yu,[G(_a,{icon:"devices",onClick:P[0]||(P[0]=_=>w("/devicemanagement")),"data-canvas-view-all":""},{default:pe(()=>[ue(a(c("查看全部","View all")),1)]),_:1}),G(za,{label:c("设备更多操作","More device actions"),items:[{id:"parental",label:c("家长控制","Parental controls")}],onSelect:C},null,8,["label","items"])])]),e("div",Qu,[e("strong",null,[ue(a(g.value||!s.devices.length&&s.errors.inventory?"—":s.devices.filter(_=>_.online).length),1),e("span",null,a(s.errors.inventory&&s.devices.length?c("上次在线","previously online"):c("在线","online")),1)]),e("small",null,a(g.value||!s.devices.length&&s.errors.inventory?c("数量待确认","Count unconfirmed"):`${s.devices.length} ${c("台 · 本次开机发现","discovered this boot")}`),1),e("button",{onClick:P[1]||(P[1]=_=>y.$emit("retry")),"aria-label":c("刷新设备","Refresh devices"),"data-refresh-inventory":""},"↻",8,Xu)]),g.value?(i(),d("div",e1,[(i(!0),d(V,null,oe(s.summary?1:3,_=>(i(),d("div",{class:"skeleton",key:_}))),128)),e("span",null,a(c("正在读取设备清单","Loading devices")),1)])):s.errors.inventory&&!s.devices.length?(i(),d("div",t1,[s.summary?T("",!0):(i(),Y(Qe,{key:0,name:"devices"})),e("strong",null,a(b.value),1),s.summary?T("",!0):(i(),d("p",n1,a(c("其他首页模块仍可使用。","Other modules remain available.")),1)),e("button",{onClick:P[2]||(P[2]=_=>y.$emit("retry"))},a(c("重试","Retry")),1)])):s.devices.length?(i(),d(V,{key:3},[s.errors.inventory?(i(),d("p",o1,a(c("上次快照 · 当前状态待确认","Previous snapshot · Current state unconfirmed")),1)):T("",!0),s.summary?T("",!0):(i(),d("div",l1,[(i(!0),d(V,null,oe(v.value,({device:_,address:D,description:E})=>(i(),d("button",{key:`${_.networkId}:${_.deviceId}`,onClick:A=>S(_),"data-canvas-device":_.deviceId,title:E,"aria-label":E},[G(Da,{scene:_.scene,"icon-key":_.iconKey,label:o(Ds)(_.scene,r)},null,8,["scene","icon-key","label"]),e("span",null,[e("strong",null,a(o(Do)(_,r)),1),e("small",{class:"device-address","data-device-address":D.kind,title:D.description},[e("bdi",c1,a(D.text),1)],8,r1)]),e("span",{class:_e(["device-online",{offline:!_.online}])},[P[4]||(P[4]=e("i",null,null,-1)),ue(a(s.errors.inventory?c("上次记录","Last recorded"):o(Lo)(_,r)),1)],2)],8,i1))),128))]))],64)):(i(),d("div",a1,[s.summary?T("",!0):(i(),Y(Qe,{key:0,name:"devices"})),e("strong",null,a(c("暂未发现设备","No devices discovered")),1),s.summary?T("",!0):(i(),d("p",s1,a(c("本局域网设备上线后会自动出现。","Devices appear when observed on this LAN.")),1)),s.summary?T("",!0):(i(),d("button",{key:2,onClick:P[3]||(P[3]=_=>w("/devicemanagement"))},a(c("添加或查看设备","Add or view devices")),1))])),m.value?(i(),d("p",d1,a(f.value)+" "+a(c("设备清单仍可使用。","Inventory remains available.")),1)):T("",!0),e("footer",u1,[e("small",null,a(c("仅显示本机观察到的设备","Only devices observed by this router")),1),e("details",null,[e("summary",null,a(c("地址与路线权限","Address & path permissions")),1),e("p",null,a(k.value),1)])])],10,Zu))}}),p1=le(v1,[["__scopeId","data-v-3d9c87f1"]]),On=Xe({app:null,status:"idle",source:"home"});let Qa,Ls,Zn;function h1(s,t,n){return Qa=s,Ls=t,Zn=n,()=>{Qa===s&&(Zn==null||Zn(),Qa=void 0,Ls=void 0,Zn=void 0)}}function m1(s,t){return Qa?(Qa(s,t),!0):!1}function Ao(s,t="home"){return Ls?(Ls(s,t),!0):!1}function gi(){Zn==null||Zn()}const es=[{id:"files",zh:"文件管理",en:"Files",detail:"磁盘与文件",detailEn:"Disks & files",glyph:"folder",path:"/cgi-bin/luci/admin/services/linkease/file/",kind:"builtin",tone:"blue"},{id:"docker",zh:"Docker",en:"Docker",detail:"容器管理",detailEn:"Containers",glyph:"layers",path:"",kind:"app",tone:"blue"},{id:"qbittorrent",zh:"qBittorrent",en:"qBittorrent",detail:"下载管理",detailEn:"Downloads",glyph:"download",path:"",kind:"app",tone:"teal"},{id:"ddnsto",zh:"DDNSTO",en:"DDNSTO",detail:"远程访问",detailEn:"Remote access",glyph:"globe",path:"",kind:"app",tone:"violet"},{id:"linkease",zh:"易有云",en:"LinkEase",detail:"文件与远程",detailEn:"Files & remote access",glyph:"folder",path:"",kind:"app",tone:"teal"},{id:"fastnet",zh:"网络测速",en:"Speed test",detail:"FastNet",detailEn:"FastNet",glyph:"activity",path:"",kind:"app",tone:"blue"},{id:"oaf",zh:"家长控制",en:"Parental controls",detail:"应用过滤",detailEn:"App filtering",glyph:"shield",path:"",kind:"app",tone:"violet"},{id:"devices",zh:"局域网设备",en:"LAN devices",detail:"设备与策略",detailEn:"Devices & policies",glyph:"devices",path:"/devicemanagement",kind:"builtin",tone:"blue"},{id:"network",zh:"网络向导",en:"Network setup",detail:"网络配置",detailEn:"Network configuration",glyph:"network",path:"/network",kind:"builtin",tone:"teal"}],As=[{id:"tool-lan",zh:"内网配置",en:"LAN settings",detail:"地址与DHCP",detailEn:"Address & DHCP",glyph:"network",path:"",kind:"tool",tone:"blue",tool:"lan"},{id:"tool-terminal",zh:"终端",en:"Terminal",detail:"命令行",detailEn:"Command line",glyph:"terminal",path:"",kind:"tool",tone:"teal",tool:"terminal"},{id:"tool-firmware",zh:"固件更新",en:"Firmware update",detail:"升级与自动检查",detailEn:"Update & auto-check",glyph:"download",path:"/cgi-bin/luci/admin/system/ota",kind:"tool",tone:"violet",tool:"firmware"},{id:"tool-dns",zh:"DNS配置",en:"DNS settings",detail:"网络解析",detailEn:"Name resolution",glyph:"globe",path:"",kind:"tool",tone:"teal",tool:"dns"},{id:"tool-source",zh:"软件源配置",en:"Software sources",detail:"软件包镜像",detailEn:"Package mirrors",glyph:"layers",path:"",kind:"tool",tone:"violet",tool:"source"},{id:"tool-sandbox",zh:"开启沙箱",en:"Enable sandbox",detail:"隔离实验环境",detailEn:"Experiment environment",glyph:"shield",path:"",kind:"tool",tone:"blue",tool:"sandbox"},{id:"tool-logs",zh:"日志查看",en:"System logs",detail:"系统日志",detailEn:"System events",glyph:"folder",path:"/cgi-bin/luci/admin/status/logs",kind:"tool",tone:"teal",tool:"logs"},{id:"tool-maintenance",zh:"系统维护",en:"Maintenance",detail:"系统维护工具",detailEn:"System maintenance",glyph:"tune",path:"/cgi-bin/luci/admin/services/store/pages/maintance",kind:"tool",tone:"blue",tool:"maintenance"}],f1=As.map(s=>s.id);function ho(s){if(!s||typeof s!="object")return null;const t=s;return t.v!==1||typeof t.id!="string"||!/^[a-zA-Z0-9][a-zA-Z0-9_.+-]{0,127}$/.test(t.id)||typeof t.scroll!="number"||!Number.isFinite(t.scroll)?null:ye(ye({v:1,id:t.id,scroll:Math.max(0,Math.min(1e6,t.scroll))},t.restoration==="auto"||t.restoration==="manual"?{restoration:t.restoration}:{}),t.source==="traffic"&&t.id==="fastnet"?{source:"traffic"}:{})}function Fa(s){if(s.panel!=="applications")return null;const t=["all","apps","tools","links"].includes(String(s.tab))&&typeof s.tab=="string"?s.tab:"all",n=typeof s.page=="string"&&/^[1-9][0-9]{0,2}$/.test(s.page)?Number(s.page):1;return{tab:t,page:n}}function mo(s,t){const n=ye({},s);return delete n.panel,delete n.tab,delete n.page,t?Ne(ye({},n),{panel:"applications",tab:t.tab,page:String(Math.max(1,Math.min(999,Math.floor(t.page)||1)))}):n}function El(s){const t=s&&typeof s=="object"?s:{},n=(l,u)=>typeof l=="string"?l.replace(/[\u0000-\u001f]/g,"").slice(0,u):"";return ye({v:1,search:n(t.search,256),scroll:typeof t.scroll=="number"&&Number.isFinite(t.scroll)?Math.max(0,Math.min(1e6,t.scroll)):0,focus:n(t.focus,128)},typeof t.from=="string"&&t.from.startsWith("/")&&t.from.length<=2048?{from:t.from}:{})}function b1(s){const t=as(),n=ta(),l=x(!1);let u=!1,c=!1,r=!1,p=null,v=0,h=Promise.resolve();const g=()=>{var D;return El((D=window.history.state)==null?void 0:D.qsLauncher)};function b(D){const E=g(),A=document.querySelector(".applications-browser-body");return Ne(ye({},E),{search:s.search.value,scroll:(A==null?void 0:A.scrollTop)||0,focus:D!=null?D:E.focus})}function m(D){!s.enabled||!s.opened.value||window.history.replaceState(Ne(ye({},window.history.state),{qsLauncher:b(D)}),"")}function f(){return B(this,null,function*(){var U;if(!p||!s.opened.value)return;const D=p;if(yield ot(),!s.opened.value||p!==D)return;const E=document.querySelector(".applications-browser-body");E&&(E.scrollTop=D.scroll);const A=D.focus?document.querySelector('[data-open-app="'+CSS.escape(D.focus)+'"]'):null;A&&A.focus({preventScroll:!0}),s.settled()&&(p=null,!A&&D.focus&&((U=document.querySelector(".application-search input"))==null||U.focus({preventScroll:!0})))})}function k(){return B(this,null,function*(){if(!u||!s.enabled)return;const D=++v,E=n.path==="/"?Fa(n.query):null;l.value=!0;try{if(!E){p=null,s.opened.value&&s.hide();return}p=g(),yield s.show(r,E,p),r=!1,D===v&&(yield f())}finally{D===v&&(l.value=!1)}})}function $(){if(!s.enabled||!u||c||l.value||!s.opened.value||!Fa(n.query))return h;const D={tab:s.tab.value,page:s.page.value},E=b();return h=h.catch(()=>{}).then(()=>B(null,null,function*(){if(!u||c||!s.opened.value||!Fa(n.query))return;const A=mo(n.query,D);n.query.tab!==A.tab||n.query.page!==A.page?yield t.replace({query:A,state:{qsLauncher:E}}):window.history.replaceState(Ne(ye({},window.history.state),{qsLauncher:E}),"")})),h}function w(D){return B(this,null,function*(){if(!s.enabled)return;if(r=D,Fa(n.query)){yield k();return}const E=Ne(ye({},El(null)),{from:n.fullPath});yield t.push({query:mo(n.query,{tab:"all",page:1}),state:{qsLauncher:E}})})}function S(){return B(this,null,function*(){var D;if(!s.enabled)return!0;c=!0;try{yield h.catch(()=>{});const E=g();return E.from&&((D=window.history.state)==null?void 0:D.back)===E.from?yield new Promise(A=>{const U=t.afterEach(()=>{U(),clearTimeout(q),A()}),q=window.setTimeout(()=>{U(),A()},1500);t.back()}):yield t.replace({query:mo(n.query,null)}),yield ot(),!s.opened.value}finally{c=!1}})}function C(D){return B(this,null,function*(){yield $(),m(D)})}function y(){return s.enabled?s.saving()?!1:!s.dirty.value||s.confirm():!0}ti(y),Vr(D=>D.path==="/"&&Fa(D.query)?!0:y()),We(()=>n.fullPath,()=>{k()},{flush:"post"}),We([s.tab,s.search,s.page],()=>{$()},{flush:"post"}),We(()=>[s.settled(),s.currentPage()],()=>{s.enabled&&(f(),s.settled()&&s.opened.value&&!l.value&&s.page.value!==s.currentPage()&&(s.page.value=s.currentPage()))},{flush:"post"});const P=()=>m(),_=()=>{s.enabled&&s.opened.value&&(p=g(),f())};return nt(()=>{u=!0,s.enabled&&(window.addEventListener("pagehide",P),window.addEventListener("pageshow",_),k())}),lt(()=>{u=!1,v++,window.removeEventListener("pagehide",P),window.removeEventListener("pageshow",_)}),{applying:l,open:w,close:S,remember:C,persist:$}}function No(s){if(!s||typeof s!="object"||Array.isArray(s))throw new Error("error");return s}function Ns(s){return typeof s=="string"&&/^\/(?!\/)/.test(s)&&s.length<=2048&&!/[\u0000-\u0020\u007f\\]/.test(s)?s:""}function g1(s){const t=Number(s);if(!/^[0-9]{1,5}$/.test(s)||t<1||t>65535)throw new Error("error");return t}function _1(s,t){const n=s.web;if(typeof n!="string"||!n||n.length>2048||/[\u0000-\u0020\u007f\\]/.test(n))throw new Error("error");const l=new URL(t);let u;const c=n.match(/^:([0-9]{1,5})(\/.*)?$/);if(c){if(s.protocol!=="http"&&s.protocol!=="https")throw new Error("error");const r=g1(c[1]);if(s.port!==void 0&&Number(s.port)!==r)throw new Error("error");u=new URL(l.origin),u.protocol=s.protocol+":",u.port=String(r);const p=new URL(c[2]||"/",u.origin);if(p.origin!==u.origin)throw new Error("error");u=p}else if(Ns(n))u=new URL(n,l.origin);else{if(!/^https?:\/\//.test(n))throw new Error("error");u=new URL(n)}if(!["http:","https:"].includes(u.protocol)||u.username||u.password)throw new Error("error");if(u.hostname!==l.hostname&&(/^(localhost|0\.0\.0\.0|127\.)/.test(u.hostname)||["[::1]","[::]"].includes(u.hostname)))throw new Error("error");return u.href}function y1(s,t,n){const l=No(t),u=l.errors,c=!!u&&typeof u=="object"&&Object.keys(u).length===0;if(l.code!==200||!Array.isArray(l.status)||!c||l.status.length!==1)throw new Error("error");const r=No(l.status[0]);if(r.app!==s.id||typeof r.running!="boolean")throw new Error("error");if(r.running===!0&&r.deployed!==!1&&r.web)return{target:_1(r,n),direct:!0};const p=Ns(s.path)||Ns(r.href);if(!p)throw new Error("no-entry");return{target:p,direct:!1}}function Zo(u,c,r){return B(this,arguments,function*(s,t,n,l=fetch){if(s.kind!=="app"||!/^[a-zA-Z0-9][a-zA-Z0-9_.+-]{0,127}$/.test(s.id))throw new Error("error");if(!s.entryScript){const f=Ns(s.path);if(!f)throw new Error("no-entry");return{target:f,direct:!1}}const p={credentials:"same-origin",cache:"no-store",signal:n},v=f=>B(null,null,function*(){if(!f.ok)throw new Error([401,403].includes(f.status)?"permission":"error");return No(yield f.json())}),h=yield v(yield l("/cgi-bin/luci/admin/store/token",Ne(ye({},p),{method:"GET"})));if(typeof h.token!="string"||!h.token||h.token.length>256||/[\u0000-\u0020]/.test(h.token))throw new Error("error");const g=new URL(t).hostname,b=new URLSearchParams({token:h.token,package:s.id,hostname:g,update:"1"}),m=yield l("/cgi-bin/luci/admin/store/entrysh",Ne(ye({},p),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:b}));return y1(s,yield v(m),t)})}function k1(u,c,r){return B(this,arguments,function*(s,t,n,l=fetch){return(yield Zo(s,t,n,l)).target})}const w1="/cgi-bin/luci/admin/services/fastnet";function $1(s,t,n,l,u){return B(this,null,function*(){const c=()=>{if(l.aborted)throw new DOMException("Aborted","AbortError")};if(c(),t!=="ready")throw new Error(t==="permission"?"permission":t==="timeout"?"timeout":"error");const r=s.find(v=>v.id==="fastnet");if(r!=null&&r.entryScript){const v=yield(u.resolve||Zo)(r,n,l);if(c(),v.direct)return v.target}if(c(),r&&!u.confirm())return null;c();const p=yield u.install();return c(),p?w1:null})}function C1(s){return s.kind==="app"&&/^[a-zA-Z0-9][a-zA-Z0-9_.+-]{0,127}$/.test(s.id)?"/luci-static/resources/app-icons/"+encodeURIComponent(s.id)+".png":""}const S1=["data-app-artwork","src"],x1=X({__name:"ApplicationArtwork",props:{app:{}},setup(s){const t=s,n=R(()=>C1(t.app)),l=x(!1);return We(n,()=>{l.value=!1}),(u,c)=>n.value&&!l.value?(i(),d("img",{key:0,class:"application-artwork","data-app-artwork":s.app.id,src:n.value,alt:"","aria-hidden":"true",draggable:"false",loading:"lazy",decoding:"async",referrerpolicy:"no-referrer",onError:c[0]||(c[0]=r=>l.value=!0)},null,40,S1)):(i(),Y(Qe,{key:1,name:s.app.glyph,"data-app-artwork":s.app.id},null,8,["name","data-app-artwork"]))}}),Cs=le(x1,[["__scopeId","data-v-a6133c23"]]),Ss=48,P1=["globe","folder","layers","network","shield","download","terminal","grid"];function T1(s,t,n=""){try{const l=new URL(s.trim()).href;return t.find(u=>u.id!==n&&u.path&&(()=>{try{return new URL(u.path).href===l}catch(c){return!1}})())}catch(l){return}}function M1(s,t,n){const l=new Map;for(const c of s)l.has(c.id)||l.set(c.id,c);const u=[];for(const c of t)u.some(r=>r.id===c)||(u.push(l.get(c)||n(c)),l.delete(c));return[...u,...l.values()]}function E1(s,t,n,l){const u=t.trim().toLocaleLowerCase(),c=s.filter(v=>(n==="all"||(n==="tools"?v.kind==="tool"||v.kind==="builtin":n==="links"?v.kind==="link":v.kind==="app"))&&[v.zh,v.en,v.detail,v.detailEn,v.path].some(h=>h.toLocaleLowerCase().includes(u))),r=Math.max(1,Math.ceil(c.length/Ss)),p=Math.max(1,Math.min(r,l));return{total:c.length,pages:r,current:p,entries:c.slice((p-1)*Ss,p*Ss)}}function I1(s){if(!Array.isArray(s))throw new Error("error");const t=new Set([...As,...es.filter(u=>u.kind==="builtin")].map(u=>u.id)),n=new Set,l=[];for(const u of s){if(!u||typeof u!="object"||typeof u.name!="string"||!/^[a-zA-Z0-9][a-zA-Z0-9_.+-]{0,127}$/.test(u.name))throw new Error("error");if(t.has(u.name)||n.has(u.name))continue;n.add(u.name);const c=es.find(h=>h.id===u.name),r=(h,g)=>typeof h=="string"&&h.trim()?h.slice(0,256):g,p=typeof u.entry=="string"&&/^\/(?!\/)/.test(u.entry)&&!/[\u0000-\u001f\\]/.test(u.entry)?u.entry:"",v=Array.isArray(u.flags)&&u.flags.includes("entrysh")&&typeof u.uci=="string"&&/^[a-zA-Z0-9_-]+$/.test(u.uci);l.push({id:u.name,zh:r(u.title,u.name),en:r(u.title_en,u.name),detail:r(u.description,""),detailEn:r(u.description_en,""),path:p,kind:"app",entryScript:v,glyph:(c==null?void 0:c.glyph)||"grid",tone:(c==null?void 0:c.tone)||"blue"})}return l}const D1="/cgi-bin/luci/admin/store/installed";function L1(n){return B(this,arguments,function*(s,t=fetch){const l=yield t(D1,{method:"GET",credentials:"same-origin",cache:"no-store",signal:s});if(!l.ok)throw new Error([401,403].includes(l.status)?"permission":"error");return I1(yield l.json())})}const Oo=["connection","networkInterface","system","sharing","docker","downloads","remote"],A1=Un.map(s=>({id:s.id,forms:s.id==="applications"?["grid","strip"]:s.id==="devices"||Oo.includes(s.id)?["standard","summary"]:["standard"],stacked:Oo.includes(s.id)})),aa=s=>{var t,n,l;return s.startsWith("plugin.")?{id:s,forms:Object.keys(((t=Is(s))==null?void 0:t.forms)||{standard:1,summary:1}),stacked:(l=(n=Is(s))==null?void 0:n.stacked.includes("summary"))!=null?l:!0}:A1.find(u=>u.id===s)};function Yo(s=2){return Object.fromEntries(Un.map(t=>[t.id,{mode:"auto",iconRows:0,ruleVersion:s}]))}function Ks(s,t){return!t||t.ruleVersion!==void 0&&![0,1,2].includes(t.ruleVersion)||!["auto",...s.startsWith("plugin.")?["standard","summary"]:aa(s).forms].includes(t.mode)||![0,1,2,3].includes(t.iconRows)||s!=="applications"&&t.iconRows!==0?"preference":""}function zo(s,t){var n,l;return{stacked:t==="summary"&&(Oo.includes(s)||s.startsWith("plugin.")&&((l=(n=Is(s))==null?void 0:n.stacked.includes("summary"))!=null?l:!0))||s==="connection"&&t==="standard",stretch:s==="traffic"||s==="connection"&&t==="standard",contentLimit:s==="networkInterface"?2:s==="storage"?3:s==="sharing"?2:void 0}}function N1(s,t,n){if(s.startsWith("plugin.")){const l=aa(s).forms,u=n.role==="stacked"?"summary":"standard";return l.includes(u)?u:l[0]||u}return t.ruleVersion===0?n.role==="stacked"?"summary":s==="applications"?"grid":"standard":t.ruleVersion===1&&n.role==="stacked"?"summary":s==="connection"?"standard":n.role==="stacked"||s==="system"&&n.width<560?"summary":s==="applications"?"grid":"standard"}function Kt(s,t,n){var $,w,S;const l=aa(s),u=rn(s),c=Math.min(s==="applications"?24:6,Math.max(0,n.favoriteCount)),r=n.role,p=t.mode==="auto"?N1(s,t,n):t.mode;let v=Ks(s,t)||(r==="stacked"&&!zo(s,p).stacked?"compact":l.forms.includes(p)?"":"form"),h=n.mobile||p==="summary"&&s==="devices"?240:u.minWidth,g=r==="stacked"&&p==="summary"?148:p==="summary"?s==="devices"?n.width<450?280:260:176:u.minHeight;if(s==="networkInterface"&&p==="summary"&&(($=t.ruleVersion)!=null?$:2)>=2&&(g=136),s.startsWith("plugin.")){const C=(w=Is(s))==null?void 0:w.forms[p];h=n.mobile?240:(C==null?void 0:C.minWidth)||(p==="summary"?240:u.minWidth),g=(C==null?void 0:C.minHeight)||(p==="summary"?148:u.minHeight)}let b=1,m=1,f=1,k=g;if(s==="applications"){const C=Math.max(1,Math.min(n.width<450?2:6,Math.floor((n.width-32+12)/112))),y=p==="strip"?1:t.iconRows;b=y?Math.min(C,Math.max(1,Math.ceil(c/y))):Math.min(C,Math.max(1,Math.ceil(c/Math.max(1,Math.ceil(c/C)))));const P=Math.max(1,Math.ceil(c/b)),_=y||(C<=2?4:3),D=p==="strip"?56:82,E=D+12;m=Math.min(_,P),k=94+m*D+(m-1)*12,g=y?k:176;const A=Math.max(0,Math.floor((n.height-94+12)/E));m=Math.max(0,Math.min(m,A)),f=m*b}else s==="devices"&&(b=n.width>=650?3:n.width>=450?2:1,m=n.height<330?1:b===1&&n.height>=370?3:2,f=p==="summary"?0:Math.min(6,m*b));return!v&&n.widthMath.max(0,...v.cards.map(h=>h?Math.min(t,Os(h,n[h],v.cards.length===2).minWidth):Math.min(t,260)))),u=Array(s.columns.length).fill(0),c=[];let r=[],p=0;l.forEach((v,h)=>{r.length&&p+v+18*r.length>t&&(c.push(r),r=[],p=0),r.push(h),p+=v}),r.length&&c.push(r);for(const v of c){let h=t-18*(v.length-1),g=[...v];for(;g.length;){const b=g.reduce((f,k)=>f+s.columns[k].weight,0),m=g.filter(f=>h*s.columns[f].weight/b!m.includes(f))}}return u}function _i(s,t,n=1160,l=4){const u=qo(s,n,t);let c=0,r="";if(s.heightMode){for(let p=0;pp.cards.forEach((h,g)=>{if(!h)return;const b=p.cards.length===2,m=Kt(h,t[h],{width:u[v],height:1e5,role:b?"stacked":s.columns.some(f=>f.cards.length===2)?"large":"ordinary",favoriteCount:l,mobile:n<650});m.issue&&!m.issue.startsWith("height:")&&(r=m.issue),c=Math.max(c,b?m.minHeight/((g===0?p.split:100-p.split)/100)+18:m.minHeight)})),{height:Math.ceil(c),issue:r}}const ys=["connection","networkInterface","system","sharing","docker","downloads","remote"],yi=Un.map(s=>({id:s.id,minWidth:s.minWidth,minHeight:s.minHeight,mobileMinWidth:240,stacked:ys.includes(s.id),compactHeight:ys.includes(s.id)?148:0,specs:ys.includes(s.id)||s.id==="applications"?["full","standard","compact"]:["full","standard"],summary:s.id==="applications"?"launch-grid":ys.includes(s.id)?"summary":"standard",forms:aa(s.id).forms})),Ro=s=>s.startsWith("plugin.")?Ne(ye({},rn(s)),{mobileMinWidth:240,stacked:!0,compactHeight:148,specs:["full","standard","compact"],summary:"summary",forms:aa(s).forms}):yi.find(t=>t.id===s),Vo=1600,xs=(s,t,n)=>Math.max(t,Math.min(Math.max(t,n),s));function O1(s,t,n){const l=Math.max(0,s-18),u=t[0]||0,c=Math.max(u,l-(t[1]||0)),r=xs(l*(n!=null?n:50)/100,u,c);return{upper:r,lower:Math.max(t[1]||0,l-r),min:u,max:c,available:l}}function z1(s){return s.minHeight!==void 0&&(!Number.isFinite(s.minHeight)||s.minHeight<1||s.minHeight>Vo)?"row-space":s.columns.some(t=>t.upperShare!==void 0&&(t.cards.length!==2||!Number.isFinite(t.upperShare)||t.upperShare<=0||t.upperShare>=100))?"stack-share":""}function ki(s){return rt(s).map(t=>Ne(ye({},t),{heightMode:t.columns.some(n=>n.cards.includes("traffic"))?"chart":"content"}))}const Yn=[{id:"single",zh:"整行",en:"Single",slots:[1]},{id:"pair",zh:"两列",en:"Two columns",slots:[1,1]},{id:"triple",zh:"三列",en:"Three columns",slots:[1,1,1]},{id:"left-big",zh:"左单右双",en:"Single left, stacked right",slots:[1,2]},{id:"right-big",zh:"左双右单",en:"Stacked left, single right",slots:[2,1]}];yi.filter(s=>s.stacked).map(s=>s.id);const rt=s=>JSON.parse(JSON.stringify(s));let q1=0;function Rn(s=[],t="single",n=320,l="row-"+ ++q1){let u=0;const c=Yn.find(r=>r.id===t).slots.map((r,p)=>({weight:t==="triple"?[34,33,33][p]:t==="single"?100:p===0?60:40,split:50,cards:Array.from({length:r},()=>s[u++]||null)}));return{id:l,template:t,height:n,columns:c}}const R1=()=>[Rn(["traffic","connection","networkInterface"],"left-big",320,"network"),Ne(ye({},Rn(["devices","applications"],"pair",340,"devices")),{columns:[{weight:50,cards:["devices"],split:50},{weight:50,cards:["applications"],split:50}]}),Ne(ye({},Rn(["storage","sharing"],"pair",330,"storage")),{columns:[{weight:50,cards:["storage"],split:50},{weight:50,cards:["sharing"],split:50}]}),Rn(["docker","downloads","remote"],"triple",280,"services"),Rn(["system"],"single",280,"system")],Yt=s=>s.flatMap(t=>t.columns.flatMap(n=>n.cards.filter(l=>!!l)));function V1(s,t,n=4,l=!1,u){const c=[],r=p=>u&&["connection","networkInterface"].includes(p)&&u[p].mode==="summary"?Kt(p,u[p],{width:t,height:1e4,role:"ordinary",favoriteCount:n,mobile:!0}).minHeight:u&&p==="applications"?Math.max(rn(p).singleHeight,Kt(p,u[p],{width:t,height:1e4,role:"ordinary",favoriteCount:n,mobile:!0}).minHeight):u&&p==="devices"&&u[p].mode==="summary"?Kt(p,u[p],{width:t,height:1e4,role:"ordinary",favoriteCount:n,mobile:!0}).minHeight:rn(p).singleHeight;for(const p of s){let v=[];const h=b=>Math.max(...b.cards.map(m=>m?u?Os(m,u[m],b.cards.length===2).minWidth:rn(m).minWidth:260)),g=()=>{v.length&&(t<650&&v.length===1?v[0].cards.forEach((b,m)=>c.push({id:p.id+"-"+(b||"empty-"+v[0].source+"-"+m),source:p.id,height:b?r(b):148,natural:!!p.heightMode,chartHeight:b==="traffic"?300:void 0,columns:[Ne(ye({},v[0]),{cards:[b],slots:[v[0].slots[m]],compact:!1})]})):c.push({id:p.id+"-"+v[0].source,source:p.id,height:p.height,natural:!!p.heightMode,chartHeight:v.some(b=>b.cards.includes("traffic"))?320:void 0,columns:v}),v=[])};p.columns.forEach((b,m)=>{const f=b.cards.map((w,S)=>l||w?S:-1).filter(w=>w>=0),k=f.map(w=>b.cards[w]);if(!k.length)return;const $={source:m,cards:k,slots:f,weight:b.weight,split:b.split,compact:b.cards.length>1};v.length&&v.reduce((w,S)=>w+h(S),0)+h($)+v.length*18>t&&g(),v.push($)}),g()}return c}function Vn(s,t){for(const n of s)for(let l=0;l=0)return{row:n.id,column:l,slot:u}}}function Il(s,t){var n,l;return(l=(n=s.find(u=>u.id===t.row))==null?void 0:n.columns[t.column])==null?void 0:l.cards[t.slot]}function B1(s){return Math.ceil(Math.max(0,...s.columns.flatMap(t=>t.cards.map((n,l)=>{if(!n)return 0;const u=t.cards.length===2,c=u?Ro(n).compactHeight:Ro(n).minHeight;return u?c/((l===0?t.split:100-t.split)/100)+18:c}))))}function rs(s){const t=Yt(s);if(new Set(t).size!==t.length)return{issue:"duplicate"};for(const n of s){const l=z1(n);if(l)return{issue:l,row:n.id};const u=Yn.find(r=>r.id===n.template);if(!u||n.columns.length!==u.slots.length||n.columns.some((r,p)=>r.cards.length!==u.slots[p]||r.weight<=0||r.split<=0||r.split>=100)||Math.abs(n.columns.reduce((r,p)=>r+p.weight,0)-100)>.01)return{issue:"structure",row:n.id};if(n.columns.some(r=>r.cards.length===2&&r.cards.some(p=>p&&!aa(p).forms.some(v=>zo(p,v).stacked))))return{issue:"compact",row:n.id};const c=B1(n);if(!n.heightMode&&n.heightp.id===t.row))==null?void 0:r.columns[t.column];if(!u||t.slot<0||t.slot>=u.cards.length)return{rows:s,issue:"target",changed:!1,hidden:[]};const c=u.cards[t.slot];if(c===n)return ea(s,l);if(n){const p=Vn(l,n);p&&(l.find(v=>v.id===p.row).columns[p.column].cards[p.slot]=null)}return u.cards[t.slot]=n,ea(s,l,c?[c]:[])}function U1(s,t,n,l,u){const c=rt(s),r=c.findIndex(m=>m.id===t),p=c[r];if(!p)return{rows:s,issue:"target",changed:!1,hidden:[]};const v=Yt([p]),h=Yn.find(m=>m.id===n).slots.reduce((m,f)=>m+f,0);if(v.length>h&&!l)return{rows:s,issue:"choose-retained",changed:!1,hidden:[]};const g=l||v;if(g.length>h||new Set(g).size!==g.length||g.some(m=>!v.includes(m)))return{rows:s,issue:"retained",changed:!1,hidden:[]};if(!l&&(p.template==="left-big"&&n==="right-big"||p.template==="right-big"&&n==="left-big"))return p.template=n,p.columns.reverse(),ea(s,c);const b=Rn(g,n==="right-big"?"left-big":n,p.height,p.id);return p.minHeight!==void 0&&(b.minHeight=p.minHeight),n==="right-big"&&(b.template=n,b.columns.reverse()),c[r]=b,ea(s,c,v.filter(m=>!g.includes(m)))}function F1(s,t,n){const l=rt(s),u=l.find(c=>c.id===t);if(!u)return{rows:s,issue:"target",changed:!1,hidden:[]};if(n.height!==void 0&&(u.height=n.height),n.weights){if(n.weights.length!==u.columns.length)return{rows:s,issue:"structure",changed:!1,hidden:[]};u.columns.forEach((c,r)=>c.weight=n.weights[r])}if(n.column!==void 0&&n.split!==void 0){if(!u.columns[n.column])return{rows:s,issue:"target",changed:!1,hidden:[]};u.columns[n.column].split=n.split}return ea(s,l)}function H1(s,t,n){const l=rt(s),u=l.findIndex(c=>c.id===t);if(u<0||n&&!l.some(c=>c.id===n))return{rows:s,issue:"target",changed:!1,hidden:[]};if(t!==n){const[c]=l.splice(u,1);l.splice(n?l.findIndex(r=>r.id===n):l.length,0,c)}return ea(s,l)}function wi(s,t,n){const l=rt(s);if(n&&!l.some(p=>p.id===n))return{rows:s,issue:"target",changed:!1,hidden:[]};const u=Vn(l,t);u&&(l.find(p=>p.id===u.row).columns[u.column].cards[u.slot]=null);let c=1;for(;l.some(p=>p.id==="slot-row-"+c);)c++;const r=Rn([t],"single",Math.max(280,Ro(t).minHeight),"slot-row-"+c);return l.splice(n?l.findIndex(p=>p.id===n):l.length,0,r),ea(s,l)}function G1(s,t,n,l){const u=rt(s),c=u.find(p=>p.id===n);if(!c||!["single","pair"].includes(c.template))return{rows:s,issue:"capacity",changed:!1,hidden:[]};const r=Vn(u,t);return(r==null?void 0:r.row)===n?{rows:s,issue:"same-row",changed:!1,hidden:[]}:(r&&(u.find(p=>p.id===r.row).columns[r.column].cards[r.slot]=null),c.columns.splice(l,0,{cards:[t],weight:1,split:50}),c.template=c.columns.length===2?"pair":"triple",c.columns.forEach((p,v)=>p.weight=c.columns.length===2?50:[34,33,33][v]),ea(s,u))}function j1(s,t=()=>!0,n=rs){const l=rt(s).filter(r=>Yt([r]).length),u=[];l.forEach((r,p)=>{const v=Yt([r]);if(!r.columns.some(f=>f.cards.some(k=>!k)))return;if(r.columns.some(f=>f.cards.length===2)&&!(v.length===1&&r.columns.some(f=>f.cards.length===1&&f.cards[0]))){u.push({row:r.id,issue:"incomplete-stack"});return}const b=v.length===1?"single":"pair",m=Rn(v,b,r.height,r.id);if(m.heightMode=r.heightMode,r.minHeight!==void 0&&(m.minHeight=r.minHeight),b==="pair"&&m.columns.forEach(f=>f.weight=50),v.some(f=>!t(f,m))){u.push({row:r.id,issue:"hard-spec"});return}l[p]=m});const c=n(l);return c.issue&&u.push({row:c.row||"",issue:c.issue,requiredHeight:c.requiredHeight}),u.length?{rows:l,issue:u[0].issue,changed:!1,hidden:[],problems:u,problemRow:u[0].row,requiredHeight:u[0].requiredHeight}:{rows:l,issue:"",hidden:[],changed:JSON.stringify(s)!==JSON.stringify(l),problems:u}}const $i=128*1024;class Lt extends Error{constructor(n,l=n){super(l);Nn(this,"code");this.code=n,this.name="HomeConfigError"}}const jt=()=>{throw new Lt("invalid")},ua=(s,t,n=t)=>{(!s||typeof s!="object"||Array.isArray(s)||Object.keys(s).some(l=>!t.includes(l))||n.some(l=>!Object.prototype.hasOwnProperty.call(s,l)))&&jt()},Ha=(s,t,n)=>typeof s=="number"&&Number.isFinite(s)&&s>=t&&s<=n,Dl=/^[A-Za-z0-9][A-Za-z0-9_.+-]{0,127}$/,Ll=/^user-link:[A-Za-z0-9_-]{1,64}$/,W1=["globe","folder","layers","network","shield","download","terminal","grid"];function ts(s,t){const n=t;if((!n||typeof n!="object"||!Number.isInteger(n.schemaVersion))&&jt(),n.schemaVersion>(s==="layout"?4:1))throw new Lt("future");if(new TextEncoder().encode(JSON.stringify(n)).length>$i&&jt(),s==="layout"){ua(n,["schemaVersion","rows","widgetPreferences"]),(![3,4].includes(n.schemaVersion)||!Array.isArray(n.rows)||n.rows.length>32)&&jt();const u=Un.map(p=>p.id),c=Object.keys(n.widgetPreferences||{}).filter(p=>vi.test(p));(c.length>32||n.schemaVersion===3&&c.length)&&jt(),ua(n.widgetPreferences,[...u,...c]);for(const p of[...u,...c]){const v=n.widgetPreferences[p];ua(v,["mode","iconRows","ruleVersion"]),(Ks(p,v)||!Number.isInteger(v.iconRows)||!Number.isInteger(v.ruleVersion))&&jt()}const r=new Set;for(const p of n.rows){ua(p,["id","template","height","heightMode","minHeight","columns"],["id","template","height","heightMode","columns"]),(typeof p.id!="string"||!Dl.test(p.id)||r.has(p.id)||!Ha(p.height,1,1600)||!["content","chart"].includes(p.heightMode)||p.minHeight!==void 0&&!Ha(p.minHeight,1,1600)||!Array.isArray(p.columns)||p.columns.length<1||p.columns.length>3)&&jt(),r.add(p.id);for(const v of p.columns){ua(v,["weight","cards","split","upperShare"],["weight","cards","split"]),(!Ha(v.weight,.01,100)||!Ha(v.split,.01,99.99)||v.upperShare!==void 0&&!Ha(v.upperShare,.01,99.99)||!Array.isArray(v.cards)||v.cards.length<1||v.cards.length>2)&&jt();for(const h of v.cards)h!==null&&(!u.includes(h)&&!(n.schemaVersion===4&&c.includes(h))&&jt(),v.cards.length===2&&Kt(h,n.widgetPreferences[h],{width:1e3,height:1e5,role:"stacked",favoriteCount:8,natural:!0}).issue&&jt())}}rs(n.rows).issue&&jt()}else{ua(n,["schemaVersion","favorites","links"]),(n.schemaVersion!==1||!Array.isArray(n.favorites)||n.favorites.length>24||!Array.isArray(n.links)||n.links.length>64)&&jt();const u=new Set;for(const r of n.links){ua(r,["id","name","url","glyph"]),(typeof r.id!="string"||!Ll.test(r.id)||u.has(r.id)||typeof r.name!="string"||r.name!==r.name.trim()||!r.name||Array.from(r.name).length>64||/[\u0000-\u001f\u007f-\u009f]/.test(r.name)||typeof r.url!="string"||!/^https?:\/\//.test(r.url)||new TextEncoder().encode(r.url).length>2048||/[\u0000-\u0020\u007f\\]/.test(r.url)||!W1.includes(r.glyph))&&jt();try{const p=new URL(r.url);(!["http:","https:"].includes(p.protocol)||!p.hostname||p.username||p.password)&&jt()}catch(p){jt()}u.add(r.id)}const c=new Set;for(const r of n.favorites)(typeof r!="string"||c.has(r)||!(Dl.test(r)||Ll.test(r)&&u.has(r)))&&jt(),c.add(r)}const l=JSON.parse(JSON.stringify(n));return s==="layout"&&(l.schemaVersion=4),l}function J1(s){const t=Xe({status:"loading",apps:[],sandbox:"unknown"}),n=new Map,l={get favorites(){return s.launcher.value.favorites}},u={get entries(){return s.launcher.value.links.map(y=>({id:y.id,zh:y.name,en:y.name,path:y.url,glyph:y.glyph,detail:"用户添加的链接",detailEn:"Custom link",kind:"link",tone:"teal"}))}};let c,r=!0,p;function v(){return p=h()}function h(){return B(this,null,function*(){c==null||c.abort();const y=new AbortController;c=y,t.status="loading";let P=!1;const _=window.setTimeout(()=>{P=!0,y.abort()},8e3);try{const D=yield L1(y.signal);if(r&&c===y){for(const E of t.apps)l.favorites.includes(E.id)&&n.set(E.id,E);for(const E of n.keys())l.favorites.includes(E)||n.delete(E);t.apps=D,t.status="ready"}}catch(D){r&&c===y&&(t.status=P?"timeout":D instanceof Error&&D.message==="permission"?"permission":"error")}finally{window.clearTimeout(_)}})}function g(){return B(this,null,function*(){var _;const y=new AbortController,P=window.setTimeout(()=>y.abort(),8e3);try{const D=yield fetch("/cgi-bin/luci/istore/nas/sandbox/",{signal:y.signal,credentials:"same-origin",cache:"no-store"}),E=yield D.json();r&&D.ok&&(E.success===void 0||E.success===0)&&!E.error&&(t.sandbox=((_=E.result)==null?void 0:_.status)||"unknown")}catch(D){}finally{window.clearTimeout(P)}})}function b(y){return[...As,...t.apps,...u.entries,...n.values(),...es].find(P=>P.id===y)||{id:y,zh:"不可用入口",en:"Unavailable shortcut",detail:y,detailEn:y,glyph:"grid",path:"",kind:"app",tone:"blue"}}function m(y){var _;if(y.kind==="link")return u.entries.some(D=>D.id===y.id)?"available":"unknown";if(y.kind==="app")return t.status==="ready"?t.apps.some(D=>D.id===y.id)?y.path||y.entryScript?"available":"no-entry":"uninstalled":t.status==="permission"?"permission":"unknown";const P={terminal:"ttyd",firmware:"ota",sandbox:"sandbox"}[y.tool||""];return P&&!((_=window.quickstart_features)!=null&&_.includes(P))?"unsupported":y.tool==="sandbox"?t.sandbox==="unsupport"?"unsupported":t.sandbox==="unknown"?"unknown":"available":"available"}const f=R(()=>M1([...As,...es.filter(y=>y.kind==="builtin"),...t.apps,...u.entries],l.favorites,b));function k(y){return B(this,null,function*(){yield s.save("launcher",Ne(ye({},s.launcher.value),{favorites:y}))})}function $(y){return B(this,null,function*(){const P=s.launcher.value;if(y.id&&!P.links.some(q=>q.id===y.id))return{error:"missing"};if(!y.id&&P.links.length>=64)return{error:"limit"};if(y.pin&&!P.favorites.includes(y.id||"")&&P.favorites.length>=24)return{error:"pins"};const _=y.id||"user-link:"+Array.from(crypto.getRandomValues(new Uint8Array(16)),q=>q.toString(16).padStart(2,"0")).join(""),D=y.name.trim(),E=y.url.trim(),A={id:_,name:D,url:E,glyph:y.glyph},U={schemaVersion:1,links:[...P.links.filter(q=>q.id!==_),A],favorites:y.pin&&!P.favorites.includes(_)?[...P.favorites,_]:[...P.favorites]};try{ts("launcher",U)}catch(q){return{error:!D||Array.from(D).length>64?"name":"url"}}return yield s.save("launcher",U),{entry:b(_)}})}function w(y){return B(this,null,function*(){const P=s.launcher.value;yield s.save("launcher",Ne(ye({},P),{links:P.links.filter(_=>_.id!==y),favorites:P.favorites.filter(_=>_!==y)}))})}const S=Oa();let C;return nt(()=>{var y,P,_;v(),g(),!((P=(y=window.quickstart_configs)==null?void 0:y.update)!=null&&P.disable)&&((_=window.quickstart_features)!=null&&_.includes("ota"))&&(C=window.setTimeout(()=>{document.hidden||S.requestCheckUpdate()},1100))}),lt(()=>{r=!1,c==null||c.abort(),window.clearTimeout(C)}),{state:t,catalogue:f,resolve:b,resolveEntry:b,entryAvailability:m,homeApplicationSession:l,linkSession:u,saveLink:$,deleteLink:w,saveFavorites:k,retry:v,waitForRead:()=>p||Promise.resolve(),begin:()=>s.begin("launcher"),editable:()=>s.editable("launcher"),saving:()=>s.state.launcher.saving,preferencesLoading:()=>s.state.launcher.loading}}const Ci=Symbol("quickstart-home-launcher");function K1(s){const t=J1(s);return ma(Ci,t),t}function ns(){const s=ba(Ci);if(!s)throw new Error("Launcher owner missing");return s}const Z1=["data-shortcut-drag"],Y1={class:"launcher-preview-heading"},Q1={class:"launcher-editor-instructions",id:"launcher-sort-help"},X1=["data-editor-shortcut"],e2=["aria-label","aria-pressed","data-shortcut-handle","onPointerdown","onKeydown"],t2=["data-remove-shortcut","aria-label","disabled","onClick"],n2={key:1,class:"launcher-empty-preview"},a2={class:"launcher-sr-only",role:"status","aria-live":"polite"},s2=X({__name:"LauncherFavoriteGrid",props:{ids:{},columns:{},limit:{}},emits:["reorder","remove"],setup(s,{emit:t}){const{resolveEntry:n}=ns(),l=s,u=t,c=window.vue_lang==="en",r=(N,F)=>c?F:N,p=n,v=N=>{const F=p(N);return r(F.zh,F.en)},h=x(null),g=x(""),b=R(()=>Math.max(2,Math.min(4,l.columns))),m=R(()=>{if(!h.value)return l.ids;const N=h.value.origin.filter(F=>F!==h.value.id);return N.splice(h.value.target,0,h.value.id),N});let f=0,k=0,$=null;function w(){f&&cancelAnimationFrame(f),f=0,$=null}function S(){var F;const N=h.value;h.value=null,w(),(N==null?void 0:N.pointer)!==void 0&&((F=N.handle)!=null&&F.hasPointerCapture(N.pointer))&&N.handle.releasePointerCapture(N.pointer)}function C(N){ot(()=>{const F=document.querySelector(`[data-shortcut-handle="${CSS.escape(N)}"]`);F==null||F.focus({preventScroll:!0}),F==null||F.scrollIntoView({block:"nearest"})})}function y(){const N=h.value;if(!N)return;const F=[...m.value],Z=F.some((Q,ce)=>N.origin[ce]!==Q);S(),Z&&(u("reorder",F),g.value=v(N.id)+r("已移动到第"," moved to position ")+(F.indexOf(N.id)+1)+r("位","")),C(N.id)}function P(N,F){if(N.button!==0||h.value)return;N.preventDefault();const Z=N.currentTarget.closest(".launcher-editor-preview");$=Z.closest(".applications-browser-body");const Q=Array.from(Z.querySelectorAll("[data-editor-shortcut]")).map(ce=>{const ve=ce.getBoundingClientRect();return{x:ve.x,y:ve.y,width:ve.width,height:ve.height}});h.value={id:F,origin:[...l.ids],target:l.ids.indexOf(F),pointer:N.pointerId,x:N.clientX,y:N.clientY,handle:Z,slots:Q,scrollStart:($==null?void 0:$.scrollTop)||0},Z.setPointerCapture(N.pointerId),k=N.clientY,f=requestAnimationFrame(A)}function _(N,F){const Z=h.value;if(!(Z!=null&&Z.slots))return;const Q=F+(($==null?void 0:$.scrollTop)||0)-(Z.scrollStart||0);let ce=1/0,ve=Z.target;Z.slots.forEach((O,de)=>{const K=fs((N-O.x-O.width/2)/O.width,2)+fs((Q-O.y-O.height/2)/O.height,2);KN.bottom-36?8:0;F&&($.scrollTop+=F,_(h.value.x,k))}f=requestAnimationFrame(A)}}function U(N,F){var Z,Q;if(!h.value&&[" ","Enter"].includes(N.key)){N.preventDefault(),h.value={id:F,origin:[...l.ids],target:l.ids.indexOf(F),x:0,y:0},g.value=r("已拿起","Picked up ")+v(F);return}if(!(((Z=h.value)==null?void 0:Z.pointer)!==void 0||((Q=h.value)==null?void 0:Q.id)!==F)){if([" ","Enter"].includes(N.key))N.preventDefault(),y();else if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(N.key)){N.preventDefault();const ce=N.key==="ArrowLeft"?-1:N.key==="ArrowRight"?1:N.key==="ArrowUp"?-b.value:b.value;h.value.target=N.key==="Home"?0:N.key==="End"?l.ids.length-1:Math.max(0,Math.min(l.ids.length-1,h.value.target+ce)),g.value=r("目标位置","Target position ")+(h.value.target+1),C(F)}}}function q(N){if(N.key==="Escape"&&h.value){N.preventDefault(),N.stopImmediatePropagation();const F=h.value.id;S(),C(F)}}function z(){document.hidden&&S()}return We(()=>l.ids,S),We(()=>l.columns,S),nt(()=>{window.addEventListener("keydown",q,!0),window.addEventListener("blur",S),window.addEventListener("resize",S),document.addEventListener("visibilitychange",z)}),lt(()=>{S(),window.removeEventListener("keydown",q,!0),window.removeEventListener("blur",S),window.removeEventListener("resize",S),document.removeEventListener("visibilitychange",z)}),(N,F)=>(i(),d("div",{class:"launcher-editor-preview","data-shortcut-drag":h.value?"active":void 0,onPointermove:D,onPointerup:E,onPointercancel:S,onLostpointercapture:S},[e("div",Y1,[e("strong",null,a(r("首页快捷入口","Home shortcuts")),1),e("span",null,a(s.ids.length)+" / "+a(s.limit),1)]),e("p",Q1,a(r("拖动手柄调整顺序,点击 × 移除入口。键盘:空格拿起,方向键移动,回车放下。","Drag a handle to reorder; × removes a shortcut. Keyboard: Space to pick up, arrows to move, Enter to drop.")),1),s.ids.length?(i(),Y(xr,{key:0,name:"shortcut",tag:"div",class:"launcher-edit-grid",style:pt({gridTemplateColumns:"repeat("+b.value+",minmax(0,1fr))"})},{default:pe(()=>[(i(!0),d(V,null,oe(m.value,Z=>{var Q,ce;return i(),d("div",{key:Z,class:_e(["launcher-edit-tile",{picked:((Q=h.value)==null?void 0:Q.id)===Z,target:h.value&&m.value.indexOf(Z)===h.value.target}]),"data-editor-shortcut":Z},[e("button",{type:"button",class:"launcher-drag-handle","aria-label":r("移动","Move ")+v(Z),"aria-describedby":"launcher-sort-help","aria-pressed":((ce=h.value)==null?void 0:ce.id)===Z,"data-shortcut-handle":Z,onPointerdown:ve=>P(ve,Z),onKeydown:ve=>U(ve,Z)},[...F[0]||(F[0]=[e("span",{"aria-hidden":"true"},"⠿",-1)])],40,e2),e("button",{type:"button",class:"launcher-remove","data-remove-shortcut":Z,"aria-label":r("移除","Remove ")+v(Z),disabled:!!h.value,onClick:ve=>N.$emit("remove",Z)},"×",8,t2),e("span",{class:_e(["application-icon",o(p)(Z).tone])},[G(Cs,{app:o(p)(Z)},null,8,["app"])],2),e("strong",null,a(v(Z)),1)],10,X1)}),128))]),_:1},8,["style"])):(i(),d("p",n2,a(r("从下方添加一个入口,首页就从这里开始。","Add a shortcut below to make this space yours.")),1)),e("span",a2,a(g.value),1)],40,Z1))}}),o2=le(s2,[["__scopeId","data-v-15a93888"]]);function l2(s,t,n=()=>!0){const l=ta();let u,c,r=0,p=!1,v,h,g="",b=0;const m=x([]),f=["pointerdown","touchstart","wheel","keydown"];function k(){const _=ye({},window.history.state);delete _.qsHomeEntry,window.history.replaceState(_,"")}function $(){p=!1,u==null||u.disconnect(),u=void 0,window.clearTimeout(c),c=void 0,cancelAnimationFrame(r),r=0,g="",b=0,m.value=[];for(const _ of f)document.removeEventListener(_,w,!0);if(v!==void 0&&(window.history.scrollRestoration=v,v=void 0),h){const _=document.documentElement.style;h.value?_.setProperty("overflow-anchor",h.value,h.priority):_.removeProperty("overflow-anchor"),h=void 0}}function w(){p&&(k(),$())}function S(){p&&!r&&(r=requestAnimationFrame(C))}function C(){var F;if(r=0,!p)return;if(l.path!=="/"||l.query.panel){$();return}if(!t())return;const _=ho((F=window.history.state)==null?void 0:F.qsHomeEntry);if(!_){$();return}const D=document.querySelector(_.source==="traffic"?"[data-home-speed]":'[data-favorite-app="'+CSS.escape(_.id)+'"]');if(!D){g="",b=0;return}const E=D.closest("[data-layout-card]"),A=document.querySelectorAll(".canvas-home [data-layout-card]"),U=E==null?void 0:E.getBoundingClientRect().top,q=Array.from(A).filter(Z=>U===void 0||Z.getBoundingClientRect().top<=U+1).map(Z=>Z.dataset.layoutCard);if(q.join("|")!==m.value.join("|")&&(m.value=q),!n(q)){g="",b=0;return}const z=D.getBoundingClientRect(),N=JSON.stringify([z.top+window.scrollY,z.left+window.scrollX,z.width,z.height]);if(b=N===g?b+1:0,g=N,b<2||document.documentElement.scrollHeight-window.innerHeight<_.scroll){S();return}window.scrollTo({top:_.scroll,behavior:"auto"}),D.focus({preventScroll:!0}),k(),$()}function y(){var E;if(!s)return;$();const _=ho((E=window.history.state)==null?void 0:E.qsHomeEntry);if(!_)return;p=!0,v=_.restoration||window.history.scrollRestoration,window.history.scrollRestoration="manual";const D=document.documentElement.style;h={value:D.getPropertyValue("overflow-anchor"),priority:D.getPropertyPriority("overflow-anchor")},D.setProperty("overflow-anchor","none","important");for(const A of f)document.addEventListener(A,w,{capture:!0,passive:!0});u=new MutationObserver(S),u.observe(document.querySelector(".canvas-home")||document.body,{childList:!0,subtree:!0}),c=window.setTimeout(()=>{k(),$()},1e4),S()}function P(_,D){if(!s)return;const E=ho({v:1,id:_,source:D,scroll:window.scrollY,restoration:window.history.scrollRestoration});E&&(window.history.replaceState(Ne(ye({},window.history.state),{qsHomeEntry:E}),""),window.history.scrollRestoration="manual")}return We(()=>[t(),n(m.value),l.fullPath],()=>{s&&S()},{flush:"post"}),nt(()=>{s&&(y(),window.addEventListener("pageshow",y))}),lt(()=>{p=!1,$(),window.removeEventListener("pageshow",y)}),{remember:P}}const i2=["aria-busy","inert"],r2={class:"link-intro"},c2=["placeholder"],d2={class:"link-icon-options"},u2=["onClick","aria-pressed","aria-label"],v2={key:0,class:"link-pin"},p2=["disabled"],h2={key:1,class:"link-intro"},m2={key:2,class:"link-notice","data-link-duplicate":""},f2={key:3,role:"alert",class:"link-error","data-link-error":""},b2={key:4,class:"link-delete-confirm",role:"alert","data-link-delete-confirm":""},g2=["disabled"],_2=["disabled"],y2=X({__name:"LauncherLinkForm",props:{initial:{},entries:{}},emits:["cancel","saved"],setup(s,{emit:t}){var S,C,y,P;const{homeApplicationSession:n,saveLink:l,deleteLink:u,saving:c}=ns(),r=s,p=t,v=(_,D)=>window.vue_lang==="en"?D:_,h=Xe({id:(S=r.initial)==null?void 0:S.id,name:((C=r.initial)==null?void 0:C.zh)||"",url:((y=r.initial)==null?void 0:y.path)||"",glyph:((P=r.initial)==null?void 0:P.glyph)||"globe",pin:!1}),g=x(""),b=x(!1),m=x(null),f=R(()=>T1(h.url,r.entries,h.id)),k=R(()=>({name:v("请输入1~64字名称。","Enter a name of 1–64 characters."),url:v("请输入有效HTTP(S)地址,不含空白或登录凭据。","Use a valid HTTP(S) address without whitespace or credentials."),icon:v("请选择内置图标。","Choose a built-in icon."),limit:v("已达到64条链接上限,请先删除不再使用的链接。","64-link limit reached. Remove an unused link first."),pins:v("首页已固定24项,请取消同时固定或先移除一项。","Homepage has 24 pins. Uncheck pin or remove one first."),missing:v("链接已不存在,请返回重试。","This link no longer exists. Return and retry.")})[g.value]||g.value);function $(){return B(this,null,function*(){if(!c())try{const _=yield l(h);if(_.error){g.value=_.error;return}p("saved",v("链接已保存","Link saved"),_.entry.id)}catch(_){g.value=_ instanceof Error?_.message:v("保存失败","Save failed")}})}function w(){return B(this,null,function*(){if(!c())try{r.initial&&(yield u(r.initial.id)),p("saved",v("链接已删除","Link deleted"))}catch(_){g.value=_ instanceof Error?_.message:v("删除失败","Delete failed")}})}return nt(()=>B(null,null,function*(){var _;yield ot(),(_=m.value)==null||_.focus()})),(_,D)=>(i(),d("form",{"aria-busy":o(c)(),inert:o(c)(),class:"launchpad-link-form",onSubmit:Ge($,["prevent"]),"data-link-form":""},[e("p",r2,a(v("把常用的服务或网站收进来。保存到此路由器,刷新后保留。","Keep a service or website here. Saved on this router and retained after reload.")),1),e("label",null,[ue(a(v("名称","Name")),1),W(e("input",{ref_key:"nameInput",ref:m,"onUpdate:modelValue":D[0]||(D[0]=E=>h.name=E),maxlength:"64",required:"",autocomplete:"off","data-link-name":"",placeholder:v("例如:家庭 NAS","For example: Home NAS")},null,8,c2),[[Oe,h.name]])]),e("label",null,[ue(a(v("地址","Address")),1),W(e("input",{"onUpdate:modelValue":D[1]||(D[1]=E=>h.url=E),maxlength:"2048",required:"",autocomplete:"off",inputmode:"url","data-link-url":"",placeholder:"https://"},null,512),[[Oe,h.url]]),e("small",null,a(v("支持 HTTP / HTTPS,在新标签页打开。","HTTP / HTTPS. Opens in a new tab.")),1)]),e("fieldset",null,[e("legend",null,a(v("图标","Icon")),1),e("div",d2,[(i(!0),d(V,null,oe(o(P1),E=>(i(),d("button",{type:"button",key:E,onClick:A=>h.glyph=E,"aria-pressed":h.glyph===E,"aria-label":v("图标:","Icon: ")+E},[G(Qe,{name:E},null,8,["name"])],8,u2))),128))])]),s.initial?T("",!0):(i(),d("label",v2,[W(e("input",{"onUpdate:modelValue":D[2]||(D[2]=E=>h.pin=E),type:"checkbox",disabled:o(n).favorites.length>=24,"data-link-pin":""},null,8,p2),[[gt,h.pin]]),ue(a(v("同时固定到首页","Also pin to homepage")),1),e("small",null,a(o(n).favorites.length)+" / 24",1)])),!s.initial&&o(n).favorites.length>=24?(i(),d("p",h2,a(v("首页已满,仍可添加到全部入口。","Homepage full. You can still add this link to All.")),1)):T("",!0),f.value?(i(),d("p",m2,a(v("已有相同地址:","An entry already uses this address: "))+a(v(f.value.zh,f.value.en))+a(v("。可取消后使用原入口,也可保留为独立链接。",". Cancel to reuse it, or save a separate link.")),1)):T("",!0),g.value?(i(),d("p",f2,a(k.value),1)):T("",!0),b.value?(i(),d("div",b2,[e("p",null,a(v("删除此链接?如已固定,也会从首页移除;不会卸载应用或关闭服务。","Delete this link and its homepage pin? Apps and services are unaffected.")),1),e("button",{type:"button",onClick:w,"data-link-confirm-delete":""},a(v("确认删除","Confirm delete")),1),e("button",{type:"button",onClick:D[3]||(D[3]=E=>b.value=!1)},a(v("保留","Keep")),1)])):T("",!0),e("footer",null,[s.initial&&!b.value?(i(),d("button",{key:0,disabled:o(c)(),type:"button",class:"link-delete",onClick:D[4]||(D[4]=E=>b.value=!0),"data-link-delete":""},a(v("删除链接","Delete link")),9,g2)):T("",!0),D[6]||(D[6]=e("span",null,null,-1)),e("button",{type:"button",onClick:D[5]||(D[5]=E=>_.$emit("cancel"))},a(v("取消","Cancel")),1),e("button",{type:"submit",disabled:o(c)(),class:"link-save","data-link-save":""},a(v("保存链接","Save link")),9,_2)])],40,i2))}}),k2=le(y2,[["__scopeId","data-v-2b884351"]]);function Zs(){const s=new Set;let t=!0;return lt(()=>{t=!1;for(const n of s)window.clearTimeout(n);s.clear()}),(n,l=0)=>{if(!t)return 0;const u=window.setTimeout(()=>{s.delete(u),t&&n()},l);return s.add(u),u}}const w2={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"128",height:"128"},$2=["fill"],C2=X({__name:"close",props:{color:{type:String,default:"#000000"}},setup(s){return(t,n)=>(i(),d("svg",w2,[e("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",fill:s.color},null,8,$2)]))}}),S2={id:"actioner"},x2={key:0,class:"action-container"},P2={class:"action-container_header"},T2={class:"title"},M2=["title"],E2={class:"action-container_body"},I2=X({__name:"index",props:{Close:{type:Function},type:{type:Number},title:String},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1);nt(()=>{u.value=!0,document.body.setAttribute("lock-scroll","true")}),lt(()=>{document.body.removeAttribute("lock-scroll")});const c=()=>{l.Close&&(u.value=!1,setTimeout(()=>{l.Close&&l.Close()},300))};return(r,p)=>(i(),d("div",S2,[e("div",{class:"bg",onClick:c}),s.type!=null?Ct(r.$slots,"default",{},void 0,!0,0):(i(),d(V,{key:1},[u.value?(i(),d("div",x2,[e("div",P2,[p[0]||(p[0]=e("div",null,null,-1)),e("div",T2,a(s.title),1),e("button",{class:"close",title:o(t)("关闭"),onClick:c},[G(C2)],8,M2)]),e("div",E2,[Ct(r.$slots,"default",{},void 0,!0)])])):T("",!0)],64))]))}}),D2=le(I2,[["__scopeId","data-v-20b7104a"]]),Nt=X({__name:"modal",props:{Close:{type:Function},type:{type:Number},title:String},setup(s){return(t,n)=>(i(),Y(D2,{Close:s.Close,type:s.type,title:s.title},{default:pe(()=>[Ct(t.$slots,"default")]),_:3},8,["Close","type","title"]))}}),Si=/\d+\.\d+\.\d+\.\d+/,L2=s=>Si.test(s)&&ss.IPv4.isValid(s),Qn=s=>{const t=ss.IPv4.parse(s).toByteArray();return t[0]<<24|t[1]<<16|t[2]<<8|t[3]},Al=s=>ss.fromByteArray([s>>24&255,s>>16&255,s>>8&255,s&255]).toString(),A2=s=>{if(!Si.test(s)||!ss.IPv4.isIPv4(s))return!1;let t=0,n=Qn(s);for(let l=31;l>=0&&(n&1<{let u=Qn(s)&Qn(t),c=Qn(n),r=Qn(l),v=~Qn(t);return cu+1&&r{let n=Qn(t),l=Qn(s)&n,u=~n,c;return u>=105?(c=l|u-5,l=l|100):u>=3?(c=l|u-1,l=l|2):(l=l|1,c=l),[Al(l),Al(c)]},z2=s=>ss.IPv4.subnetMaskFromPrefixLength(s).toString(),wn={isValidMask:A2,isValidIPv4:L2,isValidMaskRange:N2,calcMaskRange:O2,prefixToMask:z2},q2={class:"actioner-dns_header"},R2={class:"actioner-dns_body"},V2={class:"label-item"},B2={class:"label-item_key"},U2={class:"label-item_value"},F2={class:"label-item"},H2={class:"label-item_key"},G2={class:"label-item_value"},j2={key:0,class:"chose_dhcp"},W2={key:0,class:"dhcp_info"},J2={key:1,class:"dhcp_info"},K2={class:"label-item"},Z2={class:"label-item_key"},Y2={class:"label-item_value"},Q2={class:"label-item"},X2={class:"label-item_key"},e0={class:"label-item_value"},t0={class:"actioner-dns_footer"},n0=["disabled"],a0={key:1,class:"actioner-dns"},s0={class:"actioner-dns_header"},o0={class:"actioner-dns_body"},l0={key:0,class:"setting_status"},i0={class:"config-message"},r0=["href"],c0={key:1,class:"setting_status"},d0={class:"config-message"},u0={key:2,class:"setting_status"},v0={class:"config-message"},p0=X({__name:"index",props:{Close:{type:Function,required:!0}},setup(s){const t=Zs(),{$gettext:n,$ngettext:l}=Ae(),u=s,c=x(0),r=x({lanIp:"",netMask:"255.255.255.0",enableDhcp:!1,dhcpStart:"",dhcpEnd:""});x("");const p=x(!1);x(!0),x(!1);const v=x(""),h=x(2),g=x(!1),b=x("timeout");let m=!0;we.Guide.GetLan.GET().then(C=>{C.data.result&&(g.value=C.data.result.enableDhcp||!1,C.data.result.enableDhcp=!1,r.value=C.data.result,C.data.result.lanIp!==location.hostname&&(m=!1))});const k=()=>{const C=r.value;if(!wn.isValidIPv4(C.lanIp)){ne.Warning(n("IPv4地址格式错误"));return}if(!wn.isValidMask(C.netMask)){ne.Warning(n("IPv4子网掩码格式错误"));return}const y=wn.calcMaskRange(C.lanIp,C.netMask);C.dhcpStart=y[0],C.dhcpEnd=y[1],r.value=C},$=()=>{const C=r.value;if(!wn.isValidIPv4(C.lanIp)){ne.Warning(n("IPv4地址格式错误"));return}if(!wn.isValidMask(C.netMask)){ne.Warning(n("IPv4子网掩码格式错误"));return}if(C.enableDhcp&&!(wn.isValidIPv4(C.dhcpStart)&&wn.isValidIPv4(C.dhcpEnd)&&wn.isValidMaskRange(C.lanIp,C.netMask,C.dhcpStart,C.dhcpEnd))){ne.Warning(n("DHCP的IP池格式错误或超出子网范围"));return}const y=ne.Loading(n("正在配置…请稍等"),30);let P=0;const _=E=>{b.value=E,c.value=1,P=1,y.Close()},D=()=>{const E=new Date().getTime()+3e4,A=m?location.protocol+"//"+C.lanIp+(location.port?":"+location.port:""):location.origin,U=A+"/luci-static/resources/icons/loading.gif",q=()=>{P==0&&(new Date().getTime()>E?_("timeout"):t(N,2e3))},z=()=>{P==0&&(v.value=A+location.pathname,_("success"),t(()=>{h.value=1},1e3),t(()=>{location.href=v.value},2e3))},N=()=>{if(P!=0)return;console.log("check online ",U);const F=new Image;F.onload=z,F.onerror=q,F.src=U};t(N,5e3)};we.Guide.LanIp.POST(C).then(E=>{var A;if(E!=null&&E.data){if((E.data.success||0)==0)return;if((A=E.data)!=null&&A.error)throw E.data.error}throw n("未知错误")}).catch(E=>{P==0&&(_("fail"),ne.Error(E))}),D(),t(()=>{P==0&&_("timeout")},3e4)},w=C=>{C.preventDefault(),u.Close&&u.Close()},S=C=>{location.reload()};return(C,y)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[c.value==0?(i(),d("form",{key:0,class:"actioner-dns",onSubmit:Ge($,["prevent"])},[e("div",q2,[e("span",null,a(o(n)("内网配置")),1)]),e("div",R2,[e("div",V2,[e("div",B2,[e("span",null,a(o(n)("IPv4地址")),1)]),e("div",U2,[W(e("input",{type:"text",placeholder:"192.168.100.1",required:"","onUpdate:modelValue":y[0]||(y[0]=P=>r.value.lanIp=P),onChange:k},null,544),[[Oe,r.value.lanIp,void 0,{trim:!0}]])])]),e("div",F2,[e("div",H2,[e("span",null,a(o(n)("IPv4子网掩码")),1)]),e("div",G2,[W(e("input",{type:"text",placeholder:"255.255.255.0",required:"","onUpdate:modelValue":y[1]||(y[1]=P=>r.value.netMask=P),onChange:k},null,544),[[Oe,r.value.netMask,void 0,{trim:!0}]])])]),g.value?(i(),d("div",j2,[G(Jc,{modelValue:r.value.enableDhcp,"onUpdate:modelValue":y[2]||(y[2]=P=>r.value.enableDhcp=P)},{default:pe(()=>[r.value.enableDhcp?(i(),d("span",W2,a(o(n)("修改DHCP服务")),1)):(i(),d("span",J2,a(o(n)("保持DHCP服务设置")),1))]),_:1},8,["modelValue"])])):T("",!0),r.value.enableDhcp?(i(),d(V,{key:1},[e("div",K2,[e("div",Z2,[e("span",null,a(o(n)("IP池起始地址")),1)]),e("div",Y2,[W(e("input",{type:"text",placeholder:"192.168.100.100",required:"","onUpdate:modelValue":y[3]||(y[3]=P=>r.value.dhcpStart=P)},null,512),[[Oe,r.value.dhcpStart,void 0,{trim:!0}]])])]),e("div",Q2,[e("div",X2,[e("span",null,a(o(n)("IP池结束地址")),1)]),e("div",e0,[W(e("input",{type:"text",placeholder:"192.168.100.100",required:"","onUpdate:modelValue":y[4]||(y[4]=P=>r.value.dhcpEnd=P)},null,512),[[Oe,r.value.dhcpEnd,void 0,{trim:!0}]])])])],64)):T("",!0)]),e("div",t0,[e("button",{class:"cbi-button cbi-button-apply app-btn",disabled:p.value},a(o(n)("确认")),9,n0),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:w},a(o(n)("取消")),1)])],32)):c.value==1?(i(),d("div",a0,[e("div",s0,[e("span",null,a(o(n)("更换配置")),1)]),e("div",o0,[b.value=="success"?(i(),d("div",l0,[y[5]||(y[5]=e("div",{class:"success_icon"},[e("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"},[e("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)),e("div",i0,a(o(n)("配置成功")),1),e("a",{href:v.value,class:"NewAdress"},a(o(n)("%{ countdown }s后 跳转新地址",{countdown:""+h.value})),9,r0)])):b.value=="fail"?(i(),d("div",c0,[y[6]||(y[6]=e("div",{class:"success_icon"},[e("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"},[e("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)),e("div",d0,a(o(n)("配置失败")),1),e("p",null,a(o(n)("请尝试重新配置")),1),e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:S},a(o(n)("我知道了")),1)])):b.value=="timeout"?(i(),d("div",u0,[y[7]||(y[7]=e("div",{class:"success_icon"},[e("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"},[e("g",{id:"icon_yellow",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e("g",{id:"Icon/Warning"},[e("rect",{id:"矩形",fill:"#000000","fill-rule":"nonzero",opacity:"0",x:"0",y:"0",width:"128",height:"128"}),e("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:"形状",fill:"#FAAD14"})])])])],-1)),e("div",v0,a(o(n)("配置超时")),1),e("p",null,a(o(n)("路由器 IP 可能已经修改成功。若刷新页面失败,请重新连接路由器,否则请尝试重新配置。")),1),e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:S},a(o(n)("刷新页面")),1)])):T("",!0)])])):T("",!0)]),_:1},8,["Close"]))}}),h0=le(p0,[["__scopeId","data-v-e56d6503"]]),m0={class:"actioner-dns_header"},f0={class:"actioner-dns_body"},b0={class:"label-item"},g0={class:"label-item_key"},_0={class:"label-item_value"},y0=["disabled"],k0={value:"manual"},w0={class:"label-item"},$0={class:"label-item_key"},C0={class:"label-item_value"},S0=["placeholder","onUpdate:modelValue"],x0={class:"label-item_key"},P0={class:"label-item_value"},T0=["placeholder","onUpdate:modelValue"],M0={key:1,class:"label-message"},E0={class:"actioner-dns_footer"},I0=["disabled"],D0={key:1,class:"actioner-dns"},L0={class:"actioner-dns_header"},A0={class:"actioner-dns_body"},N0={class:"config-message"},O0={class:"actioner-dns_footer"},z0=X({__name:"index",props:{Close:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(0),c=os(),r=c.status,p=R(()=>c.status.proto!="static"),v=()=>{let $=r.dnsList||[];for($=$.filter(w=>w);$.length<2;)$.push("");return $},h=x({interfaceName:r.defaultInterface||"",dnsProto:r.dnsProto||"manual",manualDnsIp:v()}),g=x(""),b=x(!1),m=()=>B(null,null,function*(){g.value="";let $={};switch(h.value.dnsProto){case"auto":break;case"manual":if($.manualDnsIp=[],!h.value.manualDnsIp[0]){ne.Error(t("至少需要填写一个DNS"));return}$.manualDnsIp=h.value.manualDnsIp.filter(S=>S);break}$.dnsProto=h.value.dnsProto,$.interfaceName=h.value.interfaceName;const w=ne.Loading(t("配置中..."));try{const S=yield we.Guide.DnsConfig.POST($);if(S!=null&&S.data){const{success:C,error:y}=S==null?void 0:S.data;y&&(g.value=y),(C==null||C==0)&&(ne.Success(t("配置成功")),u.value=1)}}catch(S){g.value=S}w.Close()}),f=$=>{$.preventDefault(),l.Close&&l.Close()},k=$=>{location.reload()};return($,w)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[u.value==0?(i(),d("form",{key:0,class:"actioner-dns",onSubmit:Ge(m,["prevent"])},[e("div",m0,[e("span",null,a(o(t)("DNS配置")),1)]),e("div",f0,[e("div",b0,[e("div",g0,[e("span",null,a(o(t)("DNS选项")),1)]),e("div",_0,[W(e("select",{"onUpdate:modelValue":w[0]||(w[0]=S=>h.value.dnsProto=S)},[e("option",{value:"auto",disabled:!p.value},a(o(t)("自动获取DNS")),9,y0),e("option",k0,a(o(t)("自定义DNS")),1)],512),[[Be,h.value.dnsProto]])])]),h.value.dnsProto=="manual"?(i(!0),d(V,{key:0},oe(h.value.manualDnsIp,(S,C)=>(i(),d("div",w0,[C==0?(i(),d(V,{key:0},[e("div",$0,[e("span",null,a(o(t)("DNS服务器地址")),1)]),e("div",C0,[W(e("input",{type:"text",placeholder:o(t)("请输入DNS地址"),required:"","onUpdate:modelValue":y=>h.value.manualDnsIp[C]=y},null,8,S0),[[Oe,h.value.manualDnsIp[C],void 0,{trim:!0}]])])],64)):(i(),d(V,{key:1},[e("div",x0,a(o(t)("备用DNS服务器地址")),1),e("div",P0,[W(e("input",{type:"text",placeholder:o(t)("备用DNS地址"),"onUpdate:modelValue":y=>h.value.manualDnsIp[C]=y},null,8,T0),[[Oe,h.value.manualDnsIp[C],void 0,{trim:!0}]])])],64))]))),256)):T("",!0),g.value?(i(),d("div",M0,a(g.value),1)):T("",!0)]),e("div",E0,[e("button",{class:"cbi-button cbi-button-apply app-btn",disabled:b.value},a(o(t)("确认")),9,I0),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:f},a(o(t)("取消")),1)])],32)):u.value==1?(i(),d("div",D0,[e("div",L0,[e("span",null,a(o(t)("DNS配置")),1)]),e("div",A0,[e("div",N0,a(o(t)("DNS配置已保存")),1)]),e("div",O0,[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:k},a(o(t)("完成")),1)])])):T("",!0)]),_:1},8,["Close"]))}}),xi=le(z0,[["__scopeId","data-v-c9250761"]]),q0={},R0={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"};function V0(s,t){return i(),d("svg",R0,[...t[0]||(t[0]=[Hn('',1)])])}const Qo=le(q0,[["render",V0]]),B0={class:"actioner-dns_header"},U0={class:"actioner-dns_body"},F0={class:"label-item"},H0={class:"label-item_key"},G0={class:"label-item_value"},j0={class:"item_info"},W0={class:"label-item"},J0={class:"label-item_key"},K0={class:"label-item_value"},Z0={selected:"true",value:""},Y0=["value"],Q0={class:"actioner-dns_footer"},X0=["disabled"],e6={key:1,class:"actioner-dns"},t6={class:"actioner-dns_header"},n6={class:"softsource_tit"},a6={class:"actioner-dns_body"},s6={class:"finished"},o6={class:"successed"},l6={class:"btns"},i6=X({__name:"index",props:{Close:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(0),c=x(""),r=x(),p=x();we.Guide.SoftSourceList.GET().then(m=>{var f,k;if((f=m==null?void 0:m.data)!=null&&f.result){const $=(k=m==null?void 0:m.data)==null?void 0:k.result;p.value=$}}).then(()=>we.Guide.GetSoftSource.GET()).then(m=>{var f,k;if((f=m==null?void 0:m.data)!=null&&f.result){const $=m.data.result;r.value=$.softSource,(k=p.value)!=null&&k.softSourceList.find(w=>w.identity==$.softSource.identity)&&(c.value=$.softSource.identity)}});const h=m=>{m.preventDefault(),l.Close&&l.Close()},g=m=>{const f=ne.Loading(t("正在切换中..."));we.Guide.SoftSource.POST({softSourceIdentity:c.value}).then(k=>{if(k!=null&&k.data){if((k.data.success||0)==0){u.value=1;return}else if(k.data.error)throw k.data.error}throw t("未知错误")}).catch(k=>{ne.Error(k)}).finally(()=>f.Close())},b=m=>{m.preventDefault(),location.reload()};return(m,f)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>{var k,$;return[u.value==0?(i(),d("form",{key:0,class:"actioner-dns",onSubmit:Ge(g,["prevent"])},[e("div",B0,[e("span",null,a(o(t)("软件源配置")),1)]),e("div",U0,[e("div",F0,[e("div",H0,[e("span",null,a(o(t)("当前软件源")),1)]),e("div",G0,[e("p",j0,a((k=r.value)==null?void 0:k.name),1)])]),e("div",W0,[e("div",J0,[e("span",null,a(o(t)("切换软件源")),1)]),e("div",K0,[W(e("select",{name:"",id:"","onUpdate:modelValue":f[0]||(f[0]=w=>c.value=w)},[e("option",Z0,a(o(t)("请选择软件源")),1),(i(!0),d(V,null,oe(($=p.value)==null?void 0:$.softSourceList,(w,S)=>(i(),d("option",{value:w.identity,key:S},a(w.name),9,Y0))),128))],512),[[Be,c.value,void 0,{trim:!0}]])])])]),e("div",Q0,[e("button",{class:"cbi-button cbi-button-apply app-btn",disabled:c.value==""},a(o(t)("确认")),9,X0),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:h},a(o(t)("取消")),1)])],32)):T("",!0),u.value==1?(i(),d("form",e6,[e("div",t6,[e("span",n6,a(o(t)("软件源配置")),1)]),e("div",a6,[e("div",s6,[G(Qo)]),e("p",o6,a(o(t)("配置成功!")),1),e("div",l6,[e("button",{class:"cbi-button cbi-button-apply softsource_successed",onClick:b},a(o(t)("确定")),1)])])])):T("",!0)]}),_:1},8,["Close"]))}}),Pi=le(i6,[["__scopeId","data-v-c1ba9558"]]),r6={},c6={width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function d6(s,t){return i(),d("svg",c6,[...t[0]||(t[0]=[e("g",{id:"icon_alert",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e("g",{id:"Icon/Warning"},[e("rect",{id:"矩形",fill:"#000000","fill-rule":"nonzero",opacity:"0",x:"0",y:"0",width:"14",height:"14"}),e("path",{d:"M7,0.875 C3.61757813,0.875 0.875,3.61757813 0.875,7 C0.875,10.3824219 3.61757813,13.125 7,13.125 C10.3824219,13.125 13.125,10.3824219 13.125,7 C13.125,3.61757813 10.3824219,0.875 7,0.875 Z M6.5625,4.046875 C6.5625,3.98671875 6.61171875,3.9375 6.671875,3.9375 L7.328125,3.9375 C7.38828125,3.9375 7.4375,3.98671875 7.4375,4.046875 L7.4375,7.765625 C7.4375,7.82578125 7.38828125,7.875 7.328125,7.875 L6.671875,7.875 C6.61171875,7.875 6.5625,7.82578125 6.5625,7.765625 L6.5625,4.046875 Z M7,10.0625 C6.63769531,10.0625 6.34375,9.76855469 6.34375,9.40625 C6.34375,9.04394531 6.63769531,8.75 7,8.75 C7.36230469,8.75 7.65625,9.04394531 7.65625,9.40625 C7.65625,9.76855469 7.36230469,10.0625 7,10.0625 Z",id:"形状",fill:"#FAAD14"})])],-1)])])}const Sn=le(r6,[["render",d6]]),u6={key:0,class:"actioner-dns"},v6={class:"actioner-dns_header"},p6={class:"actioner-dns_body"},h6={class:"sandbox_info"},m6={key:0,class:"disk_loading_icon"},f6={class:"disk_loading_info"},b6={key:1,class:"disk_tips"},g6={class:"label-item"},_6={class:"label-item_key"},y6={class:"label-item_value"},k6={value:""},w6=["value"],$6={class:"label-item"},C6={class:"label-item_key"},S6={class:"label-item_value"},x6={selected:"true",value:""},P6=["value","disabled"],T6={class:"sandbox_tips"},M6={class:"sandbox_info timeout"},E6={class:"sandbox_roboot_tips"},I6={class:"sandbox_roboot_refresh"},D6={key:0,class:"actioner-dns_footer"},L6=["disabled"],A6={key:1,class:"actioner-tips"},N6={class:"actioner-tips_header"},O6={class:"actioner-tips_body"},z6={class:"sandbox_info"},q6={class:"actioner-tips_footer"},R6={key:2,class:"actioner-tips"},V6={class:"actioner-tips_header"},B6={class:"actioner-tips_body"},U6={class:"sandbox_info"},F6={class:"actioner-tips_footer"},H6=X({__name:"index",props:{Close:{type:Function,required:!0}},setup(s){const t=Zs(),{$gettext:n,$ngettext:l}=Ae(),u=s,c=x(0);x("disk");const r=x(""),p=x(3),v=x(""),h=x([]),g=x(""),b=x(null);we.Nas.SandboxDisks.GET().then(P=>{var _;if(P!=null&&P.data&&(_=P.data)!=null&&_.result){b.value=P.data.result;return}throw n("加载磁盘信息失败")}).catch(P=>{r.value=P,c.value=3});const f=()=>we.System.Reboot.POST().then(P=>{var _;if(!(P!=null&&P.data&&(((_=P==null?void 0:P.data)==null?void 0:_.success)||0)==0))throw n("未知错误")}),k=P=>{var _,D;g.value="",h.value=v.value&&((D=(_=b.value)==null?void 0:_.disks.find(E=>E.path==v.value))==null?void 0:D.childrens)||[]},$=()=>{p.value>0&&(p.value-=1,t($,1e3))},w=P=>{P.preventDefault(),u.Close&&u.Close()},S=()=>{new Promise((P,_)=>{const D="/luci-static/resources/icons/loading.gif",E=()=>{t(A,2e3)},A=()=>{const U=new Image;U.onload=P,U.onerror=E,U.src=D};t(A,1e4)}).then(()=>{t(()=>{location.reload()},2e3)})},C=P=>{const _=ne.Loading(n("配置沙箱重启中..."));we.Nas.Sandbox.POST({path:g.value}).then(D=>{var E;if(D!=null&&D.data){if((D.data.success||0)==0)return c.value=2,t($,1e3),f();if((E=D.data)!=null&&E.error)throw D.data.error}throw n("未知错误")}).then(S).catch(D=>ne.Warning(D)).finally(()=>_.Close())},y=()=>{c.value=0};return(P,_)=>{const D=At("icon-loading");return i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[c.value==0||c.value==2?(i(),d("div",u6,[e("div",v6,[e("span",null,a(o(n)("沙箱模式配置向导")),1)]),e("div",p6,[e("p",h6,a(o(n)("一个简易沙箱,方便用来实验系统配置和程序,方便开发未完成的软件,但不保护 Docker 和硬盘的数据")),1),c.value==0?(i(),d(V,{key:0},[b.value?T("",!0):(i(),d("div",m6,[G(D,{size:38,color:"currentColor"}),e("span",f6,a(o(n)("正在加载中...")),1)])),b.value&&b.value.disks.length==0?(i(),d("div",b6,[G(Sn),e("span",null,a(o(n)("检测不到挂载的磁盘信息,请先插上磁盘,建议使用U盘或者移动硬盘,方便装卸")),1)])):T("",!0),b.value&&b.value.disks.length>0?(i(),d(V,{key:2},[e("div",g6,[e("div",_6,[e("span",null,a(o(n)("目标磁盘(建议选择U盘或者移动硬盘,方便装卸)")),1)]),e("div",y6,[W(e("select",{name:"",id:"",onChange:k,"onUpdate:modelValue":_[0]||(_[0]=E=>v.value=E)},[e("option",k6,a(o(n)("请选择目标磁盘")),1),(i(!0),d(V,null,oe(b.value.disks,(E,A)=>(i(),d("option",{value:E.path,key:A},a(E.venderModel)+"("+a(E.size)+") ",9,w6))),128))],544),[[Be,v.value]])])]),e("div",$6,[e("div",C6,[e("span",null,a(o(n)("目标分区(分区大小须大于2G,将此分区作为外部 overlay 使用)")),1)]),e("div",S6,[W(e("select",{name:"",id:"","onUpdate:modelValue":_[1]||(_[1]=E=>g.value=E)},[e("option",x6,a(o(n)("请选择目标分区")),1),(i(!0),d(V,null,oe(h.value,(E,A)=>(i(),d("option",{value:E.path,key:A,disabled:E.sizeInt<(1<<30)*1||E.isSystemRoot},a(E.name)+"("+a(E.filesystem||o(n)("未格式化"))+")"+a(E.total),9,P6))),128))],512),[[Be,g.value]])])]),e("div",T6,[G(Sn),e("span",null,a(o(n)("此操作会将会删除该分区全部数据")),1)])],64)):T("",!0)],64)):T("",!0),c.value==2?(i(),d(V,{key:1},[e("p",M6,[ue(a(o(n)("即将重启设备"))+" ",1),e("span",null,"("+a(p.value)+"s)",1)]),e("p",E6,[ue(a(o(n)("等待设备重启,重启完成后")),1),e("span",I6,a(o(n)("请刷新界面")),1)])],64)):T("",!0)]),c.value==0?(i(),d("div",D6,[e("button",{class:"cbi-button cbi-button-apply app-btn",disabled:!g.value,onClick:_[2]||(_[2]=E=>c.value=1)},a(o(n)("开启沙箱")),9,L6),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:w},a(o(n)("取消")),1)])):T("",!0)])):T("",!0),c.value==1?(i(),d("div",A6,[e("div",N6,[e("span",null,a(o(n)("温馨提示")),1)]),e("div",O6,[e("p",z6,a(o(n)("此操作会将会删除该分区全部数据,并格式化成EXT4,随后自动重启进入沙箱模式,是否继续?")),1)]),e("div",q6,[e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:C},a(o(n)("继续")),1),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:y},a(o(n)("取消")),1)])])):T("",!0),c.value==3?(i(),d("div",R6,[e("div",V6,[e("span",null,a(o(n)("错误")),1)]),e("div",B6,[e("p",U6,a(r.value),1)]),e("div",F6,[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:y},a(o(n)("取消")),1)])])):T("",!0)]),_:1},8,["Close"])}}}),G6=le(H6,[["__scopeId","data-v-4239794c"]]),j6={key:0,class:"actioner-dns"},W6={class:"actioner-dns_header"},J6={class:"actioner-dns_body"},K6={class:"sandbox_info"},Z6={class:"sandbox_environment"},Y6={class:"sandbox_environment_info"},Q6={class:"sandbox_environment_reboot"},X6=["innerHTML"],ev={class:"actioner-dns_footer"},tv=["disabled"],nv=["disabled"],av=["disabled"],sv=X({__name:"index",props:{Close:{type:Function,required:!0}},setup(s){const t=Zs(),{$gettext:n,$ngettext:l}=Ae(),u=s,c=x(0),r=x(!1),p=()=>{new Promise((m,f)=>{const k="/luci-static/resources/icons/loading.gif",$=()=>{t(w,2e3)},w=()=>{const S=new Image;S.onload=m,S.onerror=$,S.src=k};t(w,1e4)}).then(()=>{t(()=>{location.reload()},2e3)})},v=()=>{r.value=!0;const m=ne.Loading(n("提交中..."));we.Nas.SandboxCommit.POST().then(f=>{var k,$;if(f!=null&&f.data)if((((k=f==null?void 0:f.data)==null?void 0:k.success)||0)==0){ne.Loading(n("设备重启中..."));return}else($=f==null?void 0:f.data)!=null&&$.error&&alert(f.data.error);throw n("未知错误")}).then(p).catch(f=>{ne.Error(f),r.value=!1}).finally(()=>m.Close())},h=()=>{r.value=!0;const m=ne.Loading(n("重置中..."));we.Nas.SandboxReset.POST().then(f=>{var k,$;if(f!=null&&f.data)if((((k=f==null?void 0:f.data)==null?void 0:k.success)||0)==0){ne.Loading(n("设备重启中... 若页面长时间未刷新可能需要手动填写地址"));return}else($=f==null?void 0:f.data)!=null&&$.error&&alert(f.data.error);throw n("未知错误")}).then(p).catch(f=>{ne.Error(f),r.value=!1}).finally(()=>m.Close())},g=()=>{if(!confirm(n("确定放弃沙箱中的数据?再次进入沙箱需要重新格式化相应磁盘分区")))return;r.value=!0;const m=ne.Loading(n("执行中..."));we.Nas.SandboxExit.POST().then(f=>{var k,$;if(f!=null&&f.data)if((((k=f==null?void 0:f.data)==null?void 0:k.success)||0)==0){ne.Loading(n("设备重启中... 若页面长时间未刷新可能需要手动填写地址"));return}else($=f==null?void 0:f.data)!=null&&$.error&&alert(f.data.error);throw n("未知错误")}).then(p).catch(f=>{ne.Error(f),r.value=!1}).finally(()=>m.Close())},b=m=>{m.preventDefault(),u.Close&&u.Close()};return(m,f)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[c.value==0?(i(),d("div",j6,[e("div",W6,[e("span",null,a(o(n)("沙箱模式配置向导")),1)]),e("div",J6,[e("p",K6,a(o(n)("一个简易沙箱,方便用来实验系统配置和程序,方便开发未完成的软件,但不保护 Docker 和硬盘的数据")),1),e("div",Z6,[e("p",null,a(o(n)("当前处于沙箱环境:")),1),e("p",null,a(o(n)("1、点击“提交”可将变更合并到非沙箱环境")),1),e("p",null,a(o(n)("2、点击“重置”可将沙箱恢复到初始状态")),1),e("p",null,a(o(n)("3、点击“退出”可退出沙箱环境,并放弃沙箱中的数据")),1)]),e("div",Y6,[ue(a(o(n)("以上操作都将重启设备,设备重启完成后会自动刷新页面。如果 IP 变化可能需要")),1),e("span",Q6,a(o(n)("手动在地址栏输入地址")),1),e("p",{class:"sandbox_environment_tex",innerHTML:o(n)("如需临时退出沙箱环境,请将设备关机后拔出相关磁盘,启动前插入相关磁盘可再次进入沙箱。
注意临时退出沙箱环境以后升级固件会导致之前的沙箱数据无效",{},!0)},null,8,X6)])]),e("div",ev,[e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:v,disabled:r.value},a(o(n)("提交")),9,tv),e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:h,disabled:r.value},a(o(n)("重置")),9,nv),e("button",{class:"cbi-button cbi-button-apply app-btn",onClick:g,disabled:r.value},a(o(n)("退出")),9,av),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:b},a(o(n)("取消")),1)])])):T("",!0)]),_:1},8,["Close"]))}}),ov=le(sv,[["__scopeId","data-v-79f9b13d"]]),lv=["data-launcher-action"],iv={key:0,role:"status"},rv=["href","target"],cv={key:3,class:"launcher-firmware-options"},dv=["checked","disabled"],uv={key:0},vv={role:"status"},pv=X({__name:"LauncherToolAction",props:{app:{}},emits:["close"],setup(s,{emit:t}){var _,D;const{entryAvailability:n,state:l}=ns(),u=s,c=t,r=window.vue_lang==="en",p=(E,A)=>r?A:E,v=Oa(),h=os(),g=R(()=>p(u.app.zh,u.app.en)),b=()=>c("close"),m=R(()=>{var E;return n(u.app)!=="available"?n(u.app)==="unsupported"?p("当前固件不支持此功能。","This firmware does not support this tool."):p("功能状态暂不可用,请稍后重试。","Tool status is unavailable. Try again later."):u.app.tool==="dns"&&!((E=h.status)!=null&&E.proto)?p("网络信息尚未就绪,请稍后重试。","Network details are not ready. Try again later."):""}),f={lan:Kn(h0),dns:Kn(xi),source:Kn(Pi),sandbox:Kn(G6)},k=R(()=>u.app.tool==="sandbox"&&l.sandbox==="running"?Kn(ov):f[u.app.tool||""]),$=R(()=>{var E,A,U,q;return u.app.tool==="terminal"?`${(A=(E=window.quickstart_configs)==null?void 0:E.ttyd)!=null&&A.ssl?"https":"http"}://${window.location.hostname}:${((q=(U=window.quickstart_configs)==null?void 0:U.ttyd)==null?void 0:q.port)||7681}/`:u.app.path}),w=x(!((D=(_=window.quickstart_configs)==null?void 0:_.update)!=null&&D.disable)),S=x(!1),C=x("");let y=!0;function P(E){return B(this,null,function*(){if(!S.value){S.value=!0,C.value="";try{const A=yield we.System.AutoCheckUpdate.POST({enable:E});if(A.data.success!==0||A.data.error)throw new Error(A.data.error);w.value=E,y&&(window.quickstart_configs.update=Ne(ye({},window.quickstart_configs.update),{disable:!E}),C.value=p("设置已保存","Setting saved"),E&&v.requestCheckUpdate())}catch(A){C.value=p("保存失败,请重试","Could not save. Try again.")}finally{S.value=!1}}})}return lt(()=>{y=!1}),(E,A)=>(i(),Y(na,{title:g.value,onClose:A[1]||(A[1]=U=>E.$emit("close"))},{default:pe(()=>{var U;return[e("div",{class:"launcher-tool-action","data-launcher-action":s.app.tool},[m.value?(i(),d("p",iv,a(m.value),1)):k.value?(i(),Y(Aa(k.value),{key:1,Close:b})):(i(),d("a",{key:2,href:$.value,target:s.app.tool==="terminal"?"_blank":void 0,rel:"noopener noreferrer","data-tool-destination":""},a(p("打开","Open"))+" "+a(g.value),9,rv)),s.app.tool==="firmware"&&!m.value?(i(),d("div",cv,[e("label",null,[e("input",{type:"checkbox",checked:w.value,disabled:S.value,onChange:A[0]||(A[0]=q=>P(q.target.checked))},null,40,dv),ue(a(p("自动检查更新","Automatically check for updates")),1)]),(U=o(v).checkUpdate)!=null&&U.needUpdate?(i(),d("span",uv,a(p("有可用更新","Update available")),1)):T("",!0),e("span",vv,a(C.value),1)])):T("",!0)],8,lv)]}),_:1},8,["title"]))}}),hv=le(pv,[["__scopeId","data-v-c89ea4d3"]]),mv=["data-app-form"],fv={class:"applications-heading"},bv={class:"applications-actions widget-action-group"},gv={key:0,class:"applications-state"},_v=["data-app-columns","data-app-capacity"],yv=["onClick","title","data-favorite-app","data-availability","aria-busy"],kv={key:0,class:"home-entry-spinner","aria-hidden":"true"},wv=["aria-label"],$v={key:0},Cv={key:0,class:"home-entry-announcement",role:"status"},Sv={key:1,class:"home-entry-error",role:"status","data-home-entry-state":""},xv=["aria-label"],Pv={key:3,class:"applications-fallback","data-applications-fallback":""},Tv=["onClick","data-home-entry"],Mv=["aria-label","data-shortcut-history"],Ev=["aria-label"],Iv=["inert"],Dv={class:"launcher-editor-toolbar"},Lv=["disabled"],Av={class:"launcher-library-heading"},Nv={class:"application-search"},Ov=["placeholder","aria-label"],zv={class:"launchpad-controls"},qv=["aria-label"],Rv=["aria-pressed","data-category","onClick"],Vv={key:0,class:"launchpad-library-actions"},Bv=["disabled"],Uv=["aria-pressed"],Fv={key:1,class:"applications-state launchpad-status",role:"status","data-applications-state":""},Hv=["aria-busy"],Gv={class:"launchpad-result-line"},jv={"data-library-total":""},Wv={key:3,class:"applications-state"},Jv={key:0},Kv={key:4,class:"application-catalogue"},Zv=["onClick","disabled","aria-pressed","aria-label","data-select-app"],Yv={key:5,class:"launchpad-grid","data-launchpad-grid":""},Qv=["onClick","title","aria-label","data-open-app","data-unavailable-shortcut","data-availability","data-browser-tool"],Xv=["aria-label"],e3={key:0},t3=["onClick","data-edit-link","aria-label"],n3=["aria-label"],a3=["disabled"],s3={"data-library-page":""},o3=["disabled"],l3={key:7,class:"application-limit"},i3={key:8,class:"browser-fallback"},r3=["onClick","data-browser-quick"],c3={key:9,class:"launchpad-notice",role:"status"},d3={key:0},u3=["disabled"],v3=["disabled"],p3={"data-shortcut-unavailable":""},h3=X({__name:"HomeApplications",props:{collapsed:{type:Boolean},hostOnly:{type:Boolean},fallbackEntries:{},contained:{type:Boolean},preference:{},natural:{type:Boolean},network:{},returnReady:{type:Function}},emits:["navigate","close"],setup(s,{emit:t}){const{entryAvailability:n,homeApplicationSession:l,linkSession:u,saving:c}=ns(),r=s,p=t,v=x(null),h=x(600),g=x(240),b=R(()=>Kt("applications",r.preference||{mode:"auto",iconRows:0},{width:h.value,height:r.natural?1e5:g.value,role:"ordinary",favoriteCount:ge.value.length,mobile:h.value<650,natural:r.natural})),m=R(()=>b.value.columns),f=R(()=>b.value.capacity);let k;const $=window.vue_lang==="en",w=(be,Te)=>$?Te:be,S=x("all"),C=x(!1),y=x(!1),P=x(""),_=x([]),D=x([]),E=x(1),A=[{id:"all",zh:"全部",en:"All"},{id:"apps",zh:"已安装应用",en:"Apps"},{id:"tools",zh:"系统工具",en:"Tools"},{id:"links",zh:"链接",en:"Links"}],U=x(!1),q=x(),z=x(null),N=x(!1),F=x(""),Z=R(()=>u.entries.length),Q=x(window.innerWidth<650?2:4),ce=ns(),ve=R(()=>ce.state.status),O=ce.catalogue,de=x(null),K=x(null),xe=Oa(),j=uo(On,"app"),re=uo(On,"status"),$e=uo(On,"source");let qe,De=0,Ke=!0,at=!1;const st=l2(!!r.hostOnly,()=>!ce.preferencesLoading()&&ce.state.status!=="loading",be=>{var Te,ie;return(ie=(Te=r.returnReady)==null?void 0:Te.call(r,be))!=null?ie:!0}),et=R(()=>re.value==="timeout"?w("打开应用超时,请重试。","Opening timed out. Please retry."):re.value==="permission"?w("没有解析入口的权限,请重新登录后重试。","No permission to resolve this entry. Sign in and retry."):w("暂时无法打开,请重试或打开配置。","Unable to open now. Retry or open settings."));function Ze(){at&&(De++,qe==null||qe.abort(),qe=void 0,re.value="idle",j.value=null,at=!1)}function it(){return B(this,null,function*(){var ie,Ye,je;const be=$e.value==="traffic",Te=$e.value==="home"?(ie=j.value)==null?void 0:ie.id:void 0;gi(),Ze(),yield ot(),be?(Ye=document.querySelector("[data-home-speed]"))==null||Ye.focus({preventScroll:!0}):Te&&((je=document.querySelector('[data-favorite-app="'+CSS.escape(Te)+'"]'))==null||je.focus({preventScroll:!0}))})}function he(){j.value&&St(j.value)}function H(){if(!j.value)return;const be=Ne(ye({},j.value),{entryScript:!1});$e.value==="home"&&!r.collapsed&&Ao(be)||J(be,$e.value)}function J(be,Te="browser"){return B(this,null,function*(){var ka;if(re.value==="loading"&&((ka=j.value)==null?void 0:ka.id)===be.id&&$e.value===Te)return;Ze(),at=!0;const ie=De,Ye=new AbortController;qe=Ye,j.value=be,$e.value=Te;const je=()=>Ke&&ie===De&&!Ye.signal.aborted&&(Te==="browser"?C.value:!C.value&&!document.querySelector(".ordered-editing")&&(Te==="traffic"?!!document.querySelector("[data-home-speed]"):l.favorites.includes(be.id)&&!!document.querySelector('[data-favorite-app="'+CSS.escape(be.id)+'"]')));let vt=!1,bn;const gn=()=>{bn=window.setTimeout(()=>{vt=!0,Ye.abort()},5e3)};(be.entryScript||Te==="traffic")&&(re.value="loading");try{let Rt;if(Te==="traffic"){if(ce.state.status==="loading"?yield ce.waitForRead():ce.state.status!=="ready"&&(yield ce.retry()),!je()){ie===De&&Ze();return}Rt=yield $1(ce.state.apps,ce.state.status,window.location.href,Ye.signal,{resolve:(...oa)=>B(null,null,function*(){gn();try{return yield Zo(...oa)}finally{window.clearTimeout(bn)}}),confirm:()=>je()&&window.confirm(w("FastNet暂未就绪,是否继续检查安装并打开配置?","FastNet is not ready. Continue with the installation check and open settings?")),install:()=>B(null,null,function*(){return je()?Xt.checkAndInstallApp("app-meta-fastnet","FastNet",void 0,je):!1})})}else be.entryScript&&gn(),Rt=yield k1(be,window.location.href,Ye.signal);if(!Rt){ie===De&&Ze();return}if(!je()){ie===De&&Ze();return}Te==="browser"?yield wt.remember(be.id):st.remember(be.id,Te==="traffic"?"traffic":void 0),je()?window.location.assign(Rt):ie===De&&Ze()}catch(Rt){Ke&&ie===De&&(re.value=vt?"timeout":Rt instanceof Error&&["permission","timeout"].includes(Rt.message)?Rt.message:"error")}finally{window.clearTimeout(bn)}})}const ge=R(()=>l.favorites.map(ce.resolve)),ze=R(()=>ve.value==="permission"?w("没有读取应用目录的权限,系统工具仍可使用。","No permission to read apps. System tools remain available."):ve.value==="timeout"?w("读取应用清单超时,请点击重试。系统工具仍可使用。","Loading applications timed out. Select Retry. System tools remain available."):ve.value==="error"?w("应用清单暂不可用,系统工具仍可使用。","Apps unavailable. System tools remain available."):ve.value==="loading"?w("正在读取应用清单…","Loading applications…"):w("还没有安装扩展应用,去软件中心发现更多。","No additional apps installed. Explore the software center."));function Fe(be){const Te=n(be);return Te==="uninstalled"?w("应用已卸载","App uninstalled"):Te==="permission"?w("无访问权限","No access"):Te==="unsupported"?w("固件不支持","Unsupported"):Te==="no-entry"?w("暂无可用入口","No verified entry"):w("状态待确认","Status unknown")}const Ee=R(()=>E1(O.value.map(be=>ce.resolve(be.id)),P.value,S.value,E.value)),dt=R(()=>Ee.value.entries);We([P,S],()=>{wt!=null&&wt.applying.value||(E.value=1)});function tt(be){var Te;E.value=be,(Te=document.querySelector(".applications-browser-body"))==null||Te.scrollTo({top:0})}function kt(be){return B(this,null,function*(){var Te;y.value||!ce.begin()||(q.value=be,U.value=!0,F.value="",yield ot(),(Te=document.querySelector(".applications-browser-body"))==null||Te.scrollTo({top:0}))})}function ct(){return B(this,null,function*(){var be;c()||(U.value=!1,q.value=void 0,yield ot(),(be=document.querySelector("[data-add-link]"))==null||be.focus())})}function Tt(be,Te){return B(this,null,function*(){var Ye;yield ct(),F.value=be,P.value="",S.value="links",yield ot();const ie=Te?O.value.filter(je=>je.kind==="link").findIndex(je=>je.id===Te):-1;E.value=ie>=0?Math.floor(ie/Ss)+1:Ee.value.current,yield ot(),Te&&((Ye=document.querySelector('[data-open-app="'+Te+'"]'))==null||Ye.focus())})}const ut=os();function St(be){return B(this,null,function*(){if(be.kind==="app"&&!r.collapsed&&Ao(be))return;if(be.kind==="app"&&n(be)==="available"){yield J(be);return}if(be.id==="files"){if(C.value&&!(yield Ue()))return;Xt.installAndGo("luci-app-linkease",w("易有云","LinkEase"),"/cgi-bin/luci/admin/services/linkease/file/","app-meta-linkease");return}const Te=r.network||Ft;if(be.kind==="builtin"){yield wt==null?void 0:wt.remember(be.id),p("navigate",be.path);return}if(!(C.value&&!(yield Ue()))){if(be.kind==="tool"){Te&&ut.updateNetworkStatus(ye({},Te)),de.value=be;return}if(n(be)!=="available"){K.value=be;return}if(be.kind==="link"){window.open(be.path,"_blank","noopener,noreferrer");return}}})}function ht(be){return B(this,null,function*(){if(n(be)!=="available"){K.value=be;return}yield J(be,"home")})}let xt=null,en="",qt=[],Ft,Ht;function ke(){ce.begin()&&(Ze(),y.value=!0,U.value=!1,N.value=!1,F.value="",_.value=[...l.favorites],D.value=[])}function Se(be){return B(this,null,function*(){be&&!ce.editable()||!r.collapsed&&m1(be,r.network)||document.querySelector(".ordered-editing")||(r.hostOnly?yield wt==null?void 0:wt.open(be):yield ae(be,{tab:"all",page:1},{search:""}))})}function ae(be,Te,ie){return B(this,null,function*(){var je;if(C.value){S.value=Te.tab,P.value=ie.search,E.value=Te.page,be&&ke();return}if(document.querySelector("[data-applications-browser]"))return;Ze(),xt=document.activeElement,be&&ce.begin(),y.value=be,P.value=ie.search,S.value=Te.tab,E.value=Te.page,U.value=!1,N.value=!1,F.value="",_.value=[...l.favorites],D.value=[],en=document.body.style.overflow,document.body.style.overflow="hidden",C.value=!0,yield ot();const Ye=document.querySelector(".canvas-home");qt=Array.from((Ye==null?void 0:Ye.children)||[]).filter(vt=>vt instanceof HTMLElement&&!vt.matches(".applications-browser,.applications-backdrop")&&!vt.hasAttribute("inert")),qt.forEach(vt=>vt.setAttribute("inert","")),(je=document.querySelector(".applications-close"))==null||je.focus()})}function He(){qt.forEach(be=>be.removeAttribute("inert")),qt=[],document.body.style.overflow=en}function Re(){Ze(),C.value=!1,U.value=!1,He(),_.value=[],D.value=[],Ft=void 0;const be=xt!=null&&xt.isConnected?xt:document.querySelector("[data-applications-hub] [data-all-apps]");be==null||be.focus({preventScroll:!0}),xt=null,p("close")}function Ue(){return B(this,null,function*(){var be;return c()?!1:r.hostOnly?(be=wt==null?void 0:wt.close())!=null?be:!1:Gt.value&&!window.confirm(w("尚有未保存的入口修改,确定放弃?","Discard unsaved shortcut changes?"))?!1:(Re(),!0)})}function Et(){return B(this,null,function*(){if(!c())try{yield ce.saveFavorites([..._.value]),Ue()}catch(be){F.value=be instanceof Error?be.message:w("保存失败,草稿保留","Save failed; draft retained")}})}function Pt(be){const Te=[...new Set(be)].slice(0,24);Te.join("|")!==_.value.join("|")&&(D.value=[...D.value.slice(-29),[..._.value]],_.value=Te)}function Ot(){D.value.length&&(_.value=D.value.pop())}function _t(be){_.value.includes(be)?Pt(_.value.filter(Te=>Te!==be)):_.value.length<24&&Pt([..._.value,be])}function dn(be){return B(this,null,function*(){Gt.value||c()||(yield wt==null?void 0:wt.remember(),p("navigate",be))})}const Gt=R(()=>C.value&&(U.value||y.value&&_.value.join("|")!==l.favorites.join("|")));function un(be){(Gt.value||c())&&(be.preventDefault(),be.returnValue="")}const wt=b1({enabled:!!r.hostOnly,opened:C,tab:S,page:E,search:P,dirty:Gt,saving:c,show:ae,hide:Re,confirm:()=>window.confirm(w("尚有未保存的入口修改,确定离开?","Leave without saving shortcut changes?")),settled:()=>ce.state.status!=="loading"&&!ce.preferencesLoading(),currentPage:()=>Ee.value.current});function sa(be){if(!C.value){be.key==="Escape"&&$e.value!=="browser"&&re.value!=="idle"&&(be.preventDefault(),be.stopImmediatePropagation(),it());return}if(be.key==="Escape"){be.preventDefault(),be.stopImmediatePropagation(),U.value?ct():Ue();return}if(be.key==="Tab"){const Te=Array.from(document.querySelectorAll(".applications-browser button:not(:disabled),.applications-browser input:not(:disabled)")).filter(je=>je.getClientRects().length),ie=Te[0],Ye=Te[Te.length-1];be.shiftKey&&document.activeElement===ie?(be.preventDefault(),Ye==null||Ye.focus()):!be.shiftKey&&document.activeElement===Ye&&(be.preventDefault(),ie==null||ie.focus())}}function tn(){Q.value=window.innerWidth<650?2:4}function Zt(){document.hidden&&(Ze(),de.value=null,K.value=null,z.value=null)}return nt(()=>window.addEventListener("pagehide",Ze)),lt(()=>{Ke=!1,Ze(),window.removeEventListener("pagehide",Ze)}),nt(()=>{window.addEventListener("beforeunload",un),r.collapsed&&(Ht=h1((be,Te)=>{Ft=Te,Se(be)},(be,Te)=>{Te==="traffic"?J(be,"traffic"):ht(be)},Ze)),document.addEventListener("keydown",sa,!0),document.addEventListener("visibilitychange",Zt),window.addEventListener("resize",tn),v.value&&(k=new ResizeObserver(()=>{const be=v.value.getBoundingClientRect();h.value=be.width,g.value=be.height}),k.observe(v.value))}),lt(()=>{window.removeEventListener("beforeunload",un),Ht==null||Ht(),k==null||k.disconnect(),document.removeEventListener("keydown",sa,!0),document.removeEventListener("visibilitychange",Zt),window.removeEventListener("resize",tn),C.value&&He()}),(be,Te)=>(i(),d(V,null,[s.collapsed?s.hostOnly?T("",!0):(i(),d("button",{key:1,class:"applications-collapsed",onClick:Te[3]||(Te[3]=ie=>Se(!1)),"data-open-applications":""},[G(Qe,{name:"grid"}),ue(a(w("应用工具","Apps & tools")),1)])):(i(),d("section",{key:0,ref_key:"hub",ref:v,class:_e(["home-applications fluid-applications",{"applications-strip":b.value.id==="strip"}]),"data-app-form":b.value.id,"data-applications-hub":""},[e("header",fv,[e("div",null,[G(Qe,{name:"grid"}),e("h2",null,a(w("应用工具","Apps & tools")),1)]),e("div",bv,[G(_a,{icon:"grid",onClick:Te[0]||(Te[0]=ie=>Se(!1)),"data-all-apps":""},{default:pe(()=>[ue(a(w("查看全部","All")),1)]),_:1}),G(za,{label:w("应用与工具更多操作","More app and tool actions"),items:[{id:"favorites",label:w("编辑快捷入口","Edit shortcuts")}],onSelect:Te[1]||(Te[1]=ie=>Se(!0))},null,8,["label","items"])])]),ge.value.length?(i(),d("div",{key:1,class:"applications-favorites",style:pt({gridTemplateColumns:"repeat("+m.value+", minmax(0,1fr))"}),"data-app-columns":m.value,"data-app-capacity":f.value},[(i(!0),d(V,null,oe(ge.value.slice(0,f.value),ie=>{var Ye,je,vt;return i(),d("button",{key:ie.id,onClick:bn=>St(ie),title:w(ie.zh,ie.en)+(o(n)(ie)==="available"?"":" · "+Fe(ie)),"data-favorite-app":ie.id,"data-availability":o(n)(ie),"aria-busy":$e.value==="home"&&((Ye=j.value)==null?void 0:Ye.id)===ie.id&&re.value==="loading"},[e("span",{class:_e(["application-icon",ie.tone])},[G(Cs,{app:ie},null,8,["app"]),$e.value==="home"&&((je=j.value)==null?void 0:je.id)===ie.id&&re.value==="loading"?(i(),d("i",kv)):T("",!0),ie.tool==="firmware"&&((vt=o(xe).checkUpdate)!=null&&vt.needUpdate)?(i(),d("i",{key:1,class:"launcher-update-dot","aria-label":w("有可用更新","Update available")},null,8,wv)):T("",!0)],2),e("span",null,[e("strong",null,a(w(ie.zh,ie.en)),1),o(n)(ie)!=="available"?(i(),d("small",$v,a(Fe(ie)),1)):T("",!0)])],8,yv)}),128))],12,_v)):(i(),d("div",gv,[G(Qe,{name:"grid"}),e("span",null,a(w("把常用应用放在这里","Keep your favorite apps here")),1),e("button",{onClick:Te[2]||(Te[2]=ie=>Se(!0))},a(w("选择应用","Choose apps")),1)])),$e.value==="home"&&j.value&&ge.value.some(ie=>{var Ye;return ie.id===((Ye=j.value)==null?void 0:Ye.id)})&&re.value!=="idle"?(i(),d(V,{key:2},[re.value==="loading"?(i(),d("span",Cv,a(w("正在打开:","Opening: ")+w(j.value.zh,j.value.en)),1)):(i(),d("div",Sv,[e("span",null,a(w(j.value.zh,j.value.en))+" · "+a(et.value),1),e("div",null,[e("button",{onClick:he,"data-home-entry-retry":""},a(w("重试","Retry")),1),j.value.path?(i(),d("button",{key:0,onClick:H,"data-home-entry-config":""},a(w("打开配置","Open settings")),1)):T("",!0),e("button",{onClick:it,"aria-label":w("关闭提示","Dismiss"),"data-home-entry-dismiss":""},"×",8,xv)])]))],64)):T("",!0),s.fallbackEntries.length?(i(),d("div",Pv,[e("span",null,a(w("快捷操作","Quick actions")),1),(i(!0),d(V,null,oe(s.fallbackEntries,ie=>(i(),d("button",{key:ie.path,onClick:Ye=>dn(ie.path),"data-home-entry":ie.path},[G(Qe,{name:ie.glyph},null,8,["name"]),ue(a(w(ie.zh,ie.en)),1),G(Qe,{name:"arrow"})],8,Tv))),128))])):T("",!0)],10,mv)),C.value?(i(),Y(Fo,{key:2,to:".canvas-home"},[e("div",{class:"applications-backdrop",onClick:Ue}),e("section",{class:_e(["applications-browser launchpad-browser",{"launchpad-editor":y.value,"launchpad-form":U.value}]),role:"dialog","aria-modal":"true","aria-label":U.value?w("链接设置","Link settings"):y.value?w("编辑快捷入口","Edit shortcuts"):w("全部应用与工具","All apps and tools"),"data-applications-browser":"","data-shortcut-history":D.value.length},[e("header",null,[e("div",null,[e("span",null,a(U.value?"YOUR SPACE":y.value?w("首页常用入口","YOUR FAVORITES"):"APPS & TOOLS"),1),e("h2",null,a(U.value?q.value?w("编辑链接","Edit link"):w("添加链接","Add a link"):y.value?w("留下常用的,刚刚好","A place for your favorites"):w("你的应用与工具","Your apps & tools")),1)]),e("button",{class:"applications-close",onClick:Te[4]||(Te[4]=ie=>U.value?ct():Ue()),"aria-label":U.value?w("返回全部入口","Return to all entries"):w("关闭应用面板","Close apps")},a(U.value?"←":"×"),9,Ev)]),e("div",{class:"applications-browser-body",inert:o(c)()},[U.value?(i(),Y(k2,{key:0,initial:q.value,entries:o(O),onCancel:ct,onSaved:Tt},null,8,["initial","entries"])):(i(),d(V,{key:1},[y.value?(i(),d(V,{key:0},[G(o2,{ids:_.value,columns:Q.value,limit:24,onRemove:_t,onReorder:Pt},null,8,["ids","columns"]),e("div",Dv,[e("button",{onClick:Ot,disabled:!D.value.length,"data-shortcut-undo":""},"↶ "+a(w("撤销","Undo")),9,Lv),e("button",{onClick:Te[5]||(Te[5]=ie=>Pt(o(f1))),"data-shortcut-restore":""},a(w("恢复默认八项","Restore eight defaults")),1)]),e("h3",Av,a(w("添加快捷入口","Add shortcuts")),1)],64)):T("",!0),e("label",Nv,[G(Qe,{name:"grid"}),W(e("input",{"onUpdate:modelValue":Te[6]||(Te[6]=ie=>P.value=ie),placeholder:w("搜索应用或系统工具","Search apps or system tools"),"aria-label":w("搜索应用或系统工具","Search apps or system tools")},null,8,Ov),[[Oe,P.value]])]),e("div",zv,[e("div",{class:"browser-category-tabs",role:"group","aria-label":w("入口分类","Shortcut categories")},[(i(),d(V,null,oe(A,ie=>e("button",{key:ie.id,"aria-pressed":S.value===ie.id,"data-category":ie.id,onClick:Ye=>S.value=ie.id},a(w(ie.zh,ie.en)),9,Rv)),64))],8,qv),y.value?T("",!0):(i(),d("div",Vv,[e("button",{onClick:Te[7]||(Te[7]=ie=>kt()),disabled:!o(ce).editable(),"data-add-link":""},"+ "+a(w("添加链接","Add link")),9,Bv),Z.value?(i(),d("button",{key:0,"aria-pressed":N.value,onClick:Te[8]||(Te[8]=ie=>N.value=!N.value),"data-manage-links":""},a(N.value?w("完成","Done"):w("管理链接","Manage links")),9,Uv)):T("",!0)]))]),ve.value!=="ready"?(i(),d("div",Fv,[e("span",null,a(ze.value),1),["error","permission","timeout"].includes(ve.value)?(i(),d("button",{key:0,onClick:Te[9]||(Te[9]=(...ie)=>o(ce).retry&&o(ce).retry(...ie))},a(w("重试","Retry")),1)):T("",!0)])):T("",!0),j.value&&re.value!=="idle"?(i(),d("div",{key:2,class:"applications-state launchpad-status",role:"status","data-entry-state":"","aria-busy":re.value==="loading"},[e("span",null,a(re.value==="loading"?w("正在打开:","Opening: ")+w(j.value.zh,j.value.en):w(j.value.zh,j.value.en)+" · "+et.value),1),re.value!=="loading"?(i(),d(V,{key:0},[e("button",{onClick:he},a(w("重试","Retry")),1),j.value.path?(i(),d("button",{key:0,onClick:H,"data-entry-config":""},a(w("打开配置","Open settings")),1)):T("",!0)],64)):T("",!0)],8,Hv)):T("",!0),e("div",Gv,[e("span",null,[ue(a(y.value?w("可添加的入口","Available shortcuts"):w("所有入口","Your library"))+" ",1),e("strong",jv,a(Ee.value.total),1)])]),dt.value.length?y.value?(i(),d("div",Kv,[(i(!0),d(V,null,oe(dt.value,ie=>(i(),d("div",{key:ie.id},[e("span",{class:_e(["application-icon",ie.tone])},[G(Cs,{app:ie},null,8,["app"])],2),e("div",null,[e("strong",null,a(w(ie.zh,ie.en)),1),e("small",null,a(o(n)(ie)!=="available"?Fe(ie):w(ie.detail,ie.detailEn)),1)]),e("button",{onClick:Ye=>_t(ie.id),disabled:!_.value.includes(ie.id)&&(_.value.length>=24||o(n)(ie)!=="available"),"aria-pressed":_.value.includes(ie.id),"aria-label":w("选择","Select ")+w(ie.zh,ie.en),"data-select-app":ie.id},a(_.value.includes(ie.id)?"✓":"+"),9,Zv)]))),128))])):(i(),d("div",Yv,[(i(!0),d(V,null,oe(dt.value,ie=>(i(),d("div",{key:ie.id,class:"launchpad-tile"},[e("button",{class:"launchpad-open",onClick:Ye=>St(ie),title:w(ie.zh,ie.en)+(o(n)(ie)==="available"?"":" · "+Fe(ie)),"aria-label":(o(n)(ie)==="available"?w("打开","Open "):w("查看原因:","View reason: "))+w(ie.zh,ie.en),"data-open-app":ie.id,"data-unavailable-shortcut":o(n)(ie)!=="available"?ie.id:void 0,"data-availability":o(n)(ie),"data-browser-tool":ie.kind==="tool"?ie.id:void 0},[e("span",{class:_e(["application-icon",ie.tone])},[G(Cs,{app:ie},null,8,["app"]),o(l).favorites.includes(ie.id)?(i(),d("i",{key:0,class:"launchpad-pin","aria-label":w("已固定到首页","Pinned to home")},null,8,Xv)):T("",!0)],2),e("strong",null,a(w(ie.zh,ie.en)),1),o(n)(ie)!=="available"?(i(),d("small",e3,a(Fe(ie)),1)):T("",!0)],8,Qv),N.value&&ie.kind==="link"?(i(),d("button",{key:0,class:"launchpad-link-edit",onClick:Ye=>kt(ie),"data-edit-link":ie.id,"aria-label":w("编辑链接:","Edit link: ")+w(ie.zh,ie.en)},a(w("编辑","Edit")),9,t3)):T("",!0)]))),128))])):(i(),d("div",Wv,[ve.value==="ready"||S.value==="tools"||S.value==="links"?(i(),d("span",Jv,a(S.value==="apps"&&ve.value==="ready"&&!o(ce).state.apps.length?w("没有已安装的扩展应用,可前往软件中心。","No additional apps installed. Explore the software center."):w("没有匹配的入口,试试其他关键词。","No matching entries. Try another search.")),1)):T("",!0)])),Ee.value.pages>1?(i(),d("nav",{key:6,class:"launchpad-pagination","aria-label":w("入口分页","Library pages")},[e("button",{disabled:Ee.value.current===1,onClick:Te[10]||(Te[10]=ie=>tt(Ee.value.current-1)),"data-library-prev":""},a(w("上一页","Previous")),9,a3),e("span",s3,a(Ee.value.current)+" / "+a(Ee.value.pages),1),e("button",{disabled:Ee.value.current===Ee.value.pages,onClick:Te[11]||(Te[11]=ie=>tt(Ee.value.current+1)),"data-library-next":""},a(w("下一页","Next")),9,o3)],8,n3)):T("",!0),y.value&&_.value.length>=24?(i(),d("p",l3,a(w("已保存24个,请先移除一个再添加。","24 selected. Remove a shortcut to add another.")),1)):T("",!0),!y.value&&!s.collapsed&&s.fallbackEntries.length?(i(),d("div",i3,[e("h3",null,a(w("快捷操作","Quick actions")),1),(i(!0),d(V,null,oe(s.fallbackEntries,ie=>(i(),d("button",{key:ie.path,onClick:Ye=>dn(ie.path),"data-browser-quick":ie.path},[G(Qe,{name:ie.glyph},null,8,["name"]),ue(a(w(ie.zh,ie.en)),1),G(Qe,{name:"arrow"})],8,r3))),128))])):T("",!0),F.value?(i(),d("p",c3,a(F.value),1)):T("",!0)],64))],8,Iv),U.value?T("",!0):(i(),d("footer",d3,[y.value?(i(),d(V,{key:0},[e("button",{onClick:Ue},a(w("取消","Cancel")),1),e("button",{class:"applications-save",disabled:o(c)(),onClick:Et},a(w("保存到首页","Save to home"))+" · "+a(_.value.length)+"/24",9,u3)],64)):(i(),d(V,{key:1},[e("button",{onClick:ke,disabled:!o(ce).editable(),"data-manage-favorites":""},a(w("编辑快捷入口","Edit shortcuts")),9,v3),e("button",{class:"software-center",onClick:Te[12]||(Te[12]=ie=>dn("/cgi-bin/luci/admin/store/pages/store")),"data-browser-software-center":""},[ue(a(w("软件中心","Software center")),1),G(Qe,{name:"arrow"})])],64))]))],10,Mv)])):T("",!0),de.value?(i(),Y(hv,{key:3,app:de.value,onClose:Te[13]||(Te[13]=ie=>de.value=null)},null,8,["app"])):T("",!0),K.value?(i(),Y(na,{key:4,title:w("入口暂不可用","Shortcut unavailable"),onClose:Te[14]||(Te[14]=ie=>K.value=null)},{default:pe(()=>[e("div",p3,[e("p",null,a(w(K.value.zh,K.value.en))+" · "+a(Fe(K.value)),1),e("p",null,a(w("入口保留在原位置,你可以在编辑快捷入口中移除。","The shortcut stays in place. You can remove it in Edit shortcuts.")),1)])]),_:1},8,["title"])):T("",!0)],64))}}),Ti=le(h3,[["__scopeId","data-v-3519060e"]]);function m3(s,t=""){if(t)return"unavailable";if(!s)return"loading";const n=s.networkInfo;return["netSuccess","dnsFailed","softSourceFailed","netFailed","netDetecting"].includes(n||"")?n:"unknown"}const f3={netSuccess:["网络连接正常","Connection normal"],dnsFailed:["DNS错误","DNS error"],softSourceFailed:["软件源错误","Software source error"],netFailed:["未联网","Not connected"],netDetecting:["检测中…","Checking…"],unknown:["连接状态待确认","Connection unconfirmed"],loading:["正在读取连接","Loading connection"],unavailable:["连接信息暂不可用","Connection unavailable"]},b3=s=>s==="pppoe"?["拨号上网","PPPoE"]:s==="static"?["静态网络","Static"]:s==="dhcp"?["DHCP","DHCP"]:[(s==null?void 0:s.toUpperCase())||"—",(s==null?void 0:s.toUpperCase())||"—"],g3=s=>s==="manual"?["手动配置","Manual"]:s==="auto"?["自动获取","Automatic"]:["来源待确认","Source unknown"];function Nl(s,t=0){const n=s==null?void 0:s.uptimeStamp;return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.floor(n)+Math.max(0,Math.floor(t)):null}function _3(s,t=!1){if(s===null)return"—";const n=Math.floor(s/86400),l=Math.floor(s%86400/3600),u=Math.floor(s%3600/60);return t?`${n?n+"d ":""}${l}h ${u}m`:`${n?n+"天 ":""}${l}小时 ${u}分`}function La(s){return s==="UP"?"up":s==="DOWN"?"down":"unknown"}function y3(s){return{total:s.length,up:s.filter(t=>La(t.linkState)==="up").length,down:s.filter(t=>La(t.linkState)==="down").length,unknown:s.filter(t=>La(t.linkState)==="unknown").length}}function k3(s){const t=x(!1),n=x(!1),l={};function u(v){(v==="ipv4"?t:n).value=!1;const h=l[v];h!==void 0&&clearTimeout(h),delete l[v]}function c(){u("ipv4"),u("ipv6")}function r(v){const h=v==="ipv4"?t:n;h.value?u(v):(h.value=!0,l[v]=setTimeout(()=>u(v),6e4))}function p(){document.hidden&&c()}return document.addEventListener("visibilitychange",p),We(s,c),lt(()=>{c(),document.removeEventListener("visibilitychange",p)}),{ipv4:t,ipv6:n,toggle:r,hideAll:c}}const w3={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},$3=["fill"],zs=X({__name:"DNS",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",w3,[e("path",{d:"M512 96c229.76 0 416 186.24 416 416S741.76 928 512 928 96 741.76 96 512 282.24 96 512 96z m-32 448l-127.317333 0.021333c0.896 20.48 2.624 40.405333 5.12 59.669334l1.984 14.293333 2.474666 15.253333c19.754667 112.896 65.728 197.738667 117.76 222.997334L480 544z m191.317333 0.021333L544 544v312.234667c50.858667-24.725333 95.936-106.368 116.373333-215.509334l1.365334-7.488 2.474666-15.232a701.013333 701.013333 0 0 0 7.104-73.984z m-382.698666 0H161.429333c11.648 129.066667 92.992 238.08 206.101334 289.066667-22.122667-34.282667-40.362667-76.416-53.76-124.032l-3.029334-11.093333-3.52-14.165334-3.242666-14.464a744.490667 744.490667 0 0 1-15.36-125.312z m573.952 0H735.36a752.661333 752.661333 0 0 1-12.672 112.128l-2.688 13.184-3.242667 14.464-3.52 14.186667c-13.653333 52.138667-32.96 98.197333-56.789333 135.104 113.109333-50.986667 194.453333-160 206.08-289.066667zM367.530667 190.890667l-2.858667 1.301333C253.013333 243.733333 172.970667 352 161.429333 480h127.189334c1.536-39.04 5.866667-76.693333 12.672-112.149333l2.688-13.184 3.242666-14.464 3.52-14.186667c13.653333-52.138667 32.96-98.197333 56.789334-135.104zM480 167.765333c-50.709333 24.618667-95.68 105.898667-116.202667 214.592l-1.536 8.405334-2.474666 15.232a701.034667 701.034667 0 0 0-7.104 74.005333H480V167.765333z m176.469333 23.146667l2.56 4.053333c20.906667 33.429333 38.229333 73.984 51.093334 119.552l3.136 11.52 3.52 14.165334 3.242666 14.464c8.362667 39.253333 13.632 81.408 15.36 125.333333h127.189334c-11.626667-129.088-92.970667-238.101333-206.101334-289.066667zM544 167.765333L544 480h127.317333a707.136 707.136 0 0 0-5.333333-61.376l-1.770667-12.629333-2.474666-15.232c-19.754667-112.874667-65.706667-197.717333-117.717334-222.997334z","p-id":"4600",fill:s.color},null,8,$3)]))}}),C3={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},S3=["fill"],x3=["fill"],P3=X({__name:"success",props:{color:{type:String,default:"#00a63e"}},setup(s){return(t,n)=>(i(),d("svg",C3,[e("path",{d:"M986.112 179.2c-12.288-12.288-31.744-12.288-44.032 0l-472.064 471.04-180.224-180.224c-12.288-12.288-31.744-12.288-44.032 0-12.288 12.288-12.288 31.744 0 44.032l202.752 201.728c6.144 6.144 12.288 9.216 22.528 9.216 9.216 0 15.36-3.072 22.528-9.216l494.592-492.544c10.24-12.288 10.24-31.744-2.048-44.032z",fill:s.color,"p-id":"11312"},null,8,S3),e("path",{d:"M1024 548.864c0-17.408-14.336-31.744-31.744-31.744-17.408 0-31.744 14.336-31.744 31.744C941.056 779.264 747.52 959.488 513.024 959.488 265.216 959.488 64.512 759.808 64.512 512c0-247.808 200.704-447.488 448.512-447.488 69.632 0 135.168 15.36 194.56 44.032h1.024c4.096 1.024 7.168 2.048 11.264 2.048 17.408 0 31.744-14.336 31.744-31.744 0-12.288-7.168-23.552-17.408-28.672C665.6 17.408 590.848 0 513.024 0 229.376 0 0 229.376 0 512s229.376 512 513.024 512c270.336 0 491.52-208.896 510.976-475.136z",fill:s.color,"p-id":"11313"},null,8,x3)]))}}),T3={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},M3=["fill"],E3=["fill"],I3=["fill"],Mi=X({__name:"topology",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",T3,[e("path",{d:"M298.894222 482.417778c-35.271111 0-65.649778 12.231111-90.624 36.636444-25.031111 24.462222-37.603556 54.158222-37.603555 88.746667v87.153778h60.359111V607.857778c0-18.318222 6.599111-33.848889 19.854222-46.762667a65.991111 65.991111 0 0 1 48.014222-19.456h426.382222c18.887111 0 34.759111 6.428444 48.014223 19.399111 13.312 13.027556 19.854222 28.444444 19.854222 46.819556v87.04h60.359111v-87.04c0-34.702222-12.572444-64.341333-37.546667-88.746667a125.098667 125.098667 0 0 0-90.680889-36.750222H298.894222z",fill:s.color,"p-id":"8894"},null,8,M3),e("path",{d:"M488.049778 334.734222h47.900444V512h-47.900444V334.734222z",fill:s.color,"p-id":"8895"},null,8,E3),e("path",{d:"M597.333333 142.222222v170.666667h-170.666666v-170.666667h170.666666z m-170.666666-56.888889a56.888889 56.888889 0 0 0-56.888889 56.888889v170.666667a56.888889 56.888889 0 0 0 56.888889 56.888889h170.666666a56.888889 56.888889 0 0 0 56.888889-56.888889v-170.666667a56.888889 56.888889 0 0 0-56.888889-56.888889h-170.666666zM284.444444 711.111111H113.777778v170.666667h170.666666v-170.666667z m-170.666666-56.888889h170.666666a56.888889 56.888889 0 0 1 56.888889 56.888889v170.666667a56.888889 56.888889 0 0 1-56.888889 56.888889H113.777778a56.888889 56.888889 0 0 1-56.888889-56.888889v-170.666667a56.888889 56.888889 0 0 1 56.888889-56.888889zM910.222222 711.111111v170.666667h-170.666666v-170.666667h170.666666z m-170.666666-56.888889a56.888889 56.888889 0 0 0-56.888889 56.888889v170.666667a56.888889 56.888889 0 0 0 56.888889 56.888889h170.666666a56.888889 56.888889 0 0 0 56.888889-56.888889v-170.666667a56.888889 56.888889 0 0 0-56.888889-56.888889h-170.666666z",fill:s.color,"p-id":"8896"},null,8,I3)]))}}),D3={width:"32",height:"32",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},L3=["fill"],A3=X({__name:"openEyes",props:{color:{type:String,default:"#2c2c2c"}},setup(s){return(t,n)=>(i(),d("svg",D3,[e("path",{d:"M512 298.666667c-162.133333 0-285.866667 68.266667-375.466667 213.333333 89.6 145.066667 213.333333 213.333333 375.466667 213.333333s285.866667-68.266667 375.466667-213.333333c-89.6-145.066667-213.333333-213.333333-375.466667-213.333333z m0 469.333333c-183.466667 0-328.533333-85.333333-426.666667-256 98.133333-170.666667 243.2-256 426.666667-256s328.533333 85.333333 426.666667 256c-98.133333 170.666667-243.2 256-426.666667 256z m0-170.666667c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333-85.333333 38.4-85.333333 85.333333 38.4 85.333333 85.333333 85.333333z m0 42.666667c-72.533333 0-128-55.466667-128-128s55.466667-128 128-128 128 55.466667 128 128-55.466667 128-128 128z",fill:s.color,"p-id":"5225"},null,8,L3)]))}}),N3={width:"32",height:"32",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},O3=["fill"],z3=X({__name:"closeEyes",props:{color:{type:String,default:"#2c2c2c"}},setup(s){return(t,n)=>(i(),d("svg",N3,[e("path",{d:"M332.8 729.6l34.133333-34.133333c42.666667 12.8 93.866667 21.333333 145.066667 21.333333 162.133333 0 285.866667-68.266667 375.466667-213.333333-46.933333-72.533333-102.4-128-166.4-162.133334l29.866666-29.866666c72.533333 42.666667 132.266667 106.666667 183.466667 192-98.133333 170.666667-243.2 256-426.666667 256-59.733333 4.266667-119.466667-8.533333-174.933333-29.866667z m-115.2-64c-51.2-38.4-93.866667-93.866667-132.266667-157.866667 98.133333-170.666667 243.2-256 426.666667-256 38.4 0 76.8 4.266667 110.933333 12.8l-34.133333 34.133334c-25.6-4.266667-46.933333-4.266667-76.8-4.266667-162.133333 0-285.866667 68.266667-375.466667 213.333333 34.133333 51.2 72.533333 93.866667 115.2 128l-34.133333 29.866667z m230.4-46.933333l29.866667-29.866667c8.533333 4.266667 21.333333 4.266667 29.866666 4.266667 46.933333 0 85.333333-38.4 85.333334-85.333334 0-12.8 0-21.333333-4.266667-29.866666l29.866667-29.866667c12.8 17.066667 17.066667 38.4 17.066666 64 0 72.533333-55.466667 128-128 128-17.066667-4.266667-38.4-12.8-59.733333-21.333333zM384 499.2c4.266667-68.266667 55.466667-119.466667 123.733333-123.733333 0 4.266667-123.733333 123.733333-123.733333 123.733333zM733.866667 213.333333l29.866666 29.866667-512 512-34.133333-29.866667L733.866667 213.333333z",fill:s.color,"p-id":"5534"},null,8,O3)]))}}),q3=["data-network-action"],R3=X({__name:"NetworkBusinessAction",props:{kind:{}},emits:["close"],setup(s,{emit:t}){const n=t,l=window.vue_lang==="en",u=(r,p)=>l?p:r,c=()=>n("close");return(r,p)=>(i(),Y(na,{title:s.kind==="dns"?u("DNS配置","DNS settings"):u("软件源配置","Software source settings"),onClose:p[0]||(p[0]=v=>r.$emit("close"))},{default:pe(()=>[e("div",{class:"network-business-action","data-network-action":s.kind},[s.kind==="dns"?(i(),Y(xi,{key:0,Close:c})):(i(),Y(Pi,{key:1,Close:c}))],8,q3)]),_:1},8,["title"]))}}),V3=le(R3,[["__scopeId","data-v-03262619"]]),B3=["data-connection-state"],U3={class:"network-header-actions widget-action-group"},F3={class:"connection-status"},H3={class:"connection-status-text"},G3={key:0},j3=["data-connection-remedy"],W3=["title","aria-label"],J3={key:0,class:"network-snapshot-note"},K3={key:1,class:"connection-addresses"},Z3=["data-address-value","title"],Y3=["data-reveal","aria-pressed","aria-label","title","onClick"],Q3={key:1,class:"connection-address-meta"},X3={class:"connection-dns-group"},e4={class:"connection-dns"},t4={class:"connection-address-meta"},n4={key:2},a4=["title"],s4={"data-connection-uptime":""},o4={class:"connection-full-details","data-connection-full-details":""},l4={class:"network-detail-status"},i4={key:0,class:"network-snapshot-note"},r4=["data-detail-address"],c4=["data-detail-reveal","aria-pressed","aria-label","onClick"],d4={key:0},u4={key:1},v4=["disabled"],p4=["disabled"],h4={key:0},m4={class:"network-privacy-note"},f4={class:"network-detail-actions"},b4=X({__name:"NetworkConnectionCard",props:{data:{},error:{},summary:{type:Boolean}},emits:["navigate","retry"],setup(s,{emit:t}){const n=s,l=t,u=window.vue_lang==="en",c=(ve,O)=>u?O:ve,r=ve=>ve[u?1:0],p=R(()=>m3(n.data,n.error)),v=R(()=>r(f3[p.value])),h=R(()=>{var ve;return r(b3((ve=n.data)==null?void 0:ve.proto))}),g=R(()=>{var ve;return r(g3((ve=n.data)==null?void 0:ve.dnsProto))}),b=k3(R(()=>{var ve,O;return JSON.stringify([(ve=n.data)==null?void 0:ve.ipv4addr,(O=n.data)==null?void 0:O.ipv6addr,n.summary])})),m=["ipv4","ipv6"],f=ve=>(ve==="ipv4"?b.ipv4:b.ipv6).value,k=ve=>{var O,de;return ve==="ipv4"?(O=n.data)==null?void 0:O.ipv4addr:(de=n.data)==null?void 0:de.ipv6addr},$=ve=>(f(ve)?c("隐藏","Hide "):c("显示60秒:","Show for 60s: "))+ve.toUpperCase(),w=R(()=>{var ve;return(((ve=n.data)==null?void 0:ve.dnsList)||[]).filter(O=>typeof O=="string"&&O.length)}),S=x(0),C=R(()=>w.value.slice(S.value*20,S.value*20+20)),y=x(!1),P=x(null),_=R(()=>p.value==="dnsFailed"?"dns":p.value==="softSourceFailed"?"source":null);function D(){y.value=!1,b.hideAll(),S.value=0}function E(ve){D(),l("navigate",ve)}const A=os();function U(ve){var O;ve&&(D(),A.updateNetworkStatus(Ne(ye({},n.data),{dnsList:[...((O=n.data)==null?void 0:O.dnsList)||[]]})),P.value=ve)}let q=Date.now(),z;const N=x(Date.now()),F=R(()=>Nl(n.data,n.error?0:(N.value-q)/1e3)),Z=R(()=>_3(F.value,u)+(F.value===null?"":u?` ${F.value%60}s`:`${F.value%60}秒`));function Q(){z!==void 0&&clearInterval(z),z=void 0,!document.hidden&&Nl(n.data)!==null&&!n.error&&(z=setInterval(()=>N.value=Date.now(),1e3))}function ce(){document.hidden&&(D(),P.value=null),N.value=Date.now(),Q()}return We(()=>n.data,()=>{q=Date.now(),N.value=q,Q()}),We(()=>n.error,Q),We(()=>n.summary,()=>{D(),P.value=null}),We(()=>w.value.length,()=>S.value=0),nt(()=>{Q(),document.addEventListener("visibilitychange",ce)}),lt(()=>{z!==void 0&&clearInterval(z),document.removeEventListener("visibilitychange",ce)}),(ve,O)=>{var de;return i(),d("section",{class:_e(["network-business-card connection-business",{summary:s.summary}]),"data-connection-card":"","data-connection-state":p.value},[e("header",null,[e("h2",null,[s.summary?(i(),Y(Qe,{key:0,name:"network"})):(i(),Y(zs,{key:1,color:"currentColor"})),ue(a(s.summary?c("网络连接","Connection"):c("网络连接","Connection & IP")),1)]),e("div",U3,[G(_a,{icon:"devices","data-connection-wizard":"",onClick:O[0]||(O[0]=K=>ve.$emit("navigate","/network"))},{icon:pe(()=>[G(Mi,{color:"currentColor"})]),default:pe(()=>[ue(a(c("网络向导","Network setup")),1)]),_:1}),G(za,{label:c("网络连接更多操作","More connection actions"),items:[{id:"connection-details",label:c("连接详情","Connection details")}],onSelect:O[1]||(O[1]=K=>y.value=!0)},null,8,["label","items"])])]),e("div",F3,[e("span",{class:_e(["connection-status-mark",p.value])},[!s.summary&&p.value==="netSuccess"?(i(),Y(P3,{key:0,color:"currentColor"})):(i(),Y(Qe,{key:1,name:p.value==="netSuccess"?"check":"network"},null,8,["name"]))],2),e("div",H3,[e("strong",null,a(v.value),1),s.summary?(i(),d("small",G3,a(((de=s.data)==null?void 0:de.defaultInterface)||"—")+" · "+a(h.value),1)):T("",!0)]),_.value?(i(),d("button",{key:0,class:"connection-remedy","data-connection-remedy":_.value,onClick:O[2]||(O[2]=K=>U(_.value))},a(_.value==="dns"?c("DNS配置","DNS settings"):c("软件源配置","Source settings")),9,j3)):s.error?(i(),d("button",{key:1,"data-connection-retry":"",onClick:O[3]||(O[3]=K=>ve.$emit("retry"))},a(c("重试","Retry")),1)):T("",!0),s.summary?T("",!0):(i(),d("span",{key:2,class:_e(["connection-uptime-badge",{normal:p.value==="netSuccess"}]),title:c("接口在线时长,不代表互联网持续可用","Interface uptime, not continuous Internet availability"),"aria-label":c("接口在线时长:","Interface uptime: ")+Z.value,"data-connection-uptime":""},a(Z.value),11,W3))]),s.error&&s.data?(i(),d("p",J3,a(c("上次快照 · 当前连接状态待确认","Previous snapshot · Current state unconfirmed")),1)):T("",!0),s.summary?T("",!0):(i(),d("dl",K3,[(i(),d(V,null,oe(m,K=>{var xe;return e("div",{key:K,class:"connection-address-group"},[e("dt",null,a(K==="ipv4"?"IPv4"+((xe=s.data)!=null&&xe.defaultInterface?"("+s.data.defaultInterface+")":""):"IPv6"),1),e("dd",null,[e("span",{"data-address-value":K,title:f(K)?k(K):void 0},a(k(K)?f(K)?k(K):"••••••••••":c("暂无地址","No address")),9,Z3),k(K)?(i(),d("button",{key:0,class:"connection-reveal","data-reveal":K,"aria-pressed":f(K),"aria-label":$(K),title:$(K),onClick:j=>o(b).toggle(K)},[f(K)?(i(),Y(z3,{key:0,color:"currentColor"})):(i(),Y(A3,{key:1,color:"currentColor"}))],8,Y3)):T("",!0),K==="ipv4"?(i(),d("span",Q3,a(h.value),1)):T("",!0)])])}),64)),e("div",X3,[O[11]||(O[11]=e("dt",null,"DNS",-1)),e("dd",e4,[e("span",null,a(w.value.slice(0,2).join(" · ")||"—"),1),w.value.length>2?(i(),d("button",{key:0,onClick:O[4]||(O[4]=K=>y.value=!0)},"+"+a(w.value.length-2),1)):T("",!0),e("span",t4,a(g.value),1)])])])),s.summary?(i(),d("footer",n4,[e("span",{title:c("接口在线时长,不代表互联网持续可用","Interface uptime, not continuous Internet availability")},[e("small",null,a(c("接口在线","Interface uptime")),1),e("b",s4,a(Z.value),1)],8,a4)])):T("",!0),y.value?(i(),Y(na,{key:3,title:c("网络连接和IP地址","Connection & IP addresses"),onClose:D},{default:pe(()=>{var K,xe;return[e("div",o4,[e("p",l4,a(v.value),1),s.error?(i(),d("p",i4,a(c("读取失败;以下为上次信息(若有),不能证明当前连接正常。","Read failed; previous information, if any, does not establish current connectivity.")),1)):T("",!0),e("dl",null,[e("div",null,[e("dt",null,a(c("当前接口","Current interface")),1),e("dd",null,a(((K=s.data)==null?void 0:K.defaultInterface)||"—"),1)]),e("div",null,[e("dt",null,a(c("上网协议","Protocol")),1),e("dd",null,a(h.value),1)]),e("div",null,[e("dt",null,a(c("接口在线时长","Interface uptime")),1),e("dd",null,a(Z.value),1)]),(i(),d(V,null,oe(m,j=>e("div",{key:j},[e("dt",null,a(j==="ipv4"?"IPv4":"IPv6"),1),e("dd",null,[e("span",{"data-detail-address":j},a(k(j)?f(j)?k(j):"••••••••••":c("暂无地址","No address")),9,r4),k(j)?(i(),d("button",{key:0,"data-detail-reveal":j,"aria-pressed":f(j),"aria-label":$(j),onClick:re=>o(b).toggle(j)},a(f(j)?c("隐藏","Hide"):c("显示60秒","Show for 60s")),9,c4)):T("",!0)])])),64)),e("div",null,[e("dt",null,a(c("DNS来源","DNS source")),1),e("dd",null,a(g.value),1)]),e("div",null,[e("dt",null,a(c("DNS地址","DNS addresses")),1),e("dd",null,[w.value.length?T("",!0):(i(),d("span",d4,"—")),(i(!0),d(V,null,oe(C.value,(j,re)=>(i(),d("span",{key:re,"data-detail-dns":""},a(j),1))),128)),w.value.length>20?(i(),d("nav",u4,[e("button",{disabled:S.value===0,onClick:O[5]||(O[5]=j=>S.value--)},a(c("上一页","Previous")),9,v4),e("span",null,a(S.value+1)+" / "+a(Math.ceil(w.value.length/20)),1),e("button",{disabled:(S.value+1)*20>=w.value.length,onClick:O[6]||(O[6]=j=>S.value++)},a(c("下一页","Next")),9,p4)])):T("",!0)])]),(xe=s.data)!=null&&xe.gateway?(i(),d("div",h4,[e("dt",null,a(c("本机出口网关","Router outbound gateway")),1),e("dd",null,[ue(a(s.data.gateway),1),e("small",null,a(c("详情补充;不是局域网设备上网路线设置","Additional detail; not the LAN device Internet Path setting")),1)])])):T("",!0)]),e("p",m4,a(c("IPv4/IPv6独立显示60秒;关闭详情或切换形态后恢复隐藏。","IPv4 / IPv6 reveal independently for 60s. Closing details or changing form hides them.")),1),e("div",f4,[e("button",{onClick:O[7]||(O[7]=j=>E("/devicemanagement"))},a(c("设备管理","Device management")),1),_.value?(i(),d("button",{key:0,onClick:O[8]||(O[8]=j=>U(_.value))},a(_.value==="dns"?c("DNS配置","DNS settings"):c("软件源配置","Software source settings")),1)):T("",!0),s.error?(i(),d("button",{key:1,onClick:O[9]||(O[9]=j=>ve.$emit("retry"))},a(c("重试","Retry")),1)):T("",!0)])])]}),_:1},8,["title"])):T("",!0),P.value?(i(),Y(V3,{key:4,kind:P.value,onClose:O[10]||(O[10]=K=>P.value=null)},null,8,["kind"])):T("",!0)],10,B3)}}}),g4=le(b4,[["__scopeId","data-v-d478a1e1"]]),_4=["data-interface-form"],y4={class:"network-header-actions widget-action-group"},k4={key:0,class:"network-widget-message"},w4={key:0},$4={key:0,class:"interface-totals"},C4={key:1,class:"network-widget-empty"},S4={key:2,class:"interface-list"},x4=["data-port","onClick"],P4={class:"interface-name"},T4={class:"interface-link-state"},M4={key:0},E4={key:1},I4={class:"interface-full-details","data-interface-details":""},D4={key:0,class:"network-snapshot-note"},L4={key:0},A4={key:1},N4={class:"interface-detail-list"},O4=["data-detail-port","onClick"],z4={key:2},q4=["disabled"],R4=["disabled"],V4={class:"network-detail-actions"},B4=X({__name:"NetworkInterfaceCard",props:{data:{},error:{},summary:{type:Boolean},legacySummary:{type:Boolean}},emits:["navigate","retry"],setup(s){const t=s,n=window.vue_lang==="en",l=(S,C)=>n?C:S,u=R(()=>{var S;return((S=t.data)==null?void 0:S.ports)||[]}),c=R(()=>y3(u.value)),r=x(!1),p=x(""),v=x(0),h=R(()=>u.value.find(S=>S.name===p.value)),g=R(()=>u.value.slice(v.value*20,v.value*20+20)),b=S=>La(S)==="up"?l("已连接","Connected"):La(S)==="down"?l("未连接","Disconnected"):l("状态待确认","State unknown"),m=[["name","名称","Name"],["interfaceNames","关联逻辑接口","Logical interfaces"],["linkState","链路状态","Link state"],["linkSpeed","协商速率","Negotiated speed"],["macAddress","MAC","MAC"],["duplex","双工","Duplex"],["rx_packets","接收包数","Received packets"],["tx_packets","发送包数","Sent packets"]];function f(S){const C=h.value;return C?S==="linkState"?b(C.linkState):S==="interfaceNames"?(C.interfaceNames||[]).join(" / ")||"—":S==="duplex"?C.duplex==="full"?l("全双工","Full duplex"):C.duplex==="half"?l("半双工","Half duplex"):"—":C[S]||"—":"—"}function k(S){p.value=S,r.value=!0}function $(){p.value="",v.value=0,r.value=!0}function w(){r.value=!1,p.value="",v.value=0}return We(()=>t.summary,w),We(h,S=>{p.value&&!S&&(p.value="")}),We(()=>u.value.length,()=>{v.value=Math.min(v.value,Math.max(0,Math.ceil(u.value.length/20)-1)),p.value&&!h.value&&(p.value="")}),(S,C)=>(i(),d("section",{class:_e(["network-business-card interface-business",{summary:s.summary,"compact-ports":s.summary&&!s.legacySummary}]),"data-interface-form":s.summary?s.legacySummary?"legacy-summary":"compact-ports":"standard","data-network-interface":""},[e("header",null,[e("h2",null,[G(Qe,{name:"network"}),ue(a(l("网络接口","Network interfaces")),1)]),e("div",y4,[G(_a,{icon:"tune","data-interface-config":"",onClick:C[0]||(C[0]=y=>S.$emit("navigate","/interfaceconfig"))},{default:pe(()=>[ue(a(l("接口配置","Configure")),1)]),_:1}),G(za,{label:l("网络接口更多操作","More interface actions"),items:[{id:"interfaces-all",label:l("查看全部","View all")+(u.value.length?" · "+u.value.length:"")}],onSelect:$},null,8,["label","items"])])]),s.error||!s.data?(i(),d("div",k4,[e("strong",null,a(s.error?l("接口信息暂不可用","Interface information unavailable"):l("正在读取接口","Loading interfaces")),1),s.error&&s.data?(i(),d("small",w4,a(l("上次快照,当前状态待确认","Previous snapshot; current state unconfirmed")),1)):T("",!0),s.error?(i(),d("button",{key:1,onClick:C[1]||(C[1]=y=>S.$emit("retry"))},a(l("重试","Retry")),1)):T("",!0)])):(i(),d(V,{key:1},[!s.summary||s.legacySummary?(i(),d("div",$4,[e("strong",null,[ue(a(c.value.up),1),e("small",null,"/ "+a(c.value.total),1)]),e("span",null,a(l("端口已连接","ports connected")),1),e("small",null,a(l("链路状态","Link state")),1)])):T("",!0),u.value.length?!s.summary||!s.legacySummary?(i(),d("div",S4,[(i(!0),d(V,null,oe(u.value.slice(0,2),y=>(i(),d("button",{key:y.name,"data-port":y.name,onClick:P=>k(y.name)},[e("span",{class:_e(["interface-link-mark",o(La)(y.linkState)])},[G(Qe,{name:"network"})],2),e("span",P4,[e("strong",null,a(y.name),1),e("small",null,a((y.interfaceNames||[]).join(" / ")||l("未关联逻辑接口","No logical interface")),1)]),e("span",T4,[e("strong",null,a(b(y.linkState)),1),y.linkSpeed?(i(),d("small",M4,a(y.linkSpeed),1)):(i(),d("small",E4,a(l("速率待确认","Speed unknown")),1))]),G(Qe,{name:"arrow"})],8,x4))),128))])):T("",!0):(i(),d("p",C4,a(l("暂未读取到网络接口","No interfaces returned")),1))],64)),e("footer",null,[e("small",null,a(l("端口连接不代表互联网可用","Link state does not establish Internet access")),1)]),r.value?(i(),Y(na,{key:2,title:p.value?l("端口详情","Port details")+" · "+p.value:l("网络接口状态","Network interfaces"),onClose:w},{default:pe(()=>[e("div",I4,[s.error&&s.data?(i(),d("p",D4,a(l("上次快照 · 当前接口状态待确认","Previous snapshot · Current link state unconfirmed")),1)):T("",!0),h.value?(i(),d(V,{key:1},[e("button",{class:"network-back",onClick:C[2]||(C[2]=y=>p.value="")},"← "+a(l("全部接口","All interfaces")),1),e("dl",null,[(i(),d(V,null,oe(m,y=>e("div",{key:y[0]},[e("dt",null,a(l(y[1],y[2])),1),e("dd",null,a(f(y[0])),1)])),64))])],64)):(i(),d(V,{key:2},[s.data?u.value.length?T("",!0):(i(),d("p",A4,a(l("暂未读取到网络接口","No interfaces returned")),1)):(i(),d("p",L4,a(s.error?l("接口信息暂不可用","Interface information unavailable"):l("正在读取接口","Loading interfaces")),1)),e("div",N4,[(i(!0),d(V,null,oe(g.value,y=>(i(),d("button",{key:y.name,"data-detail-port":y.name,onClick:P=>p.value=y.name},[e("strong",null,a(y.name),1),e("span",null,a((y.interfaceNames||[]).join(" / ")||"—"),1),e("small",null,a(b(y.linkState))+" · "+a(y.linkSpeed||l("速率待确认","Speed unknown")),1),G(Qe,{name:"arrow"})],8,O4))),128))]),u.value.length>20?(i(),d("nav",z4,[e("button",{disabled:v.value===0,onClick:C[3]||(C[3]=y=>v.value--)},a(l("上一页","Previous")),9,q4),e("span",null,a(v.value+1)+" / "+a(Math.ceil(u.value.length/20)),1),e("button",{disabled:(v.value+1)*20>=u.value.length,onClick:C[4]||(C[4]=y=>v.value++)},a(l("下一页","Next")),9,R4)])):T("",!0)],64)),e("div",V4,[e("button",{onClick:C[5]||(C[5]=y=>{w(),S.$emit("navigate","/interfaceconfig")})},a(l("配置网络接口","Configure network interfaces")),1),s.error?(i(),d("button",{key:0,onClick:C[6]||(C[6]=y=>S.$emit("retry"))},a(l("重试","Retry")),1)):T("",!0)])])]),_:1},8,["title"])):T("",!0)],10,_4))}}),U4=le(B4,[["__scopeId","data-v-d7f98cf8"]]),F4={class:"reusable-card",role:"group"},H4={class:"card-header"},G4={class:"left"},j4={class:"title"},W4={key:0,class:"settings-btn"},J4={class:"dropdown-menu"},K4={class:"card-body"},Z4={__name:"Card",props:{title:{type:String,required:!0},homeMenu:{type:Array,default:()=>[]},homeCustomMenu:{type:Boolean,default:!1},showSettings:{type:Boolean,default:!0},isSettingsMenuOpen:{type:Boolean,default:!1}},emits:["settings","update:isSettingsMenuOpen"],setup(s,{emit:t}){const n=qa();function l(h){const g=c.homeMenu[Number(h)];g!=null&&g.action?g.action():g!=null&&g.href&&window.location.assign(g.href)}const{$gettext:u}=Ae();nt(()=>document.addEventListener("click",p)),ga(()=>document.removeEventListener("click",p));const c=s,r=R({get:()=>c.isSettingsMenuOpen,set:h=>v("update:isSettingsMenuOpen",h)}),p=h=>{h.target.closest(".settings-wrapper")||(r.value=!1)},v=t;return(h,g)=>(i(),d("div",F4,[e("div",H4,[e("div",G4,[Ct(h.$slots,"icon",{},void 0,!0),e("div",j4,a(s.title),1)]),e("div",{class:_e(["settings-wrapper",{"widget-action-group":o(n)&&!s.homeCustomMenu}])},[s.showSettings?(i(),d("div",W4,[Ct(h.$slots,"settings",{},void 0,!0)])):T("",!0),o(n)&&!s.homeCustomMenu&&s.homeMenu.length?(i(),Y(za,{key:1,label:s.title+o(u)("更多操作"),items:s.homeMenu.map((b,m)=>({id:String(m),label:b.label})),onSelect:l},null,8,["label","items"])):T("",!0),o(n)?T("",!0):(i(),Y(fn,{key:2,name:"fade",persisted:""},{default:pe(()=>[W(e("div",J4,[Ct(h.$slots,"settings-menu",{},void 0,!0)],512),[[Bs,r.value]])]),_:3}))],2)]),e("div",K4,[Ct(h.$slots,"default",{},void 0,!0)])]))}},ya=le(Z4,[["__scopeId","data-v-5fc49e13"]]),Y4={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Q4=["fill"],X4=["fill"],Ol=X({__name:"disk1",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",Y4,[e("path",{d:"M554.688 682.624a42.688 42.688 0 0 0 0 85.376h0.448a42.688 42.688 0 1 0 0-85.376h-0.448zM767.488 682.624a42.688 42.688 0 0 0 0 85.376H768a42.688 42.688 0 1 0 0-85.376h-0.512z",fill:s.color,"p-id":"5230"},null,8,Q4),e("path",{d:"M465.28 96h93.44c59.456 0 106.88 0 144.96 4.48 39.36 4.48 72.128 14.08 100.992 35.584 28.8 21.44 47.424 50.112 63.104 86.464 15.232 35.2 28.8 80.64 45.952 137.6l52.48 174.848c1.28 4.48 2.752 9.28 3.584 14.336v0.32l0.192 1.216c0.64 5.12 0.64 10.048 0.64 14.72v3.392c0 72.704 0 130.304-5.632 175.68-5.824 46.592-18.112 84.736-45.952 115.84-4.992 5.568-10.304 10.88-15.936 15.872-31.104 27.84-69.184 40.128-115.84 45.952-45.312 5.696-102.912 5.696-175.616 5.696H412.352c-72.704 0-130.304 0-175.68-5.696-46.592-5.824-84.672-18.112-115.84-45.888a202.944 202.944 0 0 1-15.872-16c-27.84-31.04-40.128-69.12-45.952-115.84-5.696-45.312-5.696-102.912-5.696-175.616v-3.328c0-4.672 0-9.664 0.704-14.784v-0.32l0.192-1.216c0.832-5.056 2.24-9.856 3.584-14.272l52.48-174.912c17.088-56.96 30.72-102.4 45.952-137.6 15.68-36.352 34.304-65.024 63.104-86.4 28.8-21.504 61.632-31.104 100.992-35.712C358.4 96 405.76 96 465.28 96zM327.68 164.032c-33.152 3.84-53.632 11.072-70.144 23.36-16.512 12.288-29.376 29.824-42.56 60.48-13.568 31.424-26.176 73.28-43.968 132.544l-42.688 142.272h767.36l-42.688-142.272c-17.792-59.264-30.4-101.12-43.968-132.48-13.184-30.72-26.048-48.256-42.56-60.544-16.512-12.288-36.992-19.52-70.144-23.36C662.336 160 618.624 160 556.736 160H467.328c-61.952 0-105.6 0-139.648 4.032zM122.496 736.64c5.056 40.128 14.528 63.616 30.144 81.088 3.456 3.84 7.04 7.488 10.88 10.88 17.536 15.68 40.96 25.088 81.152 30.144 40.96 5.12 94.464 5.184 169.92 5.184h194.816c75.456 0 129.024 0 169.92-5.184 40.128-5.056 63.616-14.464 81.152-30.08 3.84-3.456 7.424-7.104 10.88-10.944 15.616-17.536 25.088-40.96 30.08-81.088 4.672-37.248 5.12-84.928 5.248-150.016H117.312c0.064 65.088 0.512 112.768 5.184 150.016z",fill:s.color,"p-id":"5231"},null,8,X4)]))}}),ep={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},tp=["fill"],np=X({__name:"folder",props:{color:{type:String,default:"#0a0a0a"}},setup(s){return(t,n)=>(i(),d("svg",ep,[e("path",{d:"M912 208H427.872l-50.368-94.176A63.936 63.936 0 0 0 321.056 80H112c-35.296 0-64 28.704-64 64v736c0 35.296 28.704 64 64 64h800c35.296 0 64-28.704 64-64v-608c0-35.296-28.704-64-64-64z m-800-64h209.056l68.448 128H912v97.984c-0.416 0-0.8-0.128-1.216-0.128H113.248c-0.416 0-0.8 0.128-1.248 0.128V144z m0 736v-96l1.248-350.144 798.752 1.216V784h0.064v96H112z",fill:s.color,"p-id":"5094"},null,8,tp)]))}}),ap={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},sp=["fill"],op=X({__name:"finance",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",ap,[e("path",{d:"M136.12 251.958a83.054 83.054 0 0 1-0.12-4.458c0-32.903 19.447-58.344 41.115-75.981 21.984-17.893 51.365-32.231 84.13-43.511C327.163 105.315 415.641 92 511.5 92c95.859 0 184.337 13.315 250.255 36.008 32.765 11.28 62.146 25.618 84.13 43.511 20.221 16.458 38.506 39.713 40.86 69.485l0.255 0.002v532.88c0 32.888-19.031 58.62-40.776 76.719-21.978 18.294-51.385 32.976-84.207 44.53C696.011 918.373 607.438 932 511.5 932c-95.938 0-184.511-13.627-250.517-36.865-32.822-11.554-62.229-26.236-84.207-44.53C155.031 832.506 136 806.774 136 773.886V251.96l0.12-0.002z m79.88-4.459v0.002c0 0.016-0.003 0.151 0.098 0.491 0.112 0.379 0.397 1.16 1.103 2.347 1.479 2.49 4.55 6.323 10.415 11.096 11.97 9.743 31.722 20.293 59.67 29.914C342.796 310.459 422.067 323 511.5 323c89.433 0 168.704-12.541 224.214-31.651 27.948-9.621 47.7-20.171 59.67-29.914 5.865-4.773 8.936-8.606 10.415-11.096 0.706-1.187 0.991-1.968 1.103-2.347 0.088-0.297 0.097-0.437 0.098-0.479v-0.014-0.012c-0.001-0.042-0.01-0.182-0.098-0.479-0.112-0.379-0.397-1.16-1.103-2.347-1.479-2.49-4.55-6.323-10.415-11.096-11.97-9.743-31.722-20.293-59.67-29.914C680.204 184.541 600.933 172 511.5 172c-89.433 0-168.704 12.541-224.214 31.651-27.948 9.621-47.7 20.171-59.67 29.914-5.865 4.773-8.936 8.606-10.415 11.096-0.706 1.187-0.991 1.968-1.103 2.347-0.101 0.34-0.098 0.475-0.098 0.491z m591 100.656c-13.955 7.052-29.194 13.311-45.245 18.837C695.837 389.685 607.359 403 511.5 403c-95.859 0-184.337-13.315-250.255-36.008-16.051-5.526-31.29-11.785-45.245-18.837v85.359c0.001 0.042 0.01 0.182 0.098 0.478 0.112 0.379 0.397 1.16 1.103 2.347 1.479 2.489 4.55 6.323 10.415 11.096 11.97 9.743 31.722 20.293 59.67 29.914C342.796 496.459 422.067 509 511.5 509c89.433 0 168.704-12.541 224.214-31.651 27.948-9.621 47.7-20.171 59.67-29.914 5.865-4.773 8.936-8.607 10.415-11.096 0.706-1.187 0.991-1.968 1.103-2.347 0.088-0.297 0.097-0.437 0.098-0.479v-85.358z m-45.245 204.837C695.837 575.685 607.359 589 511.5 589c-95.859 0-184.337-13.315-250.255-36.008-16.051-5.526-31.29-11.785-45.245-18.837v70.359c0.001 0.041 0.01 0.182 0.098 0.478 0.112 0.379 0.397 1.16 1.103 2.347 1.479 2.489 4.55 6.323 10.415 11.096 11.97 9.743 31.722 20.293 59.67 29.914C342.796 667.459 422.067 680 511.5 680c89.433 0 168.704-12.541 224.214-31.651 27.948-9.621 47.7-20.171 59.67-29.914 5.865-4.773 8.936-8.607 10.415-11.096 0.706-1.187 0.991-1.968 1.103-2.347 0.088-0.297 0.097-0.437 0.098-0.479v-70.358c-13.955 7.052-29.194 13.311-45.245 18.837zM807 705.155c-13.955 7.052-29.194 13.311-45.245 18.837C695.837 746.685 607.359 760 511.5 760c-95.859 0-184.337-13.315-250.255-36.008-16.051-5.526-31.29-11.785-45.245-18.837V773.894c0 0.181-0.003 1.283 1.399 3.695 1.555 2.675 4.69 6.646 10.556 11.529 11.976 9.968 31.701 20.738 59.594 30.557C342.97 839.186 422.146 852 511.5 852c89.354 0 168.53-12.814 223.951-32.325 27.893-9.819 47.618-20.589 59.594-30.557 5.866-4.883 9.001-8.854 10.556-11.529 1.402-2.412 1.399-3.514 1.399-3.695v-68.739z",fill:s.color,"p-id":"9960"},null,8,sp)]))}}),lp={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},ip=["fill"],Ei=X({__name:"memory",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",lp,[e("path",{d:"M827.84 886.4H187.9184375c-32.2659375 0-53.76-21.51375-53.76-53.784375V714.28625a53.889375 53.889375 0 0 1 53.76-53.784375h639.9215625a53.8940625 53.8940625 0 0 1 53.76 53.784375v118.35375a53.8940625 53.8940625 0 0 1-53.76 53.76z m-5.375625-172.11375H187.9184375v118.35375h634.5309375V714.28625z m-570 32.664375a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.865-26.88z m78.3403125 0a26.88 26.88 0 1 1-26.60625 27.1678125 26.88 26.88 0 0 1 26.5875-27.16875z m78.6 0a26.88 26.88 0 1 1-26.60625 27.1678125 26.88 26.88 0 0 1 26.5875-27.16875zM827.215625 624.9490625H187.2846875c-32.2603125 0-53.76-21.51375-53.76-53.784375V452.8353125a53.8940625 53.8940625 0 0 1 53.76-53.784375H827.196875a53.8940625 53.8940625 0 0 1 53.76 53.784375v118.329375a53.8940625 53.8940625 0 0 1-53.76 53.784375z m-5.38125-172.11375H187.285625v118.329375H821.815625V452.8353125z m-569.994375 31.9921875a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.88-26.88z m77.889375 0a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.8565625-26.88z m76.963125-0.403125a26.88 26.88 0 1 1-26.60625 27.1678125 26.88 26.88 0 0 1 26.5875-27.163125z m419.7890625-120.744375H186.56c-32.2509375 0-53.76-21.5278125-53.76-53.7984375V191.5521875a53.8940625 53.8940625 0 0 1 53.76-53.784375h639.9215625a53.8940625 53.8940625 0 0 1 53.76 53.784375v118.329375a53.8940625 53.8940625 0 0 1-53.76 53.7984375z m-5.3615625-172.1278125H186.56v118.329375h634.56V191.5521875z m-570.0140625 32.2753125a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.88-26.88z m78.6046875 0a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.8753125-26.88z m78.6046875 0a26.88 26.88 0 1 1-26.88 26.88 26.88 26.88 0 0 1 26.8846875-26.88z",fill:s.color,"p-id":"19012"},null,8,ip)]))}}),rp={},cp={width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function dp(s,t){return i(),d("svg",cp,[...t[0]||(t[0]=[Hn('',1)])])}const zl=le(rp,[["render",dp]]),up={},vp={width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function pp(s,t){return i(),d("svg",vp,[...t[0]||(t[0]=[Hn('',1)])])}const hp=le(up,[["render",pp]]),mp={class:"action-header"},fp={class:"action-header_title"},bp={class:"action-body"},gp={class:"disk-info"},_p={key:0,class:"disk-info_mount-name"},yp={key:1,class:"disk-info_mount-name"},kp={key:0,class:"label-item"},wp={class:"label-item_key"},$p={class:"label-item_path"},Cp={class:"label-item"},Sp={class:"label-item_key"},xp={class:"label-item_value"},Pp=["disabled"],Tp={key:0,value:""},Mp={value:"format"},Ep={key:1,value:"default"},Ip={class:"label-item_value"},Dp={key:0,class:"msg"},Lp={key:1,class:"msg"},Ap={class:"action-footer"},Np=["disabled"],Op=["disabled"],zp={key:1,class:"action result"},qp={class:"action-body"},Rp={class:"action-body_msg"},Vp={key:0,class:"action-body_info"},Bp={key:1,class:"action-body_info"},Up={class:"btns"},Fp=X({__name:"index",props:{action:String,disk:{type:Object,required:!0},mount:{type:Object},Close:{type:Function},Cancel:{type:Function},Next:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close&&l.Close()},c=y=>{y.preventDefault(),l.Cancel&&l.Cancel(),u()},r=y=>{l.Next&&l.Next(y),u()},p=x(!1),v=x(0),h=y=>{v.value=y},g=x(l.action=="nas"?"":"format"),b=x(),m=x(),f=()=>{switch(g.value){case"format":$();return;case"default":k();return;default:ne.Warning(t("请选择选项"));return}},k=()=>{let y="";const P=l.mount;if(P!=null&&P.mountPoint!=null&&(y=P.mountPoint),y!=""){r(y);return}ne.Warning(t("无法识别路径"))},$=()=>{const y=l.disk,P=l.mount;if(P){const _=P.mountPoint||P.path;if(!confirm(t("警告:格式化会清空 %{partname} 分区数据,请你谨慎操作",{partname:_||""}))||!confirm(t("是否确定格式化 %{partname}?",{partname:_||""})))return;S(P);return}if(y){if(!confirm(t("警告:该操作将初始化 %{model} 硬盘并创建分区,请你谨慎操作",{model:y.venderModel||""}))||!confirm(t("是否确定初始化?")))return;w(y);return}ne.Warning(t("无法识别数据"))},w=y=>B(null,null,function*(){if(y.name==null||y.path==""){ne.Warning(t("获取不到设备名称"));return}if(y.path==null||y.path==""){ne.Warning(t("获取不到设备路径"));return}p.value=!0;const P=ne.Loading(t("初始化中..."));try{const _=yield we.Nas.Disk.Init.POST({name:y.name,path:y.path});if(_!=null&&_.data){const{result:D,error:E}=_==null?void 0:_.data;E&&ne.Warning(E),D&&(D.errorInfo?ne.Warning(D.errorInfo):(ne.Success(t("初始化成功")),D.childrens&&D.childrens.length>0&&(m.value=D.childrens[0]),b.value=D,h(1)))}}catch(_){ne.Error(_)}P.Close(),p.value=!1}),S=y=>B(null,null,function*(){if(y.path==null||y.path==""){ne.Warning(t("获取不到分区路径"));return}p.value=!0;const P=ne.Loading(t("格式化中..."));try{const _=yield we.Nas.Disk.Partition.Format.POST({path:y.path,uuid:y.uuid,mountPoint:y.mountPoint});if(_!=null&&_.data){const{result:D,error:E}=_==null?void 0:_.data;E&&ne.Warning(E),D&&(ne.Success(t("格式化成功")),m.value=D,h(1))}}catch(_){ne.Error(_)}P.Close(),p.value=!1}),C=()=>{if(m.value&&m.value.mountPoint){r(m.value.mountPoint);return}ne.Warning(t("读取结果失败"))};return(y,P)=>(i(),Y(Nt,{type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>{var _;return[v.value==0?(i(),d("form",{key:0,class:"action format",onSubmit:Ge(f,["prevent"])},[e("div",mp,[e("div",fp,a(o(t)("硬盘配置")),1)]),e("div",bp,[e("div",gp,[P[1]||(P[1]=e("div",{class:"disk-info_icon"},[e("svg",{t:"1642589762094",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11301",width:"128",height:"128"},[e("path",{d:"M899.892468 123.889088c0-44.342099-36.286708-80.620486-80.624646-80.620486H204.728017C160.385918 43.268602 124.107532 79.546988 124.107532 123.889088v802.847056c0 44.342099 36.278386 80.620486 80.620485 80.620486h614.539805c44.337938 0 80.624646-36.278386 80.624646-80.620486V123.889088z",fill:"#D0D0DB","p-id":"11302"}),e("path",{d:"M169.8768 977.7772V174.930143c0-44.342099 36.278386-80.620486 80.620486-80.620485h614.539804c9.936092 0 19.426974 1.905666 28.239639 5.23434-11.525534-30.507298-40.996782-52.389169-75.398629-52.389169H203.342457c-44.342099 0-80.620486 36.278386-80.620486 80.620486v802.851217c0 34.410168 21.881871 63.873094 52.385008 75.381985A79.730065 79.730065 0 0 1 169.8768 977.7772z",fill:"#FFFFFF","p-id":"11303"}),e("path",{d:"M820.657543 40.497481H206.117739c-44.342099 0-80.620486 36.278386-80.620486 80.620485v802.847057c0 44.342099 36.278386 80.620486 80.620486 80.620486h614.539804c44.337938 0 80.624646-36.278386 80.624647-80.620486V121.117966c0-44.342099-36.286708-80.620486-80.624647-80.620485z m19.60173 828.785749c0 40.846992-33.43237 74.279362-74.287684 74.279361H199.780776c-40.855313 0-74.279362-33.424048-74.279362-74.279361V129.593603c0-40.855313 33.424048-74.279362 74.279362-74.279362h566.203296c40.842831 0 74.283522 33.424048 74.283522 74.279362l-0.008321 739.689627z",fill:"#6E6E96","p-id":"11304"}),e("path",{d:"M815.106979 1024H200.567175C146.933914 1024 103.303319 980.369405 103.303319 926.736144V123.889088C103.303319 70.255827 146.933914 26.625232 200.567175 26.625232h614.539804c53.633261 0 97.268017 43.630595 97.268017 97.263856v802.847056c0 53.633261-43.634756 97.263856-97.268017 97.263856zM200.567175 59.911972C165.287391 59.911972 136.590059 88.609303 136.590059 123.889088v802.847056c0 35.279784 28.697331 63.977115 63.977116 63.977115h614.539804c35.279784 0 63.981276-28.697331 63.981276-63.977115V123.889088c0-35.279784-28.701492-63.977115-63.981276-63.977116H200.567175z",fill:"#6E6E96","p-id":"11305"}),e("path",{d:"M301.946104 941.515457h429.985632v65.841173H301.946104z",fill:"#8A8AA1","p-id":"11306"}),e("path",{d:"M731.931736 1024H301.946104a16.64337 16.64337 0 0 1-16.64337-16.64337V941.515457a16.64337 16.64337 0 0 1 16.64337-16.64337h429.985632a16.64337 16.64337 0 0 1 16.64337 16.64337v65.841173a16.64337 16.64337 0 0 1-16.64337 16.64337z m-413.342262-33.286741h396.698892v-32.554432H318.589474v32.554432z",fill:"#6E6E96","p-id":"11307"}),e("path",{d:"M337.230049 960.318304h20.804213v47.038326h-20.804213zM386.565159 960.318304h20.804213v47.038326h-20.804213zM435.891948 960.318304h20.804213v47.038326h-20.804213zM485.231219 960.318304h20.804213v47.038326h-20.804213zM534.558008 960.318304h20.804213v47.038326h-20.804213zM583.897279 960.318304h20.804213v47.038326h-20.804213zM633.224068 960.318304h20.804213v47.038326h-20.804213zM682.563339 960.318304h20.804213v47.038326h-20.804213z",fill:"#FFE599","p-id":"11308"}),e("path",{d:"M219.153659 140.794591m-26.874883 0a26.874882 26.874882 0 1 0 53.749765 0 26.874882 26.874882 0 1 0-53.749765 0Z",fill:"#ADADD1","p-id":"11309"}),e("path",{d:"M219.153659 184.312843c-23.995579 0-43.518252-19.522673-43.518253-43.518252s19.522673-43.518252 43.518253-43.518253 43.518252 19.522673 43.518252 43.518253-19.522673 43.518252-43.518252 43.518252z m0-53.749764c-5.642103 0-10.231512 4.589409-10.231512 10.231512s4.589409 10.231512 10.231512 10.231512 10.231512-4.589409 10.231511-10.231512-4.589409-10.231512-10.231511-10.231512z",fill:"#6E6E96","p-id":"11310"}),e("path",{d:"M801.28466 140.794591m-26.870721 0a26.870721 26.870721 0 1 0 53.741442 0 26.870721 26.870721 0 1 0-53.741442 0Z",fill:"#ADADD1","p-id":"11311"}),e("path",{d:"M801.28466 184.308683c-23.995579 0-43.514092-19.518512-43.514091-43.514092s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514092z m0-53.741443c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11312"}),e("path",{d:"M801.280499 905.23291m-26.870721 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"11313"}),e("path",{d:"M801.280499 948.747001c-23.995579 0-43.514092-19.518512-43.514091-43.514091s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11314"}),e("path",{d:"M219.153659 905.23291m-26.870722 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"11315"}),e("path",{d:"M219.153659 948.747001c-23.995579 0-43.514092-19.518512-43.514092-43.514091s19.518512-43.514092 43.514092-43.514092 43.514092 19.518512 43.514091 43.514092-19.522673 43.514092-43.514091 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11316"}),e("path",{d:"M520.972857 777.43263c-142.542145 0-258.508988-115.971004-258.508988-258.52147a16.64337 16.64337 0 0 1 33.28674 0c0 124.19699 101.033579 225.23473 225.222248 225.23473s225.222248-101.03774 225.222248-225.23473c0-124.188668-101.033579-225.218087-225.222248-225.218087a16.64337 16.64337 0 0 1 0-33.286741c142.542145 0 258.508988 115.966843 258.508988 258.504828 0 142.550466-115.966843 258.521471-258.508988 258.52147z",fill:"#6E6E96","p-id":"11317"}),e("path",{d:"M520.968696 518.919481m-83.312551 0a83.312551 83.312551 0 1 0 166.625102 0 83.312551 83.312551 0 1 0-166.625102 0Z",fill:"#A9A9BA","p-id":"11318"}),e("path",{d:"M520.968696 618.875402c-55.114521 0-99.955921-44.83724-99.955921-99.95176 0-55.118682 44.8414-99.955921 99.955921-99.955921s99.95176 44.8414 99.95176 99.955921c0 55.11036-44.83724 99.95176-99.95176 99.95176z m0-166.625101c-36.761044 0-66.669181 29.908136-66.66918 66.66918s29.908136 66.66502 66.66918 66.66502 66.66502-29.908136 66.66502-66.66502c0-36.761044-29.903976-66.669181-66.66502-66.66918z",fill:"#6E6E96","p-id":"11319"}),e("path",{d:"M301.946104 941.515457h429.985632v36.977408H301.946104z",fill:"#6E6E96","p-id":"11320"})])],-1)),s.mount?(i(),d("div",_p,[e("span",null,"【"+a(s.mount.total)+"】",1),e("span",null,a(s.mount.mountPoint||s.mount.path),1)])):s.disk?(i(),d("div",yp,[e("span",null,"【"+a(s.disk.size)+"】",1),e("span",null,a(s.disk.venderModel),1)])):T("",!0)]),s.mount?(i(),d("div",kp,[e("div",wp,[e("span",null,a(o(t)("目标分区")),1)]),e("div",$p,a(s.mount.mountPoint||s.mount.path)+"("+a(s.mount.total)+")",1)])):T("",!0),e("div",Cp,[e("div",Sp,[e("span",null,a(o(t)("格式化选项")),1)]),e("div",xp,[W(e("select",{"onUpdate:modelValue":P[0]||(P[0]=D=>g.value=D),required:"",disabled:s.action=="disk"},[s.mount!=null?(i(),d("option",Tp,a(o(t)("请选择选项")),1)):T("",!0),e("option",Mp,a(o(t)("格式化")),1),s.mount!=null?(i(),d("option",Ep,a(o(t)("不格式化,使用原文件系统")),1)):T("",!0)],8,Pp),[[Be,g.value]])]),e("div",Ip,[g.value=="format"?(i(),d("p",Dp,a(o(t)("格式化为EXT4文件系统")),1)):g.value=="default"?(i(),d("p",Lp)):T("",!0)])])]),e("div",Ap,[P[2]||(P[2]=e("div",{class:"auto"},null,-1)),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:c,type:"button",disabled:p.value},a(o(t)("返回")),9,Np),e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:p.value},a(o(t)("下一步")),9,Op)])],32)):v.value==1?(i(),d("div",zp,[e("div",qp,[P[3]||(P[3]=e("div",{class:"action-body_icon"},[e("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":""},[e("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)),e("div",Rp,a(o(t)("格式化成功")),1),b.value?(i(),d("div",Vp,[ue(a(o(t)("已经成功格式化磁盘"))+" "+a(b.value.venderModel)+" "+a(o(t)("并挂载到"))+" ",1),e("a",null,a((_=m.value)==null?void 0:_.mountPoint),1)])):T("",!0),m.value?(i(),d("div",Bp,[ue(a(o(t)("已经成功初始化分区"))+" ",1),e("a",null,a(m.value.mountPoint),1)])):T("",!0),e("div",Up,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",type:"button",onClick:C},a(s.action=="nas"?o(t)("下一步"):o(t)("完成")),1)])])])):T("",!0)]}),_:1})]),_:1}))}}),Hp=le(Fp,[["__scopeId","data-v-eacbb72a"]]),Xo=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(Hp,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},Gp={class:"action-body"},jp={class:"disk-info"},Wp={key:0,class:"disk-info_mount-name"},Jp={key:1,class:"disk-info_mount-name"},Kp={key:0,class:"label-item"},Zp={class:"label-item_key"},Yp={class:"label-item_path"},Qp={class:"label-item"},Xp={class:"label-item_key"},e8={class:"label-item_value"},t8={class:"action-footer"},n8=["disabled"],a8=["disabled"],s8={key:1,class:"action result"},o8={class:"action-body"},l8={class:"action-body_msg"},i8=["innerHTML"],r8={class:"btns"},c8=X({__name:"index",props:{action:String,disk:{type:Object,required:!0},mount:{type:Object},Close:{type:Function},Cancel:{type:Function},Next:{type:Function}},setup(s){var $;const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close&&l.Close()},c=w=>{w.preventDefault(),l.Cancel&&l.Cancel(),u()},r=w=>{l.Next&&l.Next(w),u()},p=x(!1),v=x(0),h=x("/mnt/data_"+(($=l==null?void 0:l.mount)==null?void 0:$.name)),g=w=>{v.value=w};x(l.mount?"":"format"),x();const b=x(),m=()=>B(null,null,function*(){const w=l.mount;if(w==null){ne.Warning(t("获取不到分区"));return}if(w.path==null||w.path==""){ne.Warning(t("获取不到分区路径"));return}if(w.uuid==null||w.uuid==""){ne.Warning(t("获取不到分区ID"));return}p.value=!0;const S=ne.Loading(t("挂载中..."));try{const C=yield we.Nas.Disk.Partition.Mount.POST({path:w.path,uuid:w.uuid,mountPoint:h.value});if(C!=null&&C.data){const{result:y,error:P}=C==null?void 0:C.data;P&&ne.Warning(P),y&&(ne.Success(t("挂载成功")),b.value=y,g(1))}}catch(C){ne.Error(C)}S.Close(),p.value=!1}),f=()=>{if(b.value&&b.value.mountPoint){r(b.value.mountPoint);return}ne.Warning(t("读取结果失败"))},k=()=>{};return(w,S)=>(i(),Y(Nt,{type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>{var C,y;return[v.value==0?(i(),d("form",{key:0,class:"action format",onSubmit:Ge(k,["prevent"])},[S[3]||(S[3]=e("div",{class:"action-header"},[e("div",{class:"action-header_title"})],-1)),e("div",Gp,[e("div",jp,[S[1]||(S[1]=e("div",{class:"disk-info_icon"},[e("svg",{t:"1642589762094",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11301",width:"128",height:"128"},[e("path",{d:"M899.892468 123.889088c0-44.342099-36.286708-80.620486-80.624646-80.620486H204.728017C160.385918 43.268602 124.107532 79.546988 124.107532 123.889088v802.847056c0 44.342099 36.278386 80.620486 80.620485 80.620486h614.539805c44.337938 0 80.624646-36.278386 80.624646-80.620486V123.889088z",fill:"#D0D0DB","p-id":"11302"}),e("path",{d:"M169.8768 977.7772V174.930143c0-44.342099 36.278386-80.620486 80.620486-80.620485h614.539804c9.936092 0 19.426974 1.905666 28.239639 5.23434-11.525534-30.507298-40.996782-52.389169-75.398629-52.389169H203.342457c-44.342099 0-80.620486 36.278386-80.620486 80.620486v802.851217c0 34.410168 21.881871 63.873094 52.385008 75.381985A79.730065 79.730065 0 0 1 169.8768 977.7772z",fill:"#FFFFFF","p-id":"11303"}),e("path",{d:"M820.657543 40.497481H206.117739c-44.342099 0-80.620486 36.278386-80.620486 80.620485v802.847057c0 44.342099 36.278386 80.620486 80.620486 80.620486h614.539804c44.337938 0 80.624646-36.278386 80.624647-80.620486V121.117966c0-44.342099-36.286708-80.620486-80.624647-80.620485z m19.60173 828.785749c0 40.846992-33.43237 74.279362-74.287684 74.279361H199.780776c-40.855313 0-74.279362-33.424048-74.279362-74.279361V129.593603c0-40.855313 33.424048-74.279362 74.279362-74.279362h566.203296c40.842831 0 74.283522 33.424048 74.283522 74.279362l-0.008321 739.689627z",fill:"#6E6E96","p-id":"11304"}),e("path",{d:"M815.106979 1024H200.567175C146.933914 1024 103.303319 980.369405 103.303319 926.736144V123.889088C103.303319 70.255827 146.933914 26.625232 200.567175 26.625232h614.539804c53.633261 0 97.268017 43.630595 97.268017 97.263856v802.847056c0 53.633261-43.634756 97.263856-97.268017 97.263856zM200.567175 59.911972C165.287391 59.911972 136.590059 88.609303 136.590059 123.889088v802.847056c0 35.279784 28.697331 63.977115 63.977116 63.977115h614.539804c35.279784 0 63.981276-28.697331 63.981276-63.977115V123.889088c0-35.279784-28.701492-63.977115-63.981276-63.977116H200.567175z",fill:"#6E6E96","p-id":"11305"}),e("path",{d:"M301.946104 941.515457h429.985632v65.841173H301.946104z",fill:"#8A8AA1","p-id":"11306"}),e("path",{d:"M731.931736 1024H301.946104a16.64337 16.64337 0 0 1-16.64337-16.64337V941.515457a16.64337 16.64337 0 0 1 16.64337-16.64337h429.985632a16.64337 16.64337 0 0 1 16.64337 16.64337v65.841173a16.64337 16.64337 0 0 1-16.64337 16.64337z m-413.342262-33.286741h396.698892v-32.554432H318.589474v32.554432z",fill:"#6E6E96","p-id":"11307"}),e("path",{d:"M337.230049 960.318304h20.804213v47.038326h-20.804213zM386.565159 960.318304h20.804213v47.038326h-20.804213zM435.891948 960.318304h20.804213v47.038326h-20.804213zM485.231219 960.318304h20.804213v47.038326h-20.804213zM534.558008 960.318304h20.804213v47.038326h-20.804213zM583.897279 960.318304h20.804213v47.038326h-20.804213zM633.224068 960.318304h20.804213v47.038326h-20.804213zM682.563339 960.318304h20.804213v47.038326h-20.804213z",fill:"#FFE599","p-id":"11308"}),e("path",{d:"M219.153659 140.794591m-26.874883 0a26.874882 26.874882 0 1 0 53.749765 0 26.874882 26.874882 0 1 0-53.749765 0Z",fill:"#ADADD1","p-id":"11309"}),e("path",{d:"M219.153659 184.312843c-23.995579 0-43.518252-19.522673-43.518253-43.518252s19.522673-43.518252 43.518253-43.518253 43.518252 19.522673 43.518252 43.518253-19.522673 43.518252-43.518252 43.518252z m0-53.749764c-5.642103 0-10.231512 4.589409-10.231512 10.231512s4.589409 10.231512 10.231512 10.231512 10.231512-4.589409 10.231511-10.231512-4.589409-10.231512-10.231511-10.231512z",fill:"#6E6E96","p-id":"11310"}),e("path",{d:"M801.28466 140.794591m-26.870721 0a26.870721 26.870721 0 1 0 53.741442 0 26.870721 26.870721 0 1 0-53.741442 0Z",fill:"#ADADD1","p-id":"11311"}),e("path",{d:"M801.28466 184.308683c-23.995579 0-43.514092-19.518512-43.514091-43.514092s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514092z m0-53.741443c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11312"}),e("path",{d:"M801.280499 905.23291m-26.870721 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"11313"}),e("path",{d:"M801.280499 948.747001c-23.995579 0-43.514092-19.518512-43.514091-43.514091s19.518512-43.514092 43.514091-43.514092 43.514092 19.518512 43.514092 43.514092-19.518512 43.514092-43.514092 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11314"}),e("path",{d:"M219.153659 905.23291m-26.870722 0a26.870721 26.870721 0 1 0 53.741443 0 26.870721 26.870721 0 1 0-53.741443 0Z",fill:"#ADADD1","p-id":"11315"}),e("path",{d:"M219.153659 948.747001c-23.995579 0-43.514092-19.518512-43.514092-43.514091s19.518512-43.514092 43.514092-43.514092 43.514092 19.518512 43.514091 43.514092-19.522673 43.514092-43.514091 43.514091z m0-53.741442c-5.637942 0-10.227351 4.589409-10.227351 10.227351s4.589409 10.227351 10.227351 10.227351 10.227351-4.589409 10.227351-10.227351-4.589409-10.227351-10.227351-10.227351z",fill:"#6E6E96","p-id":"11316"}),e("path",{d:"M520.972857 777.43263c-142.542145 0-258.508988-115.971004-258.508988-258.52147a16.64337 16.64337 0 0 1 33.28674 0c0 124.19699 101.033579 225.23473 225.222248 225.23473s225.222248-101.03774 225.222248-225.23473c0-124.188668-101.033579-225.218087-225.222248-225.218087a16.64337 16.64337 0 0 1 0-33.286741c142.542145 0 258.508988 115.966843 258.508988 258.504828 0 142.550466-115.966843 258.521471-258.508988 258.52147z",fill:"#6E6E96","p-id":"11317"}),e("path",{d:"M520.968696 518.919481m-83.312551 0a83.312551 83.312551 0 1 0 166.625102 0 83.312551 83.312551 0 1 0-166.625102 0Z",fill:"#A9A9BA","p-id":"11318"}),e("path",{d:"M520.968696 618.875402c-55.114521 0-99.955921-44.83724-99.955921-99.95176 0-55.118682 44.8414-99.955921 99.955921-99.955921s99.95176 44.8414 99.95176 99.955921c0 55.11036-44.83724 99.95176-99.95176 99.95176z m0-166.625101c-36.761044 0-66.669181 29.908136-66.66918 66.66918s29.908136 66.66502 66.66918 66.66502 66.66502-29.908136 66.66502-66.66502c0-36.761044-29.903976-66.669181-66.66502-66.66918z",fill:"#6E6E96","p-id":"11319"}),e("path",{d:"M301.946104 941.515457h429.985632v36.977408H301.946104z",fill:"#6E6E96","p-id":"11320"})])],-1)),s.mount?(i(),d("div",Wp,[e("span",null,"【"+a(s.mount.total)+"】",1),e("span",null,a(s.mount.mountPoint),1)])):s.disk?(i(),d("div",Jp,[e("span",null,"【"+a(s.disk.size)+"】",1),e("span",null,a(s.disk.venderModel),1)])):T("",!0)]),s.mount?(i(),d("div",Kp,[e("div",Zp,[e("span",null,a(o(t)("目标分区")),1)]),e("div",Yp,a(s.mount.path)+"("+a(s.mount.total)+","+a((y=(C=s.mount)==null?void 0:C.filesystem)==null?void 0:y.toUpperCase())+")",1)])):T("",!0),e("div",Qp,[e("div",Xp,[e("span",null,a(o(t)("挂载点")),1)]),e("div",e8,[W(e("input",{type:"text","onUpdate:modelValue":S[0]||(S[0]=P=>h.value=P)},null,512),[[Oe,h.value,void 0,{trim:!0}]])])])]),e("div",t8,[S[2]||(S[2]=e("div",{class:"auto"},null,-1)),e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:p.value,onClick:m},a(o(t)("确定")),9,n8),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:c,type:"button",disabled:p.value},a(o(t)("返回")),9,a8)])],32)):v.value==1?(i(),d("div",s8,[e("div",o8,[S[4]||(S[4]=e("div",{class:"action-body_icon"},[e("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":""},[e("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)),e("div",l8,a(o(t)("挂载成功")),1),b.value?(i(),d("div",{key:0,class:"action-body_info",innerHTML:o(t)("已成功将分区 %{dev} 挂载到 %{mount}",{dev:b.value.path||"",mount:b.value.mountPoint||""})},null,8,i8)):T("",!0),e("div",r8,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",type:"button",onClick:f},a(s.action=="nas"?o(t)("完成"):o(t)("下一步")),1)])])])):T("",!0)]}),_:1})]),_:1}))}}),d8=le(c8,[["__scopeId","data-v-7ca3ba11"]]),Ii=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(d8,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},u8={class:"disk-content"},v8={class:"disk-item"},p8={class:"disk-item_name"},h8={key:0},m8={key:1},f8={key:2},b8={class:"disk_value"},g8={class:"disk-item_value"},_8={class:"value-data"},y8={key:0,class:"disk-item"},k8={class:"disk-item_name"},w8={key:0},$8=["href"],C8={key:0},S8={class:"disk_status"},x8={key:0,class:"disk_status_item"},P8={key:0,class:"tooltip-trigger disk_tip"},T8={class:"tooltip-text tooltip-top"},M8={class:"disk_dir_tip"},E8={class:"disk_status_item"},I8={key:0,class:"tooltip-trigger disk_tip"},D8={class:"tooltip-text tooltip-top"},L8={class:"disk_dir_tip"},A8=X({__name:"item",props:{part:{type:Object,required:!0},disk:{type:Object,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>l.part.filesystem=="No FileSystem"),c=R(()=>l.part.filesystem&&["ntfs","vfat","exfat"].indexOf(l.part.filesystem)>=0),r=R(()=>l.part.mountPoint&&l.part.isReadOnly&&l.part.filesystem!="swap"),p=R(()=>u.value||!l.part.isSystemRoot&&(r.value||c.value||!l.part.mountPoint&&l.part.filesystem=="swap")),v=function(){Xo({action:"disk",disk:l.disk,mount:l.part,Cancel:()=>{},Next:f=>{location.reload()}})},h=()=>{Ii({action:"nas",disk:l.disk,mount:l.part,Cancel:()=>{},Next:()=>{location.reload()}})},g=()=>B(null,null,function*(){const f=ne.Loading(t("处理中..."));try{const k=yield we.Nas.Disk.InitRest.POST({name:l.disk.name,path:l.disk.path});if(k!=null&&k.data){const{result:$,error:w}=k==null?void 0:k.data;w&&ne.Warning(w),$&&(ne.Success(t("挂载成功")),location.reload())}}catch(k){ne.Error(k)}f.Close()}),b=R(()=>l.part.filesystem=="Free Space"),m=R(()=>{const f=l.part.mountPoint?l.part.mountPoint:"";return f.indexOf("/mnt/")==0?"/cgi-bin/luci/admin/services/linkease/file/?path=/"+f.substring(5):"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+f});return(f,k)=>{var w;const $=At("progress-item");return i(),d("div",u8,[e("li",v8,[e("div",p8,[b.value?(i(),d("span",h8,a(o(t)("未分区")),1)):(i(),d("span",m8,a(s.part.name)+a(s.part.mountPoint?"":u.value?o(t)("(未格式化)"):o(t)("(未挂载)")),1)),s.part.isSystemRoot?(i(),d("span",f8,a(o(t)("(系统分区)")),1)):T("",!0)]),e("div",b8,[e("div",g8,[e("div",_8,[G($,{value:b.value||!s.part.usage?0:s.part.usage,text:b.value?o(t)("未分区(%{total})",{total:s.part.total||""}):(s.part.mountPoint&&s.part.filesystem!="swap"?s.part.used:o(t)("未知"))+"/"+(s.part.total||""),style:{backgroundColor:"#767676"}},null,8,["value","text"])])]),b.value?(i(),d("button",{key:0,class:"cbi-button cbi-button-apply",onClick:g},a(o(t)("分区并格式化")),1)):p.value?(i(),d("button",{key:1,class:"cbi-button cbi-button-apply",onClick:v},a(o(t)("格式化分区")),1)):T("",!0)])]),!b.value&&!u.value?(i(),d("li",y8,[e("span",k8,[s.part.mountPoint?(i(),d(V,{key:0},[s.part.filesystem=="swap"?(i(),d("span",w8,a(o(t)("已挂载为交换区")),1)):(i(),d("a",{key:1,href:m.value,target:"_blank"},a(s.part.mountPoint),9,$8))],64)):(i(),d(V,{key:1},[s.part.filesystem=="swap"?(i(),d("span",C8,a(o(t)("不支持挂载")),1)):(i(),d("span",{key:1,class:"value-data buttondiv",onClick:h},a(o(t)("手动挂载")),1))],64))]),e("div",S8,[s.part.mountPoint&&s.part.filesystem!="swap"?(i(),d("div",x8,[e("div",null,a(o(t)("可读写状态:"))+a(s.part.isReadOnly?o(t)("只读"):o(t)("读写")),1),r.value?(i(),d("div",P8,[G(Sn),e("div",T8,[e("div",M8,a(o(t)("此分区为只读状态,可能无法写入数据")),1)])])):T("",!0)])):T("",!0),e("div",E8,[e("div",null,a(o(t)("文件系统:"))+a((w=s.part.filesystem)==null?void 0:w.toUpperCase()),1),!s.part.isSystemRoot&&c.value?(i(),d("div",I8,[G(Sn),e("div",D8,[e("span",L8,a(o(t)("此文件系统不支持Docker等应用数据,建议格式化成EXT4文件系统")),1)])])):T("",!0)])])])):T("",!0)])}}}),N8=le(A8,[["__scopeId","data-v-ae00b3e7"]]),O8={key:0,class:"action"},z8={class:"title"},q8={class:"app-container_info"},R8={class:"app-container_body"},V8={class:"action-footer"},B8=X({__name:"index",props:{disk:{type:Object,required:!0},Close:{type:Function},Cancel:{type:Function},Next:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(0),c=()=>{l.Close&&l.Close()},r=p=>{p.preventDefault(),l.Cancel&&l.Cancel(),c()};return(p,v)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>[u.value==0?(i(),d("div",O8,[e("h2",z8,a(o(t)("分区信息"))+" - "+a((s.disk.name||"?")+(s.disk.isSystemRoot?o(t)("(系统盘)"):"")),1),e("ul",null,[e("li",null,[e("div",q8,[e("span",null,a(o(t)("分区 / 挂载点")),1),e("span",null,a(o(t)("容量")),1)]),e("div",R8,[(i(!0),d(V,null,oe(s.disk.childrens,(h,g)=>(i(),Y(N8,{key:g,part:h,disk:s.disk},null,8,["part","disk"]))),128))])])]),e("div",V8,[v[0]||(v[0]=e("div",{class:"auto"},null,-1)),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:r,type:"button"},a(o(t)("返回")),1)])])):T("",!0)]),_:1})]),_:1},8,["Close"]))}}),U8=le(B8,[["__scopeId","data-v-27fc3117"]]),F8=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(U8,Ne(ye({},s),{Close:()=>{l()}}));n.component("progress-item",Nc),n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},H8={class:"progress-bar-wrapper"},G8={key:0,class:"percentage-text"},j8={__name:"index",props:{percentage:{type:Number,default:0,validator:s=>s>=0&&s<=100},color:{type:String,default:"#4CAF50"},backgroundColor:{type:String,default:"#e0e0e0"},height:{type:[String,Number],default:"20px"},borderRadius:{type:[String,Number],default:"4px"},showPercentage:{type:Boolean,default:!0},gradient:{type:Boolean,default:!1},gradientColors:{type:String,default:"linear-gradient(90deg, #4CAF50, #45a049)"},duration:{type:Number,default:1e3}},setup(s){const t=s,n=R(()=>({height:typeof t.height=="number"?`${t.height}px`:t.height,borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius,backgroundColor:t.backgroundColor,overflow:"hidden"})),l=R(()=>{const u={height:"100%",width:`${t.percentage}%`,borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius,transition:`width ${t.duration}ms cubic-bezier(0.4, 0, 0.2, 1)`,position:"relative",overflow:"hidden"};return t.gradient?Ne(ye({},u),{background:t.gradientColors}):Ne(ye({},u),{background:t.color})});return(u,c)=>(i(),d("div",H8,[e("div",{class:"progress-bar",style:pt(n.value)},[e("div",{class:"progress-fill",style:pt(l.value)},[s.showPercentage?(i(),d("span",G8,a(Math.round(s.percentage))+"% ",1)):T("",!0)],4)],4)]))}},Di=le(j8,[["__scopeId","data-v-b80ff621"]]),W8={key:0,class:"disk-item error"},J8=["title"],K8={class:"disk-item_value"},Z8={class:"value-data"},Y8={class:"error"},Q8={key:1,class:"disk-item"},X8=["title"],eh={key:0,class:"disk_value"},th={class:"value-data"},nh={href:"/cgi-bin/luci/admin/nas/smart"},ah={class:"error"},sh={key:1,class:"disk_value"},oh={class:"disk-item_value"},lh={class:"value-data"},ih={class:"disk-item-tooltip"},rh={class:"disk_icon"},ch={key:0,class:"tooltip-trigger"},dh={class:"disk_tip"},uh={class:"tooltip-text tooltip-top"},vh={class:"disk_dir_tip"},ph={key:1,class:"tooltip-trigger"},hh={class:"disk_tip"},mh={class:"tooltip-text tooltip-top"},fh={class:"disk_dir_tip"},bh={key:2,class:"disk-item load"},gh=["title"],_h={class:"disk_value"},yh={class:"disk-item_value"},kh={class:"value-data"},wh={key:3,class:"disk-item load"},$h=["title"],Ch={class:"disk_value"},Sh={key:0,class:"disk-item_value"},xh={class:"value-data"},Ph={class:"disk_icon"},Th=X({__name:"DiskItem",props:{disk:{type:Object,required:!0},smartWarning:{type:Boolean}},setup(s){const{$gettext:t}=Ae(),n=s,l=R(()=>n.disk.errorInfo?"error":n.disk.isSystemRoot?"success":n.disk.childrens==null||n.disk.childrens.length==0||n.disk.childrens.length==1&&n.disk.childrens[0].filesystem=="No FileSystem"?"load":n.disk.childrens.filter(g=>g.mountPoint).length==0?"unmounted":"success"),u=R(()=>{const g=n.disk;let b=g.name;return g.size&&(b+=`【${g.size}】`),g.venderModel&&(b+=`(${g.venderModel})`),b}),c=R(()=>{var b;const g=n.disk;return!g.isSystemRoot&&(((b=g.childrens)==null?void 0:b.filter(m=>m.isReadOnly&&m.filesystem!="swap").length)||0)>0}),r=()=>{Xo({action:"disk",disk:n.disk,Cancel:()=>{},Next:()=>{location.reload()}})},p=()=>{F8({action:"disk",disk:n.disk,Cancel:()=>{},Next:()=>{location.reload()}})},v=()=>{const g=n.disk,b=g.childrens||[];Ii({action:"nas",disk:g,mount:b[0],Cancel:()=>{},Next:()=>{location.reload()}})},h=g=>g<60?"#2fc867":g<75?"#fdd835":g<90?"#f97316":"#dc2626";return(g,b)=>{var m,f,k,$,w,S;return l.value=="error"?(i(),d("li",W8,[e("div",{class:"disk-item_name",title:u.value},[e("span",null,a(u.value),1)],8,J8),e("div",K8,[e("div",Z8,[e("span",Y8,a(s.disk.errorInfo),1)])])])):l.value=="success"?(i(),d("li",Q8,[e("div",{class:"disk-item_name",title:u.value},[e("span",null,a(u.value),1)],8,X8),s.disk.smartWarning&&s.smartWarning?(i(),d("div",eh,[e("div",th,[e("a",nh,[e("span",ah,a(o(t)("S.M.A.R.T异常")),1)])])])):(i(),d("div",sh,[e("div",oh,[e("div",lh,[G(Di,{percentage:s.disk.usage||0,showPercentage:!1,height:"10px",borderRadius:"10px",color:h(s.disk.usage||0),backgroundColor:"#f4f5f7"},null,8,["percentage","color"]),e("div",null,[e("span",null,a(o(t)("使用率"))+":"+a(s.disk.usage||0)+"%",1),e("span",null,a(o(t)("已使用"))+":"+a(s.disk.used),1)])]),e("div",ih,[e("span",null,a(o(t)("仅统计已挂载分区")),1)])]),e("div",rh,[s.disk.isDockerRoot&&s.disk.isSystemRoot&&s.disk.usage&&s.disk.usage>=90?(i(),d("span",ch,[e("span",dh,[G(Sn)]),e("div",null,[e("div",uh,[e("span",vh,a(o(t)("您的系统空间已不足,检测到您的Docker根目录位于系统根目录上,可能会影响系统的正常运行,建议使用Docker迁移向导将Docker根目录迁移到外置硬盘上。")),1)])])])):T("",!0),c.value?(i(),d("span",ph,[e("span",hh,[G(Sn)]),e("div",null,[e("div",mh,[e("span",fh,a(o(t)("分区存在异常,点击分区列表查看错误")),1)])])])):T("",!0),c.value&&(((m=s.disk.childrens)==null?void 0:m.length)||0)==1?(i(),d("span",{key:2,class:"disk_infoicon",onClick:b[0]||(b[0]=C=>r())},[G(hp)])):T("",!0),(((f=s.disk.childrens)==null?void 0:f.length)||0)>0?(i(),d("span",{key:3,class:"disk_infoicon",onClick:b[1]||(b[1]=C=>p())},[G(zl,{style:{color:"var(--app-container_title-color)"}})])):T("",!0)])]))])):l.value=="load"?(i(),d("li",bh,[e("div",{class:"disk-item_name",title:u.value},[e("span",null,a(u.value),1)],8,gh),e("div",_h,[e("div",yh,[e("div",kh,[e("button",{onClick:b[2]||(b[2]=C=>r())},a(o(t)("格式化并挂载")),1)])])])])):l.value=="unmounted"?(i(),d("li",wh,[e("div",{class:"disk-item_name",title:u.value},[e("span",null,a(u.value),1)],8,$h),e("div",Ch,[(((k=s.disk.childrens)==null?void 0:k.length)||0)==1?(i(),d("div",Sh,[e("div",xh,[((w=($=s.disk.childrens)==null?void 0:$[0])==null?void 0:w.filesystem)=="swap"?(i(),d("button",{key:0,onClick:b[3]||(b[3]=C=>p())},a(o(t)("查看详情")),1)):(i(),d("button",{key:1,onClick:b[4]||(b[4]=C=>v())},a(o(t)("手动挂载")),1))])])):T("",!0),e("div",Ph,[(((S=s.disk.childrens)==null?void 0:S.length)||0)>1?(i(),d("span",{key:0,class:"disk_infoicon",onClick:b[5]||(b[5]=C=>p())},[G(zl,{style:{color:"var(--app-container_title-color)"}})])):T("",!0)])])])):T("",!0)}}}),fo=le(Th,[["__scopeId","data-v-34cf4556"]]),Mh={href:"/cgi-bin/luci/admin/nas/raid"},Eh={href:"/cgi-bin/luci/admin/system/diskman"},Ih={href:"/cgi-bin/luci/admin/system/mounts"},Dh={class:"content"},Lh={key:0,class:"disk_loading_icon"},Ah={class:"disk_loading_info"},Nh={class:"item",style:{"margin-top":"4px","padding-bottom":"0"}},Oh={class:"icon_box"},zh={class:"info"},qh={class:"name"},Rh={class:"schedule"},Vh={key:0,class:"line"},Bh={key:1,class:"item"},Uh={class:"icon_box",style:{background:"#f3e8ff"}},Fh={class:"info"},Hh={class:"name"},Gh={class:"schedule"},jh={key:2,class:"item"},Wh={class:"icon_box",style:{background:"#dbfce7"}},Jh={class:"info"},Kh={class:"name"},Zh={class:"schedule"},Yh=X({__name:"DiskInfo",setup(s){const{$gettext:t}=Ae(),n=x(!1),l=Xe({disks:null,raidList:null}),u=()=>{we.Nas.Disk.Status.GET().then(v=>{var h;if((h=v==null?void 0:v.data)!=null&&h.result){const g=v.data.result;l.disks=g.disks||[]}})},c=()=>B(null,null,function*(){try{const v=yield we.Raid.List.GET();if(v!=null&&v.data){const{success:h,error:g,result:b}=v.data;if(b&&(l.raidList=b.disks||[]),g)throw g}}catch(v){console.log(v)}}),r=qa();fa("raid",v=>{var h,g;return l.raidList=r!=null&&r.bounded()?(v.disks||[]).slice(0,Math.max(0,3-(((g=(h=r.data.disks)==null?void 0:h.disks)==null?void 0:g.length)||0))):v.disks||[]})||c(),fa("disks",v=>l.disks=r!=null&&r.bounded()?(v.disks||[]).slice(0,3):v.disks||[])||u();const p=()=>{Xt.installAndGo("luci-app-linkease",t("易有云"),"/cgi-bin/luci/admin/services/linkease/file/","app-meta-linkease")};return(v,h)=>{const g=At("icon-loading");return i(),Y(ya,{"home-menu":[{label:o(t)("RAID管理"),href:"/cgi-bin/luci/admin/nas/raid"},{label:"S.M.A.R.T.",href:"/cgi-bin/luci/admin/nas/smart"},{label:o(t)("磁盘管理"),href:"/cgi-bin/luci/admin/system/diskman"},{label:o(t)("挂载点"),href:"/cgi-bin/luci/admin/system/mounts"}],title:o(t)("磁盘信息"),style:{width:"100%",display:"block"},"is-settings-menu-open":n.value,"onUpdate:isSettingsMenuOpen":h[0]||(h[0]=b=>n.value=b)},{icon:pe(()=>[G(Ol,{color:"#45556c",class:"icon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:p},[G(np,{color:"#0a0a0a",class:"icon1 interfaceIcon",style:{"margin-right":"6px"}}),e("span",null,a(o(t)("文件管理")),1)])]),"settings-menu":pe(()=>[e("div",null,[e("a",Mh,a(o(t)("RAID管理")),1)]),h[1]||(h[1]=e("div",null,[e("a",{href:"/cgi-bin/luci/admin/nas/smart"},"S.M.A.R.T.")],-1)),e("div",null,[e("a",Eh,a(o(t)("磁盘管理")),1)]),e("div",null,[e("a",Ih,a(o(t)("挂载点")),1)])]),default:pe(()=>{var b,m,f,k;return[e("div",Dh,[!l.disks&&!l.raidList?(i(),d("div",Lh,[G(g,{size:38,color:"#888888"}),e("span",Ah,a(o(t)("正在获取磁盘信息...")),1)])):T("",!0),l.disks?(i(),d(V,{key:1},[e("div",Nh,[e("div",Oh,[G(Ol,{color:"#2b6cfc",class:"icon"})]),e("div",zh,[e("div",qh,[e("div",null,a(o(t)("系统根目录")),1)]),e("div",Rh,[(i(!0),d(V,null,oe((b=l.disks)==null?void 0:b.filter($=>$.isSystemRoot),($,w)=>(i(),Y(fo,{key:w,disk:$},null,8,["disk"]))),128))])])]),((m=l.disks)==null?void 0:m.filter($=>!$.isSystemRoot).length)>0?(i(),d("div",Vh)):T("",!0),((f=l.disks)==null?void 0:f.filter($=>!$.isSystemRoot).length)>0?(i(),d("div",Bh,[e("div",Uh,[G(op,{class:"icon"})]),e("div",Fh,[e("div",Hh,[e("div",null,a(o(t)("已挂载磁盘")),1)]),e("div",Gh,[(i(!0),d(V,null,oe((k=l.disks)==null?void 0:k.filter($=>!$.isSystemRoot),($,w)=>(i(),Y(fo,{key:w,disk:$,smartWarning:!0},null,8,["disk"]))),128))])])])):T("",!0)],64)):T("",!0),l.raidList&&l.raidList.length>0?(i(),d("div",jh,[e("div",Wh,[G(Ei,{color:"#0bab47",class:"icon"})]),e("div",Jh,[e("div",Kh,[e("div",null,a(o(t)("RAID设备")),1)]),e("div",Zh,[(i(!0),d(V,null,oe(l.raidList,($,w)=>(i(),Y(fo,{key:w,disk:$},null,8,["disk"]))),128))])])])):T("",!0)])]}),_:1},8,["home-menu","title","is-settings-menu-open"])}}}),Qh=le(Yh,[["__scopeId","data-v-52dc6f12"]]);function Ys(){const s=qa(),t=new Set;let n=!0;return lt(()=>{n=!1;for(const l of t)l.Close();t.clear()}),(l,u)=>{let c;return c=l(Ne(ye({},u),{onClosed:()=>{c&&t.delete(c),n&&(s==null||s.invalidate())}})),t.add(c),c}}const Xh={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e5=["fill"],t5=["fill"],n5=X({__name:"share",props:{color:{type:String,default:"#222222"}},setup(s){return(t,n)=>(i(),d("svg",Xh,[e("path",{d:"M746 112c82.84 0 150 67.16 150 150S828.84 412 746 412 596 344.84 596 262 663.16 112 746 112z m0 48C689.668 160 644 205.668 644 262S689.668 364 746 364 848 318.332 848 262 802.332 160 746 160zM746 612c82.84 0 150 67.16 150 150S828.84 912 746 912 596 844.84 596 762s67.16-150 150-150z m0 48c-56.332 0-102 45.668-102 102s45.668 102 102 102 102-45.668 102-102-45.668-102-102-102zM262 364c82.84 0 150 67.16 150 150S344.84 664 262 664 112 596.84 112 514 179.16 364 262 364z m0 48C205.668 412 160 457.668 160 514S205.668 616 262 616 364 570.332 364 514 318.332 412 262 412z",fill:s.color,"p-id":"5059"},null,8,e5),e("path",{d:"M337.7 442.744l293.488-169.62 40.464 70.16-293.484 169.62zM387.708 526.728l277.02 160.12-40.468 70.156-277.02-160.12z",fill:s.color,"p-id":"5060"},null,8,t5)]))}}),a5={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},s5=["fill"],o5=X({__name:"cloud",props:{color:{type:String,default:"#155dfc"}},setup(s){return(t,n)=>(i(),d("svg",a5,[e("path",{d:"M716.8 750.933333c47.786667 0 95.573333-27.306667 119.466667-68.266666 23.893333-40.96 23.893333-95.573333 0-136.533334-23.893333-40.96-68.266667-68.266667-119.466667-68.266666-10.24 0-17.066667-3.413333-23.893333-10.24-6.826667-6.826667-10.24-13.653333-10.24-23.893334 0-95.573333-75.093333-170.666667-170.666667-170.666666s-170.666667 75.093333-170.666667 170.666666v6.826667c81.92 23.893333 136.533333 95.573333 136.533334 180.906667 0 13.653333-6.826667 23.893333-17.066667 30.72-10.24 6.826667-23.893333 6.826667-34.133333 0-10.24-6.826667-17.066667-17.066667-17.066667-30.72 0-64.853333-54.613333-119.466667-119.466667-119.466667S170.666667 566.613333 170.666667 631.466667 225.28 750.933333 290.133333 750.933333H716.8zM296.96 819.2c-102.4 3.413333-187.733333-75.093333-194.56-177.493333-3.413333-102.4 75.093333-191.146667 177.493333-194.56 0-126.293333 95.573333-228.693333 221.866667-238.933334 122.88-6.826667 232.106667 81.92 249.173333 208.213334 105.813333 17.066667 180.906667 112.64 170.666667 218.453333-10.24 102.4-98.986667 184.32-204.8 184.32H296.96z",fill:s.color,"p-id":"8044"},null,8,s5)]))}}),l5={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},i5=["fill"],r5=X({__name:"setting",props:{color:{type:String,default:"#0a0a0a"}},setup(s){return(t,n)=>(i(),d("svg",l5,[e("path",{d:"M680.64 960a61.184 61.184 0 0 1-44.864-19.072c-14.72-16.192-61.568-58.24-99.84-58.24-38.016 0-85.504 42.24-99.2 57.088a61.184 61.184 0 0 1-67.328 14.08l-1.28-0.448-116.352-65.088-1.152-0.832a55.872 55.872 0 0 1-18.752-67.456c0.064-0.192 10.752-24.768 10.752-47.232a123.52 123.52 0 0 0-123.392-123.328h-4.864c-19.52 0-35.392-17.28-40.448-44.096C73.6 603.2 64 552.384 64 512.384c0-40.064 9.536-90.88 9.92-92.992 5.12-27.136 21.376-44.544 41.152-44.096h4.16A123.52 123.52 0 0 0 242.56 251.904c0-22.4-10.688-46.976-10.816-47.232a55.68 55.68 0 0 1 18.944-67.392l1.216-0.832L374.72 68.992l1.28-0.576a62.336 62.336 0 0 1 67.2 13.888c14.528 15.296 60.48 54.848 97.664 54.848 36.8 0 82.496-38.784 96.96-53.76a62.336 62.336 0 0 1 67.264-13.44l1.28 0.64 118.592 65.92 1.152 0.768a55.808 55.808 0 0 1 18.816 67.456c-0.064 0.192-10.752 24.768-10.752 47.168a123.52 123.52 0 0 0 123.392 123.392h4.096c19.84-0.448 36.096 16.96 41.216 44.096 0.384 2.112 9.92 52.928 9.92 92.992 0 40-9.536 90.88-9.92 92.992-5.12 27.136-21.376 44.48-41.216 44.096h-4.096A123.52 123.52 0 0 0 834.176 772.8c0 22.4 10.688 47.04 10.752 47.232a55.808 55.808 0 0 1-18.816 67.456l-1.216 0.832-120.64 66.624-1.28 0.576a56.32 56.32 0 0 1-22.4 4.48z m-3.648-56.832a7.68 7.68 0 0 0 3.84 0.96l112.704-62.336c-2.688-6.272-15.168-36.992-15.168-68.928a179.456 179.456 0 0 1 169.856-179.008c1.344-7.552 8.768-49.792 8.768-81.472 0-31.68-7.424-73.92-8.768-81.472a179.456 179.456 0 0 1-169.856-179.008c0-32 12.48-62.72 15.168-68.992L682.688 121.28h-0.448c-1.92 0-3.648 0.64-4.288 1.088-1.856 1.92-17.92 18.24-40.96 34.432-34.24 24.064-66.56 36.224-96.064 36.224-29.888 0-62.464-12.416-96.832-36.928a313.792 313.792 0 0 1-41.216-35.072 8.832 8.832 0 0 0-4.736-1.152l-114.816 63.104c2.752 6.4 15.168 36.992 15.168 68.928A179.456 179.456 0 0 1 128.64 430.912c-1.344 7.552-8.768 49.792-8.768 81.472 0 31.68 7.424 73.92 8.768 81.408A179.456 179.456 0 0 1 298.496 772.8c0 32.128-12.544 62.912-15.232 69.12L392 902.72a7.68 7.68 0 0 0 3.84-0.896c2.048-2.24 18.304-19.456 41.6-36.608 34.944-25.536 68.032-38.464 98.56-38.464 30.72 0 64.064 13.184 99.2 39.232 23.488 17.472 39.744 34.944 41.792 37.184zM536.32 676.032a164.48 164.48 0 0 1-164.288-164.288A164.48 164.48 0 0 1 536.32 347.52a164.48 164.48 0 0 1 164.352 164.288A164.48 164.48 0 0 1 536.32 676.096z m0-272.64c-59.776 0-108.352 48.64-108.352 108.352 0 59.776 48.64 108.416 108.352 108.416 59.84 0 108.416-48.64 108.416-108.416 0-59.776-48.64-108.416-108.416-108.416z",fill:s.color,"p-id":"4508"},null,8,i5)]))}}),c5={class:"app-container_samba"},d5={key:0,class:"sambas-item"},u5={class:"sambas-item_name"},v5={class:"sambas-item_value"},p5={class:"sambas-item"},h5={class:"sambas-item_name tit"},m5={class:"sambas-item_value tit"},f5={class:"samba-item"},b5=["data-label"],g5=["title","data-label"],_5=["href"],y5=X({__name:"samba",props:{sambas:{type:Array}},setup(s){const{$gettext:t}=Ae(),n=window.location.hostname;return(l,u)=>{var c;return i(),d("ul",c5,[s.sambas?(i(),d("li",d5,[e("div",u5,[e("span",null,a(o(t)("当前状态:")),1)]),e("div",v5,[e("span",null,a((c=s.sambas)!=null&&c.length?o(t)("已启用"):o(t)("未启用")),1)])])):T("",!0),e("li",p5,[e("div",h5,[e("span",null,a(o(t)("地址")),1)]),e("div",m5,[e("span",null,a(o(t)("目录")),1)])]),(i(!0),d(V,null,oe(s.sambas,r=>(i(),d("li",f5,[e("div",{class:"samba-item_name","data-label":o(t)("地址")},[e("span",null,"smb://"+a(o(n))+"/"+a(r.shareName),1)],8,b5),e("div",{class:"samba-item_value",title:r.path,"data-label":o(t)("目录")},[e("a",{target:"_blank",href:"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+r.path},a(r.path),9,_5)],8,g5)]))),256))])}}}),k5=le(y5,[["__scopeId","data-v-da89cb4d"]]),w5={class:"webdav-item"},$5={class:"webdav-item_name"},C5={class:"webdav-item_value"},S5={key:0,class:"webdav-item"},x5={class:"webdav-item_name"},P5={class:"webdav-item_value"},T5=["href"],M5={key:1,class:"webdav-item"},E5={class:"webdav-item_name"},I5={class:"webdav-item_value"},D5=["href"],L5=X({__name:"webdav",props:{webdav:{type:Object}},setup(s){const{$gettext:t}=Ae(),n=s,l=R(()=>{var u;return`http://${location.hostname}:${((u=n.webdav)==null?void 0:u.port)||"8080"}`});return(u,c)=>{var r,p,v,h,g;return i(),d(V,null,[e("li",w5,[e("div",$5,[e("span",null,a(o(t)("当前状态:")),1)]),e("div",C5,[e("span",null,a((r=s.webdav)!=null&&r.path?o(t)("已启用"):o(t)("未启用")),1)])]),(p=s.webdav)!=null&&p.path?(i(),d("li",S5,[e("div",x5,[e("span",null,a(o(t)("挂载路径:")),1)]),e("div",P5,[e("a",{target:"_blank",href:"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+((v=s.webdav)==null?void 0:v.path)},a((h=s.webdav)==null?void 0:h.path),9,T5)])])):T("",!0),(g=s.webdav)!=null&&g.path?(i(),d("li",M5,[e("div",E5,[e("span",null,a(o(t)("服务路径:")),1)]),e("div",I5,[e("a",{href:l.value,target:"_blank",rel:"noopener noreferrer"},a(l.value),9,D5)])])):T("",!0)],64)}}}),A5=le(L5,[["__scopeId","data-v-714283d0"]]),N5={class:"disk-item"},O5={class:"disk-item_f"},z5={class:"disk-item_venderModel"},q5={class:"disk-item_used"},R5={class:"disk-item-r"},V5={class:"disk-children"},B5=["onClick"],U5={key:0},F5={key:1},H5=X({__name:"item",props:{disk:{type:Object,required:!0},currDisk:{type:Object},currMountPoint:{type:Object},onDisk:{type:Function,required:!0}},setup(s){var r,p;const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1);l.currDisk!=null&&((r=l.currDisk)==null?void 0:r.venderModel)==((p=l.disk)==null?void 0:p.venderModel)&&(u.value=!0);const c=v=>{u.value=!u.value,l.onDisk(v,null)};return(v,h)=>{var g;return i(),d("ul",N5,[e("li",{class:_e(["disk-info",{on:s.disk.venderModel==((g=s.currDisk)==null?void 0:g.venderModel),nopoint:s.disk.childrens==null||s.disk.childrens.length==0}]),onClick:h[0]||(h[0]=b=>c(s.disk))},[h[1]||(h[1]=e("div",{class:"disk-item_icon"},[e("svg",{t:"1642563338465",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2216",width:"128",height:"128"},[e("path",{d:"M998.4 711.68l-119.467-512c-6.826-42.667-42.666-75.093-87.04-76.8H232.107c-44.374 1.707-80.214 35.84-87.04 78.507L25.6 711.68c-5.12 13.653-6.827 29.013-6.827 42.667 0 76.8 63.147 139.946 141.654 139.946H865.28c78.507 0 141.653-63.146 141.653-139.946 0-13.654-3.413-29.014-8.533-42.667zM394.24 366.933c1.707-51.2 56.32-92.16 124.587-92.16S640 315.733 640 365.227c44.373-1.707 81.92 23.893 83.627 58.026s-34.134 63.147-78.507 64.854h-6.827l-245.76 1.706c-44.373 0-80.213-27.306-80.213-59.733 0-35.84 37.547-63.147 81.92-63.147z m471.04 459.094H160.427c-39.254 0-69.974-30.72-69.974-69.974s32.427-69.973 69.974-69.973H865.28c39.253 0 69.973 30.72 69.973 69.973 1.707 37.547-30.72 69.974-69.973 69.974z m-35.84-92.16c-11.947 0-22.187 8.533-23.893 20.48 0 11.946 8.533 22.186 20.48 23.893h3.413c11.947 0 22.187-10.24 22.187-22.187 0-13.653-8.534-22.186-22.187-22.186z m-46.08 22.186c0-25.6 20.48-46.08 46.08-46.08s46.08 20.48 46.08 46.08-20.48 46.08-46.08 46.08-46.08-20.48-46.08-46.08z","p-id":"2217"})])],-1)),e("div",O5,[e("div",z5,a(s.disk.venderModel),1),e("div",q5,a(s.disk.used)+"/"+a(s.disk.size),1)]),h[2]||(h[2]=e("div",{class:"auto"},null,-1)),e("div",R5,a(s.disk.path),1)],2),W(e("div",V5,[(i(!0),d(V,null,oe(s.disk.childrens,b=>{var m,f;return i(),d("li",{class:_e(["disk-children_item",{on:b.uuid==((m=s.currMountPoint)==null?void 0:m.uuid)&&b.path==((f=s.currMountPoint)==null?void 0:f.path)}]),onClick:k=>s.onDisk(s.disk,b)},[h[3]||(h[3]=e("div",{class:"disk-item_icon"},[e("svg",{t:"1642563581459",class:"icon",viewBox:"0 0 1228 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7132",width:"128",height:"128"},[e("path",{d:"M525.2096 145.3568c1.9968-45.568-35.6864-99.1232-57.4976-99.1232H57.4976C15.872 79.9232 17.8176 145.408 17.8176 145.408h507.392z",fill:"#ECC049","p-id":"7133"}),e("path",{d:"M21.8112 143.36L19.8144 825.1392c0 75.3152 75.3152 152.576 150.6304 152.576h887.9104c75.264 0 150.6304-75.264 150.6304-152.576V297.984c0-75.264-75.3152-152.576-150.6304-152.576h-434.0224L21.8112 143.36z",fill:"#FFD658","p-id":"7134"})])],-1)),b.mountPoint?(i(),d("span",U5," 【"+a(b.filesystem)+"】 "+a(b.mountPoint)+" ("+a(b.used)+"/"+a(b.total)+") ["+a(b.uuid)+"] ",1)):(i(),d("span",F5," 【"+a(b.filesystem)+"】 "+a(b.mountPoint||b.path||o(t)("未挂载磁盘"))+" ["+a(b.uuid)+"] ",1))],10,B5)}),256))],512),[[Bs,u.value]])])}}}),ql=le(H5,[["__scopeId","data-v-9144a2f1"]]),G5={class:"action list"},j5={class:"action-header"},W5={class:"action-header_title"},J5={class:"action-body"},K5={class:"disk-list"},Z5={class:"action-msg"},Y5={href:"/cgi-bin/luci/admin/system/diskman"},Q5={class:"action-footer"},X5=X({__name:"index",props:{Cancel:{type:Function},Next:{type:Function},Close:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!0),c=Xe({disks:[],raids:[]});B(null,null,function*(){const k=yield Promise.all([we.Nas.Disk.Status.GET(),we.Raid.List.GET()]);try{if(k[0]){const $=k[0];$!=null&&$.data.result&&(c.disks=($==null?void 0:$.data.result.disks)||[])}if(k[1]){const $=k[1];$.data.result&&(c.raids=$.data.result.disks||[])}}catch($){ne.Warning($)}});const p=x(),v=x(),h=(k,$)=>{p.value=k,v.value=$},g=()=>{l.Close&&l.Close()},b=()=>{l.Cancel&&l.Cancel(),g()},m=k=>{l.Next&&l.Next(k),g()},f=()=>{if(p.value==null){ne.Warning(t("请选择目标硬盘"));return}if(p.value.childrens!=null&&p.value.childrens.length>0&&v.value==null){ne.Warning(t("请选择硬盘分区"));return}if(v.value!=null&&(v.value.mountPoint==null||v.value.mountPoint=="")){ne.Warning(t("该分区尚未挂载,请先去挂载"));return}u.value=!1,Xo({action:"nas",disk:p.value,mount:v.value,Cancel:()=>{u.value=!0},Next:k=>{m(k)}})};return(k,$)=>u.value?(i(),Y(Nt,{key:0,type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>[e("div",G5,[e("div",j5,[e("div",W5,a(o(t)("请选择一个硬盘或分区")),1)]),e("div",J5,[e("div",K5,[(i(!0),d(V,null,oe(c.disks,w=>(i(),Y(ql,{disk:w,onDisk:h,currDisk:p.value,currMountPoint:v.value},null,8,["disk","currDisk","currMountPoint"]))),256)),(i(!0),d(V,null,oe(c.raids,w=>(i(),Y(ql,{disk:w,onDisk:h,currDisk:p.value,currMountPoint:v.value},null,8,["disk","currDisk","currMountPoint"]))),256))])]),e("div",Z5,[e("span",null,[ue(a(o(t)("想要更精确的配置?请前往"))+" ",1),e("a",Y5,a(o(t)("高级设置")),1)])]),e("div",Q5,[$[0]||($[0]=e("div",{class:"auto"},null,-1)),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:b,type:"button"},a(o(t)("返回")),1),e("button",{class:"cbi-button cbi-button-apply app-btn app-next",onClick:f,type:"button"},a(o(t)("下一步")),1)])])]),_:1})]),_:1})):T("",!0)}}),em=le(X5,[["__scopeId","data-v-e55e171a"]]),tm=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(em,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},nm={class:"action"},am={class:"action-body"},sm={class:"title"},om={class:"info"},lm=["href"],im={class:"btns"},rm=X({__name:"index",props:{Close:Function},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(""),c=R(()=>`http://${location.hostname}:${u.value}`);we.Nas.Linkease.Enable.POST().then(v=>{var h,g;(h=v==null?void 0:v.data)!=null&&h.result&&(u.value=((g=v.data.result)==null?void 0:g.port)||"")});const p=()=>{l.Close&&l.Close(),location.reload()};return(v,h)=>(i(),Y(Nt,{type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>[e("div",nm,[e("div",am,[h[0]||(h[0]=e("div",{class:"icon"},[e("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":""},[e("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)),e("h2",sm,a(o(t)("服务已启动")),1),e("div",om,[e("span",null,a(o(t)("前往")),1),e("a",{href:c.value,target:"_blank",rel:"noopener noreferrer"},a(c.value),9,lm),e("span",null,a(o(t)("继续配置")),1)]),e("div",im,[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",type:"button",onClick:p},a(o(t)("关闭")),1)])])])]),_:1})]),_:1}))}}),cm=le(rm,[["__scopeId","data-v-6a8f7fd7"]]),dm=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(cm,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},um={class:"action-header"},vm={class:"action-header_title"},pm={class:"action-body"},hm={class:"label-item"},mm={class:"label-item_key"},fm={class:"label-item_value"},bm=["value"],gm={class:"label-item"},_m={class:"label-item_key"},ym={class:"label-item_value"},km=["placeholder"],wm={class:"label-item"},$m={class:"label-item_key"},Cm={class:"label-item_value"},Sm=["placeholder"],xm={class:"label-item"},Pm={class:"label-item_key"},Tm={class:"label-item_value"},Mm={class:"protocol-item"},Em={class:"protocol-item_key"},Im={class:"protocol-item_value"},Dm={class:"action-footer"},Lm=["disabled"],Am=["disabled"],Nm=X({__name:"index",props:{rootPath:{type:String,required:!0},Close:Function},setup(s){const t=Zs(),{$gettext:n}=Ae(),l=s,u=m=>{m.preventDefault(),l.Close&&l.Close()},c=x(!1),r=x({shareName:"",username:"",password:"",rootPath:l.rootPath,samba:!0,webdav:!0}),p=m=>m==""?(ne.Warning(n("共享名称不能为空")),!1):m.length>15?(ne.Warning(n("共享名称不能超过15个字符")),!1):/^[a-z][a-z0-9_-]*$/.test(m)?!0:(ne.Warning(n("共享名称需以小写字母开头,仅支持小写字母、数字、下划线和中划线")),!1),v=()=>B(null,null,function*(){if(c.value)return;const m=r.value;if(m.rootPath==""){ne.Warning(n("共享路径不能为空"));return}if(!p(m.shareName))return;if(m.username==""){ne.Warning(n("用户名不能为空"));return}if(m.password==""){ne.Warning(n("密码不能为空"));return}if(!m.samba&&!m.webdav){ne.Warning(n("请至少选择一种共享协议"));return}const f=Fn.checkSmabaUserName(m.username);if(f!==!0){ne.Warning(`${f}`);return}yield b(m)}),h=m=>{var k;const f=(k=m==null?void 0:m.data)==null?void 0:k.error;if(f)throw f},g=(m,f)=>{const k=m.map(w=>ye({},w)),$=k.find(w=>w.userName==f);return $?($.ro=!1,$.rw=!0):k.push({userName:f,rw:!0}),k},b=m=>B(null,null,function*(){var $,w,S,C;c.value=!0;const f=ne.Loading(n("创建中..."));let k=!1;try{const y=yield we.Share.Service.List.GET();h(y);const _=(((w=($=y==null?void 0:y.data)==null?void 0:$.result)==null?void 0:w.services)||[]).find(N=>N.name==m.shareName);if(_&&_.path!=m.rootPath){ne.Warning(n("共享名称已存在且路径不同,请更换共享名"));return}const D=m.username,E=yield we.Share.User.List.GET();h(E);const U=(((C=(S=E==null?void 0:E.data)==null?void 0:S.result)==null?void 0:C.users)||[]).find(N=>N.userName==D);if(U)U.password&&U.password!=m.password&&ne.Warning(n("用户名已存在,将复用原密码"));else{const N={userName:D,password:m.password},F=yield we.Share.User.Create.POST(N);h(F)}const q={name:m.shareName,path:m.rootPath,samba:!!(_!=null&&_.samba||m.samba),webdav:!!(_!=null&&_.webdav||m.webdav),users:_?g(_.users||[],D):[{userName:D,rw:!0}]},z=_?yield we.Share.Service.Update.POST(q):yield we.Share.Service.Create.POST(q);h(z),ne.Success(n("创建成功")),k=!0,t(()=>{location.reload()},1e3)}catch(y){ne.Error(y)}finally{f.Close(),k||(c.value=!1)}});return(m,f)=>(i(),Y(Nt,{type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>[e("form",{class:"action",onSubmit:Ge(v,["prevent"])},[e("div",um,[e("div",vm,a(o(n)("局域网文件共享配置")),1)]),e("div",pm,[e("div",hm,[e("div",mm,[e("span",null,a(o(n)("服务目录路径")),1)]),e("div",fm,[e("input",{type:"text",value:r.value.rootPath,disabled:"",required:"",style:{backgroundColor:"#eee"}},null,8,bm)])]),e("div",gm,[e("div",_m,[e("span",null,a(o(n)("共享名(建议使用英文字母)")),1)]),e("div",ym,[W(e("input",{type:"text","onUpdate:modelValue":f[0]||(f[0]=k=>r.value.shareName=k),required:"",placeholder:o(n)("共享名称")},null,8,km),[[Oe,r.value.shareName,void 0,{trim:!0}]])])]),e("div",wm,[e("div",$m,[e("span",null,a(o(n)("用户名")),1)]),e("div",Cm,[W(e("input",{type:"text",required:"",placeholder:o(n)("账号用户名"),"onUpdate:modelValue":f[1]||(f[1]=k=>r.value.username=k)},null,8,Sm),[[Oe,r.value.username,void 0,{trim:!0}]])])]),e("div",xm,[e("div",Pm,[e("span",null,a(o(n)("密码")),1)]),e("div",Tm,[W(e("input",{type:"password","onUpdate:modelValue":f[2]||(f[2]=k=>r.value.password=k),required:""},null,512),[[Oe,r.value.password,void 0,{trim:!0}]])])]),e("div",Mm,[e("div",Em,a(o(n)("共享协议")),1),e("div",Im,[e("label",null,[W(e("input",{type:"checkbox","onUpdate:modelValue":f[3]||(f[3]=k=>r.value.samba=k)},null,512),[[gt,r.value.samba]]),e("span",null,a(o(n)("Samba")),1)]),e("label",null,[W(e("input",{type:"checkbox","onUpdate:modelValue":f[4]||(f[4]=k=>r.value.webdav=k)},null,512),[[gt,r.value.webdav]]),e("span",null,a(o(n)("WebDAV")),1)])])])]),e("div",Dm,[f[5]||(f[5]=e("div",{class:"auto"},null,-1)),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",type:"button",onClick:u,disabled:c.value},a(o(n)("关闭")),9,Lm),e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:c.value},a(o(n)("创建")),9,Am)])],32)]),_:1})]),_:1}))}}),Om=le(Nm,[["__scopeId","data-v-b209fad6"]]),zm=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(Om,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},qm=s=>!Array.isArray(window.quickstart_features)||window.quickstart_features.indexOf(s)!=-1,Rm={key:0,class:"action"},Vm={class:"title"},Bm={class:"desc"},Um={value:"linkease"},Fm={value:"unishare"},Hm=["innerHTML"],Gm={class:"btns"},jm=["disabled"],Wm=X({__name:"index",props:{setup:Number,Close:{type:Function,required:!0}},setup(s){const{$gettext:t}=Ae(),n=s,l=x(!0),u=x("unishare"),c=x(!1),r=x(n.setup||0),p=()=>{n.Close&&n.Close()},v=()=>B(null,null,function*(){switch(u.value){case"unishare":yield g();break;case"linkease":yield h();break}}),h=()=>B(null,null,function*(){c.value=!0,(yield Xt.checkAndInstallApp("linkease",t("易有云"),"app-meta-linkease"))&&m(),c.value=!1}),g=()=>B(null,null,function*(){c.value=!0;const k=[{pkg:"luci-app-unishare",app:t("统一文件共享")},{pkg:"unishare",app:"UniShare"},{pkg:"samba4-server",app:"Samba"},{pkg:"webdav2",app:"WebDAV"}];for(const $ of k)if(!(yield Xt.checkAndInstallApp($.pkg,$.app))){c.value=!1;return}b(),c.value=!1}),b=()=>{c.value=!1,l.value=!1,tm({Cancel:()=>{l.value=!0},Next:k=>{u.value==="unishare"&&f(k)}})},m=()=>{dm({}),p()},f=k=>{zm({rootPath:k}),p()};return(k,$)=>l.value?(i(),Y(Nt,{key:0,Close:s.Close,type:1},{default:pe(()=>[G(fn,{name:"rotate",mode:"out-in"},{default:pe(()=>[r.value==0?(i(),d("div",Rm,[e("h2",Vm,a(o(t)("欢迎使用 NAS 配置向导")),1),e("h3",Bm,a(o(t)("请选择需要添加的NAS服务")),1),e("form",null,[e("label",null,[W(e("select",{"onUpdate:modelValue":$[0]||($[0]=w=>u.value=w)},[e("option",Um,a(o(t)("跨设备共享(易有云)")),1),e("option",Fm,a(o(t)("局域网文件共享(Samba + WebDAV)")),1)],512),[[Be,u.value]])])]),o(qm)("unishare")?(i(),d("div",{key:0,class:"tips",innerHTML:o(t)("如需对 Samba 或 WebDAV 进行更细致的权限控制,请使用“%{unishare}”",{unishare:''+o(t)("统一文件共享")+""},!0)},null,8,Hm)):T("",!0),e("div",Gm,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",onClick:v,type:"button",disabled:c.value},a(o(t)("下一步")),9,jm),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:p,type:"button"},a(o(t)("取消")),1)])])):T("",!0)]),_:1})]),_:1},8,["Close"])):T("",!0)}}),Jm=le(Wm,[["__scopeId","data-v-a0cd5b5e"]]);function Qs(s,t={}){const v=t,{onClosed:n}=v,l=kl(v,["onClosed"]),u=document.createElement("div");document.body.appendChild(u);let c=!1;const r=cn(s,Ne(ye({},l),{Close:p}));function p(){c||(c=!0,r.unmount(),u.remove(),n==null||n())}try{r.mount(u)}catch(h){throw u.remove(),h}return{Close:p}}const Li=s=>Qs(Jm,s),Km={class:"app-container_linkease"},Zm={class:"linkease-item"},Ym={class:"linkease-item_name"},Qm={class:"linkease-item_value"},Xm={key:0,class:"configure"},ef={key:0,class:"linkease-item"},tf={class:"linkease-item_name"},nf={class:"linkease-item_value"},af=["href"],sf={href:"https://www.linkease.com",target:"_blank"},of=X({__name:"linkease",props:{linkease:{type:Object}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>{var r;return`http://${location.hostname}:${(r=l.linkease)==null?void 0:r.port}`}),c=()=>{Li({setup:0})};return(r,p)=>{var v,h,g;return i(),d("ul",Km,[e("li",Zm,[e("div",Ym,[e("span",null,a(o(t)("当前状态:")),1)]),e("div",Qm,[(v=s.linkease)!=null&&v.enabel?(i(),d("span",Xm,a(o(t)("已配置")),1)):(i(),d("span",{key:1,class:"configure enabel",onClick:p[0]||(p[0]=b=>c())},a(o(t)("未配置")),1))])]),(h=s.linkease)!=null&&h.enabel?(i(),d(V,{key:0},[(g=s.linkease)!=null&&g.port?(i(),d("li",ef,[e("div",tf,[e("span",null,a(o(t)("服务地址:")),1)]),e("div",nf,[e("a",{href:u.value,target:"_blank",rel:"noopener noreferrer"},a(u.value),9,af)])])):T("",!0)],64)):T("",!0),e("div",null,[e("a",sf,a(o(t)("下载易有云客户端,随时随地相册备份、远程访问")),1)])])}}}),lf=le(of,[["__scopeId","data-v-e3dffc59"]]),rf={href:"/cgi-bin/luci/admin/nas/unishare"},cf={class:"content"},df={class:"tab"},uf=["aria-pressed"],vf={class:"title"},pf={key:0},hf={key:1},mf=["aria-pressed"],ff=["aria-pressed"],bf=X({__name:"index",setup(s){const t=Ys(),{$gettext:n}=Ae(),l=x(),u=ic(),c=x(!1),r=()=>{we.Nas.Service.Status.GET().then(f=>{var k;if((k=f==null?void 0:f.data)!=null&&k.result){const $=f.data.result;l.value=$,g(),$.webdav&&(u.webdav=$.webdav)}})},p=()=>{t(Li,{setup:0})},v=x(0),h=x(!1),g=()=>{var $,w,S,C,y,P;if(h.value)return;const k=[!!((w=($=l.value)==null?void 0:$.linkease)!=null&&w.enabel),!!((C=(S=l.value)==null?void 0:S.sambas)!=null&&C.length),!!((P=(y=l.value)==null?void 0:y.webdav)!=null&&P.path)].findIndex(Boolean);v.value=k===-1?0:k},b=f=>{v.value=f,h.value=!0},m=qa();return fa("sharing",f=>{var k;l.value=m!=null&&m.bounded()?Ne(ye({},f),{sambas:(k=f.sambas)==null?void 0:k.slice(0,2)}):f,g(),f.webdav&&(u.webdav=f.webdav)})||r(),(f,k)=>(i(),Y(ya,{"home-menu":[{label:o(n)("统一共享高级配置"),href:"/cgi-bin/luci/admin/nas/unishare"}],title:o(n)("存储服务"),style:{width:"100%",height:"100%",display:"block"},"is-settings-menu-open":c.value,"onUpdate:isSettingsMenuOpen":k[3]||(k[3]=$=>c.value=$)},{icon:pe(()=>[G(n5,{color:"#4f39f6",class:"icon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:p},[G(r5,{color:"#0a0a0a",class:"icon1 settings-icon",style:{"margin-right":"6px"}}),e("span",null,a(o(n)("存储配置")),1)])]),"settings-menu":pe(()=>[e("div",null,[e("a",rf,a(o(n)("统一共享高级配置")),1)])]),default:pe(()=>{var $,w,S,C,y,P,_,D,E;return[e("div",cf,[e("div",df,[e("button",{type:"button","aria-pressed":v.value==0,class:_e(["item cloud",{active:v.value==0}]),onClick:k[0]||(k[0]=A=>b(0))},[G(o5,{color:"#155dfc",class:"icon2"}),e("div",vf,a(o(n)("易有云")),1),(w=($=l.value)==null?void 0:$.linkease)!=null&&w.enabel?(i(),d("span",pf,a(o(n)("已配置")),1)):(i(),d("span",hf,a(o(n)("未配置")),1))],10,uf),e("button",{type:"button","aria-pressed":v.value==1,class:_e(["item memory",{active:v.value==1}]),onClick:k[1]||(k[1]=A=>b(1))},[G(Ei,{color:"#0bab47",class:"icon2"}),k[4]||(k[4]=e("div",{class:"title"},"SAMBA",-1)),e("span",null,a((C=(S=l.value)==null?void 0:S.sambas)!=null&&C.length?o(n)("已启用"):o(n)("未启用")),1)],10,mf),e("button",{type:"button","aria-pressed":v.value==2,class:_e(["item network",{active:v.value==2}]),onClick:k[2]||(k[2]=A=>b(2))},[G(zs,{color:"#9810fa",class:"icon2"}),k[5]||(k[5]=e("div",{class:"title"},"WEBDAV",-1)),e("span",null,a((P=(y=l.value)==null?void 0:y.webdav)!=null&&P.path?o(n)("已启用"):o(n)("未启用")),1)],10,ff)]),v.value==0?(i(),Y(lf,{key:0,linkease:(_=l.value)==null?void 0:_.linkease},null,8,["linkease"])):v.value==1?(i(),Y(k5,{key:1,sambas:(D=l.value)==null?void 0:D.sambas},null,8,["sambas"])):v.value==2?(i(),Y(A5,{key:2,webdav:(E=l.value)==null?void 0:E.webdav},null,8,["webdav"])):T("",!0)])]}),_:1},8,["home-menu","title","is-settings-menu-open"]))}}),gf=le(bf,[["__scopeId","data-v-15d076d8"]]),_f={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},yf=["fill"],Rl=X({__name:"docker",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",_f,[e("path",{d:"M473.950316 63.164632l488.070737 234.226526v414.234947l-337.92 200.111158-502.837895-295.019789V223.447579l352.687158-160.282947zM200.434526 306.661053V571.284211l383.892211 225.28V510.113684L200.434526 306.661053z m682.253474 82.728421l-219.082105 120.400842v286.396631l219.082105-129.670736V389.335579z m-409.761684-238.753685L258.910316 247.915789l364.759579 193.374316 212.075789-116.520421-362.819368-174.08z",fill:s.color,"p-id":"6174"},null,8,yf)]))}}),kf={class:"app-container_docker service-docker"},wf={class:"docker-item"},$f={class:"docker-item_name"},Cf={key:0,class:"docker-item_value"},Sf={key:0,class:"docker-item_value"},xf={class:"configure"},Pf={key:1,class:"docker-item_value"},Tf={class:"input-switch"},Mf=["aria-label","value","disabled"],Ef={key:0,class:"status-icon"},If={key:1,class:"status-icon",style:{background:"#e9ebef",color:"#4a5565"}},Df={key:0,class:"content service-root"},Lf={class:"docker-item_name"},Af={class:"docker_box"},Nf={class:"path"},Of={key:0},zf={class:"tooltip-trigger"},qf={class:"docker_tip"},Rf={class:"tooltip-text tooltip-top"},Vf={class:"docker_dir_tip"},Bf=X({__name:"status",props:{docker:{type:Object}},setup(s){var v;const{$gettext:t,$ngettext:n}=Ae(),l=(h,g)=>window.vue_lang==="en"?g:h,u=s,c=R(()=>{var h;return((h=u.docker)==null?void 0:h.status)!="not installed"}),r=Xe({enable:((v=u.docker)==null?void 0:v.status)=="running",disabled:!1}),p=()=>B(null,null,function*(){r.disabled=!0;try{const h=yield we.Guide.DockerSwitch.POST({enable:r.enable});if(h!=null&&h.data){const{success:g,error:b}=h.data;if(b)throw r.enable=!r.enable,b;(g||0)==0}}catch(h){ne.Warning(`${h}`)}finally{r.disabled=!1}});return(h,g)=>{var b,m,f,k;return i(),d("ul",kf,[e("li",wf,[e("div",$f,[e("span",null,a(l("运行状态","Status")),1)]),["running","stopped","not installed"].includes(((b=u.docker)==null?void 0:b.status)||"")?(i(),d(V,{key:1},[c.value?(i(),d("div",Pf,[e("label",Tf,[W(e("input",{type:"checkbox",class:"docker-switch-input",role:"switch","aria-label":l("启用 Docker","Enable Docker"),value:!r.enable,"onUpdate:modelValue":g[0]||(g[0]=$=>r.enable=$),disabled:r.disabled,onChange:p},null,40,Mf),[[gt,r.enable]]),e("span",{class:_e(r.enable?"enable":"close")},[...g[1]||(g[1]=[e("em",null,null,-1)])],2)]),r.enable?(i(),d("span",Ef,a(o(t)("运行中")),1)):T("",!0),r.enable?T("",!0):(i(),d("span",If,a(l("未运行","Stopped")),1))])):(i(),d("div",Sf,[e("span",xf,a(o(t)("未安装")),1)]))],64)):(i(),d("div",Cf,a(l("状态未知","Unknown")),1))]),((m=s.docker)==null?void 0:m.status)=="running"?(i(),d("li",Df,[e("div",Lf,[e("span",null,a(l("根目录","Root directory")),1)]),e("div",Af,[e("div",Nf,a((f=s.docker)==null?void 0:f.path),1),(k=s.docker)!=null&&k.errorInfo?(i(),d("span",Of,[e("span",zf,[e("span",qf,[G(Sn)]),e("div",null,[e("div",Rf,[e("span",Vf,a(s.docker.errorInfo),1)])])])])):T("",!0)])])):T("",!0)])}}}),Uf=le(Bf,[["__scopeId","data-v-9874651a"]]),Ff={},Hf={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"};function Gf(s,t){return i(),d("svg",Hf,[...t[0]||(t[0]=[e("g",{id:"icon_yellow",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e("g",{id:"Icon/Warning"},[e("rect",{id:"矩形",fill:"#000000","fill-rule":"nonzero",opacity:"0",x:"0",y:"0",width:"128",height:"128"}),e("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:"形状",fill:"#FAAD14"})])],-1)])])}const jf=le(Ff,[["render",Gf]]),Wf={key:0,class:"action"},Jf={class:"title"},Kf={class:"desc"},Zf={class:"roots"},Yf={class:"roots_tit"},Qf={class:"root"},Xf={class:"move"},e7={class:"roots_tit"},t7={key:0},n7={class:"select-editable"},a7={selected:"",value:null},s7=["value"],o7={value:"useInput"},l7=["placeholder"],i7={key:1,class:"tips"},r7={class:"tips_content"},c7={class:"tip"},d7={key:0,class:"btns"},u7={key:1,class:"btns"},v7={key:1,class:"action docker_success"},p7={class:"title"},h7={class:"finished"},m7={class:"successed"},f7={class:"btns"},b7={key:2,class:"action docker_download"},g7={class:"title"},_7={class:"finished"},y7={class:"successed"},k7={class:"docker_moves"},w7={class:"moves change"},$7={for:"move"},C7={class:"moves"},S7={for:"cover"},x7={class:"btns"},P7=X({__name:"index",props:{rootPath:{type:String,required:!0},Close:Function},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=x(),u=x(),c=x(0),r=x("null"),p=x(""),v=x(),h=x(!1),g=x(""),b=s;we.Nas.Disk.Status.GET().then(y=>{y!=null&&y.data.result&&(v.value=y==null?void 0:y.data.result)}),we.Guide.DockerStatus.GET().then(y=>{var P;if((P=y==null?void 0:y.data)!=null&&P.result){const _=y.data.result;l.value=_}}),we.Guide.DockerPartitionList.GET().then(y=>{var P;if((P=y==null?void 0:y.data)!=null&&P.result){const _=y.data.result;u.value=_}});const f=y=>{let P=r.value;if(P=="useInput"&&(P=p.value),P==null||P=="null"||P=="")return;const _=ne.Loading(t("正在迁移中..."));we.Guide.DockerTransfer.POST({path:P,force:y,overwriteDir:!!g.value}).then(D=>{var E;if(D!=null&&D.data){if((D.data.success||0)==0){if((E=D.data.result)!=null&&E.emptyPathWarning){h.value=!0,c.value=2;return}c.value=1;return}else if(D.data.error)throw D.data.error}throw t("未知错误")}).catch(D=>{ne.Error(D)}).finally(()=>_.Close())},k=()=>{h.value=!1,f(!1)},$=y=>{y.preventDefault(),b.Close&&b.Close()},w=y=>{y.preventDefault(),location.reload()},S=y=>{y.preventDefault(),c.value=0},C=y=>{y.preventDefault(),f(!0)};return(y,P)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>{var _,D,E,A,U,q;return[c.value==0?(i(),d("div",Wf,[e("h2",Jf,a(o(t)("Docker迁移向导")),1),e("p",Kf,a(o(t)("当系统根目录空间不足时,可将Docker根目录迁移到外置硬盘,以保证系统的正常运行(目标分区不支持NTFS,FAT等文件系统)")),1),e("div",Zf,[e("span",Yf,a(o(t)("Docker根目录:")),1),e("span",Qf,a((_=l.value)==null?void 0:_.path),1)]),e("div",Xf,[e("span",e7,a(o(t)("迁移到:")),1),(E=(D=u.value)==null?void 0:D.partitionList)!=null&&E.length?(i(),d("div",t7,[e("form",{onSubmit:Ge(k,["prevent"])},[e("label",null,[e("div",n7,[W(e("select",{"onUpdate:modelValue":P[0]||(P[0]=z=>r.value=z)},[e("option",a7,a(o(t)("请选择迁移路径")),1),(i(!0),d(V,null,oe((A=u.value)==null?void 0:A.partitionList,(z,N)=>(i(),d("option",{value:z,key:N},a(z),9,s7))),128)),e("option",o7,a(o(t)("- -自定义- -")),1)],512),[[Be,r.value,void 0,{trim:!0}]]),r.value=="useInput"?W((i(),d("input",{key:0,type:"text","onUpdate:modelValue":P[1]||(P[1]=z=>p.value=z),required:"",placeholder:o(t)("请输入迁移路径")},null,8,l7)),[[Oe,p.value,void 0,{trim:!0}]]):T("",!0)])])],32)])):u.value?(i(),d("div",i7,[e("div",r7,[G(Sn),e("span",c7,a(o(t)("检测到您还没有挂载外置硬盘或分区小于8GB,需要您接上硬盘并格式化或手动挂载硬盘后,再执行Docker迁移向导,将Docker迁移到目标硬盘。")),1)])])):T("",!0)]),(q=(U=u.value)==null?void 0:U.partitionList)!=null&&q.length?(i(),d("div",d7,[e("button",{class:"cbi-button cbi-button-apply",onClick:k},a(o(t)("确定")),1),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",type:"button",onClick:$},a(o(t)("取消")),1)])):(i(),d("div",u7,[e("button",{class:"cbi-button cbi-button-apply",onClick:$},a(o(t)("确定")),1)]))])):c.value==1?(i(),d("div",v7,[e("h2",p7,a(o(t)("Docker迁移向导")),1),e("div",h7,[G(Qo)]),e("p",m7,a(o(t)("迁移成功!")),1),e("div",f7,[e("button",{class:"cbi-button cbi-button-apply",onClick:w},a(o(t)("确定")),1)])])):c.value==2?(i(),d("div",b7,[e("h2",g7,a(o(t)("Docker迁移向导")),1),e("div",_7,[G(jf)]),e("p",y7,a(o(t)("该目标路径不为空")),1),e("div",k7,[e("div",w7,[W(e("input",{type:"radio",id:"move",name:"moves","onUpdate:modelValue":P[2]||(P[2]=z=>g.value=z),value:""},null,512),[[Mt,g.value]]),e("label",$7,a(o(t)("更换目录(不覆盖目标路径,仅将Docker目录修改为目标路径)")),1)]),e("div",C7,[W(e("input",{type:"radio",id:"cover",name:"moves","onUpdate:modelValue":P[3]||(P[3]=z=>g.value=z),value:"true"},null,512),[[Mt,g.value]]),e("label",S7,a(o(t)("覆盖迁移(覆盖目标路径,继续迁移会清空该目标路径下的文件)")),1)])]),e("div",x7,[h.value?(i(),d("button",{key:0,class:"cbi-button cbi-button-apply",onClick:C},a(o(t)("确定")),1)):T("",!0),e("button",{class:"cbi-button cbi-button-apply",onClick:S},a(o(t)("返回")),1),h.value?T("",!0):(i(),d("button",{key:1,class:"cbi-button cbi-button-remove app-btn app-back",type:"button",onClick:w},a(o(t)("取消")),1))])])):T("",!0)]}),_:1},8,["Close"]))}}),T7=le(P7,[["__scopeId","data-v-e4c2ce97"]]),M7=s=>Qs(T7,{onClosed:s==null?void 0:s.onClosed}),E7={href:"/cgi-bin/luci/admin/services/dockerman/overview"},I7={key:0,class:"content"},D7={key:1,class:"content",style:{display:"flex","justify-content":"center"}},L7=X({__name:"Docker",setup(s){const t=Ys(),{$gettext:n}=Ae(),l=x(!1),u=x(),c=x(!1),r=()=>{t(M7,{setup:0})},p=()=>{we.Guide.DockerStatus.GET().then(v=>{var h;if((h=v==null?void 0:v.data)!=null&&h.result){const g=v.data.result;u.value=g}}).finally(()=>{l.value=!0})};if(!fa("docker",v=>{u.value=v,l.value=!0})){const v=setTimeout(p,1100);lt(()=>clearTimeout(v))}return(v,h)=>{var b,m;const g=At("icon-loading");return i(),Y(ya,{"home-menu":((b=u.value)==null?void 0:b.status)==="running"?[{label:o(n)("Docker高级配置"),href:"/cgi-bin/luci/admin/services/dockerman/overview"}]:[],title:"Docker",showSettings:!0,onFooterClick:r,style:{width:"100%",height:"100%",display:"block"},"is-settings-menu-open":c.value,"onUpdate:isSettingsMenuOpen":h[0]||(h[0]=f=>c.value=f)},Pr({icon:pe(()=>[G(Rl,{color:"#155dfc",class:"icon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:r},[G(Rl,{color:"#0a0a0a",class:"icon1 dockerIcon",style:{"margin-right":"6px"}}),e("span",null,a(o(n)("数据迁移")),1)])]),default:pe(()=>[l.value?(i(),d("div",I7,[G(Uf,{docker:u.value},null,8,["docker"])])):(i(),d("div",D7,[G(g,{size:40,color:"currentColor"})]))]),_:2},[((m=u.value)==null?void 0:m.status)==="running"?{name:"settings-menu",fn:pe(()=>[e("div",null,[e("a",E7,a(o(n)("Docker高级配置")),1)])]),key:"0"}:void 0]),1032,["home-menu","is-settings-menu-open"])}}}),A7=le(L7,[["__scopeId","data-v-18542fda"]]),zn=s=>s==="running"?"running":s==="stopped"?"stopped":s==="not installed"?"notInstalled":"unknown",Jn=s=>s==="Stopped"?"stopped":s==="Disabled"?"disabled":s!=null&&s.trim()?"configured":"notConfigured",N7={running:["运行中","Running"],stopped:["未运行","Stopped"],notInstalled:["未安装","Not installed"],unknown:["状态未知","Unknown"],configured:["已配置","Configured"],disabled:["未启用","Disabled"],notConfigured:["未配置","Not configured"]},$n=(s,t)=>N7[s][t?1:0];function O7(s,t){const n={stopped:["服务尚未启动,可在下载管理中配置。","The service is stopped. Configure it in Download management."],notInstalled:["尚未安装此服务,可在下载管理中配置。","This service is not installed. Configure it in Download management."],unknown:["尚未取得此服务的状态,可在下载管理中查看。","The service status is unknown. Check Download management."]},l=zn(s);return l==="running"?"":n[l][t?1:0]}const z7={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},q7=["fill"],R7=["fill"],V7=["fill"],Ia=X({__name:"download1",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",z7,[e("path",{d:"M665.6 911.36H358.4c-76.8 0-117.76 0-153.6-20.48-30.72-15.36-56.32-40.96-71.68-71.68-20.48-35.84-20.48-76.8-20.48-153.6v-51.2c0-20.48 15.36-40.96 40.96-40.96s40.96 15.36 40.96 40.96v51.2c0 61.44 0 97.28 10.24 117.76 10.24 15.36 20.48 30.72 40.96 40.96 20.48 10.24 56.32 10.24 117.76 10.24h307.2c61.44 0 97.28 0 117.76-10.24 15.36-10.24 30.72-20.48 40.96-40.96 10.24-20.48 10.24-56.32 10.24-117.76v-51.2c0-20.48 15.36-40.96 40.96-40.96s40.96 15.36 40.96 40.96v51.2c0 76.8 0 117.76-20.48 153.6-15.36 30.72-40.96 56.32-71.68 71.68-35.84 20.48-76.8 20.48-153.6 20.48z","p-id":"4906",fill:s.color},null,8,q7),e("path",{d:"M512 645.12c-10.24 0-15.36 0-20.48-10.24l-204.8-204.8c-10.24-10.24-10.24-30.72 0-46.08s30.72-10.24 46.08 0l184.32 184.32 184.32-184.32c10.24-10.24 30.72-10.24 46.08 0 10.24 10.24 10.24 30.72 0 46.08l-204.8 204.8c-5.12 5.12-15.36 10.24-20.48 10.24z","p-id":"4907",fill:s.color},null,8,R7),e("path",{d:"M512 645.12c-15.36 0-30.72-15.36-30.72-30.72V153.6c0-15.36 15.36-30.72 30.72-30.72s30.72 15.36 30.72 30.72v460.8c0 15.36-15.36 30.72-30.72 30.72z","p-id":"4908",fill:s.color},null,8,V7)]))}}),B7={class:"app-container_aria2"},U7={class:"aria2-item"},F7={class:"aria2-item_name"},H7={class:"aria2-item_value"},G7=["href"],j7={class:"aria2-item"},W7={class:"aria2-item_name"},J7={class:"aria2-item_value"},K7=["href"],Z7={class:"aria2-item"},Y7={class:"aria2-item_name right"},Q7={class:"aria2-item_value"},X7=["href"],e9={class:"use-url_app"},t9={href:"https://doc.linkease.com/zh/guide/linkease_app/tutorial.html#%E8%BF%9C%E7%A8%8B%E4%B8%8B%E8%BD%BD",target:"_blank"},n9=X({__name:"aria2",props:{aria2:{type:Object}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>{var r;return`${location.origin}${(r=l.aria2)==null?void 0:r.webPath}`}),c=R(()=>{var v,h,g;let r=(v=l.aria2)==null?void 0:v.rpcToken;r?r=encodeURIComponent(btoa(r)):r="";const p=encodeURIComponent(location.hostname);return`${location.origin}${(h=l.aria2)==null?void 0:h.webPath}/#!/settings/rpc/set/http/${p}/${(g=l.aria2)==null?void 0:g.rpcPort}/jsonrpc/${r}`});return(r,p)=>{var v,h,g;return i(),d("ul",B7,[((v=s.aria2)==null?void 0:v.status)=="running"?(i(),d(V,{key:0},[e("li",U7,[e("div",F7,[e("span",null,a(o(t)("下载目录:")),1)]),e("div",H7,[e("a",{target:"_blank",href:"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+((h=s.aria2)==null?void 0:h.downloadPath)},a((g=s.aria2)==null?void 0:g.downloadPath),9,G7)])]),e("li",j7,[e("div",W7,[e("span",null,a(o(t)("网络地址:")),1)]),e("div",J7,[e("a",{href:u.value,target:"_blank",rel:"noopener noreferrer"},a(u.value),9,K7)])]),e("li",Z7,[e("div",Y7,[e("span",null,a(o(t)("认证失败?")),1)]),e("div",Q7,[e("a",{href:c.value,target:"_blank",rel:"noopener noreferrer"},a(o(t)("点此自动配置 AriaNg")),9,X7)])])],64)):T("",!0),e("div",e9,[e("a",t9,a(o(t)("使用易有云APP,随时随地远程下载")),1)])])}}}),a9=le(n9,[["__scopeId","data-v-79be9404"]]),s9={class:"app-container_qbittorrent"},o9={class:"qbittorrent-item"},l9={class:"qbittorrent-item_name"},i9={class:"qbittorrent-item_value"},r9=["href"],c9={class:"qbittorrent-item"},d9={class:"qbittorrent-item_name"},u9={class:"qbittorrent-item_value"},v9=["href"],p9={class:"qbittorrent-item"},h9={class:"qbittorrent-item_name right"},m9={class:"qbittorrent-item_value"},f9=X({__name:"qbittorrent",props:{qbittorrent:{type:Object}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>{var c;return`http://${location.hostname}${(c=l.qbittorrent)==null?void 0:c.webPath}`});return(c,r)=>{var p,v,h;return i(),d("ul",s9,[((p=s.qbittorrent)==null?void 0:p.status)=="running"?(i(),d(V,{key:0},[e("li",o9,[e("div",l9,[e("span",null,a(o(t)("下载目录:")),1)]),e("div",i9,[e("a",{target:"_blank",href:"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+((v=s.qbittorrent)==null?void 0:v.downloadPath)},a((h=s.qbittorrent)==null?void 0:h.downloadPath),9,r9)])]),e("li",c9,[e("div",d9,[e("span",null,a(o(t)("网络地址:")),1)]),e("div",u9,[e("a",{href:u.value,target:"_blank",rel:"noopener noreferrer"},a(u.value),9,v9)])]),e("li",p9,[e("div",h9,[e("span",null,a(o(t)("默认用户名:"))+"admin",1)]),e("div",m9,[e("span",null,a(o(t)("默认密码:"))+"adminadmin",1)])])],64)):T("",!0)])}}}),b9=le(f9,[["__scopeId","data-v-498cb646"]]),g9={class:"app-container_transmission"},_9={class:"transmission-item"},y9={class:"transmission-item_name"},k9={class:"transmission-item_value"},w9=["href"],$9={class:"transmission-item"},C9={class:"transmission-item_name"},S9={class:"transmission-item_value"},x9=["href"],P9=X({__name:"transmission",props:{transmission:{type:Object}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=R(()=>{var c;return`http://${location.hostname}${(c=l.transmission)==null?void 0:c.webPath}`});return(c,r)=>{var p,v,h;return i(),d("ul",g9,[((p=s.transmission)==null?void 0:p.status)=="running"?(i(),d(V,{key:0},[e("li",_9,[e("div",y9,[e("span",null,a(o(t)("下载目录:")),1)]),e("div",k9,[e("a",{target:"_blank",href:"/cgi-bin/luci/admin/services/linkease/file/?path=/root"+((v=s.transmission)==null?void 0:v.downloadPath)},a((h=s.transmission)==null?void 0:h.downloadPath),9,w9)])]),e("li",$9,[e("div",C9,[e("span",null,a(o(t)("网络地址:")),1)]),e("div",S9,[e("a",{href:u.value,target:"_blank",rel:"noopener noreferrer"},a(u.value),9,x9)])])],64)):T("",!0)])}}}),T9=le(P9,[["__scopeId","data-v-55991749"]]),M9={},E9={width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function I9(s,t){return i(),d("svg",E9,[...t[0]||(t[0]=[e("path",{d:"M7,0.875 C3.61757813,0.875 0.875,3.61757813 0.875,7 C0.875,10.3824219 3.61757813,13.125 7,13.125 C10.3824219,13.125 13.125,10.3824219 13.125,7 C13.125,3.61757813 10.3824219,0.875 7,0.875 Z M6.5625,4.046875 C6.5625,3.98671875 6.61171875,3.9375 6.671875,3.9375 L7.328125,3.9375 C7.38828125,3.9375 7.4375,3.98671875 7.4375,4.046875 L7.4375,7.765625 C7.4375,7.82578125 7.38828125,7.875 7.328125,7.875 L6.671875,7.875 C6.61171875,7.875 6.5625,7.82578125 6.5625,7.765625 L6.5625,4.046875 Z M7,10.0625 C6.63769531,10.0625 6.34375,9.76855469 6.34375,9.40625 C6.34375,9.04394531 6.63769531,8.75 7,8.75 C7.36230469,8.75 7.65625,9.04394531 7.65625,9.40625 C7.65625,9.76855469 7.36230469,10.0625 7,10.0625 Z",id:"形状","fill-opacity":"0.65"},null,-1)])])}const va=le(M9,[["render",I9]]),D9={key:0,class:"action"},L9={class:"title"},A9={class:"load_service input_row"},N9={class:"left"},O9={class:"radios"},z9={class:"radios"},q9={class:"radios"},R9={class:"input_row"},V9={class:"left"},B9={class:"tooltip-trigger"},U9={class:"tooltip-text tooltip-top"},F9={class:"dowload_dir_tip"},H9={class:"myinput_wrap"},G9={class:"input_row"},j9={class:"left"},W9={class:"tooltip-trigger"},J9={class:"tooltip-text tooltip-top"},K9={class:"dowload_dir_tip"},Z9={class:"myinput_wrap"},Y9={class:"input_row"},Q9={class:"left"},X9={class:"tooltip-trigger"},eb={class:"tooltip-text tooltip-bottom"},tb={class:"dowload_rpc_tip"},nb=["placeholder"],ab={class:"input_row"},sb={class:""},ob={class:"radios"},lb={for:"default"},ib={class:"radios"},rb={for:"add"},cb={class:"input_row"},db={class:"myinput_wrap Tracker_input"},ub=["placeholder"],vb={class:"input_row"},pb={class:"left"},hb={class:"tooltip-trigger"},mb={class:"tooltip-text tooltip-top"},fb={class:"dowload_dir_tip"},bb={class:"myinput_wrap"},gb={class:"input_row"},_b={class:"left"},yb={class:"tooltip-trigger"},kb={class:"tooltip-text tooltip-top"},wb={class:"dowload_dir_tip"},$b={class:"myinput_wrap"},Cb={class:"input_row"},Sb={class:"left"},xb={class:"tooltip-trigger"},Pb={class:"tooltip-text tooltip-top"},Tb={class:"dowload_dir_tip"},Mb={class:"myinput_wrap"},Eb={class:"input_row"},Ib={class:"left"},Db={class:"tooltip-trigger"},Lb={class:"tooltip-text tooltip-top"},Ab={class:"dowload_dir_tip"},Nb={class:"myinput_wrap"},Ob={class:"btns"},zb={key:1,class:"action"},qb={class:"title"},Rb={class:"finished"},Vb={class:"successed"},Bb={class:"btns"},Ub=X({__name:"index",props:{services:{type:Object,required:!0},partitionList:{type:Array,required:!0},defaultTab:{type:String,required:!1},Close:Function},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=x(""),u=x(""),c=x(""),r=x(""),p=x("default"),v=x("Aria2"),h=x(""),g=x(""),b=x(""),m=x(""),f=x([]),k=x([]),$=s,w=x(0);nt(()=>{var q,z,N,F,Z,Q,ce,ve,O,de;switch($.defaultTab){case"aria2":v.value="Aria2";break;case"qbittorrent":v.value="qBittorrent";break;case"transmission":v.value="Transmission";break}f.value=$.partitionList.map(K=>({key:K})),k.value=$.partitionList.filter(K=>K.startsWith("/mnt/")).map(K=>K.replace(/(\/mnt\/[^/]+).*/,"$1")),c.value=((q=$.services.aria2)==null?void 0:q.configPath)||"";const D=((z=$.services.aria2)==null?void 0:z.downloadPath)||((N=$.services.qbittorrent)==null?void 0:N.downloadPath)||((F=$.services.transmission)==null?void 0:F.downloadPath);D&&(r.value=D);const E=(Z=$.services.aria2)==null?void 0:Z.rpcToken;E&&(l.value=E),h.value=((Q=$.services.qbittorrent)==null?void 0:Q.configPath)||"";const A=((ce=$.services.qbittorrent)==null?void 0:ce.downloadPath)||D||((ve=$.services.transmission)==null?void 0:ve.downloadPath);A&&(g.value=A),b.value=((O=$.services.transmission)==null?void 0:O.configPath)||"";const U=((de=$.services.transmission)==null?void 0:de.downloadPath)||D||A;U&&(m.value=U)});const S=()=>{let D=c.value,E=r.value;D==null||D==""||E==null||E==""||B(null,null,function*(){if(yield Xt.checkAndInstallApp("app-meta-aria2","Aria2")){const U=ne.Loading(t("配置中..."));we.Guide.Aria2Init.POST({configPath:D,downloadPath:E,rpcToken:l.value,btTracker:p.value=="add"?u.value:""}).then(q=>{var z;if(q!=null&&q.data){if((q.data.success||0)==0){w.value=1;return}else if((z=q.data)!=null&&z.error)throw q.data.error}throw t("未知错误")}).catch(q=>ne.Error(q)).finally(()=>U.Close())}})},C=()=>{let D=h.value,E=g.value;D==null||D==""||E==null||E==""||B(null,null,function*(){if(yield Xt.checkAndInstallApp("app-meta-qbittorrent","qBittorrent")){const U=ne.Loading(t("配置中..."));we.Guide.qbitorrentInit.POST({configPath:D,downloadPath:E}).then(q=>{var z;if(q!=null&&q.data){if((q.data.success||0)==0){w.value=1;return}else if((z=q.data)!=null&&z.error)throw q.data.error}throw t("未知错误")}).catch(q=>ne.Error(q)).finally(()=>U.Close())}})},y=()=>{let D=b.value,E=m.value;D==null||D==""||E==null||E==""||B(null,null,function*(){if(yield Xt.checkAndInstallApp("app-meta-transmission","Transmission")){const U=ne.Loading(t("配置中..."));we.Guide.transmissionInit.POST({configPath:D,downloadPath:E}).then(q=>{var z;if(q!=null&&q.data){if((q.data.success||0)==0){w.value=1;return}else if((z=q.data)!=null&&z.error)throw q.data.error}throw t("未知错误")}).catch(q=>ne.Error(q)).finally(()=>U.Close())}})},P=D=>{D.preventDefault(),$.Close&&$.Close()},_=D=>{D.preventDefault(),location.reload()};return(D,E)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[w.value==0?(i(),d("div",D9,[e("h2",L9,a(o(t)("下载服务配置向导")),1),e("ul",null,[e("li",null,[e("div",A9,[e("div",N9,[e("span",null,a(o(t)("下载服务:")),1)]),e("div",O9,[W(e("input",{type:"radio",value:"Aria2","onUpdate:modelValue":E[0]||(E[0]=A=>v.value=A),name:"download",id:"Aria2"},null,512),[[Mt,v.value]]),E[13]||(E[13]=e("label",{for:"Aria2"},"Aria2",-1))]),e("div",z9,[W(e("input",{type:"radio",value:"qBittorrent","onUpdate:modelValue":E[1]||(E[1]=A=>v.value=A),name:"download",id:"qB"},null,512),[[Mt,v.value]]),E[14]||(E[14]=e("label",{for:"qB"},"qBittorrent",-1))]),e("div",q9,[W(e("input",{type:"radio",value:"Transmission","onUpdate:modelValue":E[2]||(E[2]=A=>v.value=A),name:"download",id:"Tr"},null,512),[[Mt,v.value]]),E[15]||(E[15]=e("label",{for:"Tr"},"Transmission",-1))])])])]),v.value=="Aria2"?(i(),d("form",{key:0,onSubmit:Ge(S,["prevent"])},[e("ul",null,[e("li",null,[e("div",R9,[e("div",V9,[e("span",B9,[G(va),e("div",null,[e("div",U9,[e("span",F9,a(o(t)("用于放置配置文件的目录。例如:/mnt/sda1/Configs/aria2;请勿使用 /tmp 或 /var ,以免重启以后任务丢失")),1)])])]),e("span",null,a(o(t)("配置目录:")),1)]),e("div",H9,[G(Ta,{modelValue:c.value,"onUpdate:modelValue":E[3]||(E[3]=A=>c.value=A),modelModifiers:{trim:!0},title:o(t)("配置目录"),options:k.value.concat("/root").map(A=>({key:A+"/Configs/aria2"}))},null,8,["modelValue","title","options"])])])]),e("li",null,[e("div",G9,[e("div",j9,[e("span",W9,[G(va),e("div",null,[e("div",J9,[e("span",K9,a(o(t)("用于放置下载文件的目录。例如:/mnt/sda1/download")),1)])])]),e("span",null,a(o(t)("下载目录:")),1)]),e("div",Z9,[G(Ta,{modelValue:r.value,"onUpdate:modelValue":E[4]||(E[4]=A=>r.value=A),modelModifiers:{trim:!0},title:o(t)("下载目录"),options:f.value},null,8,["modelValue","title","options"])])])]),e("li",null,[e("div",Y9,[e("div",Q9,[e("span",X9,[G(va),e("div",null,[e("div",eb,[e("span",tb,a(o(t)("用于远程访问的令牌。")),1)])])]),e("span",null,a(o(t)("RPC 令牌:")),1)]),W(e("input",{type:"text",class:"RPC_input",placeholder:o(t)("请输入RPC令牌"),"onUpdate:modelValue":E[5]||(E[5]=A=>l.value=A)},null,8,nb),[[Oe,l.value,void 0,{trim:!0}]])])]),e("li",null,[e("div",ab,[e("div",sb,[e("span",null,a(o(t)("附加的 BT Tracker:")),1)]),e("div",ob,[W(e("input",{type:"radio",value:"default",name:"BT",id:"default","onUpdate:modelValue":E[6]||(E[6]=A=>p.value=A)},null,512),[[Mt,p.value]]),e("label",lb,a(o(t)("默认")),1)]),e("div",ib,[W(e("input",{type:"radio",value:"add",name:"BT",id:"add","onUpdate:modelValue":E[7]||(E[7]=A=>p.value=A)},null,512),[[Mt,p.value]]),e("label",rb,a(o(t)("自己添加")),1)])])]),e("li",null,[e("div",cb,[E[16]||(E[16]=e("div",{class:"left"},null,-1)),e("div",db,[p.value=="add"?W((i(),d("textarea",{key:0,"onUpdate:modelValue":E[8]||(E[8]=A=>u.value=A),rows:"4",placeholder:o(t)("请输入BT Tracker服务器地址,多个地址使用换行或者英文逗号分隔")},null,8,ub)),[[Oe,u.value,void 0,{trim:!0}]]):T("",!0)])])])])],32)):T("",!0),v.value=="qBittorrent"?(i(),d("form",{key:1,onSubmit:Ge(C,["prevent"])},[e("ul",null,[e("li",null,[e("div",vb,[e("div",pb,[e("span",hb,[G(va),e("div",null,[e("div",mb,[e("span",fb,a(o(t)("用于放置配置文件的目录。例如:/mnt/sda1/Configs/qb;请勿使用 /tmp 或 /var ,以免重启以后任务丢失")),1)])])]),e("span",null,a(o(t)("配置目录:")),1)]),e("div",bb,[G(Ta,{modelValue:h.value,"onUpdate:modelValue":E[9]||(E[9]=A=>h.value=A),modelModifiers:{trim:!0},title:o(t)("配置目录"),options:k.value.concat("/root").map(A=>({key:A+"/Configs/qb"}))},null,8,["modelValue","title","options"])])])]),e("li",null,[e("div",gb,[e("div",_b,[e("span",yb,[G(va),e("div",null,[e("div",kb,[e("span",wb,a(o(t)("用于放置下载文件的目录。例如:/mnt/sda1/download")),1)])])]),e("span",null,a(o(t)("下载目录:")),1)]),e("div",$b,[G(Ta,{modelValue:g.value,"onUpdate:modelValue":E[10]||(E[10]=A=>g.value=A),modelModifiers:{trim:!0},title:o(t)("下载目录"),options:f.value},null,8,["modelValue","title","options"])])])])])],32)):T("",!0),v.value=="Transmission"?(i(),d("form",{key:2,onSubmit:Ge(y,["prevent"])},[e("ul",null,[e("li",null,[e("div",Cb,[e("div",Sb,[e("span",xb,[G(va),e("div",null,[e("div",Pb,[e("span",Tb,a(o(t)("用于放置配置文件的目录。例如:/mnt/sda1/Configs/tr;请勿使用 /tmp 或 /var ,以免重启以后任务丢失")),1)])])]),e("span",null,a(o(t)("配置目录:")),1)]),e("div",Mb,[G(Ta,{modelValue:b.value,"onUpdate:modelValue":E[11]||(E[11]=A=>b.value=A),modelModifiers:{trim:!0},title:o(t)("配置目录"),options:k.value.concat("/root").map(A=>({key:A+"/Configs/transmission"}))},null,8,["modelValue","title","options"])])])]),e("li",null,[e("div",Eb,[e("div",Ib,[e("span",Db,[G(va),e("div",null,[e("div",Lb,[e("span",Ab,a(o(t)("用于放置下载文件的目录。例如:/mnt/sda1/download")),1)])])]),e("span",null,a(o(t)("下载目录:")),1)]),e("div",Nb,[G(Ta,{modelValue:m.value,"onUpdate:modelValue":E[12]||(E[12]=A=>m.value=A),modelModifiers:{trim:!0},title:o(t)("下载目录"),options:f.value},null,8,["modelValue","title","options"])])])])])],32)):T("",!0),e("div",Ob,[v.value=="Aria2"?(i(),d("button",{key:0,class:"cbi-button cbi-button-apply",onClick:S},a(o(t)("启用")),1)):T("",!0),v.value=="qBittorrent"?(i(),d("button",{key:1,class:"cbi-button cbi-button-apply",onClick:C},a(o(t)("启用")),1)):T("",!0),v.value=="Transmission"?(i(),d("button",{key:2,class:"cbi-button cbi-button-apply",onClick:y},a(o(t)("启用")),1)):T("",!0),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:P},a(o(t)("取消")),1)])])):w.value==1?(i(),d("div",zb,[e("h2",qb,a(o(t)("%{status}下载服务配置向导",{status:v.value})),1),e("div",Rb,[G(Qo)]),e("p",Vb,a(o(t)("配置成功!")),1),e("div",Bb,[e("button",{class:"cbi-button cbi-button-apply",onClick:_},a(o(t)("确定")),1)])])):T("",!0)]),_:1},8,["Close"]))}}),Fb=le(Ub,[["__scopeId","data-v-aaa01e06"]]),Hb=s=>Qs(Fb,s),Gb={class:"content service-downloads"},jb={class:"tab"},Wb=["aria-pressed"],Jb=["data-service-state"],Kb=["aria-pressed"],Zb=["data-service-state"],Yb=["aria-pressed"],Qb=["data-service-state"],Xb={key:0,class:"service-idle"},eg=X({__name:"DownloadService",setup(s){const t=window.vue_lang==="en",n=Ys(),{$gettext:l}=Ae(),u=x(!1),c=x("aria2"),r=x(!1),p=C=>{c.value=C,r.value=!0},v=x(),h=()=>{if(r.value)return;const y=["aria2","qbittorrent","transmission"].find(P=>{var _,D;return((D=(_=v.value)==null?void 0:_[P])==null?void 0:D.status)==="running"});c.value=y||"aria2"},g=()=>{we.Guide.DownloadService.Status.GET().then(C=>{var y;if((y=C==null?void 0:C.data)!=null&&y.result){const P=C.data.result;v.value=P,h()}})};if(!fa("download",C=>{v.value=C,h()})){const C=setTimeout(g,800);lt(()=>clearTimeout(C))}x(!1);const b=x(!1),m=()=>{b.value=!b.value},f=()=>{we.Guide.DownloadPartition.List.GET().then(C=>{var P,_;let y=[];(_=(P=C==null?void 0:C.data)==null?void 0:P.result)!=null&&_.partitionList&&(y=C.data.result.partitionList),n(Hb,{services:v.value,partitionList:y,defaultTab:c.value})})},k=(C,y,P)=>B(null,null,function*(){m(),Xt.installAndGo(C,y,P)}),$=()=>{k("app-meta-aria2","Aria2","/cgi-bin/luci/admin/services/aria2")},w=()=>{k("app-meta-qbittorrent","qBittorrent","/cgi-bin/luci/admin/nas/qBittorrent")},S=()=>{k("app-meta-transmission","Transmission","/cgi-bin/luci/admin/services/transmission")};return(C,y)=>(i(),Y(ya,{"home-menu":[{label:o(l)("Aria2高级配置"),action:$},{label:o(l)("qBittorrent高级配置"),action:w},{label:o(l)("Transmission高级配置"),action:S}],title:o(l)("下载服务"),showSettings:!0,onFooterClick:f,style:{width:"100%",height:"100%",display:"block"},"is-settings-menu-open":u.value,"onUpdate:isSettingsMenuOpen":y[3]||(y[3]=P=>u.value=P)},{icon:pe(()=>[G(Ia,{color:"#00a63e",class:"icon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:f},[G(Ia,{color:"#0a0a0a",class:"icon1 downloadIcon",style:{"margin-right":"6px"}}),e("span",null,a(o(l)("下载管理")),1)])]),"settings-menu":pe(()=>[e("div",null,[e("a",{onClick:$},a(o(l)("Aria2高级配置")),1)]),e("div",null,[e("a",{onClick:w},a(o(l)("qBittorrent高级配置")),1)]),e("div",null,[e("a",{onClick:S},a(o(l)("Transmission高级配置")),1)])]),default:pe(()=>{var P,_,D,E,A,U,q,z,N,F,Z,Q,ce,ve,O,de,K,xe,j;return[e("div",Gb,[e("div",jb,[e("button",{type:"button","aria-pressed":c.value=="aria2",class:_e(["item cloud",{active:c.value=="aria2"}]),onClick:y[0]||(y[0]=re=>p("aria2"))},[G(Ia,{color:"#f54900",class:"icon2"}),y[4]||(y[4]=e("div",{class:"title"},"Aria2",-1)),e("span",{"data-service-state":o(zn)((_=(P=v.value)==null?void 0:P.aria2)==null?void 0:_.status)},a(o($n)(o(zn)((E=(D=v.value)==null?void 0:D.aria2)==null?void 0:E.status),t)),9,Jb)],10,Wb),e("button",{type:"button","aria-pressed":c.value=="qbittorrent",class:_e(["item memory",{active:c.value=="qbittorrent"}]),onClick:y[1]||(y[1]=re=>p("qbittorrent"))},[G(Ia,{color:"#4a5565",class:"icon2"}),y[5]||(y[5]=e("div",{class:"title"},"qBittorrent",-1)),e("span",{"data-service-state":o(zn)((U=(A=v.value)==null?void 0:A.qbittorrent)==null?void 0:U.status)},a(o($n)(o(zn)((z=(q=v.value)==null?void 0:q.qbittorrent)==null?void 0:z.status),t)),9,Zb)],10,Kb),e("button",{type:"button","aria-pressed":c.value=="transmission",class:_e(["item network",{active:c.value=="transmission"}]),onClick:y[2]||(y[2]=re=>p("transmission"))},[G(Ia,{color:"#009689",class:"icon2"}),y[6]||(y[6]=e("div",{class:"title"},"Transmission",-1)),e("span",{"data-service-state":o(zn)((F=(N=v.value)==null?void 0:N.transmission)==null?void 0:F.status)},a(o($n)(o(zn)((Q=(Z=v.value)==null?void 0:Z.transmission)==null?void 0:Q.status),t)),9,Qb)],10,Yb)]),((ve=(ce=v.value)==null?void 0:ce[c.value])==null?void 0:ve.status)!=="running"?(i(),d("p",Xb,a(o(O7)((de=(O=v.value)==null?void 0:O[c.value])==null?void 0:de.status,t)),1)):T("",!0),c.value=="aria2"?(i(),Y(a9,{key:1,aria2:(K=v.value)==null?void 0:K.aria2},null,8,["aria2"])):c.value=="qbittorrent"?(i(),Y(b9,{key:2,qbittorrent:(xe=v.value)==null?void 0:xe.qbittorrent},null,8,["qbittorrent"])):c.value=="transmission"?(i(),Y(T9,{key:3,transmission:(j=v.value)==null?void 0:j.transmission},null,8,["transmission"])):T("",!0)])]}),_:1},8,["home-menu","title","is-settings-menu-open"]))}}),tg=le(eg,[["__scopeId","data-v-a1c9e38b"]]),ng={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},ag=["fill"],bo=X({__name:"earth",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",ng,[e("path",{d:"M584.675 134.868C561.143 130.36 536.847 128 512 128a392 392 0 0 0-3.783 0.018l-24.19 169.685A32 32 0 0 1 466.68 321.8l-99.807 49.992-50.81 127.247a32 32 0 0 1-24.45 19.697l-162.145 27.069c8.105 92.926 49.308 176.368 111.754 238.473L223.089 657.52c-2.323-16.238 8.01-31.603 23.924-35.578l226.491-56.558a32 32 0 0 1 30.368 8.407l96.768 96.662a8 8 0 0 0 8.728 1.726l150.425-62.602 31.42-0.772c17.669-0.434 32.343 13.536 32.777 31.204 0.007 0.262 0.01 0.524 0.01 0.786v95.11c45.314-63.03 72-140.351 72-223.906 0-40.5-6.27-79.535-17.891-116.188l-103.215 27.656a32 32 0 0 1-23.36-2.684l-127.842-68.287a32 32 0 0 1-16.712-24.553l-22.305-193.076z m58.509 16.124l18.31 159.176 109.262 56.623 86.458-23.166c-43.44-88.897-120.207-158.532-214.03-192.633z m-336.132 685.8C366.357 874.295 436.644 896 512 896c94.536 0 181.093-34.162 248-90.814V683.96a8 8 0 0 0-11.074-7.386l-138.21 57.53a32 32 0 0 1-34.913-6.903l-99.24-99.132a8 8 0 0 0-7.592-2.102l-178.437 44.563a8 8 0 0 0-5.981 8.894l22.499 157.37zM128.65 489.473l140.726-23.504 49.219-123.244a32 32 0 0 1 15.386-16.744l96.748-48.46 20.65-144.762C275.347 160.675 139.137 308.212 128.65 489.47zM512 960C264.576 960 64 759.424 64 512S264.576 64 512 64s448 200.576 448 448-200.576 448-448 448z",fill:s.color,"p-id":"8679"},null,8,ag)]))}}),sg={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},og=["fill"],lg=["fill"],ig=["fill"],rg=X({__name:"router1",props:{color:{type:String,default:"#4a5565"}},setup(s){return(t,n)=>(i(),d("svg",sg,[e("path",{d:"M909.1 499.1h-797c-27.5 0-50 22.5-50 50v351.5c0 27.5 22.5 50 50 50h797c27.5 0 50-22.5 50-50V549.1c0-27.5-22.5-50-50-50z m-14 387.5h-769V563.1h769v323.5z",fill:s.color,"p-id":"19594"},null,8,og),e("path",{d:"M191.932 734.691a63 63 0 1 0 124.375-20.173 63 63 0 1 0-124.375 20.173zM395.56 774.136a63 63 0 1 0 89.093-89.097 63 63 0 1 0-89.094 89.097zM702.8 296.6c-19.4 0-35.2 8.4-35.2 18.7v198c0 10.3 15.9 18.7 35.2 18.7 19.4 0 35.2-8.4 35.2-18.7v-198c0.1-10.3-15.8-18.7-35.2-18.7z",fill:s.color,"p-id":"19595"},null,8,lg),e("path",{d:"M701.8 218.6c-49.7 0-93.2 31.8-117.7 79.5h41.5c19.3-24.3 46.3-39.5 76.2-39.5 29.9 0 56.9 15.2 76.2 39.5h41.5c-24.4-47.7-68-79.5-117.7-79.5z m5.3-45.5c41.1 0 78.3 15.2 104.8 39.5H869c-33.7-47.7-93.7-79.5-162-79.5s-128.3 31.8-162 79.5h57.1c26.6-24.3 63.8-39.5 105-39.5z",fill:s.color,"p-id":"19596"},null,8,ig)]))}}),cg={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},dg=["fill"],Vl=X({__name:"edit",props:{color:{type:String,default:"#0a0a0a"}},setup(s){return(t,n)=>(i(),d("svg",cg,[e("path",{d:"M526.41 117.029v58.514a7.314 7.314 0 0 1-7.315 7.314H219.429a36.571 36.571 0 0 0-35.987 29.989l-0.585 6.583V804.57a36.571 36.571 0 0 0 29.989 35.987l6.583 0.585H804.57a36.571 36.571 0 0 0 35.987-29.989l0.585-6.583v-317.44a7.314 7.314 0 0 1 7.314-7.314h58.514a7.314 7.314 0 0 1 7.315 7.314v317.44a109.714 109.714 0 0 1-99.182 109.203l-10.533 0.512H219.43a109.714 109.714 0 0 1-109.203-99.182l-0.512-10.533V219.43a109.714 109.714 0 0 1 99.182-109.203l10.533-0.512h299.666a7.314 7.314 0 0 1 7.314 7.315z m307.345 31.817l41.4 41.399a7.314 7.314 0 0 1 0 10.313L419.985 655.726a7.314 7.314 0 0 1-10.313 0l-41.399-41.4a7.314 7.314 0 0 1 0-10.312l455.168-455.168a7.314 7.314 0 0 1 10.313 0z","p-id":"4497",fill:s.color},null,8,dg)]))}}),ug={class:"actioner-container"},vg={class:"actioner-container_header"},pg={class:"actioner-container_body"},hg={class:"label-item"},mg={class:"label_info"},fg={class:"label-item"},bg={class:"label_info"},gg={class:"label-item"},_g={class:"label_info"},yg={class:"label-item"},kg={class:"label_info"},wg={class:"actioner-container_footer"},$g=X({__name:"setup-index",props:{onSetup:{type:Function,required:!0},active:{type:String,default:"ddnsto"}},emits:["update:active"],setup(s,{emit:t}){const{$gettext:n,$ngettext:l}=Ae(),u=s,c=t,r=()=>{u.onSetup()},p=x(u.active),v=()=>{switch(c("update:active",p.value),p.value){case"ddnsto":u.onSetup("ddnsto");break;case"ali":u.onSetup("ddns-ali");break;case"dnspod":u.onSetup("ddns-dnspod");break;case"oray":u.onSetup("ddns-oray");break}};return(h,g)=>(i(),d("div",ug,[e("div",vg,[e("span",null,a(o(n)("域名配置向导")),1)]),e("div",pg,[e("div",hg,[e("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":g[0]||(g[0]=b=>p.value=b),value:"ddnsto"},null,512),[[Mt,p.value]]),e("span",null,a(o(n)("DDNSTO")),1)]),e("p",mg,a(o(n)("DDNSTO 是一个不需要公网IP也可以在外网访问的穿透域名服务,一个浏览器搞定内网穿透,远程访问Openwrt、远程终端、远程桌面...")),1)]),e("div",fg,[e("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":g[1]||(g[1]=b=>p.value=b),value:"ali"},null,512),[[Mt,p.value]]),e("span",null,a(o(n)("阿里云")),1)]),e("p",bg,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1)]),e("div",gg,[e("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":g[2]||(g[2]=b=>p.value=b),value:"dnspod"},null,512),[[Mt,p.value]]),e("span",null,a(o(n)("Dnspod")),1)]),e("p",_g,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1)]),e("div",yg,[e("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":g[3]||(g[3]=b=>p.value=b),value:"oray"},null,512),[[Mt,p.value]]),e("span",null,a(o(n)("花生壳")),1)]),e("p",kg,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1)])]),e("div",wg,[e("div",{class:"close",onClick:r},a(o(n)("取消")),1),e("div",{class:"next",onClick:v},a(o(n)("下一步")),1)])]))}}),Cg=le($g,[["__scopeId","data-v-99e65ae9"]]),Sg={class:"actioner-container"},xg={class:"actioner-container_body"},Pg={class:"body-title"},Tg={class:"body-tips"},Mg={class:"body-info"},Eg=["href"],Ig={href:"/cgi-bin/luci/admin/services/ddns",target:"_blank"},Dg={class:"actioner-container_footer"},Lg=X({__name:"setup-ddns-success",props:{target:{type:String,required:!0},onSetup:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=()=>{localStorage.setItem("firstOpen",JSON.stringify(!0)),location.reload()};return(u,c)=>(i(),d("div",Sg,[e("div",xg,[c[0]||(c[0]=e("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":""},[e("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)),e("div",Pg,a(o(t)("添加成功")),1),e("p",Tg,a(o(t)("请稍等1分钟生效后再使用。")),1),e("div",Mg,[e("span",null,a(o(t)("访问地址:")),1),e("a",{href:s.target,target:"_blank",rel:"noopener noreferrer"},a(s.target),9,Eg)]),e("div",null,[e("span",null,a(o(t)("可前往")),1),e("a",Ig,a(o(t)("服务-动态DNS")),1),e("span",null,a(o(t)("查看更多详情")),1)])]),e("div",Dg,[e("div",{class:"close",onClick:l},a(o(t)("关闭")),1)])]))}}),Ag=le(Lg,[["__scopeId","data-v-ea162d2f"]]),Ng={class:"actioner-container"},Og={class:"actioner-container_header"},zg={class:"actioner-container_footer"},qg=X({__name:"setup-ddnsto-login",props:{onSetup:{type:Function,required:!0},onDdnstoConfig:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.onSetup()},c=r=>{if(r.data.auth=="ddnsto"){const p=r.data.sign,v=r.data.token;p&&v&&(removeEventListener("message",c),l.onDdnstoConfig(p,v),l.onSetup("ddnsto-run"))}};return nt(()=>{window.addEventListener("message",c)}),lt(()=>{removeEventListener("message",c)}),(r,p)=>(i(),d("div",Ng,[e("div",Og,[e("span",null,a(o(t)("域名配置向导")),1)]),p[0]||(p[0]=e("div",{class:"actioner-container_body ddnsto-login"},[e("iframe",{src:"https://www.kooldns.cn/bind/#/auth?send=1&source=openwrt&callback=*"})],-1)),e("div",zg,[e("div",{class:"close",onClick:u},a(o(t)("取消")),1)])]))}}),Rg=le(qg,[["__scopeId","data-v-ce7dc31a"]]),Vg={class:"actioner-container"},Bg={class:"actioner-container_header"},Ug={class:"actioner-container_body ddnsto-bind"},Fg=["src"],Hg=X({__name:"setup-ddnsto-bind",props:{onSetup:{type:Function,required:!0},config:{type:Object,required:!0},domain:{type:String,required:!0}},emits:["update:domain"],setup(s,{emit:t}){const{$gettext:n,$ngettext:l}=Ae(),u=s,c=t,r=R(()=>{const{domain:h,token:g,sign:b,routerId:m,netaddr:f}=u.config,k=encodeURIComponent(h),$=encodeURIComponent(f);return`https://www.kooldns.cn/bind/#/domain?domain=${k}&sign=${b}&token=${g}&routerId=${m}&netaddr=${$}`}),p=h=>{if(h.data){const{auth:g,url:b}=h.data;g==="ddnsto"&&b&&v(b)}},v=h=>B(null,null,function*(){var g;try{const b=yield we.Guide.DdnstoAddress.POST({address:h});b!=null&&b.data&&(((g=b==null?void 0:b.data)==null?void 0:g.success)||0)==0&&(c("update:domain",h),u.onSetup("ddnsto-save"))}catch(b){}});return nt(()=>{window.addEventListener("message",p)}),lt(()=>{removeEventListener("message",p)}),(h,g)=>(i(),d("div",Vg,[e("div",Bg,[e("span",null,a(o(n)("域名配置向导")),1)]),e("div",Ug,[e("iframe",{src:r.value},null,8,Fg)])]))}}),Gg=le(Hg,[["__scopeId","data-v-8084ff19"]]),jg={class:"actioner-container"},Wg={class:"actioner-container_body"},Jg={class:"body-title"},Kg={class:"body-tips"},Zg={class:"body-info"},Yg=["href"],Qg={href:"https://www.ddnsto.com/app/#/devices",target:"_blank"},Xg={class:"actioner-container_footer"},e_=X({__name:"setup-ddnsto-save",props:{onSetup:{type:Function,required:!0},target:{type:String,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=()=>{localStorage.setItem("firstOpen",JSON.stringify(!0)),location.reload()};return(u,c)=>(i(),d("div",jg,[e("div",Wg,[c[0]||(c[0]=e("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":""},[e("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)),e("div",Jg,a(o(t)("添加成功")),1),e("p",Kg,a(o(t)("请稍等1分钟生效后再使用。")),1),e("div",Zg,[e("span",null,a(o(t)("访问地址:")),1),e("a",{href:s.target,target:"_blank",rel:"noopener noreferrer"},a(s.target),9,Yg)]),e("div",null,[e("span",null,a(o(t)("可前往")),1),e("a",Qg,a(o(t)("DDNSTO控制台")),1),e("span",null,a(o(t)("查看更多详情")),1)])]),e("div",Xg,[e("div",{class:"close",onClick:l},a(o(t)("关闭")),1)])]))}}),t_=le(e_,[["__scopeId","data-v-82ebe368"]]),n_={class:"actioner-container"},a_={class:"actioner-container_header"},s_={class:"actioner-container_body"},o_={class:"actioner-container_footer"},l_=X({__name:"setup-ddnsto-install",props:{onSetup:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.onSetup()},c=()=>B(null,null,function*(){if(v.value)return;v.value=!0;const g=ne.Loading(t("安装中..."));try{if(yield Xt.installApp("app-meta-ddnsto",30)){l.onSetup("ddnsto-login");return}else r.value=t("安装失败")}catch(b){r.value=b}finally{g.Close()}v.value=!1}),r=x(t("正在检测中...")),p=x(!1),v=x(!1);return B(null,null,function*(){try{const g=yield we.App.Check.POST({name:"ddnsto"});if(g!=null&&g.data){const{result:b,error:m}=g.data;if(m){r.value=m;return}if(b){if(b.status=="installed"){l.onSetup("ddnsto-login");return}b.status=="uninstalled"&&(r.value=t("需要安装DDNSTO插件,点击“确定”开始安装"))}}}catch(g){r.value=g}p.value=!0}),(g,b)=>(i(),d("div",n_,[e("div",a_,[e("span",null,a(o(t)("域名配置向导")),1)]),e("div",s_,[e("span",null,a(r.value),1)]),e("div",o_,[p.value?(i(),d(V,{key:0},[e("div",{class:"close",onClick:u},a(o(t)("取消")),1),e("div",{class:"next",onClick:c},a(o(t)("确定")),1)],64)):T("",!0)])]))}}),i_=le(l_,[["__scopeId","data-v-11e7f6d6"]]),r_={class:"actioner-container"},c_={class:"actioner-container_header"},d_={class:"actioner-container_body"},u_=X({__name:"setup-ddnsto-run",props:{onSetup:{type:Function,required:!0},token:{type:String,required:!0},onDdnstoLocalConfig:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(t("正在检测插件是否已启动..."));(g=>B(null,null,function*(){var b;try{const m=yield we.Guide.Ddnsto.POST({token:l.token});m!=null&&m.data&&(m.data.error&&(u.value=m.data.error),(((b=m==null?void 0:m.data)==null?void 0:b.success)||0)==0&&p())}catch(m){u.value=m}}))(l.token);const r=x(),p=()=>{const g=()=>B(null,null,function*(){if((yield v())===!0){h();return}r.value=window.setTimeout(g,2e3)});g()},v=()=>B(null,null,function*(){try{const g=yield we.App.Check.POST({name:"ddnsto",checkRunning:!0});if(g!=null&&g.data){g.data.error&&(u.value=g.data.error);const b=g.data.result;if((b==null?void 0:b.status)=="running")return!0}}catch(g){u.value=g}return!1});lt(()=>{r.value&&clearInterval(r.value)});const h=()=>B(null,null,function*(){var g;try{const b=yield we.Guide.DdntoConfig.GET();if(b!=null&&b.data&&(b.data.error&&(u.value=b.data.error),(((g=b==null?void 0:b.data)==null?void 0:g.success)||0)==0&&b.data.result)){const m=b.data.result;l.onDdnstoLocalConfig(m.netAddr,m.deviceId),l.onSetup("ddnsto-bind")}}catch(b){u.value=b}});return(g,b)=>(i(),d("div",r_,[e("div",c_,[e("span",null,a(o(t)("域名配置向导")),1)]),e("div",d_,a(u.value),1)]))}}),v_=le(u_,[["__scopeId","data-v-cc67b1f4"]]),p_={class:"action-main"},h_=X({__name:"index",props:{Close:{type:Function,required:!0},url:{type:String,required:!0}},setup(s){const t=s,n=x("ddnsto-install"),l=v=>{v!=null?n.value=v:u()},u=()=>{t.Close&&t.Close()},c=Xe({sign:"",token:"",domain:t.url,netaddr:"",routerId:""}),r=(v,h)=>{c.sign=v,c.token=h},p=(v,h)=>{c.netaddr=v,c.routerId=h};return(v,h)=>(i(),Y(Nt,{type:1},{default:pe(()=>[e("div",p_,[n.value=="ddnsto-install"?(i(),Y(i_,{key:0,onSetup:l})):n.value=="ddnsto-login"?(i(),Y(Rg,{key:1,onSetup:l,onDdnstoConfig:r})):n.value=="ddnsto-run"?(i(),Y(v_,{key:2,onSetup:l,token:c.token,onDdnstoLocalConfig:p},null,8,["token"])):n.value=="ddnsto-bind"?(i(),Y(Gg,{key:3,onSetup:l,config:{token:c.token,sign:c.sign,domain:c.domain,netaddr:c.netaddr,routerId:c.routerId},domain:c.domain,"onUpdate:domain":h[0]||(h[0]=g=>c.domain=g)},null,8,["config","domain"])):n.value=="ddnsto-save"?(i(),Y(t_,{key:4,onSetup:l,target:c.domain},null,8,["target"])):T("",!0)])]),_:1}))}}),m_=le(h_,[["__scopeId","data-v-d55b4654"]]),f_=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(m_,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},b_={class:"action"},g_={class:"action-header"},__={class:"action-body"},y_={class:"action-footer"},k_=X({__name:"index",props:{Close:Function,next:{type:Function},clear:{type:Function},continuer:{type:Function},nextTitle:{type:String},clearTitle:{type:String},continuerTitle:{type:String},title:{type:String},content:{type:String}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.next&&l.next(),l.Close&&l.Close()},c=()=>{l.clear&&l.clear(),l.Close&&l.Close()},r=()=>{l.continuer&&l.continuer(),l.Close&&l.Close()};return(p,v)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[e("div",b_,[e("div",g_,a(s.title||o(t)("提示")),1),e("div",__,a(s.content),1),e("div",y_,[s.clear?(i(),d("div",{key:0,class:"clear",onClick:c},a(s.clearTitle||o(t)("返回")),1)):T("",!0),e("div",{class:"next",onClick:u},a(s.nextTitle||o(t)("确定")),1),s.continuer?(i(),d("div",{key:1,class:"next",onClick:r},a(s.continuerTitle||o(t)("继续保存")),1)):T("",!0)])])]),_:1},8,["Close"]))}}),w_=le(k_,[["__scopeId","data-v-ceabb82b"]]),qs=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(w_,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},$_={class:"actioner-container"},C_={class:"actioner-container_header"},S_={key:0,class:"title_info"},x_={href:"https://doc.linkease.com/zh/guide/istoreos/basic/domain.html#%E9%98%BF%E9%87%8C%E4%BA%91",target:"_blank"},P_={key:1,class:"title_info"},T_={href:"https://doc.linkease.com/zh/guide/istoreos/basic/domain.html#dnspod",target:"_blank"},M_={key:2,class:"title_info"},E_={href:"https://doc.linkease.com/zh/guide/istoreos/basic/domain.html#%E8%8A%B1%E7%94%9F%E5%A3%B3",target:"_blank"},I_={class:"label-item"},D_={class:"label-item_key"},L_={class:"label-item_value"},A_={value:"ipv4"},N_={value:"ipv6"},O_={class:"label_tips"},z_={class:"info"},q_={class:"label-item"},R_={class:"label-item_key"},V_={class:"label-item_value"},B_={class:"label-item"},U_={class:"label-item_key"},F_={class:"label-item_value"},H_=["placeholder"],G_={class:"label-item"},j_={class:"label-item_key"},W_={class:"label-item_value"},J_=["placeholder"],K_={class:"actioner-container_footer"},Z_=["disabled"],Y_=X({__name:"setup-ddns",props:{name:{type:String,default:"ali"},onSetup:{type:Function,required:!0},target:{type:String,required:!0}},emits:["update:target"],setup(s,{emit:t}){const{$gettext:n,$ngettext:l}=Ae(),u=s,c=t,r=x("ipv4"),p=x(u.name),v=x(""),h=x(""),g=x(""),b=x(!1),m=()=>{u.onSetup("index")},f=()=>{b.value=!0;const S=ne.Loading(n("检测中..."));we.Network.CheckPublickNet.POST({ipVersion:r.value}).then(C=>{var y,P;if(C!=null&&C.data){if((y=C==null?void 0:C.data)!=null&&y.error){ne.Warning(C==null?void 0:C.data.error);return}if((((P=C==null?void 0:C.data)==null?void 0:P.success)||0)==0){const _=C.data.result;_&&_.address?w():k();return}}throw n("未知错误")}).catch(C=>{ne.Error(C)}).finally(()=>{S.Close(),b.value=!1})},k=()=>{qs({title:n("温馨提示"),nextTitle:n("使用DDNSTO"),continuerTitle:n("继续保存"),content:n("检测到您的wan口没有公网IP或者IPv6地址,可以使用DDNSTO配置远程域名访问"),next(){$()},continuer(){w()},clear(){}})},$=()=>{u.onSetup("ddnsto")},w=()=>{b.value=!0;const S=ne.Loading(n("配置中..."));we.Guide.PostDdns.POST({ipVersion:r.value,serviceName:p.value,domain:v.value,userName:h.value,password:g.value}).then(C=>{if(C!=null&&C.data){const{error:y,scope:P,success:_}=C.data;if(y=="-100"&&P=="guide.ddns"){qs({title:n("温馨提示"),content:n("检测到你有未保存的配置,可前往页面右上角点击查看,保存并应用或者恢复配置后继续"),next(){}});return}if(y){ne.Warning(y);return}if((_||0)==0){c("update:target",v.value),u.onSetup("ddns-success");return}}throw n("未知错误")}).catch(C=>{ne.Error(C)}).finally(()=>{S.Close(),b.value=!1})};return(S,C)=>(i(),d("div",$_,[e("form",{class:"actioner-dns",onSubmit:Ge(f,["prevent"])},[e("div",C_,[e("span",null,a(o(n)("域名配置向导")),1)]),e("div",{class:_e(["actioner-container_body",s.name])},[s.name=="ali"?(i(),d("div",S_,[e("p",null,a(o(n)("阿里云")),1),e("span",null,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1),e("a",x_,a(o(n)("查看教程"))+">>",1)])):s.name=="dnspod"?(i(),d("div",P_,[e("p",null,a(o(n)("dnspod")),1),e("span",null,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1),e("a",T_,a(o(n)("查看教程"))+">>",1)])):s.name=="oray"?(i(),d("div",M_,[e("p",null,a(o(n)("花生壳")),1),e("span",null,a(o(n)("为拥有动态IP的主机配置一个固定的可访问域名")),1),e("a",E_,a(o(n)("查看教程"))+">>",1)])):T("",!0),e("div",I_,[e("div",D_,[e("span",null,a(o(n)("IP地址版本:")),1)]),e("div",L_,[W(e("select",{name:"",id:"","onUpdate:modelValue":C[0]||(C[0]=y=>r.value=y)},[e("option",A_,a(o(n)("IPv4地址")),1),e("option",N_,a(o(n)("IPv6地址")),1)],512),[[Be,r.value]])]),e("div",O_,[C[4]||(C[4]=Hn('',1)),e("span",z_,a(o(n)("设定哪一个 IP 地址(IPv4 或 IPv6)会被发送给 DDNS 提供商")),1)])]),e("div",q_,[e("div",R_,[e("span",null,a(o(n)("域名:")),1)]),e("div",V_,[W(e("input",{type:"text",placeholder:"myhost.example.com","onUpdate:modelValue":C[1]||(C[1]=y=>v.value=y),required:""},null,512),[[Oe,v.value,void 0,{trim:!0}]])])]),e("div",B_,[e("div",U_,[e("span",null,a(o(n)("用户名:")),1)]),e("div",F_,[W(e("input",{type:"text","onUpdate:modelValue":C[2]||(C[2]=y=>h.value=y),placeholder:o(n)("请输入用户名"),required:""},null,8,H_),[[Oe,h.value,void 0,{trim:!0}]])])]),e("div",G_,[e("div",j_,[e("span",null,a(o(n)("密码:")),1)]),e("div",W_,[W(e("input",{type:"password","onUpdate:modelValue":C[3]||(C[3]=y=>g.value=y),placeholder:o(n)("请输入密码"),required:""},null,8,J_),[[Oe,g.value,void 0,{trim:!0}]])])])],2),e("div",K_,[e("div",{class:"close",onClick:m,type:"button"},a(o(n)("返回")),1),e("button",{class:"next save",type:"submit",disabled:b.value},a(o(n)("保存")),9,Z_)])],32)]))}}),go=le(Y_,[["__scopeId","data-v-9817991d"]]),Q_={class:"action-main"},X_=X({__name:"index",props:{Close:{type:Function,required:!0},url:{type:String,required:!0}},setup(s){const t=s,n=x(""),l=x("index"),u=v=>{if(v!=null){if(v=="ddnsto"){c();return}l.value=v}else r()},c=()=>{r(),f_({url:t.url})},r=()=>{t.Close&&t.Close()},p=x("ddnsto");return(v,h)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[e("div",Q_,[l.value=="index"?(i(),Y(Cg,{key:0,onSetup:u,active:p.value,"onUpdate:active":h[0]||(h[0]=g=>p.value=g)},null,8,["active"])):l.value=="ddns-ali"?(i(),Y(go,{key:1,onSetup:u,target:n.value,"onUpdate:target":h[1]||(h[1]=g=>n.value=g),name:"ali"},null,8,["target"])):l.value=="ddns-dnspod"?(i(),Y(go,{key:2,onSetup:u,target:n.value,"onUpdate:target":h[2]||(h[2]=g=>n.value=g),name:"dnspod"},null,8,["target"])):l.value=="ddns-oray"?(i(),Y(go,{key:3,onSetup:u,target:n.value,"onUpdate:target":h[3]||(h[3]=g=>n.value=g),name:"oray"},null,8,["target"])):l.value=="ddns-success"?(i(),Y(Ag,{key:4,onSetup:u,target:n.value},null,8,["target"])):T("",!0)])]),_:1},8,["Close"]))}}),ey=le(X_,[["__scopeId","data-v-8c90412c"]]),ty=s=>Qs(ey,s),ny={class:"content service-remote"},ay={class:"tab"},sy=["aria-pressed"],oy=["data-service-state"],ly=["aria-pressed"],iy=["data-service-state"],ry=["aria-pressed"],cy=["data-service-state"],dy={key:0,class:"remote-details"},uy={class:"remote-address-heading"},vy={class:"remote-console",href:"https://www.kooldns.cn/app/#/devices",target:"_blank",rel:"noopener noreferrer"},py=["href","title"],hy={key:1,class:"service-idle"},my={class:"remote-description"},fy={key:1,class:"remote-details"},by={class:"remote-address-heading"},gy=["aria-label"],_y={key:0,class:"service-idle"},yy=["href"],ky={class:"remote-description"},wy={key:2,class:"remote-details"},$y={class:"remote-address-heading"},Cy=["aria-label"],Sy={key:0,class:"service-idle"},xy=["href"],Py={class:"remote-description"},Ty=X({__name:"RemoteDomain",setup(s){const t=window.vue_lang==="en",n=(C,y)=>t?y:C,l=Ys(),{$gettext:u}=Ae(),c=x(0),r=x(!1),p=C=>{c.value=C,r.value=!0},v=C=>!!(C&&C!=="Stopped"&&C!=="Disabled"),h=()=>{if(r.value)return;const y=[{index:0,active:!!m.value.ddnstoDomain},{index:1,active:v(m.value.ipv4Domain)},{index:2,active:v(m.value.ipv6Domain)}].find(P=>P.active);c.value=y?y.index:0};let g=!1,b;const m=x({}),f=function(){g&&(document.hidden?Promise.resolve():we.Guide.GetDdns.GET().then(C=>{var y;C!=null&&C.data&&(((y=C==null?void 0:C.data)==null?void 0:y.success)||0)==0&&C.data.result&&(m.value=C.data.result,h())})).then(()=>{g&&(b=window.setTimeout(f,3e3))})},k=fa("remote",C=>{m.value=C,h()});nt(()=>{k||(g=!0,b=window.setTimeout(f,1100))}),lt(()=>{b!==void 0&&window.clearTimeout(b),g=!1});const $=()=>{l(ty,{url:m.value.ddnstoDomain})},w=R(()=>{const C=m.value.ipv4Domain;return!C||C=="Stopped"||C=="Disabled"?C:`http://${C}`}),S=R(()=>{const C=m.value.ipv6Domain;return!C||C=="Stopped"||C=="Disabled"?C:`http://${C}`});return(C,y)=>(i(),Y(ya,{title:o(u)("远程域名"),showSettings:!0,style:{width:"100%",height:"100%",display:"block"}},{icon:pe(()=>[G(bo,{color:"#00a63e",class:"icon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:$},[G(bo,{color:"#0a0a0a",class:"icon1 earthIcon",style:{"margin-right":"6px"}}),ue(a(o(u)("域名配置")),1)])]),default:pe(()=>{var P,_,D,E,A,U,q,z,N,F;return[e("div",ny,[e("div",ay,[e("button",{type:"button","aria-pressed":c.value==0,class:_e(["item cloud",{active:c.value==0}]),onClick:y[0]||(y[0]=Z=>p(0))},[G(bo,{color:"#155dfc",class:"icon2"}),y[3]||(y[3]=e("div",{class:"title"},"DDNSTO",-1)),e("span",{"data-service-state":o(Jn)((P=m.value)==null?void 0:P.ddnstoDomain)},a(o($n)(o(Jn)((_=m.value)==null?void 0:_.ddnstoDomain),t)),9,oy)],10,sy),w.value?(i(),d("button",{key:0,type:"button","aria-pressed":c.value==1,class:_e(["item memory",{active:c.value==1}]),onClick:y[1]||(y[1]=Z=>p(1))},[G(Mi,{color:"#00a63e",class:"icon2"}),y[4]||(y[4]=e("div",{class:"title"},"IPv4",-1)),e("span",{"data-service-state":o(Jn)((D=m.value)==null?void 0:D.ipv4Domain)},a(o($n)(o(Jn)((E=m.value)==null?void 0:E.ipv4Domain),t)),9,iy)],10,ly)):T("",!0),S.value?(i(),d("button",{key:1,type:"button","aria-pressed":c.value==2,class:_e(["item network",{active:c.value==2}]),onClick:y[2]||(y[2]=Z=>p(2))},[G(rg,{class:"icon2"}),y[5]||(y[5]=e("div",{class:"title"},"IPv6",-1)),e("span",{"data-service-state":o(Jn)((A=m.value)==null?void 0:A.ipv6Domain)},a(o($n)(o(Jn)((U=m.value)==null?void 0:U.ipv6Domain),t)),9,cy)],10,ry)):T("",!0)]),c.value==0?(i(),d("div",dy,[e("div",uy,[e("span",null,a(n("访问地址","Access address")),1),e("a",vy,a(o(u)("控制台")),1)]),(q=m.value)!=null&&q.ddnstoDomain?(i(),d("a",{key:0,class:"remote-address",href:(z=m.value)==null?void 0:z.ddnstoDomain,target:"_blank",rel:"noopener noreferrer",title:(N=m.value)==null?void 0:N.ddnstoDomain},a((F=m.value)==null?void 0:F.ddnstoDomain),9,py)):(i(),d("p",hy,a(n("尚未配置访问地址。","No access address is configured.")),1)),e("p",my,a(o(u)("智能内网穿透服务")),1)])):T("",!0),c.value==1?(i(),d("div",fy,[e("div",by,[e("span",null,"IPv4 "+a(n("访问地址","Access address")),1),w.value?(i(),d("a",{key:0,class:"remote-console",href:"/cgi-bin/luci/admin/services/ddns","aria-label":n("配置 IPv4 动态域名","Configure IPv4 DDNS")},[G(Vl,{class:"icon3"}),ue(a(n("配置","Configure")),1)],8,gy)):T("",!0)]),w.value=="Stopped"||w.value=="Disabled"?(i(),d("p",_y,a(n("尚无可用访问地址,请检查域名配置。","No access address is available. Check domain settings.")),1)):(i(),d("a",{key:1,class:"remote-address",href:w.value,target:"_blank",rel:"noopener noreferrer"},a(w.value),9,yy)),e("p",ky,a(o(u)("动态域名解析")),1)])):T("",!0),c.value==2?(i(),d("div",wy,[e("div",$y,[e("span",null,"IPv6 "+a(n("访问地址","Access address")),1),S.value?(i(),d("a",{key:0,class:"remote-console",href:"/cgi-bin/luci/admin/services/ddns","aria-label":n("配置 IPv6 动态域名","Configure IPv6 DDNS")},[G(Vl,{class:"icon3"}),ue(a(n("配置","Configure")),1)],8,Cy)):T("",!0)]),S.value=="Stopped"||S.value=="Disabled"?(i(),d("p",Sy,a(n("尚无可用访问地址,请检查域名配置。","No access address is available. Check domain settings.")),1)):(i(),d("a",{key:1,class:"remote-address",href:S.value,target:"_blank",rel:"noopener noreferrer"},a(S.value),9,xy)),e("p",Py,a(o(u)("动态域名解析")),1)])):T("",!0)])]}),_:1},8,["title"]))}}),My=le(Ty,[["__scopeId","data-v-72b8c1d6"]]),Ey={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Iy=["fill"],Dy=["fill"],Ai=X({__name:"chip",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",Ey,[e("path",{d:"M577.78 355.55H449.62c-52.93 0-96 43.07-96 96V579.7c0 52.93 43.07 96 96 96h128.15c52.93 0 96-43.07 96-96V451.55c0.01-52.93-43.06-96-95.99-96z m32 224.15c0 17.64-14.36 32-32 32H449.62c-17.65 0-32-14.36-32-32V451.55c0-17.65 14.35-32 32-32h128.15c17.64 0 32 14.35 32 32V579.7z",fill:s.color,"p-id":"5378"},null,8,Iy),e("path",{d:"M927.33 547.13c17.67 0 32-14.33 32-32s-14.33-32-32-32h-62.44V355.2h62.44c17.67 0 32-14.33 32-32s-14.33-32-32-32h-64.37c-10.34-64.43-61.3-115.45-125.69-125.87v-64.19c0-17.67-14.33-32-32-32s-32 14.33-32 32v62.22H545.34v-62.22c0-17.67-14.33-32-32-32s-32 14.33-32 32v62.22H353.2v-62.22c0-17.67-14.33-32-32-32s-32 14.33-32 32v64.16c-64.46 10.37-115.49 61.42-125.83 125.9H99.14c-17.67 0-32 14.33-32 32s14.33 32 32 32h62.3v127.93h-62.3c-17.67 0-32 14.33-32 32s14.33 32 32 32h62.3v128.14h-62.3c-17.67 0-32 14.33-32 32s14.33 32 32 32h64.28c10.45 64.34 61.42 115.25 125.79 125.61v64.46c0 17.67 14.33 32 32 32s32-14.33 32-32v-62.51h128.14v62.51c0 17.67 14.33 32 32 32s32-14.33 32-32v-62.51h127.93v62.51c0 17.67 14.33 32 32 32s32-14.33 32-32v-64.48c64.3-10.41 115.2-61.29 125.64-125.58h64.42c17.67 0 32-14.33 32-32s-14.33-32-32-32H864.9V547.13h62.43zM800.89 714.82c0 48.52-39.48 88-88 88H313.44c-48.52 0-88-39.48-88-88V315.36c0-48.52 39.48-88 88-88H712.9c48.52 0 88 39.48 88 88v399.46z",fill:s.color,"p-id":"5379"},null,8,Dy)]))}}),Ly={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Ay=["fill"],Ny=X({__name:"temperature",props:{color:{type:String,default:"#ef4444"}},setup(s){return(t,n)=>(i(),d("svg",Ly,[e("path",{d:"M520 75c72.899 0 132.133 58.543 133.31 131.209l0.018 2.206v399.237C700.759 646.978 729 705.514 729 768.714c0 84.846-50.493 157.892-123.051 190.69C579.509 971.959 549.966 979 518.85 979c-57.133 0-108.962-23.737-146.008-61.784C334.65 879.324 311 826.783 311 768.714c0-63.27 28.313-121.806 75.67-161.065l0.002-399.234C386.672 134.732 446.365 75 520 75z m0 59.807c-40.22 0-72.9 32.3-73.55 72.39l-0.01 1.218v403.457c4.008 12.048-0.02 25.747-10.721 33.573l-0.619 0.441c-40.008 27.753-64.332 73.214-64.332 122.828 0 82.472 66.813 149.33 149.232 149.33s149.232-66.858 149.232-149.33c0-47.591-22.367-91.397-59.645-119.44l-1.134-0.846a29.773 29.773 0 0 1-10.972-15.751 29.763 29.763 0 0 1-3.913-14.111l-0.008-0.706V208.415c0-40.653-32.934-73.608-73.56-73.608z m-2.299 236.926c4.41 0 8.66 0.69 12.647 1.968 16.826 4.965 29.19 20.52 29.19 38.81l0.002 240.184c47.972 17.182 82.294 63.07 82.294 116.982 0 6.94-0.568 13.747-1.662 20.376-6.746 60.536-58.728 108.02-121.321 108.02-47.223 0-88.407-27.027-108.683-66.296-10.557-18.27-16.6-39.479-16.6-62.1 0-54.083 34.542-100.093 82.754-117.145l0.002-239.422c0-22.852 18.525-41.377 41.377-41.377z",fill:s.color,"p-id":"4599"},null,8,Ay)]))}}),Oy={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},zy=["fill"],Ni=X({__name:"lightning",props:{color:{type:String,default:"#222222"}},setup(s){return(t,n)=>(i(),d("svg",Oy,[e("path",{d:"M760.1 64l-150 262.7-41 71.8c-6.1 10.7 1.6 23.9 13.9 23.9h104.7c13.9 0 21.2 16.6 11.8 26.9L410.8 761.9l59.5-178.5 21.1-63.2c3.5-10.4-4.3-21.1-15.2-21.1H277.8c-11.6 0-19.4-12-14.6-22.6l179-393.8c5.2-11.4 16.6-18.8 29.1-18.8h288.8M450.8 0c-25.1 0-47.9 14.7-58.3 37.5L194.7 472.7c-19.3 42.4 11.7 90.5 58.3 90.5h145.5c5.5 0 9.3 5.3 7.6 10.5L256 1024l515.3-558.2c37.8-41 8.8-107.4-47-107.4h-44.8c-6.1 0-10-6.6-6.9-12L870.4 0H450.8z","p-id":"4712",fill:s.color},null,8,zy)]))}}),qy={key:0,class:"center-content"},Ry=X({__name:"PieChart",props:{value:{},color:{},icon:{},label:{},width:{},height:{}},setup(s){Yl([Br,Ql,Xl]);const t=s,n=x(null);let l=null,u=null;function c(h,g){return{tooltip:{show:!1},series:[{type:"pie",radius:["75%","90%"],avoidLabelOverlap:!1,label:{show:!1},labelLine:{show:!1},z:1,zlevel:0,data:[{value:h,itemStyle:{color:g||"#409EFF"}},{value:Math.max(0,100-h),itemStyle:{color:$s()?"#414b59":"#f0f0f0"}}]}]}}const r=()=>{n.value&&(u=$s()?"dark":"light",l=l!=null?l:ei(n.value,u==="dark"?"dark":"v5"),l.setOption(c(t.value,t.color)))};nt(()=>B(null,null,function*(){yield ot(),r(),v=is(h=>{l&&u!==h.effective&&(l.dispose(),l=null,r())}),window.addEventListener("resize",p)}));function p(){l==null||l.resize()}We(()=>[t.value,t.color],()=>{l?l.setOption({series:[{z:1,zlevel:0,data:[{value:t.value,itemStyle:{color:t.color||"#409EFF"}},{value:Math.max(0,100-t.value),itemStyle:{color:$s()?"#414b59":"#f0f0f0"}}]}]}):r()},{immediate:!0});let v=()=>{};return ga(()=>{window.removeEventListener("resize",p),v(),l==null||l.dispose(),l=null}),(h,g)=>(i(),d("div",{class:"pie-chart-wrapper",style:pt({width:s.width||"120px",height:s.height||"120px"})},[e("div",{ref_key:"chartDom",ref:n,class:"chart-dom"},null,512),s.icon||s.label?(i(),d("div",qy,[s.icon==="chip"?(i(),Y(Ai,{key:0,color:s.color,class:"center-icon"},null,8,["color"])):s.icon==="temperature"?(i(),Y(Ny,{key:1,color:s.color,class:"center-icon"},null,8,["color"])):s.icon==="lightning"?(i(),Y(Ni,{key:2,color:s.color,class:"center-icon"},null,8,["color"])):T("",!0),s.label?(i(),d("div",{key:3,class:"center-label",style:pt({color:s.color})},a(s.label),5)):T("",!0)])):T("",!0)],4))}}),_o=le(Ry,[["__scopeId","data-v-ab88bb4d"]]),Vy={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},By=["fill"],Rs=X({__name:"computer",props:{color:{type:String,default:"#0a0a0a"}},setup(s){return(t,n)=>(i(),d("svg",Vy,[e("path",{d:"M868.95177918 215.34678468H274.11312994c-10.26749627 0-19.00277466 3.6151618-26.30943653 10.88910739-7.22487113 7.23032433-10.89456058 15.97650768-10.89456059 26.20583515v370.75858453c0 10.24023245 3.66968946 18.95370022 10.89456059 26.22764579 7.30666259 7.22487113 16.04194099 10.86184429 26.30943653 10.86184429h594.83864924c10.28385442 0 19.04094415-3.63697315 26.28217344-10.86184429 7.30120941-7.27394558 10.9218244-15.98741334 10.92182439-26.22764579V252.44172722c0-10.2293275-3.62061501-18.97551083-10.92727686-26.20583516-7.23577681-7.27394558-15.99286582-10.8891081-26.27672097-10.88910738M274.09131931 141.21142578h594.83864924c30.77522572 0 57.07375657 10.86729676 78.86287773 32.59643853 21.78912116 21.74004671 32.66187112 47.91861806 32.66187114 78.62841045v370.76403699c0 30.68798176-10.87274996 56.91562756-32.66187114 78.63386293-21.78912116 21.72914105-48.08765274 32.59643853-78.86287773 32.59643851H608.68737796v74.15716953h111.5465602c10.26204379 0 19.03003849 3.6151618 26.28217344 10.8891081 7.29030445 7.22487113 10.91091874 15.97650768 10.91091872 26.20583518 0 10.24023245-3.62061501 18.98641651-10.91637192 26.20038195-7.25213496 7.28485125-16.01467717 10.90001305-26.27672024 10.90001379H422.80370787c-10.27840195 0-19.0191328-3.6151618-26.30943728-10.90001379-7.25213496-7.21396618-10.89456058-15.96014952-10.89456056-26.20038195 0-10.23477998 3.6478781-18.97551083 10.89456056-26.20583518 7.29030445-7.27394558 16.03103531-10.8891081 26.30943728-10.8891081h111.53565452v-74.15716953H274.09131931c-30.79703633 0-57.09011544-10.86729676-78.86287845-32.59643851C173.43931968 680.11593931 162.54475911 653.88829351 162.54475911 623.20031175V252.44172722C162.54475911 221.72648236 173.43931968 195.54791102 195.22844086 173.80786431 217.00665706 152.07872254 243.29428298 141.21142578 274.09131931 141.21142578","p-id":"6454",fill:s.color},null,8,By)]))}}),Uy={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Fy=["fill"],Hy=["fill"],Gy=X({__name:"system1",props:{color:{type:String,default:"#333333"}},setup(s){return(t,n)=>(i(),d("svg",Uy,[e("path",{d:"M512 458.67c-8.66 0-15.69 7.02-15.69 15.69v125.49c0 8.66 7.02 15.69 15.69 15.69s15.69-7.02 15.69-15.69v-125.5c0-8.66-7.03-15.68-15.69-15.68z m-31.37-26.98h62.75c8.66 0 15.69-7.02 15.69-15.69 0-8.66-7.02-15.69-15.69-15.69h-15.69V296.78c0-8.66-7.02-15.69-15.69-15.69s-15.69 7.02-15.69 15.69v103.53h-15.69c-8.66 0-15.69 7.02-15.69 15.69 0.01 8.66 7.03 15.69 15.7 15.69z m219.61 53.33c-8.66 0-15.69 7.02-15.69 15.69V601.1c0 8.66 7.02 15.69 15.69 15.69s15.69-7.02 15.69-15.69v-99.76c0.35-8.66-6.39-15.95-15.05-16.3-0.22-0.02-0.43-0.02-0.64-0.02z m-31.38-27.61h62.75c8.66 0 15.69-7.02 15.69-15.69 0-8.66-7.02-15.69-15.69-15.69h-14.43V296.78c0-8.66-7.02-15.69-15.69-15.69s-15.69 7.02-15.69 15.69v125.49h-16.94c-8.66 0-15.69 7.02-15.69 15.69 0 8.66 7.02 15.69 15.69 15.69v3.76z m-376.47 32.63h62.75c8.66 0 15.69-7.02 15.69-15.69s-7.02-15.69-15.69-15.69h-15.69V296.78c0-8.66-7.02-15.69-15.69-15.69-8.66 0-15.69 7.02-15.69 15.69v161.88h-15.69c-8.66 0-15.69 7.02-15.69 15.69s7.04 15.69 15.7 15.69z m31.37 32c-8.66 0-15.69 7.02-15.69 15.69v62.75c0 8.66 7.02 15.69 15.69 15.69 8.66 0 15.69-7.02 15.69-15.69v-62.75c0-8.67-7.02-15.69-15.69-15.69z",fill:s.color,"p-id":"15217"},null,8,Fy),e("path",{d:"M870 116.39H154c-49.71 0-90 40.29-90 90v485.1c0 49.71 40.29 90 90 90h716c49.71 0 90-40.29 90-90v-485.1c0-49.7-40.29-90-90-90z m50 565.1c0 33.14-26.86 60-60 60H164c-33.14 0-60-26.86-60-60v-465.1c0-33.14 26.86-60 60-60h696c33.14 0 60 26.86 60 60v465.1zM680.24 907.61H343.76c-11.05 0-20-8.95-20-20s8.95-20 20-20h336.48c11.05 0 20 8.95 20 20 0 11.04-8.96 20-20 20z",fill:s.color,"p-id":"15218"},null,8,Hy)]))}}),jy={key:0,class:"system-read-announcement",role:"status"},Wy={key:1,class:"system-read-error",role:"status"},Oi=X({__name:"SystemReadState",props:{loading:{type:Boolean},error:{}},emits:["retry"],setup(s){const t=(n,l)=>window.vue_lang==="en"?l:n;return(n,l)=>s.loading?(i(),d("span",jy,a(t("正在读取系统信息","Loading system information")),1)):s.error?(i(),d("div",Wy,[e("span",null,a(s.error),1),e("button",{type:"button",onClick:l[0]||(l[0]=u=>n.$emit("retry"))},a(t("重试","Retry")),1)])):T("",!0)}}),Jy={href:"/cgi-bin/luci/admin/system/flash"},Ky={href:"/cgi-bin/luci/admin/store/pages/maintance"},Zy=["aria-hidden","inert"],Yy={class:"chart_box"},Qy={class:"chart"},Xy={class:"chart"},ek={class:"chart"},tk={class:"system-facts","data-system-facts":""},nk={class:"system-fact-list"},ak={class:"system-fact system-fact--wide system-fact--model","data-system-fact":"model"},sk={class:"system-fact-label"},ok={class:"system-fact-value"},lk={class:"system-fact system-fact--wide system-fact--firmware","data-system-fact":"firmware"},ik={class:"system-fact-label"},rk={class:"system-fact-value"},ck={class:"system-kernel"},dk={class:"system-fact","data-system-fact":"time"},uk={class:"system-fact-label"},vk={class:"system-fact-value"},pk={class:"system-fact","data-system-fact":"uptime"},hk={class:"system-fact-label"},mk={class:"system-fact-value"},fk=X({__name:"SystemInfo",props:{loading:{type:Boolean},readError:{}},emits:["retry"],setup(s){const{$gettext:t}=Ae(),n=Oa(),l=qa(),u=R(()=>l?l.data.version:n.version),c=R(()=>l?l.data.system:n.systemStatus),r=x(!1),p=R(()=>{var S;return((S=c.value)==null?void 0:S.cpuUsage)||0}),v=R(()=>{var S;return((S=c.value)==null?void 0:S.cpuTemperature)||0}),h=R(()=>{var C;return 100-(((C=c.value)==null?void 0:C.memAvailablePercentage)||100)}),g=R(()=>{const S=p.value;return S<76?"#3b82f6":S>=76&&S<96?"#f59e0b":"#ef4444"}),b=R(()=>v.value<=115?"#22c55e":"#f97316"),m=R(()=>{const S=h.value;return S<76?"#8b5cf6":S>=76&&S<96?"#fb923c":"#b91c1c"}),f=()=>{location.href="/cgi-bin/luci/admin/status/overview"},k=Fn.stampForm;nt(()=>{});const $=()=>{r.value=!r.value},w=()=>{$(),Xt.installAndGo("app-meta-netdata","NetData","/cgi-bin/luci/admin/status/netdata")};return(S,C)=>(i(),Y(ya,{class:_e(["system-read-card",{"system-read-pending":s.loading}]),"aria-busy":s.loading||void 0,"data-system-loading":s.loading||void 0,"home-menu":[{label:o(t)("系统监控"),action:w},{label:o(t)("备份升级"),href:"/cgi-bin/luci/admin/system/flash"},{label:o(t)("插件备份"),href:"/cgi-bin/luci/admin/store/pages/maintance"}],title:o(t)("系统信息"),showFooter:!1,style:{width:"100%",height:"100%",display:"block"}},{icon:pe(()=>[G(Rs,{class:"icon computerIcon"})]),settings:pe(()=>[e("button",{type:"button",class:"btn_settings",onClick:f},[G(Rs,{color:"#0a0a0a",class:"icon2 computerIcon",style:{"margin-right":"6px"}}),e("span",null,a(o(t)("信息概览")),1)])]),"settings-menu":pe(()=>[e("div",null,[e("a",{onClick:w},a(o(t)("系统监控")),1)]),e("div",null,[e("a",Jy,a(o(t)("备份升级")),1)]),e("div",null,[e("a",Ky,a(o(t)("插件备份")),1)])]),default:pe(()=>{var y,P,_,D;return[e("div",{class:"content system-composition","aria-hidden":s.loading||void 0,inert:s.loading},[e("div",Yy,[e("div",Qy,[G(_o,{value:p.value,color:g.value,icon:"chip",label:c.value?`${p.value}%`:"—",width:"150px",height:"150px"},null,8,["value","color","label"]),e("div",null,a(o(t)("CPU使用率")),1)]),e("div",Xy,[G(_o,{value:v.value/1.5,color:b.value,icon:"temperature",label:c.value?`${v.value}℃`:"—",width:"150px",height:"150px"},null,8,["value","color","label"]),e("div",null,a(o(t)("CPU温度")),1)]),e("div",ek,[G(_o,{value:h.value,color:m.value,icon:"lightning",label:c.value?`${h.value}%`:"—",width:"150px",height:"150px"},null,8,["value","color","label"]),e("div",null,a(o(t)("内存使用率")),1)])]),e("div",tk,[e("dl",nk,[e("div",ak,[e("dt",sk,[G(Ai,{color:"currentColor","aria-hidden":"true"}),e("span",null,a(o(t)("设备型号")),1)]),e("dd",ok,a(((y=u.value)==null?void 0:y.model)||"—"),1)]),e("div",lk,[e("dt",ik,[G(Gy,{color:"currentColor","aria-hidden":"true"}),e("span",null,a(o(t)("固件版本")),1)]),e("dd",rk,[ue(a(((P=u.value)==null?void 0:P.firmwareVersion)||"—"),1),e("small",ck,a(o(t)("内核"))+" "+a(((_=u.value)==null?void 0:_.kernelVersion)||"—"),1)])]),e("div",dk,[e("dt",uk,[G(Qe,{name:"clock"}),e("span",null,a(o(t)("系统时间")),1)]),e("dd",vk,a(((D=c.value)==null?void 0:D.localtime)||"—"),1)]),e("div",pk,[e("dt",hk,[G(Qe,{name:"power"}),e("span",null,a(o(t)("已启动")),1)]),e("dd",mk,a(c.value?o(k)(c.value.uptime):"—"),1)])])])],8,Zy),G(Oi,{loading:s.loading,error:s.readError,onRetry:C[0]||(C[0]=E=>S.$emit("retry"))},null,8,["loading","error"])]}),_:1},8,["class","aria-busy","data-system-loading","home-menu","title"]))}}),Bl=le(fk,[["__scopeId","data-v-bcd79f60"]]),bk={class:"system-overview-actions widget-action-group"},gk=["aria-hidden","inert"],_k=["data-system-metric"],yk=["aria-hidden"],kk={"data-system-uptime":""},wk=X({__name:"SystemOverview",props:{loading:{type:Boolean},readError:{}},emits:["details","retry"],setup(s){const t=window.vue_lang==="en",n=(h,g)=>t?g:h,l=Oa(),u=qa(),c=R(()=>u?u.data.system:l.systemStatus),r=R(()=>{const h=c.value,g=(h==null?void 0:h.cpuUsage)||0,b=(h==null?void 0:h.cpuTemperature)||0,m=100-((h==null?void 0:h.memAvailablePercentage)||100);return[{id:"cpu",label:n("CPU使用率","CPU usage"),value:g,unit:"%",percent:Math.max(0,Math.min(100,g)),color:g<76?"#3b82f6":g<96?"#f59e0b":"#ef4444"},{id:"temperature",label:n("CPU温度","CPU temp"),value:b,unit:"℃",percent:Math.max(0,Math.min(100,b/1.5)),color:b<=115?"#22c55e":"#f97316"},{id:"memory",label:n("内存使用率","Memory"),value:m,unit:"%",percent:Math.max(0,Math.min(100,m)),color:m<76?"#8b5cf6":m<96?"#fb923c":"#b91c1c"}]}),p=R(()=>c.value?Fn.stampForm(c.value.uptime):"—");function v(){window.location.assign("/cgi-bin/luci/admin/status/overview")}return(h,g)=>(i(),Y(ya,{"home-custom-menu":"",title:n("系统信息","System information"),class:_e(["system-overview system-read-card",{"system-read-pending":s.loading}]),"aria-busy":s.loading||void 0,"data-system-loading":s.loading||void 0,"data-system-form":"summary"},{icon:pe(()=>[G(Rs,{class:"icon"})]),settings:pe(()=>[e("div",bk,[G(_a,{icon:"chip",class:"system-overview-primary",onClick:v,"data-system-overview":""},{icon:pe(()=>[G(Rs,{color:"currentColor"})]),default:pe(()=>[ue(a(n("信息概览","Overview")),1)]),_:1})])]),default:pe(()=>[e("div",{class:"system-overview-metrics","aria-hidden":s.loading||void 0,inert:s.loading},[(i(!0),d(V,null,oe(r.value,b=>(i(),d("div",{key:b.id,"data-system-metric":b.id},[e("span",null,a(b.label),1),e("strong",null,[ue(a(c.value?b.value:"—"),1),e("small",null,a(c.value?b.unit:""),1)]),e("i",null,[e("b",{style:pt({width:(c.value?b.percent:0)+"%",background:b.color})},null,4)])],8,_k))),128))],8,gk),e("p",{class:"system-overview-uptime","aria-hidden":s.loading||void 0},[e("span",null,a(n("已启动","Uptime")),1),e("strong",kk,a(p.value),1)],8,yk),G(Oi,{loading:s.loading,error:s.readError,onRetry:g[0]||(g[0]=b=>h.$emit("retry"))},null,8,["loading","error"])]),_:1},8,["title","class","aria-busy","data-system-loading"]))}}),$k=le(wk,[["__scopeId","data-v-7c48e3cd"]]),Ck=["data-business-surface"],Sk={key:0,class:"native-partial",role:"status"},xk={key:1,class:"native-read-state",role:"status"},Pk={key:0,class:"native-partial",role:"status"},Tk={key:2,class:"native-read-state",role:"status"},Mk={key:3,class:"native-partial",role:"status","data-projection-warning":""},yo=X({__name:"BusinessSurface",props:{id:{},data:{},errors:{},unbounded:{type:Boolean},compact:{type:Boolean}},emits:["retry","details"],setup(s,{emit:t}){const n=s,l=t,u=x(null);ma(Js,{data:n.data,bounded:()=>!n.unbounded,details:()=>l("details"),invalidate:()=>l("retry")});const c=window.vue_lang==="en",r=(y,P)=>c?P:y,p=x(!document.hidden),v=()=>p.value=!document.hidden,h={storage:Qh,sharing:gf,docker:A7,downloads:tg,remote:My,system:Bl},g=R(()=>h[n.id]),b={storage:["disks","raid"],sharing:["sharing"],docker:["docker"],downloads:["download"],remote:["remote"],system:["system","version"]},m=R(()=>b[n.id]),f={storage:r("磁盘信息","Disk information"),sharing:r("存储服务","Storage services"),docker:"Docker",downloads:r("下载服务","Download services"),remote:r("远程域名","Remote domains"),system:r("系统信息","System information")},k=R(()=>f[n.id]),$=R(()=>m.value.every(y=>n.errors[y]&&!n.data[y])),w=R(()=>m.value.some(y=>n.errors[y])),S=R(()=>m.value.every(y=>n.data[y]||n.errors[y])),C=R(()=>{var _,D;if(n.id!=="storage")return"";const y=n.errors.disks?[]:((_=n.data.disks)==null?void 0:_.disks)||[],P=n.errors.raid?[]:((D=n.data.raid)==null?void 0:D.disks)||[];return[...y,...P].slice(3).some(E=>{var A;return E.errorInfo||E.smartWarning||((A=E.childrens)==null?void 0:A.some(U=>U.isReadOnly&&U.filesystem!=="swap"))})?r("有未展开的磁盘异常。","Additional disks have warnings."):""});return nt(()=>document.addEventListener("visibilitychange",v)),lt(()=>document.removeEventListener("visibilitychange",v)),(y,P)=>(i(),d("div",{ref_key:"surface",ref:u,class:_e(["native-business-surface",["native-"+s.id,{unbounded:s.unbounded,"native-compact":s.compact}]]),"data-business-surface":s.id},[s.id==="system"?(i(),d(V,{key:0},[S.value&&w.value&&!$.value?(i(),d("p",Sk,[ue(a(r("部分信息读取失败,以下为已取得的快照,当前状态待确认。","Some information is unavailable. Showing previous snapshots; current state is unconfirmed."))+" ",1),e("button",{onClick:P[0]||(P[0]=_=>y.$emit("retry"))},a(r("重试","Retry")),1)])):T("",!0),(i(),Y(Aa(s.compact?$k:Bl),{loading:!S.value,"read-error":$.value?r("读取失败,其他组件仍可使用","Unavailable; other widgets remain usable"):void 0,onDetails:P[1]||(P[1]=_=>y.$emit("details")),onRetry:P[2]||(P[2]=_=>y.$emit("retry"))},null,40,["loading","read-error"]))],64)):$.value?(i(),d("div",xk,[ue(a(k.value)+" · "+a(r("读取失败,其他组件仍可使用","Unavailable; other widgets remain usable")),1),e("button",{onClick:P[3]||(P[3]=_=>y.$emit("retry"))},a(r("重试","Retry")),1)])):(i(),d(V,{key:2},[w.value?(i(),d("p",Pk,[ue(a(r("部分信息读取失败,以下为已取得的快照,当前状态待确认。","Some information is unavailable. Showing previous snapshots; current state is unconfirmed."))+" ",1),e("button",{onClick:P[4]||(P[4]=_=>y.$emit("retry"))},a(r("重试","Retry")),1)])):T("",!0),S.value&&p.value?(i(),Y(Aa(g.value),{key:1})):(i(),d("div",Tk,a(k.value)+" · "+a(r("读取中…","Loading…")),1))],64)),S.value&&!s.unbounded&&C.value?(i(),d("p",Mk,[ue(a(C.value)+" ",1),e("button",{onClick:P[5]||(P[5]=_=>y.$emit("details")),"data-projection-warning-open":""},a(r("查看异常","View warnings")),1)])):T("",!0)],10,Ck))}}),Ek=["data-native-widget","data-system-presentation"],Ik={key:0,role:"status"},Dk=X({__name:"BusinessCard",props:{id:{},data:{},errors:{},summary:{type:Boolean}},emits:["retry"],setup(s){const t=s,n=x(!1),l=window.vue_lang==="en",u=(b,m)=>l?m:b,c={storage:["磁盘信息","Disk information"],sharing:["存储服务","Storage services"],docker:["Docker","Docker"],downloads:["下载服务","Download services"],remote:["远程域名","Remote domains"],system:["系统信息","System information"]},r=R(()=>u(...c[t.id])),p={storage:"disks",downloads:"download"},v=R(()=>p[t.id]||t.id),h=R(()=>t.id==="storage"?t.errors.disks&&t.errors.raid:t.errors[v.value]||t.id==="system"&&t.errors.version),g=R(()=>{var m,f,k,$,w,S,C,y,P,_;const b=t.data;return t.id==="system"&&!b.system?[u("读取中","Loading")]:t.id==="system"?[u("CPU使用率","CPU usage")+" "+(((m=b.system)==null?void 0:m.cpuUsage)||0)+"% · "+u("CPU温度","CPU temperature")+" "+(((f=b.system)==null?void 0:f.cpuTemperature)||0)+"℃",u("内存使用率","Memory usage")+" "+(100-(((k=b.system)==null?void 0:k.memAvailablePercentage)||100))+"%",(($=b.version)==null?void 0:$.firmwareVersion)||u("读取中","Loading")]:t.id==="storage"?[`${t.errors.disks||!b.disks?"—":((w=b.disks.disks)==null?void 0:w.length)||0} ${u("块磁盘","disks")} · RAID ${t.errors.raid||!b.raid?"—":((S=b.raid.disks)==null?void 0:S.length)||0}`,...t.errors.disks||t.errors.raid?[u("部分磁盘信息暂不可用","Some disk information is unavailable")]:[]]:t.id==="sharing"?b.sharing?[`易有云 · ${(C=b.sharing.linkease)!=null&&C.enabel?u("已配置","Configured"):u("未配置","Not configured")}`,`SAMBA · ${(y=b.sharing.sambas)!=null&&y.length?u("已启用","Enabled"):u("未启用","Disabled")}`,`WEBDAV · ${(P=b.sharing.webdav)!=null&&P.path?u("已启用","Enabled"):u("未启用","Disabled")}`]:[u("读取中","Loading")]:t.id==="docker"?[b.docker?$n(zn(b.docker.status),l):u("读取中","Loading"),((_=b.docker)==null?void 0:_.status)==="running"?b.docker.path:""].filter(Boolean):t.id==="downloads"?["aria2","qbittorrent","transmission"].map(D=>{var E;return`${D} · ${b.download?$n(zn((E=b.download[D])==null?void 0:E.status),l):u("读取中","Loading")}`}):b.remote?["DDNSTO · "+$n(Jn(b.remote.ddnstoDomain),l),...["ipv4Domain","ipv6Domain"].filter(D=>b.remote[D]).map(D=>D.slice(0,4).toUpperCase()+" · "+$n(Jn(b.remote[D]),l)+(["Stopped","Disabled"].includes(b.remote[D])?"":" · "+b.remote[D]))]:[u("读取中","Loading")]});return(b,m)=>(i(),d("section",{class:_e(["native-business-card",{"native-summary":s.summary&&s.id!=="system"}]),"data-native-widget":s.id,"data-system-presentation":s.id==="system"?s.summary?"summary":"standard":void 0},[s.id==="system"&&!n.value?(i(),Y(yo,{key:0,id:s.id,data:s.data,errors:s.errors,compact:s.summary,onDetails:m[0]||(m[0]=f=>n.value=!0),onRetry:m[1]||(m[1]=f=>b.$emit("retry"))},null,8,["id","data","errors","compact"])):s.summary?(i(),d(V,{key:1},[e("header",null,[e("h2",null,[G(Qe,{name:o(rn)(s.id).glyph},null,8,["name"]),ue(a(r.value),1)])]),h.value?(i(),d("p",Ik,[ue(a(u("信息暂不可用","Information unavailable"))+" ",1),e("button",{onClick:m[2]||(m[2]=f=>b.$emit("retry"))},a(u("重试","Retry")),1)])):(i(!0),d(V,{key:1},oe(g.value,f=>(i(),d("p",{key:f},a(f),1))),128))],64)):n.value?T("",!0):(i(),Y(yo,{key:2,id:s.id,data:s.data,errors:s.errors,onDetails:m[3]||(m[3]=f=>n.value=!0),onRetry:m[4]||(m[4]=f=>b.$emit("retry"))},null,8,["id","data","errors"])),n.value?(i(),Y(na,{key:3,title:r.value,onClose:m[6]||(m[6]=f=>n.value=!1)},{default:pe(()=>[G(yo,{id:s.id,data:s.data,errors:s.errors,unbounded:"",onRetry:m[5]||(m[5]=f=>b.$emit("retry"))},null,8,["id","data","errors"])]),_:1},8,["title"])):T("",!0)],10,Ek))}}),Lk=le(Dk,[["__scopeId","data-v-66e01d0f"]]),Ak=["inert","data-layout-card","data-natural-card","data-presentation","data-chart-stretch"],Nk={class:"traffic-header-actions widget-action-group"},Ok={key:1,class:"speed-announcement",role:"status"},zk={key:2,class:"speed-error",role:"status","data-speed-error":""},qk=["aria-label"],Rk={key:3,class:"layout-data-notice"},Vk={key:1,class:"qs-card-placeholder","data-missing-plugin":"",role:"status"},Bk=X({__name:"HomeWidget",props:{id:{},data:{},errors:{},devices:{},theme:{},contained:{type:Boolean},preference:{},natural:{type:Boolean},role:{},chartStretch:{type:Boolean},editing:{type:Boolean}},emits:["navigate","device","retry"],setup(s,{emit:t}){const n=s,l=Ko(),u=R(()=>l.cards.value.find(_=>_.id===n.id)),c=R(()=>window.vue_lang==="en"?rn(n.id).en:rn(n.id).zh);function r(){return B(this,null,function*(){return(yield l.discover(!0)).find(_=>_.id===n.id)})}ma(Js,{data:n.data,bounded:()=>!0,details:()=>{},invalidate:()=>b("retry")});const p=R(()=>On.source==="traffic"&&On.status==="loading"),v=R(()=>On.source==="traffic"&&!["idle","loading"].includes(On.status));function h(){Ao(es.find(_=>_.id==="fastnet"),"traffic")}function g(){var _,D;gi(),(D=(_=k.value)==null?void 0:_.querySelector("[data-home-speed]"))==null||D.focus({preventScroll:!0})}const b=t,m=window.vue_lang==="en",f=(_,D)=>m?D:_,k=x(null),$=x(600),w=x(320),S=R(()=>Kt(n.id,n.preference||{mode:"auto",iconRows:0},{width:$.value,height:n.natural?1e5:w.value,role:n.role||"ordinary",favoriteCount:4,mobile:$.value<650,natural:n.natural})),C=x(!document.hidden),y=()=>C.value=!document.hidden;let P;return nt(()=>{n.id==="traffic"&&document.addEventListener("visibilitychange",y),P=new ResizeObserver(_=>{$.value=_[0].contentRect.width,w.value=_[0].contentRect.height}),k.value&&P.observe(k.value)}),lt(()=>{P==null||P.disconnect(),document.removeEventListener("visibilitychange",y)}),(_,D)=>(i(),d("div",{class:_e(["layout-widget",["widget-"+s.id,{narrow:$.value<450,medium:$.value<650,short:!s.natural&&w.value<310}]]),ref_key:"element",ref:k,inert:s.editing,"data-layout-card":s.id,"data-natural-card":s.natural||void 0,"data-presentation":S.value.id,"data-chart-stretch":s.id==="traffic"&&s.chartStretch||void 0},[s.id==="traffic"?(i(),d(V,{key:0},[C.value?(i(),Y(qu,{key:s.theme})):T("",!0),e("div",Nk,[G(_a,{icon:"activity",class:"layout-speed","data-home-speed":"",onClick:h,disabled:p.value,"aria-busy":p.value,"aria-label":f("网络测速","Network speed test")},{default:pe(()=>[ue(a(f("测速","Test")),1)]),_:1},8,["disabled","aria-busy","aria-label"])]),p.value?(i(),d("span",Ok,a(f("正在打开FastNet","Opening FastNet")),1)):T("",!0),v.value?(i(),d("div",zk,[e("span",null,a(o(On).status==="timeout"?f("打开测速超时,请重试。","Opening speed test timed out. Please retry."):o(On).status==="permission"?f("无访问权限,请重新登录后重试。","No permission. Sign in and retry."):f("暂时无法打开测速,请重试。","Unable to open speed test. Please retry.")),1),e("div",null,[e("button",{onClick:h,"data-speed-retry":""},a(f("重试","Retry")),1),e("button",{onClick:g,"data-speed-dismiss":"","aria-label":f("关闭提示","Dismiss")},"×",8,qk)])])):T("",!0),s.errors.traffic?(i(),d("span",Rk,a(f("流量采样暂不可用","Traffic sampling unavailable")),1)):T("",!0)],64)):s.id==="connection"?(i(),Y(g4,{key:1,data:s.data.network,error:s.errors.network,summary:S.value.id==="summary",onNavigate:D[0]||(D[0]=E=>_.$emit("navigate",E)),onRetry:D[1]||(D[1]=E=>_.$emit("retry"))},null,8,["data","error","summary"])):s.id==="networkInterface"?(i(),Y(U4,{key:2,"legacy-summary":S.value.legacy,data:s.data.ports,error:s.errors.ports,summary:S.value.id==="summary",onNavigate:D[2]||(D[2]=E=>_.$emit("navigate",E)),onRetry:D[3]||(D[3]=E=>_.$emit("retry"))},null,8,["legacy-summary","data","error","summary"])):s.id==="applications"?(i(),Y(Ti,{key:3,collapsed:!1,"fallback-entries":[],contained:s.contained,preference:s.preference,natural:s.natural,network:s.data.network,onNavigate:D[4]||(D[4]=E=>_.$emit("navigate",E))},null,8,["contained","preference","natural","network"])):["storage","sharing","docker","downloads","remote","system"].includes(s.id)?(i(),Y(Lk,{key:4,id:s.id,data:s.data,errors:s.errors,summary:S.value.id==="summary",onRetry:D[5]||(D[5]=E=>_.$emit("retry"))},null,8,["id","data","errors","summary"])):s.id.startsWith("plugin.")?(i(),d(V,{key:5},[u.value&&u.value.forms[S.value.id]?(i(),Y(pu,{key:u.value.entry,manifest:u.value,form:S.value.id==="summary"?"summary":"standard",rediscover:r},null,8,["manifest","form"])):(i(),d("section",Vk,[e("h2",null,a(c.value),1),e("p",null,a(u.value?f("此形态暂不可用,请在显示设置中调整","This form is unavailable. Change display settings."):o(l).state.value==="unavailable"?f("无法确认插件状态,请重试读取","Plugin status unavailable; reload to retry"):o(Ka)(s.id)?f("此卡片需要升级 Quickstart,原位置已保留","Update Quickstart to display this card. Position retained."):f("插件未安装或需要升级,原位置已保留","Plugin missing or needs updating. Position retained.")),1),e("button",{onClick:D[6]||(D[6]=E=>o(l).discover(!0))},a(f("重新读取","Reload")),1)]))],64)):(i(),Y(p1,{key:6,data:s.data,errors:s.errors,devices:s.devices,summary:S.value.id==="summary","summary-limit":s.id==="devices"?S.value.capacity:void 0,"disk-limit":s.contained?4:void 0,"contextual-actions":"",onNavigate:D[7]||(D[7]=E=>_.$emit("navigate",E)),onDevice:D[8]||(D[8]=E=>_.$emit("device",E)),onRetry:D[9]||(D[9]=E=>_.$emit("retry"))},null,8,["data","errors","devices","summary","summary-limit","disk-limit"]))],10,Ak))}}),Uk=le(Bk,[["__scopeId","data-v-81b7a52a"]]),Fk=["data-notice-kind","onKeydown"],Hk=["aria-label","title"],Gk=X({__name:"LayoutNotice",props:{notice:{},editing:{type:Boolean}},emits:["dismiss"],setup(s,{emit:t}){const n=s,l=t,u=window.vue_lang==="en",c=x(null),r=x(null),p=x(!1),v=x({left:"0px",width:"0px"});let h,g=0,b,m=!0,f=!1,k=!1;function $(){h!==void 0&&clearTimeout(h),h=void 0}function w(){if($(),!m||!n.notice.message||n.notice.kind!=="info"||f||k)return;const A=n.notice.id;h=setTimeout(()=>{h=void 0,m&&A===n.notice.id&&l("dismiss",A)},3e3)}function S(){k=!0,$()}function C(){ot(()=>{var A;m&&(k=!!((A=c.value)!=null&&A.contains(document.activeElement)),w())})}function y(A){A.pointerType==="mouse"&&(f=!0,$())}function P(A){A.pointerType==="mouse"&&(f=!1,w())}function _(){var q;const A=document.activeElement===r.value,U=(q=c.value)==null?void 0:q.closest("[data-ordered-home]");l("dismiss",n.notice.id),A&&ot(()=>{var z;return(z=U==null?void 0:U.querySelector(n.editing?".direct-toolbar button:not(:disabled)":"[data-home-settings]"))==null?void 0:z.focus({preventScroll:!0})})}function D(){var N;const A=(N=c.value)==null?void 0:N.closest("[data-ordered-home]");if(!A)return;const U=A.getBoundingClientRect(),q=Math.max(0,U.left),z=Math.min(innerWidth,U.right);v.value={left:q+"px",width:Math.max(0,z-q)+"px"},p.value=z>q}function E(){g||(g=requestAnimationFrame(()=>{g=0,D()}))}return We(()=>n.notice,()=>{var A,U,q;f=matchMedia("(hover: hover)").matches&&!!((U=(A=c.value)==null?void 0:A.querySelector(".layout-notice"))!=null&&U.matches(":hover")),k=!!((q=c.value)!=null&&q.contains(document.activeElement)),w()},{immediate:!0,flush:"post"}),nt(()=>{var U,q,z;D(),b=new ResizeObserver(E);const A=(U=c.value)==null?void 0:U.closest("[data-ordered-home]");A&&b.observe(A),window.addEventListener("resize",E),document.addEventListener("scroll",E,!0),(q=window.visualViewport)==null||q.addEventListener("resize",E),(z=window.visualViewport)==null||z.addEventListener("scroll",E)}),lt(()=>{var A,U;m=!1,$(),cancelAnimationFrame(g),b==null||b.disconnect(),window.removeEventListener("resize",E),document.removeEventListener("scroll",E,!0),(A=window.visualViewport)==null||A.removeEventListener("resize",E),(U=window.visualViewport)==null||U.removeEventListener("scroll",E)}),(A,U)=>(i(),d("div",{ref_key:"host",ref:c,class:_e(["layout-notice-host",{"layout-notice-editing":s.editing}]),style:pt(v.value),"data-layout-notice-host":""},[s.notice.message&&p.value?(i(),d("div",{key:0,class:_e(["layout-notice","layout-notice-"+s.notice.kind]),role:"status","aria-live":"polite","aria-atomic":"true","data-layout-notice":"","data-notice-kind":s.notice.kind,onClick:U[0]||(U[0]=Ge(()=>{},["stop"])),onPointerenter:y,onPointerleave:P,onFocusin:S,onFocusout:C,onKeydown:Qt(Ge(_,["stop","prevent"]),["esc"])},[e("span",null,a(s.notice.message),1),e("button",{ref_key:"closeButton",ref:r,type:"button","aria-label":u?"Dismiss notification":"关闭提示",title:u?"Dismiss notification":"关闭提示",onClick:_,"data-layout-notice-close":""},"×",8,Hk)],42,Fk)):T("",!0)],6))}}),jk=le(Gk,[["__scopeId","data-v-a2691b75"]]);function Wk(){const s=x({id:0,message:"",kind:"info"});function t(u,c="info"){s.value={id:s.value.id+1,message:u,kind:c}}function n(u){(u===void 0||u===s.value.id)&&t("")}const l=R({get:()=>s.value.message,set:u=>t(u)});return{noticeState:s,notice:l,showNotice:t,dismissNotice:n}}const Jk=["aria-label"],Kk={key:0},Zk=X({__name:"HomeBootstrap",setup(s){const t=window.vue_lang==="en"?"Loading homepage…":"正在加载首页…",n=x(!1);let l;return nt(()=>{l=window.setTimeout(()=>n.value=!0,800)}),lt(()=>window.clearTimeout(l)),(u,c)=>(i(),d("section",{class:"home-bootstrap",role:"status","aria-busy":"true","aria-label":o(t),"data-home-bootstrap":""},[c[0]||(c[0]=e("div",{class:"home-bootstrap-lines","aria-hidden":"true"},[e("i"),e("i"),e("i")],-1)),n.value?(i(),d("p",Kk,a(o(t)),1)):T("",!0)],8,Jk))}}),Yk=le(Zk,[["__scopeId","data-v-dd3adf7c"]]);function Qk(s,t,n,l){const u=x({});let c=0,r=!1,p=0;function v(){if(c=0,!r||document.hidden||l()||!s.value)return;const g={};for(const b of t.value){const m=Array.from(s.value.children).find(w=>w.dataset.orderedRow===b.id);if(!m)continue;const f=document.documentElement.style,k=f.getPropertyValue("overflow-anchor"),$=f.getPropertyPriority("overflow-anchor");f.setProperty("overflow-anchor","none","important");try{m.setAttribute("data-size-measuring","");const w=Array.from(m.querySelectorAll(":scope > .ordered-column")).map(S=>Array.from(S.querySelectorAll(":scope > .ordered-card")).map(C=>Math.ceil(C.getBoundingClientRect().height)));g[b.id]={height:Math.ceil(Math.max(b.chartHeight||0,...w.map(S=>S.reduce((C,y)=>C+y,0)+Math.max(0,S.length-1)*18))),columns:w}}finally{m.removeAttribute("data-size-measuring"),k?f.setProperty("overflow-anchor",k,$):f.removeProperty("overflow-anchor")}}p++,JSON.stringify(g)!==JSON.stringify(u.value)&&(u.value=g)}function h(){r&&!document.hidden&&!l()&&!c&&(c=requestAnimationFrame(v))}return We(n,h,{deep:!0,flush:"post"}),nt(()=>{r=!0,document.addEventListener("visibilitychange",h),h()}),lt(()=>{r=!1,c&&cancelAnimationFrame(c),c=0,document.removeEventListener("visibilitychange",h)}),{sizes:u,schedule:h,debug:()=>({passes:p,pending:!!c,count:Object.keys(u.value).length})}}const Xk={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"32",height:"32"},ew=["fill"],tw=["fill"],nw=["fill"],aw=["fill"],sw=X({__name:"module",props:{color:{type:String,default:"#ffffff"}},setup(s){return(t,n)=>(i(),d("svg",Xk,[e("path",{d:"M384 480 96 480C44.8 480 0 435.2 0 384L0 96C0 44.8 44.8 0 96 0L384 0c51.2 0 96 44.8 96 96L480 384C480 435.2 435.2 480 384 480z",fill:s.color,"p-id":"6495"},null,8,ew),e("path",{d:"M384 1024 96 1024C44.8 1024 0 979.2 0 928L0 640c0-51.2 44.8-96 96-96L384 544c51.2 0 96 44.8 96 96l0 281.6C480 979.2 435.2 1024 384 1024z",fill:s.color,"p-id":"6496"},null,8,tw),e("path",{d:"M787.2 1024 787.2 1024c-134.4 0-243.2-108.8-243.2-236.8l0 0c0-134.4 108.8-236.8 236.8-236.8l0 0c134.4 0 236.8 108.8 236.8 236.8l0 0C1024 915.2 915.2 1024 787.2 1024z",fill:s.color,"p-id":"6497"},null,8,nw),e("path",{d:"M928 480 640 480C588.8 480 544 435.2 544 384L544 96C544 44.8 588.8 0 640 0l281.6 0C979.2 0 1024 44.8 1024 96L1024 384C1024 435.2 979.2 480 928 480z",fill:s.color,"p-id":"6498"},null,8,aw)]))}}),ow=["data-theme-preference","data-effective-theme"],lw=["aria-label","title"],iw={key:0,viewBox:"0 0 24 24","aria-hidden":"true","data-theme-icon":"system"},rw={key:0,class:"system-state"},cw={key:1,class:"system-state",d:"M13.8 7.2a3.2 3.2 0 1 0 2.1 4.9 2.7 2.7 0 0 1-2.1-4.9Z"},dw={key:1,viewBox:"0 0 24 24","aria-hidden":"true","data-theme-icon":"light"},uw={key:2,viewBox:"0 0 24 24","aria-hidden":"true","data-theme-icon":"dark"},vw=["aria-label"],pw=["aria-checked","onClick"],hw={key:0},mw={"aria-hidden":"true"},fw=X({__name:"ThemeSelector",setup(s){const t=window.vue_lang==="en",n=(m,f)=>t?f:m,l=[{value:"system",zh:"跟随系统",en:"Use system setting"},{value:"light",zh:"浅色",en:"Light"},{value:"dark",zh:"深色",en:"Dark"}],u=x(null),c=x(di()),r=x(Ws()),p=R(()=>{const m=l.find(f=>f.value===c.value);return n(m.zh,m.en)}),v=R(()=>r.value==="dark"?n("深色","Dark"):n("浅色","Light")),h=R(()=>c.value==="system"?n("主题:","Theme: ")+p.value+n(",当前:","; current: ")+v.value:n("主题:","Theme: ")+p.value);let g=()=>{};function b(m){var f;Nd(m),(f=u.value)==null||f.removeAttribute("open")}return nt(()=>{g=is(m=>{c.value=m.preference,r.value=m.effective})}),lt(()=>g()),(m,f)=>(i(),d("details",{ref_key:"menu",ref:u,class:"theme-selector","data-theme-selector":"","data-theme-preference":c.value,"data-effective-theme":r.value},[e("summary",{"aria-label":h.value,title:h.value},[c.value==="system"?(i(),d("svg",iw,[f[1]||(f[1]=e("rect",{x:"2.5",y:"3",width:"19",height:"14",rx:"2"},null,-1)),f[2]||(f[2]=e("path",{d:"M8 21h8M10 17v4m4-4v4"},null,-1)),r.value==="light"?(i(),d("g",rw,[...f[0]||(f[0]=[e("circle",{cx:"12",cy:"10",r:"2"},null,-1),e("path",{d:"M12 6.5v1M12 12.5v1M8.5 10h1M14.5 10h1"},null,-1)])])):(i(),d("path",cw))])):c.value==="light"?(i(),d("svg",dw,[...f[3]||(f[3]=[e("circle",{cx:"12",cy:"12",r:"3.5"},null,-1),e("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.65 17.65l1.42 1.42M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.65 6.35l1.42-1.42"},null,-1)])])):(i(),d("svg",uw,[...f[4]||(f[4]=[e("path",{d:"M20.2 15.4A8.5 8.5 0 1 1 8.6 3.8a6.7 6.7 0 0 0 11.6 11.6Z"},null,-1)])]))],8,lw),e("div",{class:"theme-menu",role:"radiogroup","aria-label":n("主题模式","Theme mode")},[e("strong",null,a(n("主题","Theme")),1),(i(),d(V,null,oe(l,k=>e("button",{key:k.value,type:"button",role:"radio","aria-checked":c.value===k.value,class:_e({selected:c.value===k.value}),onClick:$=>b(k.value)},[e("span",null,a(n(k.zh,k.en)),1),k.value==="system"?(i(),d("small",hw,a(n("当前:","Current: "))+a(r.value==="dark"?n("深色","Dark"):n("浅色","Light")),1)):T("",!0),e("i",mw,a(c.value===k.value?"✓":""),1)],10,pw)),64)),e("p",null,a(n("此选择保存在当前浏览器,并与 LuCI 主题同步。","Saved in this browser and synchronized with the LuCI theme.")),1)],8,vw)],8,ow))}}),bw=le(fw,[["__scopeId","data-v-190180e9"]]),gw=["aria-label"],_w=["aria-label"],yw={class:"direct-panel-body"},Wn=X({__name:"DirectEditPanel",props:{title:{}},emits:["close"],setup(s,{emit:t}){const n=t,l=x(null),u=window.vue_lang==="en";let c=null;function r(p){if(p.key==="Escape"&&(p.stopPropagation(),n("close")),p.key==="Tab"){const v=Array.from(l.value.querySelectorAll("button:not(:disabled),select,input,a[href]")).filter(b=>b.getClientRects().length),h=v[0],g=v[v.length-1];p.shiftKey&&document.activeElement===h?(p.preventDefault(),g==null||g.focus()):!p.shiftKey&&document.activeElement===g&&(p.preventDefault(),h==null||h.focus())}}return nt(()=>B(null,null,function*(){var p,v;c=document.activeElement,yield ot(),(v=(p=l.value)==null?void 0:p.querySelector("button"))==null||v.focus()})),lt(()=>{c!=null&&c.isConnected&&c.focus({preventScroll:!0})}),(p,v)=>(i(),d(V,null,[e("div",{class:"direct-panel-backdrop",onClick:v[0]||(v[0]=h=>n("close"))}),e("section",{ref_key:"element",ref:l,class:"direct-panel",role:"dialog","aria-modal":"true","aria-label":s.title,onKeydown:r},[e("header",null,[e("h2",null,a(s.title),1),e("button",{onClick:v[1]||(v[1]=h=>n("close")),"aria-label":u?"Close panel":"关闭面板"},"×",8,_w)]),e("div",yw,[Ct(p.$slots,"default")]),e("footer",null,[Ct(p.$slots,"actions",{},()=>[e("button",{onClick:v[2]||(v[2]=h=>n("close"))},a(u?"Back to home":"返回首页"),1)])])],40,gw)],64))}}),kw={class:"presentation-settings"},ww={class:"direct-panel-note"},$w={class:"presentation-forms","aria-label":"展示形态"},Cw=["aria-pressed","data-presentation-form","onClick"],Sw={key:0,class:"presentation-options"},xw=["aria-pressed","data-icon-rows","onClick"],Pw=X({__name:"PresentationSettings",props:{id:{},value:{}},emits:["update"],setup(s,{emit:t}){const n=s,l=t,u=R(()=>["auto",...aa(n.id).forms]),c=[0,1,2,3],r=window.vue_lang==="en",p=(g,b)=>r?b:g,v=g=>n.id==="system"&&g==="standard"?p("完整信息","Complete information"):n.id==="system"&&g==="summary"?p("紧凑概览","Compact overview"):{auto:p("自动推荐","Automatic"),standard:p("标准","Standard"),summary:p("摘要","Summary"),grid:p("图标网格","Icon grid"),strip:p("启动条","Launch strip")}[g]||g;function h(g){l("update",Ne(ye(ye({},n.value),g),{ruleVersion:2}))}return(g,b)=>(i(),d("div",kw,[e("p",ww,a(p("选择形态与排布,页面同步预览;采用前不会改变草稿。","Preview a form and layout. Your draft changes only when adopted.")),1),e("div",$w,[(i(!0),d(V,null,oe(u.value,m=>(i(),d("button",{key:m,"aria-pressed":s.value.mode===m,"data-presentation-form":m,onClick:f=>h({mode:m})},[e("span",{class:_e(["presentation-mini",m])},[...b[0]||(b[0]=[e("i",null,null,-1),e("i",null,null,-1),e("i",null,null,-1)])],2),ue(a(v(m)),1)],8,Cw))),128))]),s.id==="applications"&&s.value.mode!=="strip"?(i(),d("section",Sw,[e("h3",null,a(p("图标排布","Icon layout")),1),e("div",null,[(i(),d(V,null,oe(c,m=>e("button",{key:m,"aria-pressed":s.value.iconRows===m,"data-icon-rows":m,onClick:f=>h({iconRows:m})},a([p("自动","Auto"),p("单行","One row"),p("双行","Two rows"),p("三行","Three rows")][m]),9,xw)),64))]),e("p",null,a(p("条目较少时采用均衡排布,超过容量的常用项仍在全部面板。","Fewer items stay balanced. Items beyond capacity remain in All.")),1)])):T("",!0)]))}}),Xa=(s,t=Yo(),n=0)=>({schemaVersion:4,revision:n,rows:ki(s),widgetPreferences:Object.fromEntries(Object.entries(t).map(([l,u])=>{var c;return[l,Ne(ye({},rt(u)),{ruleVersion:(c=u.ruleVersion)!=null?c:2})]}))}),Cn=s=>JSON.stringify([s.rows,s.widgetPreferences]);function ks(s,t,n){const l=rs(s);if(l.issue&&!l.issue.startsWith("height:"))return l;for(const u of Un)if(Ks(u.id,t[u.id]))return{issue:"preference"};for(const u of s){const c=_i(u,t,n.width,n.favoriteCount);if(c.issue)return{issue:c.issue,row:u.id};if(!u.heightMode&&c.height>u.height)return{issue:"height:"+c.height,row:u.id,requiredHeight:c.height}}return{issue:""}}function pa(s,t,n,l=s.widgetPreferences,u=!0){const c=Xa(t.candidateRows||t.rows,l,s.revision),r=[];let p=t.issue&&!t.issue.startsWith("height:")?t.issue:"";const v=rs(c.rows);v.issue&&!v.issue.startsWith("height:")&&(p=v.issue);for(const g of Un)Ks(g.id,l[g.id])&&(p="preference");for(const g of c.rows){const b=_i(g,l,n.width,n.favoriteCount);b.issue&&(p=b.issue),!g.heightMode&&b.height>g.height&&(u?(r.push({row:g.id,from:g.height,to:b.height}),g.height=b.height):p="height:"+b.height)}const h=Cn(s)!==Cn(c);return h&&(c.revision=s.revision+1),{status:p?"blocked":r.length?"needs-confirmation":"ready",issue:p,baseRevision:s.revision,baseFingerprint:Cn(s),contextKey:JSON.stringify(n),next:c,adjustments:r,hidden:t.hidden,changed:h}}function ws(s,t,n){const l=s.revision!==t.baseRevision||Cn(s)!==t.baseFingerprint||JSON.stringify(n)!==t.contextKey;return l||t.status==="blocked"?{document:s,issue:l?"stale-plan":t.issue}:{document:rt(t.next),issue:""}}function ko(s,t,n,l){const u=rt(s.widgetPreferences),c=t.candidateRows||t.rows;for(const r of c)for(const p of r.columns)for(const v of p.cards){if(!v)continue;const h=p.cards.length===2&&Kt(v,u[v],{width:1e3,height:1e5,role:"stacked",favoriteCount:n.favoriteCount,natural:!0}).issue==="compact";aa(v).forms.includes("summary")&&(v===l||h)&&(u[v]=Ne(ye({},u[v]),{mode:"summary",ruleVersion:2}))}return Cn(Xa(s.rows,u))===Cn(s)?null:pa(s,t,n,u)}const Ga=s=>s.kind==="slot"?`slot:${s.row}:${s.column}:${s.slot}`:s.kind==="beside"?`beside:${s.row}:${s.index}`:`edge:${s.before||"end"}`;function Tw(s){return s.flatMap(t=>[{kind:"edge",before:t.id},...t.columns.flatMap((n,l)=>n.cards.map((u,c)=>({kind:"slot",row:t.id,column:l,slot:c}))),...Array.from({length:t.columns.length+1},(n,l)=>({kind:"beside",row:t.id,index:l}))]).concat([{kind:"edge",before:null}])}function wo(s,t,n){const l=u=>({rows:s,issue:u,changed:!1,hidden:[]});return t.kind==="card"&&!Vn(s,t.id)?l("target"):n.kind==="slot"?Bo(s,n,t.id):n.kind==="beside"?G1(s,t.id,n.row,n.index):wi(s,t.id,n.before)}function Mw(s){const t=Na(null),n=x(!1),l=R(()=>!!t.value);let u,c,r=0,p=!1;function v(){p=!0,setTimeout(()=>p=!1,0)}function h(){var _,D;const P=u;u=void 0,c!==void 0&&cancelAnimationFrame(c),c=void 0,r=0,window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",b),window.removeEventListener("blur",b),window.removeEventListener("resize",b),P==null||P.element.removeEventListener("lostpointercapture",b),(D=P==null?void 0:(_=P.element).hasPointerCapture)!=null&&D.call(_,P.pointer)&&P.element.releasePointerCapture(P.pointer),t.value=null,n.value=!1}function g(P=!1){const _=t.value;h(),_&&(v(),P&&s.announce(_.from,_.to,!0))}function b(){g(!0)}function m(){var P;return!!(u&&s.enabled()&&((P=s.root())!=null&&P.isConnected)&&s.root().clientWidth===u.width&&innerWidth===u.viewport[0]&&innerHeight===u.viewport[1]&&JSON.stringify(s.rows())===u.hash)}function f(){if(!u||!m()){g(!0);return}const P=u,_=P.boxes.filter(Q=>Q.id!==P.id),D=_.filter(Q=>P.y+scrollY>Q.top+Q.height/2).length,E=[..._];E.splice(D,0,P.boxes[P.from]);const A={};let U=P.boxes[0].top,q=U;for(const Q of E)Q.id===P.id?q=U:A[Q.id]=U-Q.top,U+=Q.height+Q.gap;const z=P.boxes[P.from],N=P.boxes[P.boxes.length-1],F=Math.max(P.boxes[0].top-z.top,Math.min(N.top+N.height-z.height-z.top,P.y-P.startY+scrollY-P.scroll)),Z=t.value;(!Z||Z.to!==D||Z.dy!==F)&&(t.value={id:P.id,from:P.from,to:D,dy:F,height:P.boxes[P.from].height,top:q-P.rootTop,offsets:A},(!Z||Z.to!==D)&&s.announce(P.from,D))}function k(P){if(c=void 0,!u||!t.value)return;if(!m()){g(!0);return}const _=document.querySelector(".direct-toolbar"),D=Math.max(8,((_==null?void 0:_.getBoundingClientRect().bottom)||0)+12),E=innerHeight-24,A=72,U=s.root().getBoundingClientRect(),q=u.x,z=r?Math.min(.032,(P-r)/1e3):0;r=P;const N=u.yE-A?Math.min(1,Math.max(0,(u.y-E+A)/A)):0;q>=U.left&&q<=U.right&&N&&window.scrollTo(0,Math.max(0,Math.min(u.maxScroll,scrollY+Math.sign(N)*N*N*720*z))),f(),u&&(c=requestAnimationFrame(k))}function $(P){!u||P.pointerId!==u.pointer||(u.x=P.clientX,u.y=P.clientY,!(!t.value&&Math.abs(P.clientY-u.startY)<6)&&(P.preventDefault(),f(),u&&c===void 0&&(c=requestAnimationFrame(k))))}function w(P){var A;if(!u||P.pointerId!==u.pointer)return;const _=(A=s.root())==null?void 0:A.getBoundingClientRect(),D=m()&&_&&P.clientX>=_.left&&P.clientX<=_.right&&P.clientY>=0&&P.clientY<=innerHeight;u.y=P.clientY,t.value&&D&&f();const E=t.value;h(),E&&(v(),D?s.commit(E.id,E.to):s.announce(E.from,E.to,!0))}function S(P,_){var z;if(P.button!==0||P.isPrimary===!1||!s.enabled())return;s.beforeStart(),h(),p=!1;const D=s.root();if(!D)return;const E=Array.from(D.querySelectorAll("[data-overview-row]")),A=E.map(N=>{const F=N.getBoundingClientRect();return{id:N.dataset.overviewRow,top:F.top+scrollY,height:F.height,gap:parseFloat(getComputedStyle(N).marginBottom)||0}}),U=A.findIndex(N=>N.id===_);if(U<0)return;const q=P.currentTarget;q.focus({preventScroll:!0}),u={pointer:P.pointerId,id:_,from:U,x:P.clientX,y:P.clientY,startY:P.clientY,scroll:scrollY,maxScroll:Math.max(0,document.documentElement.scrollHeight-innerHeight),hash:JSON.stringify(s.rows()),boxes:A,rootTop:D.getBoundingClientRect().top+scrollY,width:D.clientWidth,viewport:[innerWidth,innerHeight],element:q},n.value=!0,(z=q.setPointerCapture)==null||z.call(q,P.pointerId),q.addEventListener("lostpointercapture",b),window.addEventListener("pointermove",$,{passive:!1}),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",b),window.addEventListener("blur",b),window.addEventListener("resize",b)}function C(P){const _=t.value;return _?P===_.id?{transform:`translate3d(0,${_.dy}px,0)`,zIndex:80,transition:"none",pointerEvents:"none"}:{transform:`translate3d(0,${_.offsets[P]||0}px,0)`,pointerEvents:"none"}:{}}function y(){const P=p;return p=!1,P}return{preview:t,busy:n,active:l,start:S,cancel:g,style:C,consumeClick:y,debug:()=>{var P,_,D;return{pending:n.value,active:l.value,id:(P=t.value)==null?void 0:P.id,from:(_=t.value)==null?void 0:_.from,to:(D=t.value)==null?void 0:D.to,frame:c!==void 0}}}}const Ew={class:"home-top","data-home-top":""},Iw={class:"home-top-actions"},Dw={href:"https://www.istoreos.com/",target:"_blank",rel:"noopener noreferrer"},Lw=["disabled","aria-pressed","aria-label","title"],Aw=["inert"],Nw={class:"direct-edit-label"},Ow=["aria-pressed"],zw=["disabled"],qw={class:"direct-toolbar-end"},Rw={class:"presentation-result","data-display-preview":""},Vw={key:0,role:"status"},Bw={key:1,class:"presentation-impact"},Uw=["disabled"],Fw={class:"direct-panel-note"},Hw={class:"presentation-impact","data-adaptation-preview":""},Gw={key:0},jw={class:"presentation-help"},Ww={class:"slot-confirm"},Jw={class:"direct-panel-note"},Kw={class:"ordered-width"},Zw=["max","value"],Yw={class:"direct-panel-note"},Qw=["data-target-option","aria-disabled","onClick"],Xw={key:0},e$={key:6,class:"direct-moving-bar",role:"status"},t$={class:"ordered-template-list","aria-label":"行布局样式"},n$=["onClick","aria-pressed","data-template"],a$={key:0,class:"slot-change-preview","data-structure-preview":""},s$={key:0},o$=["checked","onChange","data-retain"],l$={key:2},i$={key:3},r$={key:4,role:"status"},c$={key:5,role:"status"},d$={key:6,"data-structure-adaptations":""},u$={class:"slot-confirm"},v$=["disabled"],p$={class:"direct-panel-note","data-natural-height-note":""},h$={key:1,class:"direct-ratio-presets"},m$=["onClick","aria-pressed","data-width-preset"],f$={class:"ordered-row-actions"},b$={class:"ordered-editor-hint"},g$={class:"direct-panel-note"},_$=["data-finish-row"],y$=["onClick"],k$={class:"slot-confirm"},w$=["disabled"],$$={class:"slot-overview-heading"},C$={role:"status"},S$=["data-overview-row"],x$=["data-placement","onClick","aria-label"],P$=["onPointerdown","onClick","onKeydown","data-row-handle","aria-label","title"],T$=["data-row-menu"],M$=["aria-label"],E$=["onClick","disabled"],I$=["onClick","disabled"],D$=["onClick","disabled"],L$=["onClick","disabled"],A$=["onClick","data-select-row"],N$=["onPointerdown","onClick","data-drag-card"],O$=["title"],z$=["data-overview-form"],q$={class:"slot-overview-actions"},R$=["onClick","data-move-card"],V$=["onClick","aria-label"],B$=["onClick","data-module-menu","aria-label"],U$=["data-overview-empty","onClick"],F$=["data-placement","aria-label","aria-disabled","onClick"],H$=["data-placement","aria-label","aria-disabled","onClick"],G$=["data-ordered-row","data-row-source"],j$=["data-placement","onClick"],W$={key:1,class:"direct-row-tools"},J$=["onClick","aria-label","data-select-row"],K$=["data-ordered-column"],Z$=["data-ordered-card"],Y$={key:0,class:"ordered-card-controls slot-card-tools"},Q$=["onClick","aria-label","data-display-settings"],X$=["onClick","aria-label","data-replace-module"],eC=["onClick","aria-label","data-hide-module"],tC=["onClick","data-empty-slot"],nC=["data-placement","aria-label","aria-disabled","onClick"],aC={key:0},sC=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax","onPointerdown","onKeydown","title"],oC=["aria-valuenow","aria-valuemin","aria-valuemax","aria-label","onPointerdown","onKeydown"],lC={key:0},iC=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax","onPointerdown","onKeydown","title"],rC={key:4,class:"row-size-hint",role:"status","data-size-hint":""},cC={key:2,class:"ordered-empty"},dC={class:"direct-panel-note"},uC={class:"slot-module-list"},vC=["onClick","disabled","aria-pressed","data-choice","data-fit"],pC={key:0,class:"slot-change-preview","data-choice-preview":""},hC={key:0},mC={key:1},fC={class:"presentation-impact"},bC=["aria-pressed"],gC=["disabled"],_C={key:1,class:"slot-confirm"},yC=X({__name:"HomeLayout",props:{config:{},data:{},errors:{},theme:{},favoriteIds:{},canEdit:{type:Boolean},externalBusy:{type:Boolean},bootstrapping:{type:Boolean},persist:{type:Function}},emits:["navigate","device","editing","visible"],setup(s,{emit:t}){var bl;const n=Tr({loader:()=>Po(()=>import("./FastnetInstallDialog.js?v=Bkzq9Ozt"),__vite__mapDeps([0,1,2])),timeout:8e3,errorComponent:{inheritAttrs:!1,setup:()=>()=>vo(na,{title:"FastNet",onClose:w},()=>[vo("p",{role:"alert"},r("安装窗口加载失败,请刷新页面后重试。","The installation window could not load. Refresh and retry.")),vo("button",{type:"button",onClick:w,style:{padding:"8px 16px",border:"1px solid var(--qs-card-line)",borderRadius:"8px",background:"var(--qs-card-soft)",color:"inherit"}},r("返回","Back"))])}}),l=s,u=t,c=window.vue_lang==="en",r=(M,L)=>c?L:M,p=M=>r(rn(M).zh,rn(M).en),v=Ko(),h=ba(ui,null),g=x(null),b=x(!1),m=x(""),f=x("checking");let k=0,$;function w(){return B(this,null,function*(){var L;const M=g.value;k++,$==null||$.abort(),g.value=null,m.value="",b.value=!1,M&&(yield ot(),yield ot(),(L=document.querySelector('[data-choice="'+M+'"]'))==null||L.focus({preventScroll:!0}))})}function S(M){g.value=null,Ft.value=vt(),Ht.value=je(),ct.value=M,qt.value=!1}function C(){return B(this,null,function*(){if(!h||!g.value)return;const M=++k,L=g.value;$==null||$.abort(),$=new AbortController,f.value="checking",m.value="";try{const I=yield h.inspect(L,$.signal);if(M!==k)return;if(I==="ready"){if(yield v.discover(!0),M!==k)return;if(!D(L)){S(L);return}f.value="unknown"}else f.value=I}catch(I){M===k&&(f.value="unknown",m.value=I instanceof Error?I.message:String(I))}})}function y(M){if(!Ka(M)){if(D(M)){g.value=M,C();return}ct.value=M,qt.value=!1}}function P(){return B(this,null,function*(){if(!h||!g.value||b.value||!["uninstalled","update_required","failed","installing"].includes(f.value))return;const M=g.value,L=k;b.value=!0,m.value="",$==null||$.abort(),$=new AbortController;try{if(yield h.install(M,$.signal),yield v.discover(!0),L!==k)return;if(D(M))throw Error(r("插件安装后仍未注册卡片,请升级或修复插件。","Plugin did not register a card; update or repair it."));S(M)}catch(I){L===k&&(f.value="unknown",m.value=I instanceof Error?I.message:String(I))}finally{L===k&&(b.value=!1)}})}const _=R(()=>[...Un,...Array.from(new Set([...hi.map(M=>M.id),...v.cards.value.map(M=>M.id),...Object.keys(l.config.widgetPreferences).filter(M=>M.startsWith("plugin."))])).map(M=>rn(M))]),D=M=>M.startsWith("plugin.")&&!v.cards.value.some(L=>L.id===M),E=R(()=>l.config.rows),A=R(()=>l.config.widgetPreferences);R(()=>l.theme);const U=l.data,q=l.errors,z=x(!1),N={get favorites(){return l.favoriteIds}},{noticeState:F,notice:Z,showNotice:Q,dismissNotice:ce}=Wk(),ve=x(!1),O=x(rt(E.value)),de=x(rt(A.value)),K=x(0),xe=x([]),j=x(((bl=O.value[0])==null?void 0:bl.id)||""),re=x(0),$e=R(()=>ve.value?O.value:E.value),qe=R(()=>Yt($e.value));R(()=>Un.filter(M=>!qe.value.includes(M.id))),We(qe,M=>u("visible",M),{immediate:!0});const De=R(()=>O.value.findIndex(M=>M.id===j.value)),Ke=R(()=>O.value[De.value]),at=R(()=>{var I,te;const M=((I=Ke.value)==null?void 0:I.columns.length)===3?[[34,33,33],[50,25,25],[25,50,25]]:[[50,50],[60,40],[65,35],[40,60]],L=((te=Ke.value)==null?void 0:te.columns.map(Ie=>Ie.weight))||[];return M.some(Ie=>Ie.join("/")===L.join("/"))?M:[L,...M]}),st=x(null),et=x(null),Ze=x(null),it=x(1160),he=x(0),H=R(()=>l.bootstrapping||!he.value),J=R(()=>H.value?[]:V1(Et.value,he.value,N.favorites.length,ve.value,Pt.value)),ge=x(null),ze=x(!1),Fe=x(null),Ee=x(""),dt=x(null),tt=x(null),kt=x(""),ct=x(null),Tt=x(null),ut=x([]),St=x(null),ht=x(!1),xt=x(null),en=x(null),qt=x(!1),Ft=x(null),Ht=x(null),ke=x(null),Se=x("applications"),ae=x({mode:"auto",iconRows:0}),He=x(null),Re=x(null),Ue=R(()=>{if(!He.value||!Re.value)return null;const M=rt(He.value.widgetPreferences);return M[Se.value]=rt(ae.value),pa(He.value,{rows:He.value.rows,issue:"",hidden:[]},Re.value,M)}),Et=R(()=>{var M;return ve.value&&Ee.value==="display"&&((M=Ue.value)==null?void 0:M.status)!=="blocked"&&Ue.value?Ue.value.next.rows:$e.value}),Pt=R(()=>{var M;return ve.value&&Ee.value==="display"&&((M=Ue.value)==null?void 0:M.status)!=="blocked"&&Ue.value?Ue.value.next.widgetPreferences:ve.value?de.value:A.value}),Ot=Qk(et,J,()=>[J.value,Pt.value,U,q,ht.value],()=>ht.value||!!H.value),_t=x("");function dn(M){return M?"stacked":"ordinary"}function Gt(M){return Et.value.find(L=>L.id===M.source)}function un(M){const L=Gt(M);return he.value>=650&&L&&M.columns.length===L.columns.length&&M.columns.every(I=>I.cards.length===L.columns[I.source].cards.length)}function wt(M){return ve.value&&!bt.value&&!ht.value&&M.source===j.value&&un(M)}function sa(M){const L=Gt(M);return un(M)&&(L.minHeight!==void 0||L.columns.some(I=>I.upperShare!==void 0))}function tn(M){var L;return Math.max(((L=Ot.sizes.value[M.id])==null?void 0:L.height)||M.chartHeight||M.height,un(M)&&Gt(M).minHeight||0)}function Zt(M,L){var Ve;const I=((Ve=Ot.sizes.value[M.id])==null?void 0:Ve.columns[L])||[148,148],te=M.columns[L],Ie=Gt(M).columns[te.source].upperShare,me=tn(M)-18,Le=te.cards.map(Je=>Je&&Kt(Je,Pt.value[Je],{width:1e3,height:1e5,role:"stacked",favoriteCount:4,natural:!0}).stretch),Me=Le[0]?me-I[1]:Le[1]?I[0]:I[0]+Math.max(0,me-I[0]-I[1])/2;return O1(tn(M),I,Ie!=null?Ie:Me/me*100)}function be(M){var L;return(L=et.value)==null?void 0:L.querySelector('[data-ordered-row="'+M.id+'"]')}function Te(M,L){return Zt(M,L).upper+9}function ie(M,L,I){if(un(M)&&L.cards.length===2&&Gt(M).columns[L.source].upperShare!==void 0&&Ot.sizes.value[M.id]){const te=Zt(M,I);return{gridTemplateRows:te.upper+"px "+te.lower+"px"}}return vr(L)}function Ye(){Ut(),ca(M=>{const L=M.find(I=>I.id===j.value);return L&&(delete L.minHeight,L.columns.forEach(I=>delete I.upperShare)),M}),_t.value=""}function je(){return{width:Math.max(240,he.value),favoriteCount:N.favorites.length,favoritesKey:N.favorites.join("|")}}function vt(){return Xa(O.value,de.value,K.value)}const bn=R(()=>{if(!Ue.value||!Re.value)return"";const M=Ue.value.next.rows,L=M.find(me=>Yt([me]).includes(Se.value));if(!L)return"";const I=L.columns.findIndex(me=>me.cards.includes(Se.value)),te=qo(L,Re.value.width,Ue.value.next.widgetPreferences)[I],Ie=Kt(Se.value,ae.value,{width:te,height:1e5,role:L.columns[I].cards.length===2?"stacked":"ordinary",favoriteCount:Re.value.favoriteCount,mobile:Re.value.width<650,natural:!0});return(Se.value==="applications"?Ie.columns+r("列 × "," columns × ")+Ie.rows+r("行"," rows")+" · ":"")+Math.round(te)+r("px 宽 · 自适应高度","px wide · Content height")});function gn(M){return B(this,null,function*(){var L,I;En("display"),Se.value=M,ae.value=rt(de.value[M]),He.value=vt(),Re.value=je(),ht.value=!1,yield ot(),(I=(L=et.value)==null?void 0:L.querySelector(`[data-display-settings="${M}"]`))==null||I.scrollIntoView({block:"center"})})}function ka(M,L){tt.value=ye({kind:"slot"},L),ke.value=M,En("module-actions")}function Rt(M){var I;if(z.value)return!1;const L=vt();return Cn(L)===Cn(M)?!1:(xe.value=[...xe.value.slice(-29),L],O.value=rt(M.rows),de.value=rt(M.widgetPreferences),K.value++,M.rows.some(te=>te.id===j.value)||(j.value=((I=M.rows[0])==null?void 0:I.id)||""),Z.value="",!0)}function oa(){if(!Ue.value)return;const M=ws(vt(),Ue.value,je());if(M.issue){In(M.issue);return}Rt(M.document),ft()}const Gn=M=>({auto:r("自动推荐","Automatic"),standard:r("标准","Standard"),summary:r("摘要","Summary"),grid:r("图标网格","Icon grid"),strip:r("启动条","Launch strip")})[M]||M;function wa(M){return Object.keys(M.next.widgetPreferences).filter(L=>JSON.stringify(de.value[L])!==JSON.stringify(M.next.widgetPreferences[L]))}function Va(M,L){const I=pa(vt(),M,je()),te=ko(vt(),M,je(),L);return{direct:I,alternative:te}}function cs(M,L){const{direct:I,alternative:te}=Va(M,L);if(I.status==="blocked"&&(!te||te.status==="blocked"))return In(I.issue),!1;if(I.status==="ready")return Rt(I.next);const Ie=I.status==="blocked"?te:I;return En("adapt"),xt.value=Ie,en.value=I.status==="blocked"?null:te,!1}function eo(){if(!xt.value)return;const M=ws(vt(),xt.value,je());if(M.issue){In(M.issue);return}Rt(M.document),ft()}function to(M){return j1(M,()=>!0,L=>ks(L,de.value,je()))}const ee=Mw({rows:()=>O.value,root:()=>Ze.value,enabled:()=>ve.value&&ht.value&&!Ee.value,beforeStart:()=>{var M;Ut(),dt.value=null,(M=Ze.value)==null||M.querySelectorAll("details[open]").forEach(L=>L.removeAttribute("open"))},commit:(M,L)=>{fe(M,L)},announce:(M,L,I)=>{Z.value=I?r("已取消排序,布局未改变。","Sort cancelled. Layout unchanged."):r("第","Row ")+(M+1)+r("行 → 第"," → position ")+(L+1)+r("位,松手放置。","; release to place.")}});function se(M){ee.consumeClick()||(j.value=M,dt.value=null)}function fe(M,L,I=!1){return B(this,null,function*(){var Ve,Je,$t;Ut(),(Ve=Ze.value)==null||Ve.querySelectorAll("details[open]").forEach(Dt=>Dt.removeAttribute("open"));const te=O.value.filter(Dt=>Dt.id!==M);if(O.value.findIndex(Dt=>Dt.id===M)<0||L<0||L>te.length)return;const me=H1(O.value,M,((Je=te[L])==null?void 0:Je.id)||null),Le=no(me);j.value=M,Z.value=Le?r("整行位置已调整,可撤销。","Row reordered. Undo is available."):r("位置未改变。","Position unchanged."),yield ot();const Me=($t=Ze.value)==null?void 0:$t.querySelector(`[data-row-handle="${M}"]`);Me==null||Me.focus({preventScroll:!0}),I&&(Me==null||Me.scrollIntoView({block:"nearest"}))})}function mt(M,L,I){if(!M.altKey)return;const te=M.key==="ArrowUp"?I-1:M.key==="ArrowDown"?I+1:M.key==="Home"?0:M.key==="End"?O.value.length-1:void 0;te!==void 0&&(M.preventDefault(),fe(L,te,!0))}function vn(){Ut(),ft(),ht.value=!ht.value,window.scrollTo({top:0})}function _n(M){return B(this,null,function*(){var L,I,te;Ut(),ht.value=!1,dt.value=M,j.value=((L=Vn(O.value,M))==null?void 0:L.row)||"",yield ot(),(te=(I=et.value)==null?void 0:I.querySelector(`[data-replace-module="${M}"]`))==null||te.scrollIntoView({block:"center"})})}function la(M,L){return L?L===M.columns.length?"100%":M.columns.slice(0,L).reduce((I,te)=>I+te.weight,0)+"%":"0%"}function Pn(M){if(!M)return r("移除空行","Remove empty row");const L=Yn.find(I=>I.id===M.template);return r(L.zh,L.en)+" · "+Yt([M]).map(p).join(" / ")+" · "+r("自适应高度","Content height")}function ia(){if(St.value&&!St.value.issue){const M=St.value.rows;ft(),al(M)}}function Ce(M){return B(this,null,function*(){var L,I;j.value=M,En("row"),yield ot(),(I=(L=et.value)==null?void 0:L.querySelector(`[data-row-source="${M}"]`))==null||I.scrollIntoView({block:"center"})})}const Tn=R(()=>{var M;return((M=Yn.find(L=>L.id===Tt.value))==null?void 0:M.slots.reduce((L,I)=>L+I,0))||0}),ds=R(()=>{const M=Yn.find(L=>L.id===Tt.value);return M?r(M.zh,M.en):""}),pn=R(()=>{if(!Tt.value)return{rows:O.value,issue:"",changed:!1,hidden:[]};const M=U1(O.value,j.value,Tt.value,Yt([Ke.value]).length>Tn.value?ut.value:void 0);if(M.issue&&!M.issue.startsWith("height:"))return M;const L=ki(M.candidateRows||M.rows),I=ks(L,de.value,je());if(I.issue){const te=ko(vt(),M,je());return Ne(ye({},M),{issue:te&&te.status!=="blocked"&&!I.issue.startsWith("height:")?"":I.issue,requiresAdaptation:!!te&&te.status!=="blocked"&&!I.issue.startsWith("height:"),requiredHeight:I.requiredHeight,problemRow:I.row})}return Ne(ye({},M),{rows:L,candidateRows:void 0,issue:"",requiredHeight:void 0,changed:JSON.stringify(L)!==JSON.stringify(O.value)})});function $a(M){var I;const L=O.value.findIndex(te=>te.id===M.row);return r("第","Row ")+(L+1)+r("行 · 第"," · Column ")+(M.column+1)+(((I=O.value[L])==null?void 0:I.columns[M.column].cards.length)===2?M.slot===0?r("列上方"," top"):r("列下方"," bottom"):r("列",""))}function Ba(M){if(Ka(M))return r("需要升级 Quickstart","Update Quickstart");if(D(M))return v.state.value!=="ready"?r("正在确认插件状态,暂不可添加","Plugin status unknown; adding unavailable"):r("需要先安装或升级插件","Install or update the plugin first");const L=Vn(O.value,M);return L?r("已在首页 · 移到这里 · ","On home · Move here · ")+$a(L):r("未展示 · 添加","Hidden · Add")}function jn(M){var I,te;const L=((I=Ft.value)==null?void 0:I.rows)||O.value;return((te=tt.value)==null?void 0:te.kind)==="slot"?Bo(L,tt.value,M):wi(L,M,null)}function hn(M){const L=Ft.value||vt(),I=ye({},L.widgetPreferences);return I[M]||(I[M]={mode:"auto",iconRows:0,ruleVersion:2}),pa(L,jn(M),Ht.value||je(),I)}function sn(M){const L=Ft.value||vt();return M.startsWith("plugin.")&&!L.widgetPreferences[M]?pa(L,jn(M),Ht.value||je(),Ne(ye({},L.widgetPreferences),{[M]:{mode:"summary",iconRows:0,ruleVersion:2}})):ko(L,jn(M),Ht.value||je(),M)}function us(M){return hn(M).status!=="blocked"||!!sn(M)&&sn(M).status!=="blocked"}function ra(M){const L=hn(M);return L.status==="blocked"&&us(M)?"needs-confirmation":L.status}const nn=R(()=>ct.value?qt.value||hn(ct.value).status==="blocked"?sn(ct.value):hn(ct.value):null);function Mn(M){Ut(),tt.value=(M==null?void 0:M.kind)==="slot"?M:null,ct.value=null,qt.value=!1,En("slot"),Ft.value=vt(),Ht.value=je()}function Ji(){const M=nn.value;if(!M)return;const L=ws(vt(),M,je());if(L.issue){In(L.issue);return}Rt(L.document),ft()}function Ki(){const M=tt.value?Il(O.value,tt.value):null;ft(),M&&ao(M)}function no(M){return cs(M)}function Zi(M){ut.value=ut.value.includes(M)?ut.value.filter(L=>L!==M):[...ut.value,M]}const vs=R(()=>{const M=Va(pn.value);return M.direct.status==="blocked"&&M.alternative||M.direct});function Yi(){const M=vs.value;if(!M||M.status==="blocked")return;const L=ws(vt(),M,je());if(L.issue){In(L.issue);return}Rt(L.document),Tt.value=null}function Qi(){const M=pa(vt(),{rows:R1(),issue:"",hidden:[]},je(),Yo());M.status!=="blocked"&&Rt(M.next)}function Xi(M){const L=J.value.find(me=>me.columns.some(Le=>Le.cards.includes(M))),I=L==null?void 0:L.columns.find(me=>me.cards.includes(M));if(!L||!I)return"";const te=qo({id:L.id,height:L.height,columns:L.columns},he.value,Pt.value)[L.columns.indexOf(I)],Ie=Kt(M,Pt.value[M],{width:te,height:1e5,role:I.compact?"stacked":"ordinary",favoriteCount:4,natural:!0});return Gn(Ie.id)}function En(M){Ut(),Ee.value=M,dt.value=null,Tt.value=null}function ft(){const M=Ee.value==="display"?Se.value:null;Ee.value="",He.value=null,Re.value=null,xt.value=null,en.value=null,Ft.value=null,Ht.value=null,M&&ot(()=>{var L,I;return(I=(L=et.value)==null?void 0:L.querySelector(`[data-display-settings="${M}"]`))==null?void 0:I.focus({preventScroll:!0})})}function er(M){var L;if(Ot.schedule(),!kn&&!M.target.closest("button,input,select,a,summary,.direct-panel,.ordered-library")){const I=ve.value&&((L=M.target.closest("[data-row-source]"))==null?void 0:L.dataset.rowSource)||"";I!==j.value&&(_t.value=""),j.value=I,dt.value=null}}function tl(){var M;!l.canEdit||l.externalBusy||z.value||(u("editing",!0),O.value=rt(E.value),de.value=rt(A.value),K.value++,xe.value=[],ve.value=!0,ht.value=!1,j.value=((M=O.value[0])==null?void 0:M.id)||"",dt.value=null,Z.value="",_t.value="")}function nl(){var M;z.value||(u("editing",!1),Ut(),ft(),ze.value=!1,ve.value=!1,ht.value=!1,O.value=rt(E.value),de.value=rt(A.value),K.value++,Z.value=r("已取消,保留路由器上已保存的布局。","Cancelled. The saved router layout is unchanged."),(M=ge.value)==null||M.focus())}function tr(){if(z.value)return;Ut();const M=to(O.value);if(M.issue||M.changed){St.value=M,En("finish");return}al(M.rows)}function al(M){return B(this,null,function*(){var I;const L=ks(M,de.value,je());if(L.issue){In(L.issue);return}if(!z.value){z.value=!0,Q(r("正在保存…","Saving…"),"progress");try{yield l.persist({schemaVersion:4,rows:rt(M),widgetPreferences:rt(de.value)}),O.value=rt(M),ft(),ze.value=!1,ve.value=!1,ht.value=!1,u("editing",!1),Z.value=r("首页布局已保存。","Homepage layout saved."),(I=ge.value)==null||I.focus()}catch(te){Q(te.message||r("保存失败,草稿仍保留。","Save failed. Your draft is kept."),"error")}finally{z.value=!1}}})}function In(M){Q(Dn(M),"error")}function ca(M){const L=vt(),I=M(rt(O.value)),te=pa(L,{rows:I,issue:"",hidden:[]},je(),de.value,!1);return te.status==="blocked"?(In(te.issue),!1):Rt(te.next)}function nr(){var L;Ut(),ft();const M=xe.value.pop();M&&(O.value=rt(M.rows),de.value=rt(M.widgetPreferences),K.value++,M.rows.some(I=>I.id===j.value)||(j.value=((L=M.rows[0])==null?void 0:L.id)||""),Z.value=r("已撤销上一次布局修改。","Last layout change undone."))}function ar(M){Tt.value=M;const L=Yn.find(I=>I.id===M).slots.reduce((I,te)=>I+te,0);ut.value=Yt([Ke.value]).slice(0,L)}function sr(M){no(F1(O.value,j.value,{weights:M}))}function ao(M){return B(this,null,function*(){var te,Ie,me;const L=Vn(O.value,M);if(!L)return;j.value=L.row,no(Bo(O.value,L,null)),dt.value=null,yield ot();const I=`slot:${L.row}:${L.column}:${L.slot}`;ht.value?(te=document.querySelector(`[data-overview-empty="${I}"]`))==null||te.focus({preventScroll:!0}):(me=(Ie=et.value)==null?void 0:Ie.querySelector(`[data-empty-slot="${I}"]`))==null||me.focus({preventScroll:!0})})}function sl(){const M=Rn();ca(L=>[...L,M]),j.value=M.id}function or(){ca(M=>M.filter(L=>L.id!==j.value)),ft()}function lr(){ca(()=>[])}function ir(M,L){kn||(j.value=M,dt.value=dt.value===L?null:L,Z.value="")}const bt=x(null),da=x(""),Ca=x(null),so=R(()=>Tw(O.value)),oo=R(()=>bt.value?p(bt.value.id):"");function Dn(M){return M==="compact"?r("此形态不支持上下位置,请换形态或选择普通位置。","This form does not support a stacked position. Change form or position."):M==="retained"||M==="choose-retained"?r("请按槽位数量选择保留模块。","Choose modules within this layout’s capacity."):M==="incomplete-stack"?r("上下组合仍有空位,请补齐或更换行布局。","Fill the stacked slots or choose another layout."):M==="hard-spec"?r("整理后的规格不适配,请更换布局。","The simplified layout does not fit."):M==="capacity"?r("此行无法继续插入,请选择新行或更换布局。","This row is full. Use a new row or change its layout."):M==="structure"?r("比例合计须为100%,且与布局槽位一致。","Proportions must total 100% and match the layout."):M==="row-target"?r("整行请放到行间","Move whole rows between rows"):M==="target"?r("目标已变化,请重新选择","Destination changed; choose again"):M.startsWith("height:")?r("需要行高至少 ","Needs row height of at least ")+M.split(":")[1]+" px":M.startsWith("width:")?r("需要更宽的槽位:","Needs a wider slot: ")+M.split(":")[1]+" px":r("无法采用此组合:","Cannot use this layout: ")+M}function It(M){var Me,Ve;const L=M.kind!=="edge"?O.value.findIndex(Je=>Je.id===M.row):M.before?O.value.findIndex(Je=>Je.id===M.before):O.value.length,I=M.kind==="slot"?$a(M):M.kind==="beside"?r("并排插入第","Insert beside row ")+(L+1)+r("行",""):M.before?r("第","Before row ")+(L+1)+r("行之前",""):r("页面末尾","End of page"),te=M.kind==="slot"?(Ve=(Me=O.value[L])==null?void 0:Me.columns[M.column])==null?void 0:Ve.cards[M.slot]:null,Ie=bt.value?Va(wo(O.value,bt.value,M),bt.value.id):null,me=M.kind==="edge"?r("独占新行","New single row"):M.kind==="beside"?r("预览扩列","Preview new column"):te?r("替换","Replace ")+p(te)+r(",原模块隐藏","; current module will be hidden"):r("移入空位","Move into empty slot"),Le=Ie&&(Ie.direct.status!=="blocked"||Ie.alternative&&Ie.alternative.status!=="blocked");return{label:I+" · "+me+(Ie&&Le&&Ie.direct.status!=="ready"?r(" · 调整后可放入"," · Adjust to fit"):""),issue:Ie&&!Le?Ie.direct.issue:""}}const ol=R(()=>{const M=so.value.find(te=>Ga(te)===da.value);if(!M)return r("选择位置;来源空位会保留,可撤销。","Choose a destination. The source slot stays empty; undo is available.");const L=It(M);if(L.issue)return Dn(L.issue);const I=bt.value?wo(O.value,bt.value,M).rows:[];return L.label+(M.kind!=="edge"?" → "+Pn(I.find(te=>te.id===M.row)):"")});function ll(M){var I;if(!bt.value)return;const L=(I=M.target.closest("[data-placement]"))==null?void 0:I.dataset.placement;L&&(da.value=L)}const yn=(M,L,I)=>({kind:"slot",row:M.source,column:L.source,slot:L.slots[I]}),lo=(M,L,I)=>Ga(yn(M,L,I)),rr=M=>{var L;return((L=J.value.find(I=>I.source===M.source))==null?void 0:L.id)===M.id};function il(M){if(kn){kn=!1;return}ee.cancel(),zt==null||zt(),ht.value=!0,bt.value=M,Ee.value="",Z.value=""}function cr(){return B(this,null,function*(){var L,I;const M=bt.value;Vt==null||Vt(),Sa(),Z.value=r("已取消移动,布局未改变。","Move cancelled. Layout unchanged."),yield ot(),M&&((I=(L=Ze.value)==null?void 0:L.querySelector(`[data-drag-card="${M.id}"]`))==null||I.focus({preventScroll:!0}))})}function Sa(){bt.value=null,da.value="",Ca.value=null,Ee.value==="targets"&&(Ee.value="")}function Ln(M){return B(this,null,function*(){var me,Le;if(!bt.value)return;const L=It(M);if(L.issue){In(L.issue);return}const I=bt.value,te=wo(O.value,I,M),Ie=cs(te,I.id);Ee.value!=="adapt"&&Sa(),Ie&&(Z.value=r("位置已调整,可撤销。","Position updated. Undo is available.")),yield ot(),Ee.value!=="adapt"&&((Le=(me=Ze.value)==null?void 0:me.querySelector(`[data-drag-card="${I.id}"]`))==null||Le.focus({preventScroll:!0}))})}let Vt,kn=!1;function dr(M,L){if(M.button!==0||M.isPrimary===!1||zt||Ee.value)return;ee.cancel(),Vt==null||Vt();const I={x:M.clientX,y:M.clientY},te=M.pointerId,Ie=[innerWidth,innerHeight];let me=!1;const Le=$t=>{var Dt,Wt,Jt;$t.pointerId===te&&(!me&&Math.hypot($t.clientX-I.x,$t.clientY-I.y)<6||(me||(il(L),me=!0),$t.preventDefault(),Ca.value={x:Math.max(((Dt=et.value)==null?void 0:Dt.getBoundingClientRect().left)||0,Math.min(innerWidth-180,$t.clientX+12)),y:Math.max(0,Math.min(innerHeight-80,$t.clientY+12))},da.value=((Jt=(Wt=document.elementFromPoint($t.clientX,$t.clientY))==null?void 0:Wt.closest("[data-placement]"))==null?void 0:Jt.dataset.placement)||""))},Me=()=>{window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",Je),window.removeEventListener("pointercancel",Ve),window.removeEventListener("blur",Ve),Vt=void 0},Ve=()=>{Me(),me&&(kn=!0,setTimeout(()=>kn=!1,0),Sa())},Je=$t=>{if($t.pointerId===te&&(Me(),me)){if(kn=!0,setTimeout(()=>kn=!1,0),Ie[0]!==innerWidth||Ie[1]!==innerHeight){Sa();return}const Dt=so.value.find(Wt=>Ga(Wt)===da.value);Dt?Ln(Dt):Sa(),Ca.value=null}};Vt=Ve,window.addEventListener("pointermove",Le,{passive:!1}),window.addEventListener("pointerup",Je),window.addEventListener("pointercancel",Ve),window.addEventListener("blur",Ve)}function ur(M){return{height:sa(M)&&Ot.sizes.value[M.id]?tn(M)+"px":M.natural?"auto":M.height+"px",minHeight:M.chartHeight?M.chartHeight+"px":void 0,"--natural-chart-height":(M.chartHeight||320)+"px",gridTemplateColumns:M.columns.map(L=>"minmax("+Math.min(he.value,Math.max(...L.cards.map(I=>I?Os(I,Pt.value[I],L.cards.length===2).minWidth:260)))+"px,"+L.weight+"fr)").join(" ")}}function vr(M){if(M.cards.length===1)return{gridTemplateRows:"auto"};const L=M.cards.map(I=>I&&Kt(I,Pt.value[I],{width:1e3,height:1e5,role:"stacked",favoriteCount:4,natural:!0}).stretch);return{gridTemplateRows:L[0]?"minmax(min-content,1fr) max-content":L[1]?"max-content minmax(min-content,1fr)":"auto auto"}}function pr(M){var L;return sa(M)||M.columns.length>1&&M.columns.some(I=>I.compact)&&(((L=Pt.value.traffic.ruleVersion)!=null?L:2)>=2||M.columns.some(I=>I.compact&&I.cards.some(te=>{var Ie;return te&&(((Ie=Pt.value[te].ruleVersion)!=null?Ie:2)>=2||Kt(te,Pt.value[te],{width:1e3,height:1e5,role:"stacked",favoriteCount:4,natural:!0}).stretch)})))}function hr(M,L){var Ie;const I=(Ie=et.value)==null?void 0:Ie.querySelector('[data-ordered-row="'+M.id+'"]'),te=I==null?void 0:I.querySelectorAll(".ordered-column");return!I||!(te!=null&&te[L])?0:te[L].getBoundingClientRect().right-I.getBoundingClientRect().left+9}let zt,xa=!1;function mr(M){xa&&(xa=!1,M.detail>0&&(M.preventDefault(),M.stopImmediatePropagation()))}function io(M,L,I){var Wt;if(M.button!==0)return;M.preventDefault(),zt==null||zt();const te=M.clientX,Ie=M.clientY,me=M.pointerId,Le=[innerWidth,innerHeight,(Wt=et.value)==null?void 0:Wt.clientWidth];let Me=!1;const Ve=Jt=>{if(Jt.pointerId!==me)return;const An=Jt.clientX-te,gl=Jt.clientY-Ie;Me||(Me=Math.hypot(An,gl)>3),Me&&L(An,gl)},Je=Jt=>{window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",$t),window.removeEventListener("pointercancel",Dt),window.removeEventListener("blur",Dt),zt=void 0,Me&&(xa=!0,kn=!0,setTimeout(()=>kn=!1,0)),I(Jt),kt.value=""},$t=Jt=>{var An;Jt.pointerId===me&&Je(Le[0]!==innerWidth||Le[1]!==innerHeight||Le[2]!==((An=et.value)==null?void 0:An.clientWidth))},Dt=()=>Je(!0);zt=Dt,window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",$t),window.addEventListener("pointercancel",Dt),window.addEventListener("blur",Dt)}function ro(M,L){if(L){O.value=M;return}const I=ks(O.value,de.value,je()).issue;if(I){O.value=M,In(I);return}JSON.stringify(M)!==JSON.stringify(O.value)&&(xe.value=[...xe.value.slice(-29),Xa(M,de.value,K.value)],K.value++)}function ps(M,L){const I=M.columns.reduce((Le,Me)=>Le+Me.weight,0),te=M.columns[L].weight+M.columns[L+1].weight,Ie=he.value-18*(M.columns.length-1),me=Le=>Math.max(...Le.cards.map(Me=>Me?Os(Me,de.value[Me],Le.cards.length===2).minWidth:260));return[Math.ceil(me(M.columns[L])/Ie*I*10)/10,Math.floor((te-me(M.columns[L+1])/Ie*I)*10)/10]}function fr(M,L,I){if(M.button!==0||M.isPrimary===!1||zt||Vt||ee.busy.value)return;const te=rt(O.value),Ie=O.value.find(Wt=>Wt.id===L.source),me=L.columns[I].source,Le=L.columns[I+1].source,Me=Ie.columns[me].weight,Ve=Me+Ie.columns[Le].weight,Je=he.value-18*(L.columns.length-1),$t=L.columns.reduce((Wt,Jt)=>Wt+Jt.weight,0),Dt=ps(L,I);kt.value=Ie.id,io(M,Wt=>{const Jt=Math.round((Me+Wt/Je*$t)/5)*5,An=Math.max(Dt[0],Math.min(Dt[1],Jt));Ie.columns[me].weight=An,Ie.columns[Le].weight=Number((Ve-An).toFixed(1)),An!==Jt&&(Z.value=r("已到卡片最小宽度。","Card minimum width reached."))},Wt=>ro(te,Wt))}function rl(M,L,I){Ut(),j.value=M.source;const te=ps(M,L);ca(Ie=>{const me=Ie.find($t=>$t.id===M.source),Le=M.columns[L].source,Me=M.columns[L+1].source,Ve=me.columns[Le].weight+me.columns[Me].weight,Je=Math.max(te[0],Math.min(te[1],me.columns[Le].weight+I));return me.columns[Le].weight=Je,me.columns[Me].weight=Number((Ve-Je).toFixed(1)),Ie})}function br(){_t.value=r("已到内容最小高度,可拉高整行增加调整空间。","Content minimum reached. Drag the row’s bottom edge for more room.")}function cl(M,L){var Ie;const I=((Ie=Ot.sizes.value[M.id])==null?void 0:Ie.height)||tn(M),te=xs(Math.round(L),I,Math.max(I,Vo));return _t.value=te!==Math.round(L)?LLe.id===L.source),Ie=((me=be(L))==null?void 0:me.getBoundingClientRect().height)||tn(L);kt.value=te.id,_t.value="",io(M,(Le,Me)=>{const Ve=cl(L,Ie+Me);Ve!==Math.round(Ie)?te.minHeight=Ve:I.find(Je=>Je.id===te.id).minHeight===void 0?delete te.minHeight:te.minHeight=I.find(Je=>Je.id===te.id).minHeight},Le=>{ro(I,Le),Le&&(_t.value="")})}function dl(M,L){var Ie;Ut();const I=((Ie=be(M))==null?void 0:Ie.getBoundingClientRect().height)||tn(M),te=cl(M,I+L);te!==Math.round(I)&&ca(me=>(me.find(Le=>Le.id===M.source).minHeight=te,me))}function ul(M,L,I,te,Ie){const me=Zt(M,L),Le=xs(I+te,me.min,me.max);return Le!==I+te?br():_t.value="",Math.abs(Le-I)<.5?!1:(Ie.find(Me=>Me.id===M.source).columns[M.columns[L].source].upperShare=Number(xs(Le/me.available*100,.01,99.99).toFixed(4)),!0)}function _r(M,L,I){var Le,Me;if(M.button!==0||M.isPrimary===!1||zt||Vt||ee.busy.value)return;const te=rt(O.value),Ie=(Le=be(L))==null?void 0:Le.querySelectorAll(":scope > .ordered-column")[I],me=((Me=Ie==null?void 0:Ie.querySelector(":scope > .ordered-card"))==null?void 0:Me.getBoundingClientRect().height)||Zt(L,I).upper;kt.value=L.source,_t.value="",io(M,(Ve,Je)=>{const $t=rt(te);ul(L,I,me,Je,$t),O.value=$t},Ve=>{ro(te,Ve),Ve&&(_t.value="")})}function vl(M,L,I){var me,Le;Ut();const te=(me=be(M))==null?void 0:me.querySelectorAll(":scope > .ordered-column")[L],Ie=((Le=te==null?void 0:te.querySelector(":scope > .ordered-card"))==null?void 0:Le.getBoundingClientRect().height)||Zt(M,L).upper;ca(Me=>(ul(M,L,Ie,I,Me),Me))}let hs=null;We(ze,M=>B(null,null,function*(){var L,I;M?(Ut(),Ee.value="",dt.value=null,hs=document.activeElement,yield ot(),(I=(L=Fe.value)==null?void 0:L.querySelector("button"))==null||I.focus()):hs==null||hs.focus({preventScroll:!0})}));function yr(){ze.value=!1,tt.value=null}function pl(M){if(M.key==="Escape"&&g.value){M.preventDefault(),M.stopImmediatePropagation(),w();return}if(M.key==="Escape"&&(ee.busy.value||bt.value||Vt||zt)){M.preventDefault(),M.stopImmediatePropagation();const L=bt.value;Ut(),L&&ot(()=>{var I,te;return(te=(I=Ze.value)==null?void 0:I.querySelector(`[data-drag-card="${L.id}"]`))==null?void 0:te.focus({preventScroll:!0})}),Z.value=r("已取消操作,布局未改变。","Action cancelled. Layout unchanged.")}else M.key==="Escape"&&(ze.value||Ee.value)&&(M.preventDefault(),M.stopImmediatePropagation(),ze.value?yr():ft())}function Ut(){ee.cancel(),Vt==null||Vt(),zt==null||zt(),Sa()}function hl(){Ut(),["display","adapt","slot"].includes(Ee.value)&&(ft(),Z.value=r("预览条件已变化,请重新选择。","Preview conditions changed. Choose again."))}We(()=>l.config,()=>{ve.value&&(Z.value=r("已读取当前保存版本,编辑草稿仍保留。","Saved version reloaded. Your editing draft is retained."))}),We(K,()=>{Vt==null||Vt(),ee.cancel()});let Pa;const ml=R(()=>ve.value&&Cn(vt())!==Cn(Xa(l.config.rows,l.config.widgetPreferences)));function fl(M){(ml.value||z.value)&&(M.preventDefault(),M.returnValue="")}return ti(()=>!ml.value&&!z.value||window.confirm(r("尚有未保存的首页修改,确定离开?","Leave without saving homepage changes?"))),nt(()=>{window.addEventListener("beforeunload",fl),window.addEventListener("keydown",pl,!0),window.addEventListener("resize",hl),Pa=new ResizeObserver(M=>{for(const L of M)L.target===st.value&&(it.value=L.contentRect.width),L.target===et.value&&(he.value=L.contentRect.width);Ot.schedule()}),st.value&&Pa.observe(st.value),et.value&&Pa.observe(et.value)}),lt(()=>{k++,$==null||$.abort(),Pa==null||Pa.disconnect(),Ut(),window.removeEventListener("beforeunload",fl),window.removeEventListener("keydown",pl,!0),window.removeEventListener("resize",hl),zt==null||zt()}),(M,L)=>(i(),d("main",{class:_e(["canvas-home layout-design-home ordered-home natural-home home-semantic-colors",{"ordered-editing":ve.value,"slot-overview-active":ht.value}]),"data-ordered-home":"",onPointerdownCapture:L[23]||(L[23]=I=>Mr(xa)?xa.value=!1:xa=!1),onClickCapture:mr,onClick:er},[e("div",Ew,[e("div",Iw,[e("a",Dw,a(r("iStoreOS官网","iStoreOS website")),1),G(bw),e("button",{ref_key:"editButton",ref:ge,class:"home-module-settings",onClick:L[0]||(L[0]=I=>ve.value?nl():tl()),disabled:H.value||!s.canEdit||s.externalBusy||z.value,"aria-pressed":ve.value,"aria-label":r("自定义首页","Customize home"),title:r("模块设置","Module settings"),"data-home-settings":""},[G(sw,{color:"#fff"})],8,Lw)])]),Ct(M.$slots,"status",{},void 0,!0),ve.value?(i(),d("section",{key:0,inert:z.value,class:"direct-toolbar","aria-label":"首页布局编辑器"},[e("span",Nw,[L[24]||(L[24]=e("i",null,null,-1)),ue(a(r("整理首页","Arrange home")),1)]),e("button",{onClick:L[1]||(L[1]=I=>Mn(null)),"data-open-library":""},"+ "+a(r("添加模块","Add module")),1),e("button",{onClick:vn,"aria-pressed":ht.value,"data-overview":""},a(ht.value?r("真实页面","Real page"):r("布局总览","Overview")),9,Ow),e("button",{onClick:nr,disabled:!xe.value.length,"data-undo":""},[L[25]||(L[25]=ue("↶ ",-1)),e("span",null,a(r("撤销","Undo")),1)],8,zw),e("button",{onClick:L[2]||(L[2]=I=>En("more"))},a(r("更多","More"))+" ···",1),e("div",qw,[e("button",{onClick:nl,"data-cancel":""},a(r("取消","Cancel")),1),e("button",{onClick:tr,class:"primary","data-apply":""},a(r("完成","Done")),1)])],8,Aw)):T("",!0),Ee.value==="display"&&Ue.value?(i(),Y(Wn,{key:1,title:p(Se.value)+" · "+r("显示设置","Display settings"),onClose:ft},{actions:pe(()=>[e("button",{class:"primary",disabled:Ue.value.status==="blocked",onClick:oa,"data-adopt-display":""},a(r("采用设置","Adopt settings")),9,Uw)]),default:pe(()=>[G(Pw,{id:Se.value,value:ae.value,onUpdate:L[3]||(L[3]=I=>ae.value=I)},null,8,["id","value"]),e("section",Rw,[e("strong",null,a(r("当前实际呈现","Actual presentation")),1),e("p",null,a(bn.value),1),Ue.value.status==="blocked"?(i(),d("p",Vw,a(Dn(Ue.value.issue)),1)):(i(),d("ul",Bw)),e("p",null,a(r("只调整此模块的展示;常用项清单与业务设置不变。","Only the display changes. Favorites and business settings stay intact.")),1)])]),_:1},8,["title"])):T("",!0),Ee.value==="module-actions"&&ke.value?(i(),Y(Wn,{key:2,title:p(ke.value),onClose:ft},{default:pe(()=>[e("button",{class:"direct-panel-action",onClick:L[4]||(L[4]=I=>ke.value&&gn(ke.value)),"data-edit-display":""},a(r("显示设置","Display settings")),1),e("button",{class:"direct-panel-action",onClick:L[5]||(L[5]=I=>Mn(tt.value))},a(r("替换模块","Replace module")),1),e("button",{class:"direct-panel-action",onClick:L[6]||(L[6]=I=>{ke.value&&ao(ke.value),ft()})},a(r("从首页移除","Hide module")),1)]),_:1},8,["title"])):T("",!0),Ee.value==="adapt"&&xt.value?(i(),Y(Wn,{key:3,title:r("放入前调整","Adjust before placing"),onClose:ft},{actions:pe(()=>[e("div",Ww,[e("button",{onClick:L[8]||(L[8]=I=>ft()),"data-cancel-adaptation":""},a(r("取消","Cancel")),1),e("button",{class:"primary",onClick:eo,"data-confirm-adaptation":""},a(r("采用调整并放入","Adjust and place")),1)])]),default:pe(()=>[e("p",Fw,a(r("确认以下调整后一起放入;取消时布局保持不变。","Review the changes before placing. Cancel keeps your layout intact.")),1),e("ul",Hw,[(i(!0),d(V,null,oe(wa(xt.value),I=>(i(),d("li",{key:I},a(p(I))+" · "+a(Gn(de.value[I].mode))+" → "+a(Gn(xt.value.next.widgetPreferences[I].mode)),1))),128)),xt.value.hidden.length?(i(),d("li",Gw,a(r("将隐藏:","Will hide: "))+a(xt.value.hidden.map(p).join("、")),1)):T("",!0)]),en.value&&en.value.status!=="blocked"?(i(),d("button",{key:0,onClick:L[7]||(L[7]=I=>{xt.value=en.value,en.value=null}),"data-adaptation-summary":""},a(r("改用摘要方案","Use summary alternative")),1)):T("",!0),e("p",jw,a(r("位置和展示设置将一起提交,可一次撤销。","Position and display form one undoable change.")),1)]),_:1},8,["title"])):T("",!0),Ee.value==="more"?(i(),Y(Wn,{key:4,title:r("预览与恢复","Preview and restore"),onClose:ft},{default:pe(()=>[e("p",Jw,a(r("布局保存到此路由器,所有登录者共用。恢复推荐先进入草稿。","Saved on this router for everyone. Restore changes the draft first.")),1),e("button",{class:"direct-panel-action",onClick:L[9]||(L[9]=I=>{Qi(),ft()}),"data-reset":""},a(r("恢复推荐布局","Restore recommended")),1),e("button",{class:"direct-panel-action",onClick:L[10]||(L[10]=I=>{sl(),Ee.value="row"}),"data-add-row":""},"+ "+a(r("添加空行","Add empty row")),1),e("button",{class:"direct-panel-action",onClick:L[11]||(L[11]=I=>{lr(),ft()})},a(r("全部收起","Hide all")),1),e("div",Kw,[e("label",null,[ue(a(r("内容预览宽度","Content preview width")),1),e("input",{type:"range",min:"292",max:Math.max(292,it.value),step:"1",value:Math.min(re.value||it.value,it.value),onInput:L[12]||(L[12]=I=>re.value=Number(I.target.value)),"aria-label":"内容预览宽度"},null,40,Zw),e("output",null,a(Math.round(he.value))+"px",1)]),e("button",{onClick:L[13]||(L[13]=I=>re.value=0)},a(r("自动宽度","Auto width")),1),e("span",null,a(r("缩窄不改写你的布局,变宽后恢复","Narrow previews preserve the wide layout")),1)])]),_:1},8,["title"])):T("",!0),Ee.value==="targets"&&bt.value?(i(),Y(Wn,{key:5,title:r("移动到哪里","Choose a destination"),onClose:ft},{default:pe(()=>[e("p",Yw,a(oo.value)+" · "+a(r("选择目标,确认前不会改变布局。","Choose a destination. Nothing changes until confirmed.")),1),(i(!0),d(V,null,oe(so.value,I=>(i(),d("button",{key:o(Ga)(I),class:"direct-target-option","data-target-option":o(Ga)(I),"aria-disabled":!!It(I).issue,onClick:te=>Ln(I)},[e("span",null,a(It(I).label),1),It(I).issue?(i(),d("small",Xw,a(Dn(It(I).issue)),1)):T("",!0)],8,Qw))),128))]),_:1},8,["title"])):T("",!0),bt.value?(i(),d("div",e$,[e("span",null,[ue(a(oo.value)+" ",1),e("small",null,a(r("选择位置","Choose destination")),1)]),e("button",{onClick:L[14]||(L[14]=I=>Ee.value="targets")},a(r("目标列表","Destinations")),1),e("button",{onClick:cr},a(r("取消移动","Cancel move")),1)])):T("",!0),Ca.value?(i(),d("div",{key:7,class:"direct-drag-ghost",style:pt({left:Ca.value.x+"px",top:Ca.value.y+"px"})},[ue("⠿ "+a(oo.value),1),e("small",null,a(ol.value),1)],4)):T("",!0),Ee.value==="row"?(i(),Y(Wn,{key:8,title:r("这一行的布局","This row’s layout"),onClose:ft},{default:pe(()=>[Ke.value?(i(),d(V,{key:0},[e("div",t$,[(i(!0),d(V,null,oe(o(Yn),I=>(i(),d("button",{key:I.id,onClick:te=>ar(I.id),class:_e({active:Ke.value.template===I.id}),"aria-pressed":Ke.value.template===I.id,"data-template":I.id},[e("span",{class:_e(["ordered-miniature",I.id])},[(i(!0),d(V,null,oe(I.slots,(te,Ie)=>(i(),d("i",{key:Ie},[(i(!0),d(V,null,oe(te,me=>(i(),d("b",{key:me}))),128))]))),128))],2),ue(a(r(I.zh,I.en)),1)],10,n$))),128))]),Tt.value?(i(),d("section",a$,[e("h3",null,a(r("布局预览","Layout preview"))+" · "+a(ds.value),1),o(Yt)([Ke.value]).length>Tn.value?(i(),d("p",s$,a(r("请选择保留的模块;未保留项仅从首页隐藏。","Choose what to keep. Other modules will only be hidden.")),1)):T("",!0),o(Yt)([Ke.value]).length>Tn.value?(i(!0),d(V,{key:1},oe(o(Yt)([Ke.value]),I=>(i(),d("label",{key:I,class:"slot-retained"},[e("input",{type:"checkbox",checked:ut.value.includes(I),onChange:te=>Zi(I),"data-retain":I},null,40,o$),ue(a(p(I)),1)]))),128)):(i(),d("p",l$,a(o(Yt)([Ke.value]).map(p).join(" · ")),1)),pn.value.hidden.length?(i(),d("p",i$,a(r("将隐藏:","Will hide: "))+a(pn.value.hidden.map(p).join("、")),1)):T("",!0),pn.value.issue?(i(),d("p",r$,a(Dn(pn.value.issue)),1)):T("",!0),pn.value.requiresAdaptation?(i(),d("p",c$,a(r("采用此布局将同时调整以下形态,可一次撤销。","This layout also changes the following forms in one undoable step.")),1)):T("",!0),pn.value.requiresAdaptation&&vs.value?(i(),d("ul",d$,[(i(!0),d(V,null,oe(wa(vs.value),I=>(i(),d("li",{key:I},a(p(I))+" · "+a(Gn(de.value[I].mode))+" → "+a(Gn(vs.value.next.widgetPreferences[I].mode)),1))),128))])):T("",!0),e("div",u$,[e("button",{onClick:L[15]||(L[15]=I=>Tt.value=null)},a(r("取消更改","Cancel change")),1),e("button",{disabled:!!pn.value.issue,onClick:Yi,"data-confirm-structure":"",class:"primary"},a(r("采用此布局","Use layout")),9,v$)])])):T("",!0),e("p",p$,a(r("默认随内容等高。拖动上下分隔线分配空间,拉行底边增加空间。","Content sets the default height. Drag the stack divider to share space, or the row’s bottom edge to add space.")),1),e("button",{class:"direct-panel-action",onClick:Ye,"data-reset-row-space":""},a(r("恢复自动高度与分配","Restore automatic height and allocation")),1),Ke.value.columns.length>1?(i(),d("div",h$,[e("small",null,a(r("列宽比例","Column proportions")),1),(i(!0),d(V,null,oe(at.value,I=>(i(),d("button",{key:I.join("/"),onClick:te=>sr(I),"aria-pressed":Ke.value.columns.map(te=>te.weight).join("/")===I.join("/"),"data-width-preset":I.join("/")},[(i(!0),d(V,null,oe(I,(te,Ie)=>(i(),d("i",{key:Ie,style:pt({flex:te})},null,4))),128)),e("span",null,a(I.join(" / ")),1)],8,m$))),128))])):T("",!0),e("div",f$,[e("button",{onClick:or,"data-hide-row":""},a(r("收起整行","Hide row")),1)]),e("p",b$,a(r("内容最小尺寸始终保留。调整后可一次撤销。","Content minimums are always preserved. Each adjustment can be undone.")),1)],64)):T("",!0)]),_:1},8,["title"])):T("",!0),G(jk,{notice:o(F),editing:ve.value,onDismiss:o(ce)},null,8,["notice","editing","onDismiss"]),Ee.value==="finish"&&St.value?(i(),Y(Wn,{key:9,title:r("完成前整理","Review before finishing"),onClose:ft},{default:pe(()=>[e("p",g$,a(r("仅整理本次留下的空位,不合并不同行。确认前首页布局不变。","Only empty slots are simplified. Rows are never merged. Nothing is applied until you confirm.")),1),(i(!0),d(V,null,oe(O.value,I=>(i(),d("div",{key:I.id,class:"slot-finish-row","data-finish-row":I.id},[e("strong",null,a(r("第","Row ")+(O.value.indexOf(I)+1)+r("行","")),1),e("small",null,a(Pn(I))+" → "+a(Pn(St.value.rows.find(te=>te.id===I.id))),1)],8,_$))),128)),(i(!0),d(V,null,oe(St.value.problems,I=>(i(),d("section",{key:I.row,class:"slot-change-preview","data-finish-problem":""},[e("p",null,a(r("第","Row ")+(O.value.findIndex(te=>te.id===I.row)+1)+r("行:"," · "))+a(Dn(I.issue)),1),e("button",{onClick:te=>Ce(I.row),"data-fix-row":""},a(r("定位并修改布局","Locate and fix layout")),9,y$)]))),128)),e("div",k$,[e("button",{onClick:L[16]||(L[16]=I=>ft()),"data-cancel-finish":""},a(r("继续编辑","Keep editing")),1),e("button",{disabled:!!St.value.issue,onClick:ia,"data-confirm-finish":"",class:"primary"},a(r("确认整理并完成","Confirm and finish")),9,w$)])]),_:1},8,["title"])):T("",!0),ve.value&&ht.value?(i(),d("section",{key:10,ref_key:"overviewElement",ref:Ze,class:_e(["slot-overview",{"row-sort-active":o(ee).active.value}]),"data-layout-overview":"",onPointerover:ll,onFocusin:ll},[e("div",$$,[e("h2",null,a(r("把首页排成你喜欢的样子","Make room for what matters")),1),e("p",C$,a(bt.value?ol.value:r("拖动行标题排列整行;点选或拖动模块名称调整模块。","Drag a row title to reorder rows; select or drag a module name to move modules.")),1)]),o(ee).preview.value?(i(),d("div",{key:0,class:"row-sort-placeholder","data-row-placeholder":"",style:pt({top:o(ee).preview.value.top+"px",height:o(ee).preview.value.height+"px"})},[e("span",null,a(r("放到这里","Drop here"))+" · "+a(o(ee).preview.value.to+1),1)],4)):T("",!0),(i(!0),d(V,null,oe(O.value,(I,te)=>{var Ie;return i(),d("section",{key:I.id,class:_e(["slot-overview-row",{"row-sort-source":((Ie=o(ee).preview.value)==null?void 0:Ie.id)===I.id}]),style:pt(o(ee).style(I.id)),"data-overview-row":I.id},[bt.value?(i(),d("button",{key:0,class:"slot-overview-gap","data-placement":"edge:"+I.id,onClick:me=>Ln({kind:"edge",before:I.id}),"aria-label":It({kind:"edge",before:I.id}).label},[e("span",null,"+ "+a(It({kind:"edge",before:I.id}).label),1)],8,x$)):T("",!0),e("header",null,[e("button",{class:"row-sort-handle",onPointerdown:me=>o(ee).start(me,I.id),onClick:me=>se(I.id),onKeydown:me=>mt(me,I.id,te),"data-row-handle":I.id,"aria-label":r("拖动整行","Drag row")+" "+(te+1),title:r("拖动排序;Alt + 上下键或 Home / End","Drag to sort; Alt + arrows or Home / End")},[L[26]||(L[26]=e("span",{"aria-hidden":"true"},"⠿",-1)),e("strong",null,a(r("第","Row ")+(te+1)+r("行","")),1)],40,P$),e("span",null,a(r("自适应高度","Content height"))+" · "+a(I.columns.map(me=>me.weight).join(" / ")),1),e("details",{class:"row-sort-menu","data-row-menu":I.id},[e("summary",{"aria-label":r("整行操作","Row actions")+" "+(te+1)},"···",8,M$),e("div",null,[e("button",{onClick:me=>fe(I.id,te-1,!0),disabled:te===0,"data-row-up":""},a(r("上移","Move up")),9,E$),e("button",{onClick:me=>fe(I.id,te+1,!0),disabled:te===O.value.length-1,"data-row-down":""},a(r("下移","Move down")),9,I$),e("button",{onClick:me=>fe(I.id,0,!0),disabled:te===0,"data-row-first":""},a(r("置顶","Move to first")),9,D$),e("button",{onClick:me=>fe(I.id,O.value.length-1,!0),disabled:te===O.value.length-1,"data-row-last":""},a(r("置底","Move to last")),9,L$)])],8,T$),e("button",{onClick:me=>{j.value=I.id,En("row")},"data-select-row":I.id},a(r("布局","Layout"))+" ▦",9,A$)]),e("div",{class:_e(["slot-overview-grid",{stacked:I.columns.some(me=>me.cards.length===2)}]),style:pt({gridTemplateColumns:I.columns.map(me=>"minmax(0,"+me.weight+"fr)").join(" "),height:I.columns.some(me=>me.cards.length===2)?"184px":"88px"})},[(i(!0),d(V,null,oe(I.columns,(me,Le)=>(i(),d("div",{key:Le,class:"slot-overview-column",style:pt({gridTemplateRows:me.cards.length===1?"minmax(0,1fr)":"repeat(2,minmax(0,1fr))"})},[(i(!0),d(V,null,oe(me.cards,(Me,Ve)=>(i(),d("div",{key:Ve,class:_e(["slot-overview-card",{chosen:dt.value===Me,drop:da.value==="slot:"+I.id+":"+Le+":"+Ve}])},[Me?(i(),d(V,{key:0},[e("button",{class:"slot-overview-name",onPointerdown:Je=>dr(Je,{kind:"card",id:Me}),onClick:Je=>ir(I.id,Me),"data-drag-card":Me},[G(Qe,{name:o(rn)(Me).glyph},null,8,["name"]),e("span",{class:"overview-module-title",title:p(Me)},a(p(Me)),9,O$),e("small",{class:"overview-form-label","data-overview-form":Me},a(Xi(Me)),9,z$)],40,N$),e("div",q$,[dt.value===Me?(i(),d("button",{key:0,onClick:Je=>il({kind:"card",id:Me}),"data-move-card":Me},a(r("移动","Move")),9,R$)):(i(),d("button",{key:1,onClick:Je=>_n(Me),"aria-label":r("查看","Preview ")+p(Me)},"↗",8,V$)),e("button",{onClick:Je=>ka(Me,{row:I.id,column:Le,slot:Ve}),"data-module-menu":Me,"aria-label":r("模块操作","Module actions ")+p(Me)},"···",8,B$)])],64)):(i(),d("button",{key:1,class:"slot-overview-empty","data-overview-empty":"slot:"+I.id+":"+Le+":"+Ve,onClick:Je=>Mn({kind:"slot",row:I.id,column:Le,slot:Ve})},"+ "+a(r("添加","Add")),9,U$)),bt.value?(i(),d("button",{key:2,class:"slot-overview-drop","data-placement":"slot:"+I.id+":"+Le+":"+Ve,"aria-label":It({kind:"slot",row:I.id,column:Le,slot:Ve}).label,"aria-disabled":!!It({kind:"slot",row:I.id,column:Le,slot:Ve}).issue,onClick:Je=>Ln({kind:"slot",row:I.id,column:Le,slot:Ve})},[e("span",null,a(Me?p(Me):r("空位","Empty")),1),e("small",null,a(It({kind:"slot",row:I.id,column:Le,slot:Ve}).issue?Dn(It({kind:"slot",row:I.id,column:Le,slot:Ve}).issue):r("放入此处","Place here")),1)],8,F$)):T("",!0)],2))),128))],4))),128)),bt.value?(i(!0),d(V,{key:0},oe(I.columns.length+1,me=>(i(),d("button",{key:me,class:"slot-overview-insert",style:pt({left:la(I,me-1)}),"data-placement":"beside:"+I.id+":"+(me-1),"aria-label":It({kind:"beside",row:I.id,index:me-1}).label,"aria-disabled":!!It({kind:"beside",row:I.id,index:me-1}).issue,onClick:Le=>Ln({kind:"beside",row:I.id,index:me-1})},[...L[27]||(L[27]=[e("span",null,"+",-1)])],12,H$))),128)):T("",!0)],6)],14,S$)}),128)),bt.value?(i(),d("button",{key:1,class:"slot-overview-end","data-placement":"edge:end",onClick:L[17]||(L[17]=I=>Ln({kind:"edge",before:null}))},"+ "+a(r("放到最后","Place at end")),1)):T("",!0),O.value.length?T("",!0):(i(),d("button",{key:2,class:"slot-overview-end",onClick:L[18]||(L[18]=I=>sl())},"+ "+a(r("添加空行","Add empty row")),1))],34)):T("",!0),e("div",{class:_e(["lab-available",{"slot-parked":ht.value}]),ref_key:"availableElement",ref:st},[e("div",{class:"lab-content ordered-content",ref_key:"contentElement",ref:et,style:pt({maxWidth:re.value?re.value+"px":void 0})},[H.value?(i(),Y(Yk,{key:0})):T("",!0),(i(!0),d(V,null,oe(J.value,I=>{var te,Ie;return i(),d("section",{key:I.id,class:_e(["ordered-row",{selected:ve.value&&I.source===j.value}]),style:pt(ur(I)),"data-ordered-row":I.id,"data-row-source":I.source},[bt.value&&rr(I)?(i(),d("button",{key:0,class:"direct-gap-target","data-placement":"edge:"+I.source,onClick:me=>Ln({kind:"edge",before:I.source})},"+ "+a(r("独占新行 / 整行移到这里","New row / move row here")),9,j$)):T("",!0),ve.value?(i(),d("div",W$,[e("button",{onClick:me=>{j.value=I.source,En("row")},"aria-label":r("第","Row ")+(O.value.findIndex(me=>me.id===I.source)+1)+r("行布局"," layout"),"data-select-row":I.source},a(r("布局","Layout"))+" ▦",9,J$)])):T("",!0),(i(!0),d(V,null,oe(I.columns,(me,Le)=>(i(),d("div",{key:me.source,class:"ordered-column",style:pt(ie(I,me,Le)),"data-ordered-column":Le},[(i(!0),d(V,null,oe(me.cards,(Me,Ve)=>(i(),d("div",{key:Me||"empty-"+Ve,class:_e(["ordered-card",{drop:da.value===lo(I,me,Ve),chosen:dt.value===Me}]),"data-ordered-card":Me||void 0},[Me?(i(),d(V,{key:0},[ve.value?(i(),d("div",Y$,[e("button",{onClick:Je=>gn(Me),"aria-label":p(Me)+r("显示设置"," display settings"),"data-display-settings":Me},"⚙",8,Q$),e("button",{onClick:Je=>Mn(yn(I,me,Ve)),"aria-label":r("替换","Replace ")+p(Me),"data-replace-module":Me},a(r("替换","Replace")),9,X$),e("button",{onClick:Je=>ao(Me),"aria-label":r("从首页移除","Hide ")+p(Me),"data-hide-module":Me},"×",8,eC)])):T("",!0),Ct(M.$slots,"widget",{id:Me,role:dn(me.compact),chartStretch:pr(I),preference:Pt.value[Me],natural:I.natural,editing:ve.value},void 0,!0)],64)):(i(),d("button",{key:1,class:"direct-empty-slot",onClick:Je=>Mn(yn(I,me,Ve)),"data-empty-slot":lo(I,me,Ve)},"+ "+a(r("添加模块","Add module")),9,tC)),bt.value?(i(),d("button",{key:2,class:_e(["direct-placement",{invalid:It(yn(I,me,Ve)).issue}]),"data-placement":lo(I,me,Ve),"aria-label":It(yn(I,me,Ve)).label,"aria-disabled":!!It(yn(I,me,Ve)).issue,onClick:Je=>Ln(yn(I,me,Ve))},[e("span",null,[ue(a(It(yn(I,me,Ve)).label),1),It(yn(I,me,Ve)).issue?(i(),d("small",aC,a(Dn(It(yn(I,me,Ve)).issue)),1)):T("",!0)])],10,nC)):T("",!0)],10,Z$))),128)),wt(I)&&me.cards.length===2?(i(),d("button",{key:0,class:"row-stack-grip",role:"separator","aria-orientation":"horizontal","aria-label":r("调整上下空间","Adjust stacked card space"),"aria-valuenow":Math.round(Zt(I,Le).upper),"aria-valuemin":Math.round(Zt(I,Le).min),"aria-valuemax":Math.round(Zt(I,Le).max),style:pt({top:Te(I,Le)+"px"}),onPointerdown:Me=>_r(Me,I,Le),onKeydown:[Qt(Ge(Me=>vl(I,Le,-16),["prevent"]),["up"]),Qt(Ge(Me=>vl(I,Le,16),["prevent"]),["down"])],title:r("拖动分配上下空间;↑ ↓ 微调","Drag to share space; ↑ ↓ to adjust"),"data-stack-grip":""},[...L[28]||(L[28]=[e("span",null,"•••",-1)])],44,sC)):T("",!0)],12,K$))),128)),wt(I)&&I.columns.length>1?(i(!0),d(V,{key:2},oe(I.columns.slice(0,-1),(me,Le)=>(i(),d("button",{key:Le,class:"ordered-column-handle",role:"separator",tabindex:"0","aria-orientation":"vertical","aria-valuenow":I.columns[Le].weight,"aria-valuemin":ps(I,Le)[0],"aria-valuemax":ps(I,Le)[1],style:pt({left:"clamp(9px,"+hr(I,Le)+"px,calc(100% - 9px))"}),"aria-label":r("调整列宽","Adjust column widths")+" "+(Le+1),onPointerdown:Me=>fr(Me,I,Le),onKeydown:[Qt(Ge(Me=>rl(I,Le,-5),["prevent"]),["left"]),Qt(Ge(Me=>rl(I,Le,5),["prevent"]),["right"])]},[L[29]||(L[29]=e("span",null,"⋮",-1)),kt.value===I.source?(i(),d("output",lC,a(I.columns.map(Me=>Me.weight).join(" / ")),1)):T("",!0)],44,oC))),128)):T("",!0),wt(I)?(i(),d("button",{key:3,class:"row-bottom-grip",role:"separator","aria-orientation":"horizontal","aria-label":r("调整整行空间","Adjust row space"),"aria-valuenow":Math.round(tn(I)),"aria-valuemin":((te=o(Ot).sizes.value[I.id])==null?void 0:te.height)||0,"aria-valuemax":Math.max(o(Vo),((Ie=o(Ot).sizes.value[I.id])==null?void 0:Ie.height)||0),onPointerdown:me=>gr(me,I),onKeydown:[Qt(Ge(me=>dl(I,-32),["prevent"]),["up"]),Qt(Ge(me=>dl(I,32),["prevent"]),["down"])],title:r("拖动行底边增加空间;↑ ↓ 微调","Drag the bottom edge for more room; ↑ ↓ to adjust"),"data-row-space-grip":""},[...L[30]||(L[30]=[e("span",null,"•••",-1)])],40,iC)):T("",!0),wt(I)&&_t.value?(i(),d("span",rC,a(_t.value),1)):T("",!0)],14,G$)}),128)),bt.value?(i(),d("button",{key:1,class:"direct-last-target","data-placement":"edge:end",onClick:L[19]||(L[19]=I=>Ln({kind:"edge",before:null}))},"+ "+a(r("放到最后,独占新行 / 整行移到最后","New row at end / move row to end")),1)):T("",!0),!H.value&&!J.value.length?(i(),d("section",cC,[G(Qe,{name:"grid"}),e("h2",null,a(r("首页,由你安排","A home of your own")),1),e("p",null,a(r("添加常看的模块,也可以随时恢复推荐布局。","Add the things you check most, or restore the recommended layout.")),1),e("button",{onClick:L[20]||(L[20]=I=>ve.value?Mn(null):tl())},a(r("添加模块","Add modules")),1)])):T("",!0)],4)],2),g.value?(i(),Y(o(n),{key:11,state:f.value,installing:b.value,error:m.value,onClose:w,onInstall:P,onRecheck:C},null,8,["state","installing","error"])):T("",!0),Ct(M.$slots,"launcher",{},void 0,!0),Ee.value==="slot"&&!g.value?(i(),Y(Wn,{key:12,title:tt.value?r("选择槽位模块","Choose module"):r("添加一行模块","Add module in a new row"),onClose:ft},{actions:pe(()=>{var I,te;return[ct.value?(i(),d("section",pC,[e("h3",null,a(p(ct.value))+" → "+a(tt.value?$a(tt.value):r("页面末尾新行","New row at end")),1),o(Vn)(O.value,ct.value)?(i(),d("p",hC,a(r("将从原位置移到这里,不创建副本。","Moves from its current position; no duplicate.")),1)):T("",!0),jn(ct.value).hidden.length?(i(),d("p",mC,a(jn(ct.value).hidden.map(p).join("、"))+a(r("将从首页隐藏,设置保留。"," will be hidden. Settings are kept.")),1)):T("",!0),e("ul",fC,[(i(!0),d(V,null,oe(nn.value?wa(nn.value):[],Ie=>(i(),d("li",{key:Ie},a(p(Ie))+" → "+a(Gn(nn.value.next.widgetPreferences[Ie].mode)),1))),128))]),sn(ct.value)&&sn(ct.value).status!=="blocked"?(i(),d("button",{key:2,onClick:L[21]||(L[21]=Ie=>qt.value=!qt.value),"aria-pressed":qt.value,"data-placement-summary":""},a(qt.value?r("保持原形态","Keep current form"):r("选择摘要方案","Choose summary alternative")),9,bC)):T("",!0),e("button",{class:"primary",disabled:((I=nn.value)==null?void 0:I.status)==="blocked",onClick:Ji,"data-confirm-choice":""},a(((te=nn.value)==null?void 0:te.status)==="needs-confirmation"||nn.value&&wa(nn.value).length?r("放入并采用调整","Place with adjustments"):r("确认放置","Place module")),9,gC)])):(i(),d("div",_C,[tt.value&&o(Il)(O.value,tt.value)?(i(),d("button",{key:0,onClick:Ki,"data-remove-pending":""},a(r("从首页移除","Hide module")),1)):T("",!0),e("button",{onClick:L[22]||(L[22]=Ie=>ft())},a(r("返回首页","Back to home")),1)]))]}),default:pe(()=>[e("p",dC,a(r("选择后先预览;已有模块会移到这里,原位置留空。","Preview before confirming. Existing modules move here and leave their old slot empty.")),1),e("div",uC,[(i(!0),d(V,null,oe(_.value,I=>(i(),d("button",{key:I.id,onClick:te=>y(I.id),disabled:o(Ka)(I.id)||D(I.id)?o(Ka)(I.id)||!o(h)||o(v).state.value!=="ready":!us(I.id),"aria-pressed":ct.value===I.id,"data-choice":I.id,"data-fit":ra(I.id)},[G(Qe,{name:I.glyph},null,8,["name"]),e("span",null,[ue(a(p(I.id)),1),e("small",null,a(ra(I.id)==="blocked"?Dn(hn(I.id).issue):ra(I.id)==="needs-confirmation"?r("调整后可放入 · ","Adjust to fit · ")+Ba(I.id):Ba(I.id)),1)]),e("span",null,a(o(Vn)(O.value,I.id)?"↗":"+"),1)],8,vC))),128))])]),_:1},8,["title"])):T("",!0)],34))}}),kC=le(yC,[["__scopeId","data-v-af0f0c55"]]),Ul=/^[a-f0-9]{32}:[1-9][0-9]{0,19}$/,Vs=(s,t)=>{if(s===t)return!0;if(!s||!t||typeof s!="object"||typeof t!="object"||Array.isArray(s)!==Array.isArray(t))return!1;const n=Object.keys(s),l=Object.keys(t);return n.length===l.length&&n.every(u=>Object.prototype.hasOwnProperty.call(t,u)&&Vs(s[u],t[u]))},Fl=Vs;function wC(s=fetch,t=8e3){function n(u,c,r,p=""){return B(this,null,function*(){const v=new AbortController,h=setTimeout(()=>v.abort(),t);try{const g=yield s("/cgi-bin/luci/istore/home/v1/"+u+"/"+p,{method:c,credentials:"same-origin",cache:"no-store",signal:v.signal,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!g.ok)throw new Lt(g.status===409?"conflict":g.status===401||g.status===403?"forbidden":g.status===404&&c==="GET"?"unsupported":g.status===422?"invalid":g.status===423?"readonly":"unavailable");const b=yield g.text();if(new TextEncoder().encode(b).length>$i+4096)throw new Lt("invalid");let m;try{m=JSON.parse(b)}catch($){throw new Lt("invalid")}if((m==null?void 0:m.success)!==0||m!=null&&m.error)throw new Lt((m==null?void 0:m.success)===-1001?"forbidden":"unavailable");const f=m.result;if(!f||!["missing","saved","backup","damaged","future"].includes(f.state))throw new Lt("invalid");const k=["saved","backup"].includes(f.state);if(k&&(!Ul.test(f.version)||!f.value)||f.state==="missing"&&(f.version!=="missing"||f.value!==void 0)||["future","damaged"].includes(f.state)&&f.value!==void 0)throw new Lt("invalid");return{state:f.state,version:f.version||"",value:k?ts(u,f.value):void 0,recoveryVersion:typeof f.recoveryVersion=="string"&&/^[a-f0-9]{64}$/.test(f.recoveryVersion)?f.recoveryVersion:void 0}}catch(g){throw g instanceof Lt?g:new Lt("unavailable")}finally{clearTimeout(h)}})}return{read:u=>n(u,"GET"),recover(u,c,r=!1){return B(this,null,function*(){if(!/^[a-f0-9]{64}$/.test(c))throw new Lt("invalid");try{return yield n(u,"POST",{expectedRecovery:c},r?"reset-damaged/":"restore/")}catch(p){throw p instanceof Lt&&p.code!=="unavailable"?p:new Lt("uncertain")}})},save(u,c,r){return B(this,null,function*(){const p=ts(u,r);if(c!=="missing"&&!Ul.test(c))throw new Lt("invalid");try{const v=yield n(u,"POST",{expectedVersion:c,value:p});if(v.state!=="saved"||!Vs(v.value,p))throw new Lt("uncertain");return v}catch(v){if(v instanceof Lt&&!["unavailable","uncertain"].includes(v.code))throw v;try{const h=yield n(u,"GET");if(h.state==="saved"&&Vs(h.value,p))return h}catch(h){}throw new Lt("uncertain")}})}}}const $C={schemaVersion:4,rows:[{id:"network",template:"left-big",height:320,heightMode:"chart",columns:[{weight:60,split:50,cards:["traffic"]},{weight:40,split:50,cards:["connection","networkInterface"]}]},{id:"devices",template:"pair",height:340,heightMode:"content",columns:[{weight:50,split:50,cards:["devices"]},{weight:50,split:50,cards:["applications"]}]},{id:"storage",template:"pair",height:330,heightMode:"content",columns:[{weight:50,split:50,cards:["storage"]},{weight:50,split:50,cards:["sharing"]}]},{id:"services",template:"triple",height:280,heightMode:"content",columns:[{weight:34,split:50,cards:["docker"]},{weight:33,split:50,cards:["downloads"]},{weight:33,split:50,cards:["remote"]}]},{id:"system",template:"single",height:280,heightMode:"content",columns:[{weight:100,split:50,cards:["system"]}]}],widgetPreferences:{traffic:{mode:"auto",iconRows:0,ruleVersion:2},connection:{mode:"auto",iconRows:0,ruleVersion:2},networkInterface:{mode:"auto",iconRows:0,ruleVersion:2},devices:{mode:"auto",iconRows:0,ruleVersion:2},applications:{mode:"auto",iconRows:0,ruleVersion:2},storage:{mode:"auto",iconRows:0,ruleVersion:2},sharing:{mode:"auto",iconRows:0,ruleVersion:2},docker:{mode:"auto",iconRows:0,ruleVersion:2},downloads:{mode:"auto",iconRows:0,ruleVersion:2},remote:{mode:"auto",iconRows:0,ruleVersion:2},system:{mode:"auto",iconRows:0,ruleVersion:2}}},CC={schemaVersion:1,favorites:["tool-lan","tool-terminal","tool-firmware","tool-dns","tool-source","tool-sandbox","tool-logs","tool-maintenance"],links:[]},zi={layout:$C,launcher:CC},SC=()=>ts("layout",zi.layout),xC=()=>ts("launcher",zi.launcher),ja=s=>{const t=window.vue_lang==="en",n=s instanceof Lt?s.code:"unavailable";return n==="unsupported"?t?"This backend does not support homepage configuration. Showing defaults; saving is unavailable.":"当前后端不支持首页配置,暂用默认内容,无法保存。":{conflict:["另一窗口已保存。草稿仍保留;请先取消编辑并重新读取,再合并修改。","Another window saved. Keep your draft, then cancel and reload before merging."],forbidden:["登录已失效或没有权限,请重新登录。","Session expired or access denied. Sign in again."],future:["配置来自更新版本,当前页面只读。","Configuration requires a newer version. This page is read only."],readonly:["配置需要恢复,当前禁止覆盖。","Configuration needs recovery; overwriting is disabled."],uncertain:["保存结果尚未确认,草稿已保留。请重试读取,勿重复提交。","Save outcome is unconfirmed. Draft retained. Reload to confirm before submitting again."],invalid:["配置结构不兼容,未保存。","Configuration is incompatible and was not saved."],unavailable:["暂时无法读取路由器配置,正在临时展示内置首页。","Router configuration is unavailable. Showing built-in defaults temporarily."]}[n][t?1:0]};function PC(){const s=wC(),t=x(SC()),n=x(xC()),l=Xe({layout:{loading:!0,saving:!1,error:"",uncertain:!1},launcher:{loading:!0,saving:!1,error:"",uncertain:!1}}),u={},c={};function r(m,f){l[m].snapshot=f,f.value&&(m==="layout"?t.value=f.value:n.value=f.value)}function p(m){return B(this,null,function*(){const f=l[m];if(!f.saving){f.loading=!0,f.error="";try{const k=yield s.read(m);r(m,k),c[m]&&k.state==="saved"&&Fl(c[m],k.value)&&(u[m]=k.version,delete c[m]),f.uncertain=!1}catch(k){f.error=ja(k)}finally{f.loading=!1}}})}function v(m){var k;const f=l[m];return!f.loading&&!f.saving&&!f.error&&!f.uncertain&&((k=f.snapshot)==null?void 0:k.state)==="saved"}function h(m){return v(m)?(u[m]=l[m].snapshot.version,!0):!1}function g(m,f){return B(this,null,function*(){var w;const k=l[m],$=u[m];if(!$||!v(m))throw new Error(k.error||ja(new Lt("readonly")));if(((w=k.snapshot)==null?void 0:w.version)===$&&Fl(k.snapshot.value,f)){delete c[m];return}k.saving=!0;try{r(m,yield s.save(m,$,f)),u[m]=k.snapshot.version,k.error="",delete c[m]}catch(S){throw S instanceof Lt&&S.code==="uncertain"&&(k.uncertain=!0,c[m]=JSON.parse(JSON.stringify(f))),k.error=ja(S),new Error(ja(S))}finally{k.saving=!1}})}nt(()=>{p("layout"),p("launcher")});function b(m){return B(this,null,function*(){var k;const f=l[m];if(!(!((k=f.snapshot)!=null&&k.recoveryVersion)||!["backup","damaged"].includes(f.snapshot.state)||f.loading||f.saving)){f.saving=!0;try{r(m,yield s.recover(m,f.snapshot.recoveryVersion,f.snapshot.state==="damaged")),f.error="",f.uncertain=!1}catch($){f.error=ja($)}finally{f.saving=!1}}})}return{layout:t,launcher:n,state:l,begin:h,save:g,recover:b,read:p,editable:v,layoutEditable:R(()=>v("layout")),launcherEditable:R(()=>v("launcher"))}}class on extends Error{constructor(n,l){super(n);Nn(this,"code");this.code=l}}function qi(){return B(this,arguments,function*(s=fetch){var l;const t=new AbortController,n=setTimeout(()=>t.abort(),8e3);try{const u=yield s("/cgi-bin/luci/istore/lanctrl/v2/networks/",{credentials:"same-origin",signal:t.signal});if(u.status===404||u.status===501)return{networks:[{networkId:"lan",displayName:"lan",device:"",state:"legacy"}],legacy:!0};if(u.status===401)throw new on("登录已过期,请重新登录","permission");if(u.status===403)throw new on("没有读取局域网列表的权限","permission");if(!u.ok)throw new on("局域网服务暂不可用,请重试","unavailable");let c;try{c=yield u.json()}catch(p){throw new on("局域网列表格式不正确,请重试","invalid")}if(!c||typeof c!="object")throw new on("局域网列表格式不正确,请重试","invalid");if(c.success===-1001)throw new on("登录已过期,请重新登录","permission");if(c.error||c.success!==void 0&&c.success!==0||!Array.isArray((l=c.result)==null?void 0:l.networks))throw new on("局域网列表不可用,请重试","invalid");const r=c.result.networks;if(r.some(p=>!p||!/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,31}$/.test(p.networkId)||typeof p.displayName!="string")||new Set(r.map(p=>p.networkId)).size!==r.length)throw new on("局域网列表格式不正确,请重试","invalid");return{networks:r,legacy:!1}}catch(u){const c=u==null?void 0:u.name;throw t.signal.aborted||c==="TimeoutError"||c==="AbortError"?new on("局域网列表读取超时,请重试","timeout"):u instanceof on?u:new on("无法连接路由器,请检查网络后重试","unavailable")}finally{clearTimeout(n)}})}const TC=s=>{const t=!!String(s.displayName||s.hostname||"").trim();return{showBrandInMeta:t&&!!s.brand,metaMode:s.classification.source==="fallback"?"pending":!t&&s.brand?"classification-source":"category"}},ln=s=>String(s||"").trim().toLowerCase(),MC=[{brand:"ASUS",patterns:[/\basustek\b/i,/\basus\b/i]},{brand:"Apple",patterns:[/\bapple(?:,? inc\.?)?\b/i]},{brand:"Samsung",patterns:[/\bsamsung\b/i]},{brand:"Xiaomi",patterns:[/\bxiaomi\b/i,/北京小米/i]},{brand:"HUAWEI",patterns:[/\bhuawei\b/i,/华为/i]}],Uo=s=>{var n;const t=String(s||"").trim().normalize("NFKC");return((n=MC.find(l=>l.patterns.some(u=>u.test(t))))==null?void 0:n.brand)||""},EC=[{scene:"storage",patterns:[/\bnas\b/i,/\bserver\b/i,/storage/i,/truenas/i,/openmediavault/i,/synology/i,/qnap/i,/群晖/i,/威联通/i]},{scene:"camera",patterns:[/camera/i,/webcam/i,/doorbell/i,/\bipc[-_ ]/i,/cctv/i,/摄像头/i,/监控/i,/门铃/i]},{scene:"gaming",patterns:[/gaming/i,/game[-_ ]?console/i,/playstation/i,/\bps[345]\b/i,/xbox/i,/nintendo/i,/steam[-_ ]?deck/i,/游戏/i,/主机/i]},{scene:"printer",patterns:[/printer/i,/laserjet/i,/deskjet/i,/officejet/i,/打印机/i,/一体机/i]},{scene:"wearable",patterns:[/smart[-_ ]?watch/i,/fitness[-_ ]?(band|tracker)/i,/wearable/i,/watch/i,/手表/i,/手环/i]},{scene:"tv",patterns:[/(^|[-_ ])tv($|[-_ ])/i,/television/i,/smart[-_ ]?tv/i,/chromecast/i,/streaming[-_ ]?(box|stick)/i,/电视/i,/投影/i]},{scene:"tablet",patterns:[/tablet/i,/\bipad\b/i,/e[-_ ]?reader/i,/kindle/i,/平板/i,/阅读器/i]},{scene:"phone",patterns:[/phone/i,/iphone/i,/android/i,/mobile/i,/pixel[-_ ]?\d/i,/手机/i]},{scene:"network",patterns:[/router/i,/gateway/i,/openwrt/i,/access[-_ ]?point/i,/\bmesh\b/i,/repeater/i,/\bswitch\b/i,/路由/i,/网关/i,/交换机/i,/无线接入点/i]},{scene:"smart-home",patterns:[/smart[-_ ]?home/i,/home[-_ ]?assistant/i,/speaker/i,/thermostat/i,/sensor/i,/vacuum/i,/air[-_ ]?purifier/i,/light[-_ ]?(bulb|strip)/i,/smart[-_ ]?plug/i,/智能家居/i,/音箱/i,/传感器/i,/扫地/i,/灯泡/i,/插座/i]},{scene:"computer",patterns:[/desktop/i,/laptop/i,/notebook/i,/workstation/i,/macbook/i,/imac/i,/windows/i,/ubuntu/i,/\bpc\b/i,/电脑/i,/笔记本/i,/工作站/i]}],IC=s=>{var u;const t=[s.displayName,s.hostname].filter(Boolean).join(" ").normalize("NFKC"),n=(u=EC.find(c=>c.patterns.some(r=>r.test(t))))==null?void 0:u.scene;if(n)return n;const l=`${t} ${s.vendor||""}`.normalize("NFKC");return/\b(?:rt|gt)-?ax\d+[a-z0-9-]*\b|\bzenwifi\b|\brouter\b|\bgateway\b|\baccess[-_ ]?point\b|\bmesh\b|\brepeater\b|路由|网关|交换机/i.test(l)||Uo(s.vendor)==="ASUS"?"network":"unknown"},DC=new Set(["phone","computer","tablet","tv","network","smart-home","camera","gaming","storage","printer","wearable"]),LC=new Set(["model","hostname","manufacturer_default","fallback","manual"]),AC=new Set(["high","medium","low"]),NC=s=>{const t=s.classification;if(t&&DC.has(t.category)&&LC.has(t.source)&&AC.has(t.confidence))return{brand:String(t.brand||"").trim(),manufacturer:String(t.manufacturer||s.vendor||"").trim(),category:t.category,source:t.source,confidence:t.confidence};const n=IC(s),l=n==="unknown"?"computer":n;return{brand:Uo(s.vendor),manufacturer:String(s.vendor||"").trim(),category:l,source:n==="unknown"?"fallback":Uo(s.vendor)==="ASUS"&&l==="network"&&!String(s.displayName||s.hostname||"").trim()?"manufacturer_default":"hostname",confidence:n==="unknown"?"low":"medium"}},OC=s=>{const t=(s==null?void 0:s.staticAssigned)||{};return!!(t.hostname||t.tagName||t.tagTitle||t.bindIP||t.action==="modify")},zC=s=>{var n;const t=[];return OC(s)&&t.push("static"),(n=s==null?void 0:s.speedLimit)!=null&&n.enabled&&t.push(s.speedLimit.networkAccess===!1?"blocked":"limited"),t},qC=s=>{const t=new Map,n=(l,u)=>{if(!l)return;const c=t.get(l)||new Set;c.add(u),t.set(l,c)};for(const l of s)n(l.deviceId?`device:${l.deviceId}`:"",l.kind),n(l.mac?`mac:${ln(l.mac)}`:"",l.kind),n(l.ip?`ip:${ln(l.ip)}`:"",l.kind);return t},RC=(s,t)=>{const n=new Set,l=[`device:${s.deviceId}`,`mac:${ln(s.mac)}`,...s.addresses.current.map(c=>`ip:${ln(c.address)}`)];for(const c of l)for(const r of t.get(c)||[])n.add(r);const u=[];return n.has("static")&&u.push("static"),n.has("route")&&u.push("route"),n.has("speed")&&u.push("limited"),n.has("access")&&u.push("blocked"),u},Ps=(s,t=[],n,l)=>{const u=new Map(t.map(r=>[ln(r.mac),r])),c=l?qC(l):void 0;return s.map(r=>{var b;const p=u.get(ln(r.mac)),v=r.addresses.current.find(m=>m.primary)||r.addresses.current[0]||r.addresses.historical[0],h=c?RC(r,c):zC(p),g=NC(r);return Ne(ye({},r),{scene:g.category,brand:g.brand,classification:g,iconKey:(b=r.icon)==null?void 0:b.assetKey,displayName:r.displayName||"",primaryAddress:(v==null?void 0:v.address)||"",extraAddressCount:Math.max(0,r.addresses.current.length+r.addresses.historical.length-(v?1:0)),controlled:h.length>0,policyLabels:h,uploadSpeedStr:(p==null?void 0:p.uploadSpeedStr)||"",downloadSpeedStr:(p==null?void 0:p.downloadSpeedStr)||"",legacy:p})})},VC=(s,t,n,l,u={})=>{const c=ln(n);return[...s.filter(p=>{if(t==="online"&&!p.online||t==="controlled"&&!p.controlled||u.connection&&u.connection!=="all"&&p.connection.kind!==u.connection||u.brand&&ln(p.brand)!==ln(u.brand)||u.policy==="none"&&p.policyLabels.length>0||u.policy&&u.policy!=="all"&&u.policy!=="none"&&!p.policyLabels.includes(u.policy))return!1;if(!c)return!0;const v=[...p.addresses.current,...p.addresses.historical].map(h=>h.address);return[p.displayName,p.hostname,p.mac,p.vendor,p.brand,...v].some(h=>ln(h).includes(c))})].sort((p,v)=>l==="name"?ln(p.displayName||p.hostname||p.mac).localeCompare(ln(v.displayName||v.hostname||v.mac)):p.online!==v.online?p.online?-1:1:Date.parse(v.lastSeenAt)-Date.parse(p.lastSeenAt)||p.deviceId.localeCompare(v.deviceId))},BC=s=>({all:s.length,online:s.filter(t=>t.online).length,controlled:s.filter(t=>t.controlled).length}),UC=(s,t)=>{const n=t.trim();if(!n)return[{text:s,matched:!1}];const l=s.toLowerCase(),u=n.toLowerCase(),c=[];let r=0;for(;rr&&c.push({text:s.slice(r,p),matched:!1}),c.push({text:s.slice(p,p+n.length),matched:!0}),r=p+n.length}return c.length?c:[{text:s,matched:!1}]},mn=s=>!!s&&typeof s=="object"&&!Array.isArray(s),$o=s=>t=>mn(t)&&Array.isArray(t[s])&&t[s].length<=4096,Wa=[{id:"network",widgets:[],path:"/u/network/status/",seconds:5,validate:mn},{id:"ports",widgets:["networkInterface"],path:"/network/port/list/",seconds:10,validate:$o("ports")},{id:"traffic",widgets:["traffic"],path:"/u/network/statistics/",seconds:5,validate:$o("items")},{id:"inventory",widgets:["devices"],path:"/lanctrl/v2/devices/",seconds:30,validate:$o("devices")},{id:"routerContext",widgets:["devices"],path:"/lanctrl/v2/router-context/",seconds:30,validate:mn},{id:"disks",widgets:["storage"],path:"/nas/disk/status/",seconds:60,validate:mn},{id:"raid",widgets:["storage"],path:"/raid/list/",seconds:60,validate:mn},{id:"sharing",widgets:["sharing"],path:"/u/nas/service/status/",seconds:60,validate:mn},{id:"docker",widgets:["docker"],path:"/guide/docker/status/",seconds:60,validate:mn},{id:"download",widgets:["downloads"],path:"/guide/download-service/status/",seconds:60,validate:mn},{id:"remote",widgets:["remote"],path:"/u/guide/ddns/",seconds:3,validate:mn},{id:"system",widgets:["system"],path:"/system/status/",seconds:5,validate:mn},{id:"version",widgets:["system"],path:"/u/system/version/",seconds:0,validate:mn}];function FC(s){const t=Xe({}),n=Xe({}),l=Xe({}),u=new Map,c=new Map,r=os(),p=Oa();let v=!1,h,g=0;const b=C=>!C.widgets.length||C.widgets.some(y=>s.value.includes(y));function m(C){var y;window.clearTimeout(c.get(C)),c.delete(C),(y=u.get(C))==null||y.abort(),u.delete(C)}function f(C){return B(this,null,function*(){if(!v||document.hidden||!b(C)||u.has(C.id))return;window.clearTimeout(c.get(C.id)),c.delete(C.id);const y=new AbortController;u.set(C.id,y);const P=window.setTimeout(()=>y.abort(),8e3);try{let _=C.path;if(C.id==="inventory"||C.id==="routerContext"){Date.now()-g>=3e4&&(h=void 0,g=Date.now());const U=yield h||(h=qi().catch(z=>{throw h=void 0,z}));t.lanNetworks=U.networks,t.lanLegacy=U.legacy;const q=U.networks.length===1?U.networks[0].networkId:"all";if(C.id==="routerContext"&&q==="all"){v&&(t.routerContext={multiLAN:!0},n[C.id]="",l[C.id]=Date.now());return}U.legacy||(_+="?network="+encodeURIComponent(q))}const D=yield fetch("/cgi-bin/luci/istore"+_,{credentials:"same-origin",cache:"no-store",signal:y.signal});if(!D.ok)throw new Error(D.status===401||D.status===403?"permission":"unavailable");const E=yield D.text();if(E.length>2*1024*1024)throw new Error("invalid");const A=JSON.parse(E);if(A.error||A.success!==void 0&&A.success!==0||!C.validate(A.result))throw new Error(A.success===-1001?"permission":"invalid");if(!v||u.get(C.id)!==y||!b(C))return;t[C.id]=C.id==="traffic"?Ne(ye({},A.result),{items:A.result.items.slice(-60)}):A.result,n[C.id]="",l[C.id]=Date.now(),C.id==="network"&&r.updateNetworkStatus(ye({},t.network)),C.id==="system"&&p.updateSystemStatus(ye({},t.system)),C.id==="version"&&(p.version=ye({},t.version))}catch(_){v&&u.get(C.id)===y&&(n[C.id]=_ instanceof on&&_.code==="permission"||_ instanceof Error&&_.message==="permission"?"permission":"unavailable")}finally{window.clearTimeout(P),u.get(C.id)===y&&(u.delete(C.id),v&&!document.hidden&&b(C)&&C.seconds&&c.set(C.id,window.setTimeout(()=>{f(C)},C.seconds*1e3)))}})}function k(C=!1){for(const y of Wa)b(y)?(C||!c.has(y.id)&&!u.has(y.id)&&(y.seconds>0||!l[y.id]&&!n[y.id]))&&f(y):m(y.id)}function $(){for(const C of Wa)m(C.id);document.hidden||k(!0)}function w(C){for(const y of Wa)(!C||y.widgets.includes(C))&&f(y)}function S(C){return Wa.every(y=>!(y.id==="network"?["traffic","connection","devices"]:y.widgets).some(_=>C.includes(_))||t[y.id]!==void 0||!!n[y.id])}return We(()=>[...s.value].sort().join(","),()=>k()),nt(()=>{v=!0,k(),document.addEventListener("visibilitychange",$)}),lt(()=>{v=!1;for(const C of Wa)m(C.id);document.removeEventListener("visibilitychange",$)}),{data:t,errors:n,updated:l,devices:R(()=>{var C;return Ps(((C=t.inventory)==null?void 0:C.devices)||[])}),invalidate:w,initialSettled:S}}const HC=["data-config-domain"],GC={class:"home-config-message"},jC={class:"home-config-actions"},WC=["onClick"],JC=["disabled","onClick"],KC=["aria-label","onClick"],ZC=X({__name:"index",setup(s){ma(ui,{inspect:(y,P)=>Po(()=>import("./installClient.js?v=DjM-4PhF"),__vite__mapDeps([3,1,2])).then(_=>_.cardInstaller.inspect(y,P)),install:(y,P)=>Po(()=>import("./installClient.js?v=DjM-4PhF"),__vite__mapDeps([3,1,2])).then(_=>_.cardInstaller.install(y,P))});const t=x(null),n=PC();K1(n);const l=FC(R(()=>t.value||Yt(n.layout.value.rows))),u=x(!1);We(()=>!n.state.layout.loading&&!n.state.launcher.loading,y=>{y&&(u.value=!0)},{immediate:!0});const c=as(),r=x(!1),p=x(Ws()),v=["layout","launcher"],h=Xe({layout:!1,launcher:!1});for(const y of v)We(()=>{var P,_;return[n.state[y].loading,n.state[y].error,(P=n.state[y].snapshot)==null?void 0:P.state,(_=n.state[y].snapshot)==null?void 0:_.version]},()=>{h[y]=!1});const g=(y,P)=>window.vue_lang==="en"?P:y;function b(y){var _;const P=n.state[y];return(y==="layout"?g("首页布局:","Homepage: "):g("应用工具:","Apps & tools: "))+(P.loading?g("正在校验路由器配置…","Checking router configuration…"):P.error||{backup:g("原文件异常,临时使用有效备份;请恢复后编辑。","Original file invalid. Showing valid backup; restore before editing."),damaged:g("配置损坏,临时显示默认内容,未覆盖原文件。","Configuration damaged. Showing defaults without replacing the file."),future:g("配置来自更新版本,当前页面只读。","Configuration requires a newer version. This page is read only."),missing:g("配置尚未初始化,请重试。","Configuration not initialized. Retry.")}[((_=P.snapshot)==null?void 0:_.state)||""]||"")}function m(y){window.confirm(g("将保留损坏文件,恢复此项配置;其他设置不变。确定继续?","Keep the damaged file and restore this setting? Other settings are unchanged."))&&n.recover(y)}function f(y){r.value=y,y&&n.begin("layout")}const k=y=>n.save("layout",y);function $(y){return!n.state.layout.loading&&l.initialSettled(y)}function w(y){r.value||(y.startsWith("/cgi-bin/")?window.location.assign(y):c.push(y))}function S(y){r.value||c.push({path:"/devicemanagement",query:{device:y}})}let C=()=>{};return nt(()=>{Ko().discover(),C=is(y=>p.value=y.effective)}),lt(()=>C()),(y,P)=>(i(),Y(kC,{bootstrapping:!u.value,config:o(n).layout.value,data:o(l).data,errors:o(l).errors,theme:p.value,"favorite-ids":o(n).launcher.value.favorites,"can-edit":o(n).layoutEditable.value,"external-busy":o(n).state.launcher.saving,persist:k,onEditing:f,onVisible:P[0]||(P[0]=_=>t.value=_),onNavigate:w,onDevice:S},{status:pe(()=>[(i(),d(V,null,oe(v,_=>{var D,E,A;return W(e("div",{key:_,class:"home-config-state","data-config-domain":_,role:"status"},[e("span",GC,a(b(_)),1),e("div",jC,[!o(n).state[_].loading&&!o(n).state[_].saving?(i(),d("button",{key:0,type:"button","data-retry-config":"",onClick:U=>o(n).read(_)},a(g("重新读取","Reload")),9,WC)):T("",!0),!r.value&&["backup","damaged"].includes(((D=o(n).state[_].snapshot)==null?void 0:D.state)||"")?(i(),d("button",{key:1,type:"button",disabled:o(n).state[_].saving,onClick:U=>m(_)},a(((E=o(n).state[_].snapshot)==null?void 0:E.state)==="backup"?g("恢复有效备份","Restore valid backup"):g("保留损坏文件并恢复默认","Keep damaged file and restore defaults")),9,JC)):T("",!0)]),e("button",{type:"button",class:"home-config-close","data-dismiss-config-notice":"","aria-label":_==="layout"?g("关闭首页布局提示","Dismiss homepage layout notice"):g("关闭应用工具提示","Dismiss apps and tools notice"),onClick:U=>h[_]=!0},[...P[1]||(P[1]=[e("svg",{viewBox:"0 0 20 20","aria-hidden":"true"},[e("path",{d:"m5 5 10 10M15 5 5 15"})],-1)])],8,KC)],8,HC),[[Bs,u.value&&!h[_]&&!o(n).state[_].loading&&(o(n).state[_].error||((A=o(n).state[_].snapshot)==null?void 0:A.state)!=="saved")]])}),64))]),widget:pe(_=>[G(Uk,Zl(_,{data:o(l).data,errors:o(l).errors,devices:o(l).devices.value,theme:p.value,contained:"",onNavigate:w,onDevice:S,onRetry:D=>o(l).invalidate(_.id)}),null,16,["data","errors","devices","theme","onRetry"])]),launcher:pe(()=>[G(Ti,{collapsed:"","host-only":"","fallback-entries":[],network:o(l).data.network,"return-ready":$,onNavigate:w},null,8,["network"])]),_:1},8,["bootstrapping","config","data","errors","theme","favorite-ids","can-edit","external-busy"]))}}),YC=le(ZC,[["__scopeId","data-v-05fbd43c"]]),QC={};function XC(s,t){const n=At("router-view");return i(),Y(n)}const eS=le(QC,[["render",XC]]),tS={},nS={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"};function aS(s,t){return i(),d("svg",nS,[...t[0]||(t[0]=[Hn('',2)])])}const sS=le(tS,[["render",aS]]),oS={},lS={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"};function iS(s,t){return i(),d("svg",lS,[...t[0]||(t[0]=[Hn('',2)])])}const rS=le(oS,[["render",iS]]),cS={},dS={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"};function uS(s,t){return i(),d("svg",dS,[...t[0]||(t[0]=[Hn('',2)])])}const vS=le(cS,[["render",uS]]),pS={id:"page"},hS={class:"title"},mS={class:"desc"},fS={class:"network-containers"},bS={class:"network-container_item"},gS={class:"cover"},_S={class:"thumbnail"},yS={class:"network-container_item"},kS={class:"cover"},wS={class:"thumbnail"},$S={class:"network-container_item"},CS={class:"cover"},SS={class:"thumbnail"},xS=["innerHTML"],PS=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=t("没找到想要的配置?请使用%{link}",{link:''+t("高级模式")+""},!0);return(u,c)=>{const r=At("router-link");return i(),d("div",pS,[e("div",hS,a(o(t)("欢迎使用网络配置向导")),1),e("div",mS,a(o(t)("选择一种连接方式以开始")),1),e("div",fS,[e("div",bS,[G(r,{to:"/network/pppoe"},{default:pe(()=>[e("div",gS,[e("div",_S,[G(rS),e("span",null,a(o(t)("宽带拨号连接")),1)])])]),_:1})]),e("div",yS,[G(r,{to:"/network/dhcp"},{default:pe(()=>[e("div",kS,[e("div",wS,[G(sS),e("span",null,a(o(t)("连接现有路由器")),1)])])]),_:1})]),e("div",$S,[G(r,{to:"/network/gateway"},{default:pe(()=>[e("div",CS,[e("div",SS,[G(vS),e("span",null,a(o(t)("配置为旁路由")),1)])])]),_:1})])]),e("div",{class:"info",innerHTML:o(l)},null,8,xS)])}}}),TS=le(PS,[["__scopeId","data-v-67dfa1ab"]]),MS={key:0,id:"page"},ES={class:"title"},IS={class:"desc"},DS={class:"network-message"},LS=["innerHTML"],AS={class:"label-key"},NS=["placeholder","disabled"],OS={class:"label-key"},zS=["placeholder","disabled"],qS={key:0,class:"chose_dhcp"},RS={class:"dhcp_info"},VS={key:1,class:"msg"},BS={class:"btns"},US=["disabled"],FS=["onClick"],HS={key:1,id:"page"},GS={class:"title"},jS={class:"btns"},WS=["onClick"],JS=["onClick"],KS=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),u=ta().query.type,c=t("由于您的设备没有 WAN 口,无法使用本设置向导,具体请看%{link}",{link:''+t("链接")+""},!0),r=x(0),p=x({}),v=x(""),h=x(!1),g=x(0),b=x(!1);B(null,null,function*(){var k,$;h.value=!0;try{const w=yield Promise.all([we.Guide.Pppoe.GET(),we.Guide.GetLan.GET()]);if(w[0].data){const{success:S,error:C,result:y}=w[0].data;y&&(y.enableLanDhcp=!1,p.value=y),S==-1011&&(h.value=!0,g.value=S)}(k=w[1].data)!=null&&k.result&&((($=w[1].data)==null?void 0:$.result).enableDhcp||(b.value=!0,p.value.enableLanDhcp=!0))}catch(w){v.value=w}g.value==0&&(h.value=!1)});const f=()=>B(null,null,function*(){const k=p.value.account||"",$=p.value.password||"";if(k==""){v.value=t("账号不能为空");return}if($==""){v.value=t("密码不能为空");return}h.value=!0;const w=ne.Loading(t("配置中..."));try{const S=yield we.Guide.Pppoe.POST({account:k,password:$});if(S!=null&&S.data){const{error:C,success:y}=S.data;C&&(v.value=C),(y==null||y==0)&&(ne.Success(t("配置成功")),r.value=1)}}catch(S){v.value=S}h.value=!1,w.Close()});return(k,$)=>{const w=At("switch-box"),S=At("router-link");return r.value==0?(i(),d("div",MS,[e("h2",ES,a(o(t)("配置宽带账号")),1),e("h3",IS,a(o(t)("请确保您已将路由 WAN 口连接到光猫")),1),e("div",DS,[g.value==-1011?(i(),d("li",{key:0,innerHTML:o(c)},null,8,LS)):T("",!0)]),e("form",{onSubmit:Ge(f,["prevent"])},[e("label",null,[e("div",AS,[e("span",null,a(o(t)("宽带账号")),1)]),W(e("input",{type:"text","onUpdate:modelValue":$[0]||($[0]=C=>p.value.account=C),placeholder:o(t)("宽带账号"),required:"",disabled:h.value},null,8,NS),[[Oe,p.value.account,void 0,{trim:!0}]])]),e("label",null,[e("div",OS,[e("span",null,a(o(t)("密码")),1)]),W(e("input",{type:"password","onUpdate:modelValue":$[1]||($[1]=C=>p.value.password=C),placeholder:o(t)("宽带密码"),required:"",disabled:h.value},null,8,zS),[[Oe,p.value.password,void 0,{trim:!0}]])]),b.value?(i(),d("div",qS,[G(w,{modelValue:p.value.enableLanDhcp,"onUpdate:modelValue":$[2]||($[2]=C=>p.value.enableLanDhcp=C)},{default:pe(()=>[e("span",RS,a(o(t)("启用LAN口DHCP服务(用于从旁路由模式恢复成默认状态)")),1)]),_:1},8,["modelValue"])])):T("",!0),v.value?(i(),d("div",VS,a(v.value),1)):T("",!0),e("div",BS,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:h.value},a(o(t)("保存配置")),9,US),G(S,{to:o(u)=="index"?"/":"/network",custom:""},{default:pe(({navigate:C})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:C},a(o(t)("返回")),9,FS)]),_:1},8,["to"])])],32)])):r.value==1?(i(),d("div",HS,[e("h2",GS,a(o(t)("配置成功")),1),e("div",jS,[G(S,{to:"/",custom:""},{default:pe(({navigate:C})=>[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",onClick:C},a(o(t)("进入控制台")),9,WS)]),_:1}),G(S,{to:o(u)=="index"?"/":"/network",custom:""},{default:pe(({navigate:C})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:C},a(o(t)("返回")),9,JS)]),_:1},8,["to"])])])):T("",!0)}}}),ZS=le(KS,[["__scopeId","data-v-f91feaff"]]),YS={key:0,id:"page"},QS={class:"title"},XS={class:"desc"},ex={class:"network-message"},tx=["innerHTML"],nx={class:"label-key"},ax={value:"dhcp"},sx={value:"static"},ox={class:"label-key"},lx=["placeholder","disabled"],ix={key:0,class:"msg"},rx={class:"label-key"},cx=["placeholder","disabled"],dx={key:1,class:"msg"},ux={class:"label-key"},vx=["placeholder","disabled"],px={class:"label-key"},hx=["disabled"],mx={value:"manual"},fx={class:"label-key"},bx=["onUpdate:modelValue","placeholder","disabled"],gx={class:"label-key"},_x=["placeholder","disabled"],yx={class:"label-key"},kx=["placeholder","disabled"],wx={key:2,class:"chose_dhcp"},$x={class:"dhcp_info"},Cx={key:3,class:"msgs"},Sx={class:"btns"},xx=["disabled"],Px=["onClick"],Tx={key:1,id:"page"},Mx={class:"title"},Ex={class:"btns"},Ix=["onClick"],Dx=["onClick"],Lx=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=t("由于您的设备没有 WAN 口,无法使用本设置向导,具体请看%{link}",{link:''+t("链接")+""},!0),u=x(0),c=x({}),r=x(""),p=x(""),v=x(""),h=x(!1),g=x(""),b=x(""),m=x(0),f=Fn.checkIsIP,k=x(!1),w=ta().query.type;B(null,null,function*(){var D,E;h.value=!0;try{const A=yield Promise.all([we.Guide.ClientModel.GET(),we.Guide.GetLan.GET()]);if(A[0]){const U=A[0];if(U.data){const{success:q,error:z,result:N}=U.data;N&&(N.wanProto!="dhcp"&&N.wanProto!="static"&&(N.wanProto="dhcp",N.dnsProto="auto"),N.enableLanDhcp=!1,c.value=N),q==-1011&&(m.value=q,h.value=!0)}}(D=A[1].data)!=null&&D.result&&(((E=A[1].data)==null?void 0:E.result).enableDhcp||(k.value=!0,c.value.enableLanDhcp=!0))}catch(A){r.value=A}m.value==0&&(h.value=!1)});const C=D=>{D.target.value=="static"?((c.value.staticIp==null||c.value.staticIp=="")&&(c.value.staticIp="192.168.1.100"),(c.value.subnetMask==null||c.value.subnetMask=="")&&(c.value.subnetMask="255.255.255.0"),c.value.dnsProto=="auto"&&setTimeout(()=>c.value.dnsProto="manual",0)):c.value.dnsProto=="manual"&&setTimeout(()=>c.value.dnsProto="auto",0)},y=D=>{const E=D.target;if(E.value==""){g.value="";return}f(E.value)?g.value="":g.value=t("请输入合法的IP地址")},P=D=>{const E=D.target;if(E.value==""){b.value="";return}f(E.value)?b.value="":b.value=t("请输入合法的地址")},_=()=>B(null,null,function*(){const D={};switch(c.value.wanProto){case"dhcp":break;case"static":D.staticIp=c.value.staticIp,D.subnetMask=c.value.subnetMask,D.gateway=c.value.gateway||"";break}switch(c.value.dnsProto){case"auto":break;case"manual":D.manualDnsIp=[],c.value.manualDnsIp!=null&&c.value.manualDnsIp.length>0?D.manualDnsIp=c.value.manualDnsIp:(D.manualDnsIp.push(p.value),v.value&&D.manualDnsIp.push(v.value));break}D.dnsProto=c.value.dnsProto,D.wanProto=c.value.wanProto,D.enableLanDhcp=c.value.enableLanDhcp;const E=ne.Loading(t("配置中...."));h.value=!0;try{const A=yield we.Guide.ClientModel.POST(D);if(A!=null&&A.data){const{success:U,error:q}=A==null?void 0:A.data;q&&(r.value=q),(U==null||U==0)&&(ne.Success(t("配置成功")),u.value=1)}}catch(A){r.value=A}h.value=!1,E.Close()});return(D,E)=>{const A=At("switch-box"),U=At("router-link");return u.value==0?(i(),d("div",YS,[e("h2",QS,a(o(t)("配置互联网")),1),e("h3",XS,a(o(t)("请确保您已将本设备 WAN 口连接到上级路由器局域网( LAN )接口")),1),e("div",ex,[m.value==-1011?(i(),d("li",{key:0,innerHTML:o(l)},null,8,tx)):T("",!0)]),e("form",{onSubmit:Ge(_,["prevent"])},[e("label",null,[e("div",nx,[e("span",null,a(o(t)("WAN 接口配置方式")),1)]),W(e("select",{"onUpdate:modelValue":E[0]||(E[0]=q=>c.value.wanProto=q),onInput:C},[e("option",ax,a(o(t)("自动获取IP地址(DHCP)")),1),e("option",sx,a(o(t)("静态IP地址")),1)],544),[[Be,c.value.wanProto]])]),c.value.wanProto=="static"?(i(),d(V,{key:0},[e("label",null,[e("div",ox,[e("span",null,a(o(t)("IP地址")),1)]),W(e("input",{type:"text","onUpdate:modelValue":E[1]||(E[1]=q=>c.value.staticIp=q),placeholder:o(t)("静态IP地址"),required:"",disabled:h.value,onInput:y},null,40,lx),[[Oe,c.value.staticIp,void 0,{trim:!0}]])]),g.value?(i(),d("p",ix,a(g.value),1)):T("",!0),e("label",null,[e("div",rx,[e("span",null,a(o(t)("子网掩码")),1)]),W(e("input",{type:"text","onUpdate:modelValue":E[2]||(E[2]=q=>c.value.subnetMask=q),placeholder:o(t)("子网掩码"),required:"",disabled:h.value,onInput:P},null,40,cx),[[Oe,c.value.subnetMask,void 0,{trim:!0}]])]),b.value?(i(),d("p",dx,a(b.value),1)):T("",!0),e("label",null,[e("div",ux,[e("span",null,a(o(t)("网关地址")),1)]),W(e("input",{type:"text","onUpdate:modelValue":E[3]||(E[3]=q=>c.value.gateway=q),placeholder:o(t)("网关地址"),required:"",disabled:h.value},null,8,vx),[[Oe,c.value.gateway,void 0,{trim:!0}]])])],64)):T("",!0),e("label",null,[e("div",px,[e("span",null,a(o(t)("DNS 配置方式")),1)]),W(e("select",{"onUpdate:modelValue":E[4]||(E[4]=q=>c.value.dnsProto=q)},[e("option",{value:"auto",disabled:c.value.wanProto=="static"},a(o(t)("自动获取(DHCP)")),9,hx),e("option",mx,a(o(t)("手工配置")),1)],512),[[Be,c.value.dnsProto]])]),c.value.dnsProto=="manual"?(i(),d(V,{key:1},[c.value.manualDnsIp!=null&&c.value.manualDnsIp.length>0?(i(!0),d(V,{key:0},oe(c.value.manualDnsIp,(q,z)=>(i(),d("label",null,[e("div",fx,[e("span",null,a(o(t)("DNS服务器")),1)]),W(e("input",{type:"text","onUpdate:modelValue":N=>c.value.manualDnsIp[z]=N,placeholder:o(t)("DNS服务器"),required:"",disabled:h.value},null,8,bx),[[Oe,c.value.manualDnsIp[z],void 0,{trim:!0}]])]))),256)):(i(),d(V,{key:1},[e("label",null,[e("div",gx,[e("span",null,a(o(t)("DNS服务器")),1)]),W(e("input",{type:"text","onUpdate:modelValue":E[5]||(E[5]=q=>p.value=q),placeholder:o(t)("DNS服务器"),required:"",disabled:h.value},null,8,_x),[[Oe,p.value,void 0,{trim:!0}]])]),e("label",null,[e("div",yx,a(o(t)("备用DNS服务器")),1),W(e("input",{type:"text","onUpdate:modelValue":E[6]||(E[6]=q=>v.value=q),placeholder:o(t)("备用DNS服务器"),disabled:h.value},null,8,kx),[[Oe,v.value,void 0,{trim:!0}]])])],64))],64)):T("",!0),k.value?(i(),d("div",wx,[G(A,{modelValue:c.value.enableLanDhcp,"onUpdate:modelValue":E[7]||(E[7]=q=>c.value.enableLanDhcp=q)},{default:pe(()=>[e("span",$x,a(o(t)("启用LAN口DHCP服务(用于从旁路由模式恢复成默认状态)")),1)]),_:1},8,["modelValue"])])):T("",!0),r.value?(i(),d("div",Cx,a(r.value),1)):T("",!0),e("div",Sx,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:h.value},a(o(t)("保存配置")),9,xx),G(U,{to:o(w)=="index"?"/":"/network",custom:""},{default:pe(({navigate:q})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:q},a(o(t)("返回")),9,Px)]),_:1},8,["to"])])],32)])):u.value==1?(i(),d("div",Tx,[e("h2",Mx,a(o(t)("配置成功")),1),e("div",Ex,[G(U,{to:"/",custom:""},{default:pe(({navigate:q})=>[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",onClick:q},a(o(t)("进入控制台")),9,Ix)]),_:1}),G(U,{to:o(w)=="index"?"/":"/network",custom:""},{default:pe(({navigate:q})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:q},a(o(t)("返回")),9,Dx)]),_:1},8,["to"])])])):T("",!0)}}}),Ax=le(Lx,[["__scopeId","data-v-dc3ea120"]]),Nx={key:0,id:"page"},Ox={class:"title"},zx={class:"btns"},qx=["onClick"],Rx={key:1,id:"page"},Vx={class:"title"},Bx={class:"desc"},Ux={class:"label-key"},Fx={class:"label-value"},Hx={disabled:"",style:{backgroundColor:"rgba(215, 215, 215, 1)",color:"#333"}},Gx={class:"label-key"},jx=["placeholder"],Wx={class:"label-key"},Jx=["placeholder"],Kx={class:"label-key"},Zx=["placeholder"],Yx={class:"label-key"},Qx=["placeholder"],Xx={key:0,class:"msgs"},eP={class:"switch_inline"},tP={key:0,class:"switch_info"},nP={key:1,class:"switch_info"},aP={class:"switch_inline"},sP={class:"switch_info"},oP={class:"switch_inline"},lP={class:"switch_info"},iP={class:"btns"},rP={class:"cbi-button cbi-button-apply app-btn app-next"},cP=["onClick"],dP={key:2,id:"page"},uP={class:"title"},vP={class:"desc"},pP={class:"btns"},hP={key:3,id:"page"},mP={class:"title"},fP=["disabled"],bP={style:{"text-align":"left"}},gP={class:"btns"},_P=["disabled"],yP=["onClick"],kP=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),u=ta().query.type,c=x(0),r=x(""),p=x(!1),v=R(()=>{var $,w,S;return!(($=g.value)!=null&&$.ipv4addr&&((w=g.value)!=null&&w.ipv4mask)&&((S=g.value)!=null&&S.gateway))}),h=x({subnetMask:"255.255.255.0",staticDnsIp:"223.5.5.5",staticLanIp:"",gateway:"",enableDhcp:!0,dhcp6c:!1,enableNat:!1}),g=x(),b=()=>{p.value=!0,we.Network.Status.GET().then($=>{if($!=null&&$.data){const{result:w}=$==null?void 0:$.data;w&&(g.value=w)}}).finally(()=>{p.value=!1})},m=$=>{var w,S,C,y,P;$&&(h.value.staticLanIp=((w=g.value)==null?void 0:w.ipv4addr)||"",h.value.subnetMask=((S=g.value)==null?void 0:S.ipv4mask)&&wn.prefixToMask(g.value.ipv4mask)||"",h.value.gateway=((C=g.value)==null?void 0:C.gateway)||"",h.value.staticDnsIp=((y=g.value)==null?void 0:y.dnsList)&&((P=g.value)==null?void 0:P.dnsList[0])||"223.5.5.5"),c.value=1},f=$=>{window.location.href=location.protocol+"//"+h.value.staticLanIp+(location.port?":"+location.port:"")},k=()=>B(null,null,function*(){const $=h.value,w=ne.Loading(t("配置中..."));try{const S=yield we.Guide.GatewayRouter.POST($);if(S!=null&&S.data){const{success:C,error:y}=S==null?void 0:S.data;if(y&&(r.value=y),C==null||C==0){setTimeout(()=>{c.value=2,w.Close()},5e3);return}}}catch(S){r.value=S}w.Close()});return($,w)=>{var y,P,_,D;const S=At("router-link"),C=At("switch-box");return c.value==0?(i(),d("div",Nx,[e("h2",Ox,a(o(t)("旁路由配置前的准备工作")),1),e("code",null,[ue(a(o(t)("旁路由模式,也叫单臂路由模式。"))+" ",1),e("p",null,a(o(t)("您可以用上一级路由(主路由)拨号,然后用本路由来实现一些高级功能。")),1),w[10]||(w[10]=e("br",null,null,-1)),e("p",null,a(o(t)("本向导支持自动或手动配置:")),1),e("p",null,a(o(t)("点击“自动配置”按钮开始自动配置向导;")),1),e("p",null,a(o(t)("手动配置则需自行获取主路由器的IP地址(例如 192.168.2.1 )和子网掩码,记录以备后续填写,点击“手动配置”按钮,切换到参数配置页,按实际情况自行填写。")),1)]),e("div",zx,[e("button",{class:"cbi-button cbi-button-success app-btn app-next",onClick:w[0]||(w[0]=E=>c.value=3)},a(o(t)("自动配置...")),1),e("button",{class:"cbi-button cbi-button-neutral app-btn app-next",onClick:w[1]||(w[1]=E=>m(!1))},a(o(t)("手动配置...")),1),G(S,{to:o(u)=="index"?"/":"/network",custom:""},{default:pe(({navigate:E})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:E},a(o(t)("返回")),9,qx)]),_:1},8,["to"])])])):c.value==1?(i(),d("div",Rx,[e("h2",Vx,a(o(t)("配置旁路由网络")),1),e("h3",Bx,a(o(t)("现在,请你配置旁路由信息")),1),e("form",{onSubmit:Ge(k,["prevent"])},[e("label",null,[e("div",Ux,[e("span",null,a(o(t)("LAN 接口配置方式")),1)]),e("div",Fx,[e("select",Hx,[e("option",null,a(o(t)("旁路由模式仅支持静态IP地址")),1)])])]),e("label",null,[e("div",Gx,[e("span",null,a(o(t)("IP 地址")),1)]),W(e("input",{type:"text","onUpdate:modelValue":w[2]||(w[2]=E=>h.value.staticLanIp=E),placeholder:o(t)("IP地址"),required:""},null,8,jx),[[Oe,h.value.staticLanIp,void 0,{trim:!0}]])]),e("label",null,[e("div",Wx,[e("span",null,a(o(t)("子网掩码")),1)]),W(e("input",{type:"text","onUpdate:modelValue":w[3]||(w[3]=E=>h.value.subnetMask=E),placeholder:o(t)("子网掩码"),required:""},null,8,Jx),[[Oe,h.value.subnetMask,void 0,{trim:!0}]])]),e("label",null,[e("div",Kx,[e("span",null,a(o(t)("网关地址")),1)]),W(e("input",{type:"text","onUpdate:modelValue":w[4]||(w[4]=E=>h.value.gateway=E),placeholder:o(t)("网关地址"),required:""},null,8,Zx),[[Oe,h.value.gateway,void 0,{trim:!0}]])]),e("label",null,[e("div",Yx,[e("span",null,a(o(t)("DNS服务器")),1)]),W(e("input",{type:"text","onUpdate:modelValue":w[5]||(w[5]=E=>h.value.staticDnsIp=E),placeholder:o(t)("223.5.5.5"),required:""},null,8,Qx),[[Oe,h.value.staticDnsIp,void 0,{trim:!0}]])]),r.value?(i(),d("div",Xx,a(r.value),1)):T("",!0),e("div",eP,[G(C,{modelValue:h.value.enableDhcp,"onUpdate:modelValue":w[6]||(w[6]=E=>h.value.enableDhcp=E)},{default:pe(()=>[h.value.enableDhcp?(i(),d("span",tP,a(o(t)("提供 DHCPv4 服务(需要关闭主路由 DHCP 服务)")),1)):(i(),d("span",nP,a(o(t)("提供 DHCPv4 服务")),1))]),_:1},8,["modelValue"])]),e("div",aP,[G(C,{modelValue:h.value.dhcp6c,"onUpdate:modelValue":w[7]||(w[7]=E=>h.value.dhcp6c=E)},{default:pe(()=>[e("span",sP,a(o(t)("自动获取 IPV6(即开启 DHCPv6 客户端)")),1)]),_:1},8,["modelValue"])]),e("div",oP,[G(C,{modelValue:h.value.enableNat,"onUpdate:modelValue":w[8]||(w[8]=E=>h.value.enableNat=E)},{default:pe(()=>[e("span",lP,a(o(t)("开启 NAT(可修复某些无线热点不能访问外网问题)")),1)]),_:1},8,["modelValue"])]),e("div",iP,[e("button",rP,a(o(t)("保存配置")),1),G(S,{to:o(u)=="index"?"/":"/network",custom:""},{default:pe(({navigate:E})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:E},a(o(t)("返回")),9,cP)]),_:1},8,["to"])])],32)])):c.value==2?(i(),d("div",dP,[e("h2",uP,a(o(t)("配置成功")),1),e("h3",vP,a(o(t)("现在,将本路由WAN口断开,将其中一个LAN口与主路由连接,并将当前浏览器设备连接到主路由。点击“进入控制台”浏览器将跳转到新的路由IP")),1),e("div",pP,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",onClick:f},a(o(t)("进入控制台")),1)])])):c.value==3?(i(),d("div",hP,[e("h2",mP,a(o(t)("旁路由自动配置")),1),e("code",null,a(o(t)("首先确认主路由开启了 DHCP 服务,确认本路由 WAN 口是 DHCP 客户端模式(默认即是,如果不是可使用“连接现有路由器”向导改成 DHCP 客户端),然后将本路由 WAN 口与主路由的 LAN 连接,以自动获取配置。")),1),ue(" "+a(o(t)("1. 满足上述条件以后,点击“当前 IPv4 上游信息”以刷新当前连接信息,成功以后,“自动填写”按钮将被激活。(失败可再次点击)"))+" ",1),e("button",{class:_e(["cbi-button cbi-button-neutral",v.value?"cbi-button-neutral":"cbi-button-success"]),disabled:p.value,onClick:b},[ue(a(o(t)("当前 IPv4 上游信息(点此刷新)"))+" ",1),e("p",bP,[e("ul",null,[e("li",null,a(o(t)("IP 地址: "))+a((y=g.value)==null?void 0:y.ipv4addr),1),e("li",null,a(o(t)("子网掩码: "))+a(((P=g.value)==null?void 0:P.ipv4mask)&&o(wn).prefixToMask(g.value.ipv4mask)),1),e("li",null,a(o(t)("网关地址: "))+a((_=g.value)==null?void 0:_.gateway),1),e("li",null,a(o(t)("DNS服务器: "))+a(((D=g.value)==null?void 0:D.dnsList)&&g.value.dnsList[0]||(v.value?"":o(t)("(无DNS服务器,请之后自行填写公共DNS服务器,例如 223.5.5.5)"))),1)])])],10,fP),ue(" "+a(o(t)("2. 点击“自动填写”,将切换到参数页并自动填写。此时依然可以自行调整参数。"))+" ",1),e("div",gP,[e("button",{class:"cbi-button cbi-button-apply app-btn app-next",disabled:v.value,onClick:w[9]||(w[9]=E=>m(!0))},a(o(t)("自动填写..."))+a(v.value?o(t)("(请先获取IPv4上游信息)"):""),9,_P),G(S,{to:o(u)=="index"?"/":"/network",custom:""},{default:pe(({navigate:E})=>[e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:E},a(o(t)("返回")),9,yP)]),_:1},8,["to"])])])):T("",!0)}}}),wP=le(kP,[["__scopeId","data-v-c4ce32be"]]),$P={class:"actioner-container"},CP={class:"actioner-container_header"},SP={class:"actioner-container_body"},xP={class:"label-item"},PP={class:"label-item_key"},TP={class:"label-item_value"},MP=["value"],EP={class:"label-item_tips"},IP={class:"label-item"},DP={class:"label-item_key"},LP={key:0,class:"label-item_value"},AP={class:"msg-warning"},NP={key:1,class:"label-item_value"},OP=["value"],zP={key:1,class:"msg-warning"},qP={class:"label-item_tips"},RP={class:"actioner-container_footer"},VP=["disabled"],BP=["disabled"],UP={key:1,class:"actioner-container_body setup-loading"},FP={class:"actioner-container_body setup-error"},HP={class:"actioner-container_footer"},GP=["disabled"],jP={class:"actioner-container_body setup-success"},WP={class:"body-title"},JP={class:"actioner-container_footer"},KP=X({__name:"setup-create",props:{Close:{type:Function,required:!0},success:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close()},c=()=>{l.success&&l.success()},r=x("init"),p=x(""),v=[{name:"jbod",title:t("JBOD (线性)"),info:t("至少需要2块硬盘,将多个硬盘合并为单个存储空间,其容量等于所有硬盘容量的总和。不提供数据冗余。"),select:2},{name:"raid0",title:t("RAID 0 (条带)"),info:t("至少需要2块硬盘,“区块延展”功能是将数据分成多个块,并将数据块分散到组成的多个硬盘上以提高性能的过程。不提供数据冗余。"),select:2},{name:"raid1",title:t("RAID 1 (镜像)"),info:t("至少需要2块硬盘,同时向所有硬盘写入相同的数据。提供数据冗余。"),select:2},{name:"raid5",title:"RAID 5 ",info:t("至少需要3块硬盘,执行段落分块延展,并对分布到所有组成硬盘上的数据执行奇偶校验,从而提供比 RAID 1 更有效的数据冗余。"),select:3},{name:"raid6",title:"RAID 6 ",info:t("至少需要4块硬盘,执行两个层级的数据奇偶校验以存储等于 2 个硬盘容量的冗余数据,提供比 RAID 5 更大程度的数据冗余。"),select:4},{name:"raid10",title:"RAID 10",info:t("至少需要4块硬盘,提供 RAID 0 的性能和 RAID 1 的数据保护级别,将硬盘组合进镜像数据的由两个硬盘组成的组。"),select:4}],h=x("raid5"),g=x([]),b=S=>{let C="";return v.forEach(y=>{y.name===S&&(C=y.info)}),C},m=x(!1),f=Xe({loading:!1,members:[]}),k=S=>{};B(null,null,function*(){f.loading=!0;try{const S=yield we.Raid.CreateList.GET();if(S!=null&&S.data){const{success:C,error:y,result:P}=S.data;if(P&&(f.members=P.members||[]),y)throw y}}catch(S){console.log(S)}finally{f.loading=!1}});const w=()=>B(null,null,function*(){const S=v.filter(y=>y.name===h.value)[0],C=g.value;if(!S){ne.Warning(t("请选择raid类型"));return}if(C.length==0){ne.Warning(t("请选择磁盘"));return}if(S.select>C.length){ne.Warning(t("请选择至少%{min}块磁盘",{min:""+S.select}));return}if(confirm(t("是否立即创建 %{name}?选择的硬盘所有分区将会被清除,此操作可能会导致硬盘数据丢失,请谨慎操作。",{name:S.name}))&&confirm(t("确定创建 %{name}?该操作不可逆,请谨慎操作",{name:S.name}))){m.value=!0,r.value="loading";try{const y=yield we.Raid.Create.POST({level:S.name,devicePaths:C});if(y.data){const{success:P,error:_,result:D}=y.data;if(_)throw _;(P||0)==0&&(r.value="success",c())}}catch(y){p.value=y,r.value="error"}finally{m.value=!1}}});return(S,C)=>{const y=At("icon-loading"),P=At("icon-error"),_=At("icon-success");return i(),d("div",$P,[e("div",CP,[e("span",null,a(o(t)("RAID创建向导")),1)]),r.value=="init"?(i(),d(V,{key:0},[e("div",SP,[e("p",null,a(o(t)("RAID磁盘阵列是用多个独立的磁盘组成在一起形成一个大的磁盘系统,从而实现比单块磁盘更好的存储性能和更高的可靠性。")),1),e("div",xP,[e("div",PP,[e("span",null,a(o(t)("RAID级别:")),1)]),e("div",TP,[W(e("select",{"onUpdate:modelValue":C[0]||(C[0]=D=>h.value=D),onChange:k},[(i(),d(V,null,oe(v,D=>e("option",{value:D.name},a(D.title),9,MP)),64))],544),[[Be,h.value]])]),e("div",EP,[G(Sn),ue(" "+a(b(h.value)),1)])]),e("div",IP,[e("div",DP,[e("span",null,a(o(t)("磁盘阵列成员:")),1)]),f.loading?(i(),d("div",LP,[e("span",AP,a(o(t)("检测中...")),1)])):(i(),d("div",NP,[f.members.length>0?(i(!0),d(V,{key:0},oe(f.members,D=>(i(),d("label",null,[W(e("input",{type:"checkbox","onUpdate:modelValue":C[1]||(C[1]=E=>g.value=E),value:D.path},null,8,OP),[[gt,g.value]]),ue(" 【"+a(D.model)+"】"+a(D.name)+" "+a(D.path)+" ["+a(D.sizeStr)+"] ",1)]))),256)):(i(),d("span",zP,a(o(t)("检测不到可用磁盘阵列成员")),1))])),e("div",qP,[G(Sn),ue(" "+a(o(t)("选择将要用于创建 RAID 的硬盘,通过 USB 接入的设备不会在列表中显示(USB接入不稳定)。")),1)])])]),e("div",RP,[e("div",{class:"close",onClick:u,disabled:m.value},a(o(t)("取消")),9,VP),e("div",{class:"next",onClick:w,disabled:m.value},a(o(t)("创建")),9,BP)])],64)):r.value=="loading"?(i(),d("div",UP,[G(y,{size:60,color:"#666"}),e("span",null,a(o(t)("正在创建中...")),1)])):r.value=="error"?(i(),d(V,{key:2},[e("div",FP,[G(P),e("span",null,a(p.value),1)]),e("div",HP,[e("div",{class:"close",onClick:u},a(o(t)("关闭")),1),e("div",{class:"next",onClick:w,disabled:m.value},a(o(t)("重新创建")),9,GP)])],64)):r.value=="success"?(i(),d(V,{key:3},[e("div",jP,[G(_),e("div",WP,a(o(t)("创建成功")),1)]),e("div",JP,[e("div",{class:"close",onClick:u},a(o(t)("关闭")),1)])],64)):T("",!0)])}}}),ZP=le(KP,[["__scopeId","data-v-fb4bf57d"]]),YP={class:"actioner-container"},QP={class:"actioner-container_body"},XP=["value"],eT={class:"actioner-container_footer"},tT=X({__name:"setup-info",props:{Close:{type:Function,required:!0},raid:{type:Object,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close()},c=x("");return we.Raid.Detail.POST({path:l.raid.path}).then(p=>{if(p.data){const{result:v,error:h}=p.data;h?c.value=h:c.value=(v==null?void 0:v.detail)||""}}).catch(p=>{c.value=p.message}),(p,v)=>(i(),d("div",YP,[e("div",QP,[e("textarea",{value:c.value},null,8,XP)]),e("div",eT,[e("div",{class:"close",onClick:u},a(o(t)("关闭")),1)])]))}}),nT=le(tT,[["__scopeId","data-v-4d9db7d4"]]),aT={class:"actioner-container"},sT={class:"actioner-container_header"},oT={class:"actioner-container_body"},lT={class:"label-item"},iT={class:"label-item_key"},rT={class:"label-item_value"},cT={disabled:""},dT={class:"label-item"},uT={class:"label-item_key"},vT={key:0,class:"label-item_value"},pT={class:"msg-warning"},hT={key:1,class:"label-item_value"},mT=["value"],fT={key:1,class:"msg-warning"},bT={class:"actioner-container_footer"},gT=["disabled"],_T=["disabled"],yT=X({__name:"setup-edit",props:{Close:{type:Function,required:!0},raid:{type:Object,required:!0},success:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close()},c=()=>{l.success&&l.success()},r=()=>B(null,null,function*(){const b=h.value;if(b==""){ne.Warning(t("请选择要添加的硬盘"));return}v.value=!0;const m=ne.Loading(t("保存中..."));try{const f=yield we.Raid.Add.POST({path:l.raid.path,memberPath:b});if(f.data){const{error:k,success:$}=f.data;if(k)throw k;($||0)==0&&(ne.Success(t("保存成功")),c(),u())}}catch(f){ne.Error(`${f}`)}finally{v.value=!1,m.Close()}}),p=Xe({loading:!1,members:[]}),v=x(!1),h=x("");return B(null,null,function*(){p.loading=!0,v.value=!0;try{const b=yield we.Raid.CreateList.GET();if(b!=null&&b.data){const{success:m,error:f,result:k}=b.data;if(k&&(p.members=k.members||[]),f)throw f}}catch(b){console.log(b)}finally{v.value=!1,p.loading=!1}}),(b,m)=>(i(),d("div",aT,[e("div",sT,[e("span",null,"RAID - "+a(s.raid.name)+" "+a(o(t)("修改")),1)]),e("div",oT,[e("div",lT,[e("div",iT,a(o(t)("设备")),1),e("div",rT,[e("select",cT,[e("option",null,a(s.raid.name)+"_"+a(s.raid.venderModel)+" ("+a(s.raid.path)+","+a(s.raid.level)+","+a(s.raid.size)+") ",1)])])]),e("div",dT,[e("div",uT,a(o(t)("选择硬盘(选择被添加到RAID的硬盘):")),1),p.loading?(i(),d("div",vT,[e("span",pT,a(o(t)("检测中...")),1)])):(i(),d("div",hT,[p.members.length>0?(i(!0),d(V,{key:0},oe(p.members,f=>(i(),d("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":m[0]||(m[0]=k=>h.value=k),value:f.path},null,8,mT),[[Mt,h.value]]),ue(" 【"+a(f.model)+"】"+a(f.name)+" "+a(f.path)+" ["+a(f.sizeStr)+"] ",1)]))),256)):(i(),d("span",fT,a(o(t)("检测不到可用磁盘阵列成员")),1))]))])]),e("div",bT,[e("div",{class:"close",onClick:u,disabled:v.value},a(o(t)("取消")),9,gT),e("div",{class:"next",onClick:r,disabled:v.value},a(o(t)("保存")),9,_T)])]))}}),kT=le(yT,[["__scopeId","data-v-a6a43b80"]]),wT={class:"actioner-container"},$T={class:"actioner-container_header"},CT={class:"actioner-container_body"},ST={class:"label-item"},xT={class:"label-item_key"},PT={class:"label-item_value"},TT={disabled:""},MT={class:"label-item"},ET={class:"label-item_key"},IT={class:"label-item_value"},DT=["value"],LT={class:"actioner-container_footer"},AT=["disabled"],NT=["disabled"],OT=X({__name:"setup-remove",props:{Close:{type:Function,required:!0},raid:{type:Object,required:!0},success:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close()},c=()=>{l.success&&l.success()},r=()=>B(null,null,function*(){const h=v.value;if(h==""){ne.Warning(t("请选择要删除的硬盘"));return}p.value=!0;const g=ne.Loading(t("保存中..."));try{const b=yield we.Raid.Remove.POST({path:l.raid.path,memberPath:h});if(b.data){const{error:m,success:f}=b.data;if(m)throw m;(f||0)==0&&(ne.Success(t("保存成功")),c(),u())}}catch(b){ne.Error(`${b}`)}finally{p.value=!1,g.Close()}}),p=x(!1),v=x("");return(h,g)=>(i(),d("div",wT,[e("div",$T,[e("span",null,"RAID - "+a(s.raid.name)+" "+a(o(t)("移除")),1)]),e("div",CT,[e("div",ST,[e("div",xT,a(o(t)("设备")),1),e("div",PT,[e("select",TT,[e("option",null,a(s.raid.name)+"_"+a(s.raid.venderModel)+" ("+a(s.raid.path)+","+a(s.raid.level)+","+a(s.raid.size)+") ",1)])])]),e("div",MT,[e("div",ET,a(o(t)("选择硬盘(选择要从RAID阵列中删除的硬盘):")),1),e("div",IT,[(i(!0),d(V,null,oe(s.raid.members,b=>(i(),d("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":g[0]||(g[0]=m=>v.value=m),value:b},null,8,DT),[[Mt,v.value]]),ue(" "+a(b),1)]))),256))])])]),e("div",LT,[e("div",{class:"close",onClick:u,disabled:p.value},a(o(t)("取消")),9,AT),e("div",{class:"next",onClick:r,disabled:p.value},a(o(t)("保存")),9,NT)])]))}}),zT=le(OT,[["__scopeId","data-v-f58fb3c5"]]),qT={class:"actioner-container"},RT={class:"actioner-container_header"},VT={class:"actioner-container_body"},BT={class:"label-item"},UT={class:"label-item_key"},FT={class:"label-item_value"},HT={disabled:""},GT={class:"label-item"},jT={class:"label-item_key"},WT={key:0,class:"label-item_value"},JT={class:"msg-warning"},KT={key:1,class:"label-item_value"},ZT=["value"],YT={key:1,class:"msg-warning"},QT={class:"actioner-container_footer"},XT=["disabled"],eM=["disabled"],tM=X({__name:"setup-recover",props:{Close:{type:Function,required:!0},raid:{type:Object,required:!0},success:{type:Function}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=()=>{l.Close()},c=()=>{l.success&&l.success()},r=()=>B(null,null,function*(){const b=h.value;if(b==""){ne.Warning(t("请选择要添加的硬盘"));return}v.value=!0;const m=ne.Loading(t("保存中..."));try{const f=yield we.Raid.Recover.POST({path:l.raid.path,memberPath:b});if(f.data){const{error:k,success:$}=f.data;if(k)throw k;($||0)==0&&(ne.Success(t("保存成功")),c(),u())}}catch(f){ne.Error(`${f}`)}finally{v.value=!1,m.Close()}}),p=Xe({loading:!1,members:[]}),v=x(!1),h=x("");return B(null,null,function*(){p.loading=!0,v.value=!0;try{const b=yield we.Raid.CreateList.GET();if(b!=null&&b.data){const{success:m,error:f,result:k}=b.data;if(k&&(p.members=k.members||[]),f)throw f}}catch(b){console.log(b)}finally{v.value=!1,p.loading=!1}}),(b,m)=>(i(),d("div",qT,[e("div",RT,[e("span",null,"RAID - "+a(s.raid.name)+" "+a(o(t)("恢复")),1)]),e("div",VT,[e("div",BT,[e("div",UT,a(o(t)("设备")),1),e("div",FT,[e("select",HT,[e("option",null,a(s.raid.name)+"_"+a(s.raid.venderModel)+" ("+a(s.raid.path)+","+a(s.raid.level)+","+a(s.raid.size)+") ",1)])])]),e("div",GT,[e("div",jT,a(o(t)("选择硬盘(选择空闲的硬盘恢复RAID设备):")),1),p.loading?(i(),d("div",WT,[e("span",JT,a(o(t)("检测中...")),1)])):(i(),d("div",KT,[p.members.length>0?(i(!0),d(V,{key:0},oe(p.members,f=>(i(),d("label",null,[W(e("input",{type:"radio","onUpdate:modelValue":m[0]||(m[0]=k=>h.value=k),value:f.path},null,8,ZT),[[Mt,h.value]]),ue(" 【"+a(f.model)+"】"+a(f.name)+" "+a(f.path)+" ["+a(f.sizeStr)+"] ",1)]))),256)):(i(),d("span",YT,a(o(t)("检测不到可用磁盘阵列成员")),1))]))])]),e("div",QT,[e("div",{class:"close",onClick:u,disabled:v.value},a(o(t)("取消")),9,XT),e("div",{class:"next",onClick:r,disabled:v.value},a(o(t)("保存")),9,eM)])]))}}),nM=le(tM,[["__scopeId","data-v-3b6f47ef"]]),aM={class:"action-main"},sM=X({__name:"index",props:{Close:{type:Function,required:!0},setup:{type:String,default:"create"},raid:{type:Object},success:{type:Function}},setup(s){return(t,n)=>(i(),Y(Nt,{type:2},{default:pe(()=>[e("div",aM,[s.setup=="create"?(i(),Y(ZP,{key:0,Close:s.Close},null,8,["Close"])):s.setup=="info"&&s.raid!=null?(i(),Y(nT,{key:1,Close:s.Close,raid:s.raid,success:s.success},null,8,["Close","raid","success"])):s.setup=="edit"&&s.raid!=null?(i(),Y(kT,{key:2,Close:s.Close,raid:s.raid,success:s.success},null,8,["Close","raid","success"])):s.setup=="remove"&&s.raid!=null?(i(),Y(zT,{key:3,Close:s.Close,raid:s.raid,success:s.success},null,8,["Close","raid","success"])):s.setup=="recover"&&s.raid!=null?(i(),Y(nM,{key:4,Close:s.Close,raid:s.raid,success:s.success},null,8,["Close","raid","success"])):T("",!0)])]),_:1}))}}),oM=le(sM,[["__scopeId","data-v-11e639c1"]]),Ja=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(oM,Ne(ye({},s),{Close:()=>{l()}}));n.use(Pd),n.mount(t);const l=()=>{n.unmount(),t.remove()};return{Close:l}},lM={id:"page"},iM={name:"content"},rM={class:"cbi-map-descr"},cM={style:{color:"#f5365b","margin-top":"10px"}},dM={style:{color:"#f5365b","margin-top":"10px"}},uM={class:"btns"},vM=["disabled"],pM={class:"cbi-section cbi-tblsection",id:"cbi-nfs-mount"},hM={class:"table cbi-section-table"},mM={style:{}},fM={class:"tr cbi-section-table-titles anonymous"},bM={class:"th cbi-section-table-cell","data-widget":"value"},gM={class:"th cbi-section-table-cell","data-widget":"value"},_M={class:"th cbi-section-table-cell","data-widget":"value"},yM={class:"th cbi-section-table-cell","data-widget":"value"},kM={class:"th cbi-section-table-cell","data-widget":"value"},wM={class:"th cbi-section-table-cell","data-widget":"value"},$M={class:"th cbi-section-table-cell","data-widget":"value"},CM={class:"th cbi-section-table-cell","data-widget":"value"},SM={class:"tr cbi-section-table-row"},xM={class:"td cbi-value-field"},PM={class:"td cbi-value-field"},TM=["title"],MM={class:"item-status"},EM={key:0,class:"item-status item-status-detail"},IM={class:"td cbi-value-field"},DM={class:"td cbi-value-field"},LM={class:"td cbi-value-field"},AM={class:"td cbi-value-field"},NM={key:1,href:"/cgi-bin/luci/admin/quickstart/"},OM={class:"td cbi-section-table-cell nowrap cbi-section-actions"},zM=["title","disabled","onClick"],qM=["title","disabled","onClick"],RM=["title","onClick"],VM=["title","onClick"],BM=["title","onClick"],UM=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=Xe({disksList:[]}),u=()=>B(null,null,function*(){try{const w=yield we.Raid.List.GET();if(w!=null&&w.data){const{success:S,error:C,result:y}=w.data;if(y&&(l.disksList=y.disks||[]),C)throw C}}catch(w){console.log(w)}}),c=Fn.easyInterval(u,5e3);ga(()=>{c()});const r=w=>{switch(w.level){case"raid0":case"jbod":return!0}return w.status.indexOf("degraded")!=-1||w.status.indexOf("resyncing(")!=-1},p=w=>{let S=[];return w.childrens&&w.childrens.forEach(C=>{C.mountPoint&&S.push(`${C.name}(${C.mountPoint})`)}),S},v=()=>B(null,null,function*(){Ja({setup:"create",success:()=>{u()}})}),h=w=>{Ja({setup:"info",raid:w})},g=w=>B(null,null,function*(){if(w.childrens&&w.childrens.length>0&&w.childrens.filter(y=>y.mountPoint).length>0){qs({content:t("删除 RAID 设备之前请先卸载文件系统"),nextTitle:t("去卸载"),next:()=>{location.href="/cgi-bin/luci/admin/system/mounts"},clearTitle:t("取消"),clear:()=>{}});return}if(!confirm(t("确定要删除 %{name} 该磁盘阵列吗?删除操作可能会导致数据丢失,请谨慎操作。删除成功后,如需另外组RAID,建议稍等几分钟后再试。",{name:w.name}))||!confirm(t("确定要删除 %{name} 吗?",{name:w.name})))return;const S=ne.Loading(t("删除中..."));try{const C=yield we.Raid.Delete.POST({path:w.path,members:w.members});if(C.data){const{success:y,error:P}=C.data;if(P)throw P;(y||0)==0&&(ne.Success(t("删除成功")),u())}}catch(C){ne.Error(`${C}`)}finally{S.Close()}}),b=w=>{Ja({setup:"edit",raid:w,success:()=>{u()}})},m=w=>{Ja({setup:"remove",raid:w,success:()=>{u()}})},f=w=>{Ja({setup:"recover",raid:w,success:()=>{u()}})},k=x(!1),$=()=>{qs({content:t("将扫描磁盘里 RAID 的磁盘阵列配置并恢复,确定要恢复 RAID 磁盘阵列吗?"),nextTitle:t("确定"),next:()=>B(null,null,function*(){k.value=!0;const w=ne.Loading(t("扫描中..."));try{const S=yield we.Raid.Autofix.POST();if(S.data){const{error:C,success:y}=S.data;if(C)throw C;(y||0)==0&&(ne.Success(t("恢复完成")),u())}}catch(S){ne.Error(`${S}`)}finally{w.Close(),k.value=!1}}),clearTitle:t("取消"),clear:()=>{}})};return(w,S)=>(i(),d("div",lM,[e("h2",iM,a(o(t)("RAID管理")),1),e("div",rM,[e("p",null,a(o(t)("RAID ( Redundant Array of Independent Disks )即独立磁盘冗余阵列,简称为「磁盘阵列」,就是用多个独立的磁盘组成在一起形成一个大的磁盘系统,从而实现比单块磁盘更好的存储性能和更高的可靠性。")),1),e("p",cM," * "+a(o(t)("RAID功能正在公测中,使用过程中如造成数据丢失等问题,概不负责,请谨慎使用。")),1),e("p",dM," * "+a(o(t)("如果由于系统重置或重启导致的RAID设备丢失可以尝试通过下方'扫描恢复RAID'按钮恢复")),1)]),e("div",uM,[e("button",{class:"btn cbi-button cbi-button-apply",onClick:S[0]||(S[0]=C=>v())},a(o(t)("创建RAID")),1),e("button",{class:"btn cbi-button cbi-button-apply",onClick:S[1]||(S[1]=C=>$()),disabled:k.value},a(o(t)("扫描恢复RAID")),9,vM)]),e("div",null,[e("div",pM,[e("table",hM,[e("tbody",mM,[e("tr",fM,[e("th",bM,a(o(t)("名称")),1),e("th",gM,a(o(t)("设备")),1),e("th",_M,a(o(t)("状态")),1),e("th",yM,a(o(t)("级别")),1),e("th",kM,a(o(t)("容量")),1),e("th",wM,a(o(t)("成员")),1),e("th",$M,a(o(t)("挂载信息")),1),e("th",CM,a(o(t)("操作")),1)]),(i(!0),d(V,null,oe(l.disksList,C=>(i(),d("tr",SM,[e("td",xM,[e("b",null,a(C.name),1)]),e("td",PM,[e("b",null,a(C.path),1)]),e("td",{class:"td cbi-value-field",title:C.status+(C.rebuildStatus||"")},[e("b",MM,a(C.status),1),C.rebuildStatus?(i(),d("b",EM," … ")):T("",!0)],8,TM),e("td",IM,[e("b",null,a(C.level),1)]),e("td",DM,[e("b",null,a(C.size),1)]),e("td",LM,[(i(!0),d(V,null,oe(C.members,y=>(i(),d("b",null,[ue(a(y)+" ",1),S[2]||(S[2]=e("br",null,null,-1))]))),256))]),e("td",AM,[p(C).length>0?(i(!0),d(V,{key:0},oe(p(C),y=>(i(),d("b",null,[ue(a(y)+" ",1),S[3]||(S[3]=e("br",null,null,-1))]))),256)):(i(),d("a",NM,a(o(t)("去挂载")),1))]),e("td",OM,[e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("扩充"),disabled:r(C),onClick:y=>b(C)},a(o(t)("扩充")),9,zM),e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("移除"),disabled:r(C),onClick:y=>m(C)},a(o(t)("移除")),9,qM),e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("恢复"),onClick:y=>f(C)},a(o(t)("恢复")),9,RM),e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("详情"),onClick:y=>h(C)},a(o(t)("详情")),9,VM),e("button",{class:"cbi-button cbi-button-remove",title:o(t)("如果您在RAID磁盘阵列中创建了文件系统,先卸载文件系统,后删除文件系统删除操作可能会导致数据丢失,请谨慎操作。"),onClick:y=>g(C)},a(o(t)("删除")),9,BM)])]))),256))])])])])]))}}),FM=le(UM,[["__scopeId","data-v-dcf60521"]]),HM={id:"page"},GM={class:"cbi-map-descr"},jM={class:"tabs"},WM=["href","onClick"],JM=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=[{to:"/smart",name:t("常规设置")},{to:"/smart/task",name:t("计划任务")},{to:"/smart/log",name:t("查看日志")}],u=x(!1),c=Xe({global:{enable:!1,powermode:"never",tmpDiff:0,tmpMax:0},devices:[],tasks:[]}),r=h=>{const{global:g,devices:b,tasks:m}=h;g&&(c.global.enable=g.enable||!1,c.global.powermode=g.powermode||"never"),c.devices=b||[],c.tasks=m||[]};B(null,null,function*(){try{const h=yield we.Smart.Config.GET();if(h.data){const{result:g}=h.data;g&&r(g)}}catch(h){}finally{u.value=!0}});const v=h=>B(null,null,function*(){const g=ne.Loading(t("保存中..."));try{const b=yield we.Smart.Config.POST(h);if(b.data){console.log(b.data);const{success:m,error:f,result:k}=b.data;if(f)throw f;(m||0)==0&&(ne.Success(t("保存成功")),k&&r(k))}}catch(b){ne.Error(`${b}`)}finally{g.Close()}});return(h,g)=>{const b=At("router-link"),m=At("router-view");return i(),d("div",HM,[g[0]||(g[0]=e("h2",{name:"content"},"S.M.A.R.T.",-1)),e("div",GM,[e("p",null,a(o(t)("S.M.A.R.T.,全称为“Self-Monitoring Analysis and Reporting Technology”,即“自我监测、分析及报告技术”,")),1),e("p",null,a(o(t)("是一种自动的硬盘状态检测与预警系统和规范。通过在硬盘硬件内的检测指令对硬盘的硬件如磁头、盘片、马达、")),1),e("p",null,a(o(t)("电路的运行情况进行监控、记录并与厂商所设定的预设安全值进行比较,若监控情况将要或已超出预设安全值的安全范围,")),1),e("p",null,a(o(t)("就可以通过主机的监控硬件或软件自动向用户作出警告并进行轻微的自动修复,以提前保障硬盘数据的安全。")),1)]),e("ul",jM,[(i(),d(V,null,oe(l,f=>G(b,{to:f.to,custom:"",key:f.to},{default:pe(({route:k,href:$,navigate:w,isActive:S,isExactActive:C})=>[e("li",{class:_e({"active cbi-tab":S&&C})},[e("a",{href:$,onClick:w},a(f.name),9,WM)],2)]),_:2},1032,["to"])),64))]),u.value?(i(),Y(m,{key:0,name:"default"},{default:pe(({Component:f,route:k})=>[(i(),Y(Er,null,{default:pe(()=>[(i(),Y(Aa(f),{key:k.path,config:c,saveData:v},null,8,["config"]))]),_:2},1024))]),_:1})):T("",!0)])}}}),KM=le(JM,[["__scopeId","data-v-c748d4fd"]]),ZM={class:"action-main"},YM=X({__name:"app",setup(s){return(t,n)=>(i(),Y(Nt,{type:2},{default:pe(()=>[e("div",ZM,[Ct(t.$slots,"default",{},void 0,!0)])]),_:3}))}}),Xs=le(YM,[["__scopeId","data-v-9bd81e00"]]),QM={class:"actioner-container"},XM={class:"actioner-container_header"},eE={class:"actioner-container_body"},tE={class:"cbi-value"},nE={class:"cbi-value-title"},aE={class:"cbi-value-field"},sE={class:"cbi-value-description"},oE={class:"cbi-value"},lE={class:"cbi-value-title"},iE={class:"cbi-value-field"},rE={class:"cbi-checkbox"},cE={value:-1},dE={value:0},uE=["value"],vE={class:"cbi-value-description"},pE={class:"cbi-value"},hE={class:"cbi-value-title"},mE={class:"cbi-value-field"},fE={class:"cbi-checkbox"},bE={value:-1},gE={value:0},_E=["value"],yE={class:"cbi-value-description"},kE={class:"actioner-container_footer"},wE=["disabled"],$E=["disabled"],CE=X({__name:"edit-disk",props:{close:{type:Function,required:!0},disk:{type:Object,required:!0},device:{type:Object},next:{type:Function,required:!0}},setup(s){var v,h,g;const{$gettext:t,$ngettext:n}=Ae(),l=s;console.log(l.device);const u=x(!1),c=Xe({tmpDiff:((v=l.device)==null?void 0:v.tmpDiff)||0,tmpMax:((h=l.device)==null?void 0:h.tmpMax)||0,devicePath:((g=l.device)==null?void 0:g.devicePath)||""}),r=()=>{u.value=!0,l.close()},p=()=>B(null,null,function*(){u.value=!0;try{yield l.next({tmpDiff:c.tmpDiff,tmpMax:c.tmpMax,devicePath:c.devicePath}),u.value=!1,r()}catch(b){}});return(b,m)=>(i(),Y(Xs,null,{default:pe(()=>[e("div",QM,[e("div",XM,[e("span",null," S.M.A.R.T. » "+a(o(t)("设备"))+" » "+a(s.disk.path),1)]),e("div",eE,[e("div",tE,[e("label",nE,a(o(t)("磁盘")),1),e("div",aE,[e("div",sE,a(s.disk.model)+" [ "+a(s.disk.path)+","+a(s.disk.sizeStr)+" ] ",1)])]),e("div",oE,[e("label",lE,a(o(t)("温度监测(差异)")),1),e("div",iE,[e("div",rE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":m[0]||(m[0]=f=>c.tmpDiff=f)},[e("option",cE,a(o(t)("使用全局配置")),1),e("option",dE,a(o(t)("禁用")),1),(i(),d(V,null,oe(20,f=>e("option",{value:f},a(f)+"°C",9,uE)),64))],512),[[Be,c.tmpDiff,void 0,{number:!0}]])]),e("div",vE,a(o(t)("自上次报告以来温度变化至少 N 度,则需报告.")),1)])]),e("div",pE,[e("label",hE,a(o(t)("温度监测(最大)")),1),e("div",mE,[e("div",fE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":m[1]||(m[1]=f=>c.tmpMax=f)},[e("option",bE,a(o(t)("使用全局配置")),1),e("option",gE,a(o(t)("禁用")),1),(i(),d(V,null,oe(20,f=>e("option",{value:f*5},a(f*5)+"°C",9,_E)),64))],512),[[Be,c.tmpMax,void 0,{number:!0}]])]),e("div",yE,a(o(t)("如果温度大于或等于 N 摄氏度则报告.")),1)])])]),e("div",kE,[e("button",{class:"close",onClick:r,disabled:u.value},a(o(t)("取消")),9,wE),e("button",{class:"next",onClick:p,disabled:u.value},a(o(t)("保存")),9,$E)])])]),_:1}))}}),SE={class:"actioner-container"},xE={class:"actioner-container_header"},PE={class:"actioner-container_body"},TE={class:"cbi-value"},ME={class:"cbi-value-title"},EE={class:"cbi-value-field"},IE={class:"cbi-checkbox"},DE={value:""},LE=["value"],AE={class:"cbi-value"},NE={class:"cbi-value-title"},OE={class:"cbi-value-field"},zE={class:"cbi-checkbox"},qE={value:"short"},RE={value:"long"},VE={value:"conveyance"},BE={value:"offline"},UE={class:"cbi-value"},FE={class:"cbi-value-title"},HE={class:"cbi-value-field"},GE={class:"cbi-checkbox"},jE=["value"],WE={class:"cbi-value-description"},JE={class:"cbi-value"},KE={class:"cbi-value-title"},ZE={class:"cbi-value-field"},YE={class:"cbi-checkbox"},QE=["value"],XE={class:"cbi-value-description"},eI={class:"cbi-value"},tI={class:"cbi-value-title"},nI={class:"cbi-value-field"},aI={class:"cbi-checkbox"},sI=["value"],oI={class:"cbi-value-description"},lI={class:"actioner-container_footer"},iI=["disabled"],rI=["disabled"],cI=X({__name:"add-task",props:{close:{type:Function,required:!0},config:{type:Object,required:!0},next:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1),c=Xe({type:"short",devicePath:"",month:"*",dayPerMonth:"*",hour:"*"}),r=x([]);B(null,null,function*(){try{const g=yield we.Smart.List.GET();if(g.data){const{result:b,error:m}=g.data;b&&b.disks&&(r.value=b.disks)}}catch(g){}});const v=()=>{u.value=!0,l.close()},h=()=>B(null,null,function*(){if(c.devicePath==""){ne.Warning(t("请选择磁盘"));return}u.value=!0;try{yield l.next(c),v()}catch(g){}finally{u.value=!1}});return(g,b)=>(i(),Y(Xs,null,{default:pe(()=>[e("div",SE,[e("div",xE,[e("span",null,a(o(t)("创建计划任务")),1)]),e("div",PE,[e("div",TE,[e("label",ME,a(o(t)("磁盘")),1),e("div",EE,[e("div",IE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":b[0]||(b[0]=m=>c.devicePath=m)},[e("option",DE,a(o(t)("选择磁盘")),1),(i(!0),d(V,null,oe(r.value,m=>(i(),d("option",{value:m.path},a(m.model)+" [ "+a(m.path)+","+a(m.sizeStr)+" ] ",9,LE))),256))],512),[[Be,c.devicePath,void 0,{trim:!0}]])])])]),e("div",AE,[e("label",NE,a(o(t)("类型")),1),e("div",OE,[e("div",zE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":b[1]||(b[1]=m=>c.type=m)},[e("option",qE,a(o(t)("短暂自检")),1),e("option",RE,a(o(t)("长时自检")),1),e("option",VE,a(o(t)("传输时自检")),1),e("option",BE,a(o(t)("离线时自检")),1)],512),[[Be,c.type,void 0,{trim:!0}]])])])]),e("div",UE,[e("label",FE,a(o(t)("小时")),1),e("div",HE,[e("div",GE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":b[2]||(b[2]=m=>c.hour=m)},[b[5]||(b[5]=e("option",{value:"*"},"*",-1)),(i(),d(V,null,oe(24,(m,f)=>e("option",{value:`${f}`},a(f),9,jE)),64))],512),[[Be,c.hour,void 0,{trim:!0}]])]),e("div",WE,a(o(t)("* 表示每小时")),1)])]),e("div",JE,[e("label",KE,a(o(t)("天")),1),e("div",ZE,[e("div",YE,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":b[3]||(b[3]=m=>c.dayPerMonth=m)},[b[6]||(b[6]=e("option",{value:"*"},"*",-1)),(i(),d(V,null,oe(31,m=>e("option",{value:`${m}`},a(m),9,QE)),64))],512),[[Be,c.dayPerMonth,void 0,{trim:!0}]])]),e("div",XE,a(o(t)("* 表示每天")),1)])]),e("div",eI,[e("label",tI,a(o(t)("月")),1),e("div",nI,[e("div",aI,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":b[4]||(b[4]=m=>c.month=m)},[b[7]||(b[7]=e("option",{value:"*"},"*",-1)),(i(),d(V,null,oe(12,(m,f)=>e("option",{value:`${m}`},a(m),9,sI)),64))],512),[[Be,c.month,void 0,{trim:!0}]])]),e("div",oI,a(o(t)("* 表示每月")),1)])])]),e("div",lI,[e("button",{class:"close",onClick:v,disabled:u.value},a(o(t)("取消")),9,iI),e("button",{class:"next",onClick:h,disabled:u.value},a(o(t)("保存")),9,rI)])])]),_:1}))}}),dI={class:"actioner-container"},uI={class:"actioner-container_header"},vI={class:"actioner-container_body"},pI=["value"],hI={class:"actioner-container_footer"},mI=["disabled"],fI=["disabled"],bI=X({__name:"test-task",props:{close:{type:Function,required:!0},task:{type:Object,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1),c=x(""),r=x(""),p=x(""),v=()=>B(null,null,function*(){c.value+=".";try{const m=yield we.Smart.Test.Result.POST({type:"selftest",devicePath:l.task.devicePath||""});if(m.data){const{result:f,error:k}=m.data;f&&f.result&&(p.value=f.result),k&&(p.value=k)}}catch(m){m&&(p.value=m)}}),h=Fn.easyInterval(v,5e3);ga(()=>{h()});const g=()=>{u.value=!0,h(),l.close()},b=()=>B(null,null,function*(){u.value=!0;try{const m=yield we.Smart.Test.POST({type:l.task.type||"short",devicePath:l.task.devicePath||""});if(m.data){const{success:f,error:k,result:$}=m.data;k&&(r.value=k),$&&$.result&&(r.value=$.result)}}catch(m){r.value=m}});return(m,f)=>(i(),Y(Xs,null,{default:pe(()=>[e("div",dI,[e("div",uI,[e("span",null,a(o(t)("运行调试")),1)]),e("div",vI,[e("textarea",{value:r.value+`
`+p.value+`
`+c.value,disabled:""},null,8,pI)]),e("div",hI,[e("div",{class:"close",onClick:g,disabled:u.value},a(o(t)("关闭")),9,mI),u.value?T("",!0):(i(),d("div",{key:0,class:"next",onClick:b,disabled:u.value},a(o(t)("运行")),9,fI))])])]),_:1}))}}),gI=le(bI,[["__scopeId","data-v-3fabbd23"]]),_I={class:"actioner-container"},yI={class:"actioner-container_header"},kI={class:"tabs"},wI={class:"actioner-container_body"},$I={key:0,class:"table"},CI={class:"tr"},SI={class:"td left"},xI={class:"td left"},PI={class:"tr"},TI={class:"td left"},MI={class:"td left"},EI={class:"tr"},II={class:"td left"},DI={class:"td left"},LI=["value"],AI=["value"],NI=["value"],OI={class:"actioner-container_footer"},zI=["disabled"],qI=X({__name:"disk-info",props:{close:{type:Function,required:!0},disk:{type:Object,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1),c=x("info"),r=m=>{switch(c.value=m,m){case"info":break;case"attribute":g();break;case"log":h();break;case"extend":b();break}},p=()=>{u.value=!0,l.close()},v=Xe({log:"",attribute:"",extend:""}),h=()=>B(null,null,function*(){try{const m=yield we.Smart.Test.Result.POST({type:"selftest",devicePath:l.disk.path||""});if(m.data){const{result:f,error:k}=m.data;f&&f.result&&(v.log=f.result),k&&(v.log=k)}}catch(m){v.log=m}}),g=()=>B(null,null,function*(){try{const m=yield we.Smart.Attribute.Result.POST({devicePath:l.disk.path||""});if(m.data){const{result:f,error:k}=m.data;f&&f.result&&(v.attribute=f.result),k&&(v.attribute=k)}}catch(m){v.attribute=m}}),b=()=>B(null,null,function*(){try{const m=yield we.Smart.Extend.Result.POST({devicePath:l.disk.path||""});if(m.data){const{result:f,error:k}=m.data;f&&f.result&&(v.extend=f.result),k&&(v.extend=k)}}catch(m){v.extend=m}});return(m,f)=>(i(),Y(Xs,null,{default:pe(()=>[e("div",_I,[e("div",yI,[e("ul",kI,[e("li",{class:_e({"active cbi-tab":c.value=="info"}),onClick:f[0]||(f[0]=k=>r("info"))},[e("a",null,a(o(t)("设备信息")),1)],2),e("li",{class:_e({"active cbi-tab":c.value=="attribute"}),onClick:f[1]||(f[1]=k=>r("attribute"))},[e("a",null,a(o(t)("属性")),1)],2),e("li",{class:_e({"active cbi-tab":c.value=="log"}),onClick:f[2]||(f[2]=k=>r("log"))},[e("a",null,a(o(t)("自检日志")),1)],2),e("li",{class:_e({"active cbi-tab":c.value=="extend"}),onClick:f[3]||(f[3]=k=>r("extend"))},[e("a",null,a(o(t)("扩展信息")),1)],2)])]),e("div",wI,[c.value=="info"?(i(),d("table",$I,[e("tr",CI,[e("td",SI,a(o(t)("设备")),1),e("td",xI,a(s.disk.path),1)]),e("tr",PI,[e("td",TI,a(o(t)("型号")),1),e("td",MI,a(s.disk.model),1)]),e("tr",EI,[e("td",II,a(o(t)("序号")),1),e("td",DI,a(s.disk.serial),1)])])):c.value=="attribute"?(i(),d("textarea",{key:1,disabled:"",value:v.attribute},null,8,LI)):c.value=="log"?(i(),d("textarea",{key:2,disabled:"",value:v.log},null,8,AI)):c.value=="extend"?(i(),d("textarea",{key:3,disabled:"",value:v.extend},null,8,NI)):T("",!0)]),e("div",OI,[e("div",{class:"close",onClick:p,disabled:u.value},a(o(t)("关闭")),9,zI)])])]),_:1}))}}),RI=le(qI,[["__scopeId","data-v-ba5f9eb4"]]),VI=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=G(CE,Ne(ye({},s),{close:()=>{l()}})),l=()=>{t.remove()};Us(n,t)},BI=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=G(cI,Ne(ye({},s),{close:()=>{l()}})),l=()=>{t.remove()};Us(n,t)},UI=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=G(gI,Ne(ye({},s),{close:()=>{l()}})),l=()=>{t.remove()};Us(n,t)},FI=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=G(RI,Ne(ye({},s),{close:()=>{l()}})),l=()=>{t.remove()};Us(n,t)},HI={class:"cbi-section"},GI={class:"cbi-value"},jI={class:"cbi-value-title"},WI={class:"cbi-value-field"},JI={class:"cbi-checkbox"},KI=["value"],ZI={class:"cbi-value"},YI={class:"cbi-value-title"},QI={class:"cbi-value-field"},XI={class:"cbi-checkbox"},eD={value:"never"},tD={value:"sleep"},nD={value:"standby"},aD={value:"idle"},sD={class:"cbi-value-description"},oD={class:"cbi-value"},lD={class:"cbi-value-title"},iD={class:"cbi-value-field"},rD={class:"cbi-checkbox"},cD={value:0},dD=["value"],uD={class:"cbi-value-description"},vD={class:"cbi-value"},pD={class:"cbi-value-title"},hD={class:"cbi-value-field"},mD={class:"cbi-checkbox"},fD={value:0},bD=["value"],gD={class:"cbi-value-description"},_D={class:"cbi-section cbi-tblsection",id:"cbi-nfs-mount"},yD={class:"table cbi-section-table"},kD={class:"tr cbi-section-table-titles anonymous"},wD={class:"th cbi-section-table-cell","data-widget":"value"},$D={class:"th cbi-section-table-cell","data-widget":"value"},CD={class:"th cbi-section-table-cell","data-widget":"value"},SD={class:"th cbi-section-table-cell","data-widget":"value"},xD={class:"th cbi-section-table-cell","data-widget":"value"},PD={class:"th cbi-section-table-cell","data-widget":"value"},TD={class:"th cbi-section-table-cell","data-widget":"value"},MD={class:"th cbi-section-table-cell","data-widget":"value"},ED={class:"tr cbi-section-table-row"},ID={class:"td cbi-value-field"},DD={class:"td cbi-value-field"},LD={class:"td cbi-value-field"},AD={class:"td cbi-value-field"},ND={class:"td cbi-value-field"},OD={class:"td cbi-value-field"},zD={class:"td cbi-value-field"},qD={class:"td cbi-value-field"},RD=["title","onClick"],VD=["title","onClick"],BD={class:"cbi-page-actions control-group"},UD=["value"],FD=X({__name:"index",props:{config:{type:Object,required:!0},saveData:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=Xe(l.config),c=()=>{u.global.tmpDiff=l.config.global.tmpDiff||0,u.global.tmpMax=l.config.global.tmpMax||0,u.global.enable=l.config.global.enable||!1,u.global.powermode=l.config.global.powermode||"never",u.devices=l.config.devices||[],u.tasks=l.config.tasks||[]},r=x([]),p=()=>B(null,null,function*(){try{const m=yield we.Smart.List.GET();if(m.data){const{result:f,error:k}=m.data;f&&f.disks&&(r.value=f.disks||[])}}catch(m){}}),v=Fn.easyInterval(p,5e3);ga(()=>{v()});const h=()=>B(null,null,function*(){yield l.saveData({global:u.global,devices:l.config.devices,tasks:l.config.tasks}),c()}),g=m=>{FI({disk:m})},b=(m,f)=>B(null,null,function*(){let k=null,$=-1;if(u.devices){for(let w=0;wB(null,null,function*(){w.tmpDiff==-1&&(w.tmpDiff=u.global.tmpDiff),w.tmpMax==-1&&(w.tmpMax=u.global.tmpMax),w.devicePath==""&&(w.devicePath=m.path);let S=[...u.devices];$>=0&&(S[$]=w);const C=new Map;S.forEach(y=>{y.devicePath!=null&&C.set(y.devicePath,null)});for(let y=0;y(i(),d(V,null,[e("fieldset",HI,[e("div",GI,[e("label",jI,a(o(t)("启用")),1),e("div",WI,[e("div",JI,[W(e("input",{type:"checkbox","onUpdate:modelValue":f[0]||(f[0]=k=>u.global.enable=k),value:!u.global.enable},null,8,KI),[[gt,u.global.enable]])])])]),e("div",ZI,[e("label",YI,a(o(t)("电源模式")),1),e("div",QI,[e("div",XI,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":f[1]||(f[1]=k=>u.global.powermode=k)},[e("option",eD,a(o(t)("总是")),1),e("option",tD,a(o(t)("睡眠")),1),e("option",nD,a(o(t)("待机")),1),e("option",aD,a(o(t)("闲置")),1)],512),[[Be,u.global.powermode,void 0,{trim:!0}]])]),e("div",sD,[e("span",null,a(o(t)("测试时磁盘会转动,请选择合适的模式来控制磁盘转动。")),1),f[4]||(f[4]=e("br",null,null,-1)),e("span",null,"* "+a(o(t)("总是-无论是什么功耗模式下都测试(检查)磁盘,当检查时,这可能会使停转的磁盘开始转动。")),1),f[5]||(f[5]=e("br",null,null,-1)),e("span",null,"* "+a(o(t)("睡眠-处于睡眠模式下不检查设备。")),1),f[6]||(f[6]=e("br",null,null,-1)),e("span",null,"* "+a(o(t)("待机-处于待机和睡眠模式下不检查设备。此模式下磁盘一般不旋转,如果你不想每次检查都转动磁盘,那么这个模式比较适合。")),1),f[7]||(f[7]=e("br",null,null,-1)),e("span",null,"* "+a(o(t)("闲置-处于待机、睡眠、闲置模式下不检查设备,在闲置状态下,大多数磁盘还在转动,所以这可能不适合你。")),1)])])]),e("div",oD,[e("label",lD,a(o(t)("温度监测(差异)")),1),e("div",iD,[e("div",rD,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":f[2]||(f[2]=k=>u.global.tmpDiff=k)},[e("option",cD,a(o(t)("禁用")),1),(i(),d(V,null,oe(15,k=>e("option",{value:k},a(k)+"°C",9,dD)),64))],512),[[Be,u.global.tmpDiff,void 0,{number:!0}]])]),e("div",uD,a(o(t)("自上次报告以来温度变化至少 N 度,则需报告.")),1)])]),e("div",vD,[e("label",pD,a(o(t)("温度监测(最大)")),1),e("div",hD,[e("div",mD,[W(e("select",{class:"cbi-input-select","onUpdate:modelValue":f[3]||(f[3]=k=>u.global.tmpMax=k)},[e("option",fD,a(o(t)("禁用")),1),(i(),d(V,null,oe(20,k=>e("option",{value:k*5},a(k*5)+"°C",9,bD)),64))],512),[[Be,u.global.tmpMax,void 0,{number:!0}]])]),e("div",gD,a(o(t)("如果温度大于或等于 N 摄氏度则报告.")),1)])])]),e("div",_D,[e("table",yD,[e("thead",null,[e("tr",kD,[e("th",wD,a(o(t)("设备")),1),e("th",$D,a(o(t)("型号")),1),e("th",CD,a(o(t)("序号")),1),e("th",SD,a(o(t)("容量")),1),e("th",xD,a(o(t)("温度")),1),e("th",PD,a(o(t)("状态")),1),e("th",TD,a(o(t)("健康")),1),e("th",MD,a(o(t)("操作")),1)])]),e("tbody",null,[(i(!0),d(V,null,oe(r.value,(k,$)=>(i(),d("tr",ED,[e("td",ID,[e("b",null,a(k.path),1)]),e("td",DD,[e("b",null,a(k.model),1)]),e("td",LD,[e("b",null,a(k.serial),1)]),e("td",AD,[e("b",null,a(k.sizeStr),1)]),e("td",ND,[e("b",null,a(k.temp),1)]),e("td",OD,[e("b",null,a(k.status),1)]),e("td",zD,[e("b",null,a(k.health),1)]),e("td",qD,[e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("编辑"),onClick:w=>b(k)},a(o(t)("编辑")),9,RD),e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("详情"),onClick:w=>g(k)},a(o(t)("详情")),9,VD)])]))),256))])])]),e("span",BD,[e("input",{class:"btn cbi-button cbi-button-apply",type:"button",value:o(t)("保存并应用"),onClick:h},null,8,UD)])],64))}}),HD={class:"cbi-section cbi-tblsection",id:"cbi-nfs-mount"},GD={class:"table cbi-section-table"},jD={class:"tr cbi-section-table-titles anonymous"},WD={class:"th cbi-section-table-cell","data-widget":"value"},JD={class:"th cbi-section-table-cell","data-widget":"value"},KD={class:"th cbi-section-table-cell","data-widget":"value"},ZD={class:"th cbi-section-table-cell","data-widget":"value"},YD={class:"tr cbi-section-table-row"},QD={class:"td cbi-value-field"},XD={class:"td cbi-value-field"},eL={class:"td cbi-value-field"},tL={class:"td cbi-value-field"},nL=["title","onClick"],aL=["title","onClick"],sL=X({__name:"index",props:{config:{type:Object,required:!0},saveData:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=Xe(l.config),c=h=>{switch(h){case"short":return t("短暂自检");case"long":return t("长时自检");case"conveyance":return t("传输时自检");case"offline":return t("离线时自检");default:return t("未知")}},r=()=>{BI({config:l.config,disks:[],next:h=>B(null,null,function*(){yield l.saveData({tasks:[...u.tasks,h],global:l.config.global,devices:l.config.devices}),u.tasks=l.config.tasks||[]})})},p=h=>B(null,null,function*(){const g=[...u.tasks];g.splice(h,1),yield l.saveData({tasks:g,global:l.config.global,devices:l.config.devices}),u.tasks=l.config.tasks||[]}),v=h=>{UI({task:h})};return(h,g)=>(i(),d(V,null,[e("button",{class:"btn cbi-button cbi-button-apply",onClick:g[0]||(g[0]=b=>r())},a(o(t)("新建")),1),e("div",HD,[e("table",GD,[e("thead",null,[e("tr",jD,[e("th",WD,a(o(t)("设备")),1),e("th",JD,a(o(t)("类型")),1),e("th",KD,a(o(t)("调度")),1),e("th",ZD,a(o(t)("功能")),1)])]),e("tbody",null,[(i(!0),d(V,null,oe(u.tasks,(b,m)=>(i(),d("tr",YD,[e("td",QD,[e("b",null,a(b.devicePath),1)]),e("td",XD,[e("b",null,a(c(b.type)),1)]),e("td",eL,[e("b",null,a(b.month)+"/"+a(b.dayPerMonth)+"/"+a(b.hour),1)]),e("td",tL,[e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("调试"),onClick:f=>v(b)},a(o(t)("预览")),9,nL),e("button",{class:"cbi-button cbi-button-remove",title:o(t)("删除"),onClick:f=>p(m)},a(o(t)("删除")),9,aL)])]))),256))])])])],64))}}),oL={class:"cbi-section"},lL=["value"],iL=X({__name:"index",setup(s){return B(this,null,function*(){let t,n;const l=x(""),u=()=>B(null,null,function*(){try{const c=yield we.Smart.Log.GET();if(c.data){const{result:r,error:p}=c.data;r&&r.result&&(l.value=r.result),p&&(l.value=p)}}catch(c){l.value=c}});return[t,n]=Ir(()=>u()),yield t,n(),(c,r)=>(i(),d("fieldset",oL,[e("textarea",{value:l.value,disabled:""},null,8,lL)]))})}}),rL=le(iL,[["__scopeId","data-v-a79be366"]]),cL={class:"app-container_status-label_text"},dL={class:"text_status"},uL={class:"text_info"},vL={class:"app-container_status-label_text"},pL={class:"text_info"},hL=X({__name:"item",props:{item:{type:Object,required:!0},transform:{type:Number,default:0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=li(),u=s,c=x(null),r=v=>{const h=v.target,{left:g,top:b}=h.getBoundingClientRect();l.portitemStyle.show=!0,l.portitemStyle.left=g,l.portitemStyle.top=b,l.portitemStyle.portitem=u.item},p=v=>{l.portitemStyle.show=!1};return(v,h)=>(i(),d("div",{class:"app-container_status-label_bg",style:pt(`transform: translateX(${s.transform}px);`),ref_key:"el",ref:c,onMouseenter:r,onMouseleave:p},[s.item.linkState=="DOWN"?(i(),d(V,{key:0},[h[0]||(h[0]=e("div",{class:"app-container_status-label_iconer"},[e("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:v":"https://vecta.io/nano",width:"48",height:"38",viewBox:"0 0 12.7 10.05"},[e("defs",null,[e("filter",{id:"A","color-interpolation-filters":"sRGB"},[e("feColorMatrix",{result:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "}),e("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),e("feColorMatrix",{in:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "})]),e("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),e("g",{transform:"translate(0 -286.95)"},[e("rect",{x:".21",y:"287.25",width:"12.33",height:"9.5",ry:".57",fill:"#e6e6e6",stroke:"#e6e6e6","stroke-linejoin":"round","stroke-width":".37","paint-order":"normal"}),e("path",{transform:"matrix(.105 0 0 .0989 -6.0834 280.6)",d:"M73.96 75.66h89.41c2.31 0 4.17 1.86 4.17 4.17v52.65h-21.74v9.41h-8.69v12.59h-36.87v-12.59h-8.69v-9.41H69.79V79.83c0-2.31 1.86-4.17 4.17-4.17z",fill:"#999",filter:"url(#A)",stroke:"#999","stroke-width":"2.5"}),e("g",{transform:"matrix(.1048 0 0 .1048 -6.0999 280.7)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[e("use",{"xlink:href":"#B"}),e("use",{"xlink:href":"#B",x:"73.04"}),e("use",{"xlink:href":"#B",x:"52.17"}),e("use",{"xlink:href":"#B",x:"41.74"}),e("use",{"xlink:href":"#B",x:"31.3"}),e("use",{"xlink:href":"#B",x:"20.87"}),e("use",{"xlink:href":"#B",x:"10.43"}),e("use",{"xlink:href":"#B",x:"62.61"})]),e("rect",{x:"1.24",y:"294.55",width:"1.6",height:"1.38",ry:".11",fill:"#ccc",stroke:"#ccc","stroke-width":".22","paint-order":"normal"})])])],-1)),e("div",cL,[e("div",dL,a(o(t)("已断开")),1),e("div",uL,a(s.item.name)+" "+a(s.item.interfaceNames?`(${s.item.interfaceNames.join(",").toLocaleUpperCase()})`:""),1)])],64)):(i(),d(V,{key:1},[h[1]||(h[1]=e("div",{class:"app-container_status-label_iconer"},[e("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"48",height:"38",viewBox:"0 0 12.7 10.05","xmlns:v":"https://vecta.io/nano"},[e("defs",null,[e("filter",{id:"A","color-interpolation-filters":"sRGB"},[e("feColorMatrix",{result:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "}),e("feColorMatrix",{values:"0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"}),e("feColorMatrix",{in:"A",values:"2 -0.5 -0.5 0 0 -0.5 2 -0.5 0 0 -0.5 -0.5 2 0 0 0 0 0 1 0 "})]),e("path",{id:"B",d:"M80.56 75.75h3.91v22.79h-3.91z"})]),e("g",{transform:"translate(-.03 -287.07)"},[e("rect",{x:".24",y:"287.36",width:"12.33",height:"9.5",ry:".57",fill:"#e6e6e6",stroke:"#e6e6e6","stroke-linejoin":"round","stroke-width":".37","paint-order":"normal"}),e("path",{transform:"matrix(.105 0 0 .0989 -6.0532 280.72)",d:"M73.96 75.66h89.41c2.31 0 4.17 1.86 4.17 4.17v52.65h-21.74v9.41h-8.69v12.59h-36.87v-12.59h-8.69v-9.41H69.79V79.83c0-2.31 1.86-4.17 4.17-4.17z",fill:"#4d4d4d",filter:"url(#A)",stroke:"#4d4d4d","stroke-width":"2.5"}),e("g",{transform:"matrix(.1048 0 0 .1048 -6.0697 280.81)",fill:"#fff",filter:"url(#A)",stroke:"#fff"},[e("use",{"xlink:href":"#B"}),e("use",{"xlink:href":"#B",x:"73.04"}),e("use",{"xlink:href":"#B",x:"52.17"}),e("use",{"xlink:href":"#B",x:"41.74"}),e("use",{"xlink:href":"#B",x:"31.3"}),e("use",{"xlink:href":"#B",x:"20.87"}),e("use",{"xlink:href":"#B",x:"10.43"}),e("use",{"xlink:href":"#B",x:"62.61"})]),e("rect",{x:"1.27",y:"294.67",width:"1.6",height:"1.38",ry:".11",fill:"#55d400",stroke:"#55d400","stroke-width":".22","paint-order":"normal"})])])],-1)),e("div",vL,[e("div",null,a(s.item.linkSpeed),1),e("div",pL,a(s.item.name)+" "+a(s.item.interfaceNames?`(${s.item.interfaceNames.join(",").toLocaleUpperCase()})`:""),1)])],64))],36))}}),mL=le(hL,[["__scopeId","data-v-73c93936"]]),fL={},bL={t:"1659511092204",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2332","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"200",height:"200"};function gL(s,t){return i(),d("svg",bL,[...t[0]||(t[0]=[e("path",{d:"M514.048 62.464q93.184 0 175.616 35.328t143.872 96.768 96.768 143.872 35.328 175.616q0 94.208-35.328 176.128t-96.768 143.36-143.872 96.768-175.616 35.328q-94.208 0-176.64-35.328t-143.872-96.768-96.768-143.36-35.328-176.128q0-93.184 35.328-175.616t96.768-143.872 143.872-96.768 176.64-35.328zM772.096 576.512q26.624 0 45.056-18.944t18.432-45.568-18.432-45.056-45.056-18.432l-192.512 0 0-192.512q0-26.624-18.944-45.568t-45.568-18.944-45.056 18.944-18.432 45.568l0 192.512-192.512 0q-26.624 0-45.056 18.432t-18.432 45.056 18.432 45.568 45.056 18.944l192.512 0 0 191.488q0 26.624 18.432 45.568t45.056 18.944 45.568-18.944 18.944-45.568l0-191.488 192.512 0z","p-id":"2333"},null,-1)])])}const Hl=le(fL,[["render",gL]]),_L={class:"actioner-dns_header"},yL={key:0},kL={key:1},wL={class:"actioner-dns_body"},$L={class:"label-item"},CL={class:"label-item_key"},SL={class:"label-item_value"},xL={class:"label-item"},PL={class:"label-item_key"},TL={class:"label-item_value"},ML={value:"dhcp"},EL={key:0,value:"pppoe"},IL={value:"static"},DL={class:"actioner-dns_footer"},LL=["disabled"],AL=X({__name:"index",props:{Close:{type:Function,required:!0},e:{type:String,required:!0},name:{type:String,required:!0},inface:{type:Object,required:!0},next:{type:Function,required:!0}},setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=s,u=x(!1),c=x(l.inface),r=()=>B(null,null,function*(){ne.Loading(t("配置中...")).Close(),l.next(c.value),p()}),p=()=>{l.Close&&l.Close()};return(v,h)=>(i(),Y(Nt,{Close:s.Close,type:1},{default:pe(()=>[e("form",{class:"actioner-dns",onSubmit:Ge(r,["prevent"])},[e("div",_L,[s.name=="wan"?(i(),d("span",yL,a(s.e=="edit"?o(t)("编辑WAN"):o(t)("添加WAN")),1)):(i(),d("span",kL,a(s.e=="edit"?o(t)("编辑LAN"):o(t)("添加LAN")),1))]),e("div",wL,[e("div",$L,[e("div",CL,[e("span",null,a(o(t)("名称")),1)]),e("div",SL,[e("span",null,a(c.value.name.toLocaleUpperCase()),1)])]),e("div",xL,[e("div",PL,[e("span",null,a(o(t)("协议(网络获取方式)")),1)]),e("div",TL,[W(e("select",{"onUpdate:modelValue":h[0]||(h[0]=g=>c.value.proto=g)},[e("option",ML,a(o(t)("DHCP客户端")),1),s.name=="wan"?(i(),d("option",EL,"PPPoE")):T("",!0),e("option",IL,a(o(t)("静态地址")),1)],512),[[Be,c.value.proto]])])])]),e("div",DL,[e("button",{class:"cbi-button cbi-button-apply app-btn",disabled:u.value},a(o(t)("保存")),9,LL),e("button",{class:"cbi-button cbi-button-remove app-btn app-back",onClick:p},a(o(t)("取消")),1)])],32)]),_:1},8,["Close"]))}}),NL=le(AL,[["__scopeId","data-v-4db2be2b"]]),Gl=s=>{const t=document.createElement("div");document.body.appendChild(t);const n=cn(NL,Ne(ye({},s),{Close:()=>{l()}}));n.mount(t);const l=()=>{n.unmount(),t.remove()}},OL={id:"page"},zL={name:"content"},qL={class:"container"},RL={class:"table-wrapper"},VL={class:"table-header"},BL={class:"interface-device-flex"},UL={class:"table-body"},FL=["name","value","onUpdate:modelValue","onInput"],HL={class:"table-cell name-col"},GL={class:"table-cell action-col"},jL=["title","onClick"],WL=["onClick"],JL={class:"table-cell action-col"},KL=["name","value","onUpdate:modelValue","onInput"],ZL={class:"table-cell name-col"},YL={class:"table-cell action-col"},QL=["title","onClick"],XL=["onClick"],eA={class:"table-cell action-col"},tA={class:"cbi-page-actions control-group"},nA=["value","disabled"],aA=X({__name:"index",setup(s){const{$gettext:t,$ngettext:n}=Ae(),l=Xe({devices:[],interfaces:[]}),u=x(!1),c=Xe({lan:[],wan:[]});we.Network.GetInterfaceConfig.GET().then(f=>{if(f.data){const{result:k}=f.data;if(k){l.devices=k.devices||[],l.interfaces=k.interfaces||[];for(let $=0;${f=="wan"?c.wan.splice(k,1):f=="lan"&&c.lan.splice(k,1)},v=(f,k)=>{if(k==null){let $=f=="wan"?c.wan.length:c.lan.length;$==6&&f=="wan"&&$++,Gl({e:"add",name:f,inface:{name:f+`${$}`,proto:"dhcp",ipv4Addr:"",ipv6Addr:"",portName:"",deviceNames:[],ports:[],firewallType:f},next:w=>{f=="wan"?c.wan.push(w):c.lan.push(w),ne.Message(t("请在保存以后前往'网络-接口'页面配置接口详细参数"))}})}else Gl({e:"edit",name:f,inface:f=="wan"?c.wan[k]:c.lan[k],next:$=>{f=="wan"?c.wan[k]=$:c.lan[k]=$}})},h=(f,k)=>f?f.indexOf(k):-1,g=(f,k)=>{const w=f.target.value;for(let C=0;C{const w=f.target.value;for(let S=0;SB(null,null,function*(){u.value=!0;const f=[];for(let $=0;$(i(),d("div",OL,[e("h2",zL,a(o(t)("网口配置")),1),e("div",qL,[e("div",RL,[e("div",VL,[(i(!0),d(V,null,oe(l.devices,$=>(i(),d("div",{class:"header-cell device-col",key:$.name},[e("div",BL,[G(mL,{item:$},null,8,["item"])])]))),128)),k[2]||(k[2]=e("div",{class:"header-cell spacer-col"},null,-1)),k[3]||(k[3]=e("div",{class:"header-cell"},null,-1)),k[4]||(k[4]=e("div",{class:"header-cell action-col"},null,-1))]),e("div",UL,[(i(!0),d(V,null,oe(c.lan,($,w)=>(i(),d("div",{key:w,class:"table-row"},[(i(!0),d(V,null,oe(l.devices,S=>(i(),d("div",{class:"table-cell device-col",key:S.name},[W(e("input",{type:"checkbox",name:S.name,value:S.name,"onUpdate:modelValue":C=>$.deviceNames=C,onInput:C=>g(C,w)},null,40,FL),[[gt,$.deviceNames]])]))),128)),k[5]||(k[5]=e("div",{class:"table-cell spacer-col"},null,-1)),e("div",HL,[e("b",null,a($.name),1)]),e("div",GL,[e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("编辑"),onClick:S=>v("lan",w)},a(o(t)("编辑")),9,jL),w!==0?(i(),d("button",{key:0,class:"cbi-button cbi-button-remove",onClick:S=>p("lan",w)},a(o(t)("删除")),9,WL)):T("",!0)])]))),128)),e("div",{class:"table-row add-row",onClick:k[0]||(k[0]=$=>v("lan"))},[(i(!0),d(V,null,oe(l.devices,$=>(i(),d("div",{class:"table-cell device-col",key:$.name}))),128)),k[6]||(k[6]=e("div",{class:"table-cell spacer-col"},null,-1)),k[7]||(k[7]=e("div",{class:"table-cell name-col"},null,-1)),e("div",JL,[G(Hl,{class:"icon"})])]),(i(!0),d(V,null,oe(c.wan,($,w)=>(i(),d("div",{key:w,class:"table-row"},[(i(!0),d(V,null,oe(l.devices,S=>(i(),d("div",{class:"table-cell device-col",key:S.name},[W(e("input",{type:"checkbox",name:S.name,value:S.name,"onUpdate:modelValue":C=>$.deviceNames=C,onInput:C=>b(C,w)},null,40,KL),[[gt,$.deviceNames]])]))),128)),k[8]||(k[8]=e("div",{class:"table-cell spacer-col"},null,-1)),e("div",ZL,[e("b",null,a($.name),1)]),e("div",YL,[e("button",{class:"btn cbi-button cbi-button-apply",title:o(t)("编辑"),onClick:S=>v("wan",w)},a(o(t)("编辑")),9,QL),w!==0?(i(),d("button",{key:0,class:"cbi-button cbi-button-remove",onClick:S=>p("wan",w)},a(o(t)("删除")),9,XL)):T("",!0)])]))),128)),e("div",{class:"table-row add-row",onClick:k[1]||(k[1]=$=>v("wan"))},[(i(!0),d(V,null,oe(l.devices,$=>(i(),d("div",{class:"table-cell device-col",key:$.name}))),128)),k[9]||(k[9]=e("div",{class:"table-cell spacer-col"},null,-1)),k[10]||(k[10]=e("div",{class:"table-cell name-col"},null,-1)),e("div",eA,[G(Hl,{class:"icon"})])])])])]),e("div",tA,[e("input",{class:"btn cbi-button cbi-button-apply",type:"button",value:o(t)("保存并应用"),onClick:m,disabled:u.value},null,8,nA)])]))}}),sA=le(aA,[["__scopeId","data-v-b7e9dfd4"]]),oA=s=>`${s.networkId||""}\0${s.deviceId}`,Ri=Symbol("lan-context"),Vi=Symbol("lan-client"),Bi=()=>ba(Ri,{networks:[]}),xn=()=>ba(Vi,oi),Ui=X({__name:"lanScope",props:{networkId:{},networks:{},legacy:{type:Boolean}},setup(s){const t=s;return ma(Vi,Gs(t.legacy?void 0:t.networkId)),ma(Ri,{networkId:t.networkId,networks:t.networks,legacy:t.legacy}),(n,l)=>Ct(n.$slots,"default")}}),lA=["role"],iA={class:"page-state__icon","aria-hidden":"true"},rA={key:0,class:"page-state__spinner"},cA={key:1},dA={key:2},uA={key:3},vA={class:"page-state__body"},pA={key:0},hA=X({__name:"pageState",props:{kind:{default:"info"},title:{},description:{default:""},actionLabel:{default:""}},emits:["action"],setup(s){return(t,n)=>(i(),d("div",{class:_e(["page-state",`page-state--${s.kind}`]),role:s.kind==="error"?"alert":"status"},[e("div",iA,[s.kind==="loading"?(i(),d("span",rA)):s.kind==="error"?(i(),d("span",cA,"!")):s.kind==="unavailable"?(i(),d("span",dA,"–")):(i(),d("span",uA,"○"))]),e("div",vA,[e("strong",null,a(s.title),1),s.description?(i(),d("span",pA,a(s.description),1)):T("",!0)]),s.actionLabel?(i(),d("button",{key:0,type:"button",onClick:n[0]||(n[0]=l=>t.$emit("action"))},a(s.actionLabel),1)):T("",!0)],10,lA))}}),yt=le(hA,[["__scopeId","data-v-60af56b6"]]),mA=X({__name:"loadError",props:{message:{},retry:{type:Boolean,default:!0}},emits:["retry"],setup(s){const{$gettext:t}=Ae();return(n,l)=>(i(),Y(yt,{kind:"error",title:o(t)("加载失败"),description:s.message,"action-label":s.retry?o(t)("重新加载"):"",onAction:l[0]||(l[0]=u=>n.$emit("retry"))},null,8,["title","description","action-label"]))}}),fA=["computer","phone","tablet","tv","network","smart-home","camera","gaming","storage","printer","wearable"],bA=s=>s.trim(),gA=s=>{const t=bA(s);return Array.from(t).length<=64&&new TextEncoder().encode(t).length<=256&&!/[\u0000-\u001f\u007f]/.test(t)},_A=(s,t)=>{var n,l;return((l=(n=s==null?void 0:s.capabilities)==null?void 0:n[t])==null?void 0:l.state)==="available"},yA=(s,t)=>{var l;const n=(l=s==null?void 0:s.capabilities)==null?void 0:l[t];return!n||n.state==="available"?"":n.reason==="selected_provider_unavailable"?"已安装限速服务,但当前执行方式不可用;请到局域网设置选择并预览。":n.reason==="dependency_not_installed"||n.state==="not_installed"?"所需组件尚未安装":n.state==="disabled"?"请先在全局设置中启用该能力":n.reason||"当前暂不可用"},kA=s=>{const t=[];return s.static.enabled&&t.push("static"),s.access.networkAccess?s.speed.enabled&&t.push("limited"):t.push("blocked"),t},Fi=s=>String(s||"").trim().toLowerCase(),wA=s=>{const t=Fi(s);return t===""||/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(t)},Ts=(s,t="")=>({dependency_not_installed:"所需组件尚未安装",conflict:"该设置与现有规则冲突",validation_failed:"请检查填写内容",apply_failed:"应用失败,原设置已恢复",rolled_back:"应用失败,原设置已恢复,可以重试",recovery_required:"自动恢复未完成,请按提示处理",transaction_unavailable:"暂时无法安全保存,请稍后重试",effect_record_failed:"配置已写入,但状态记录需要恢复",address_conflict:"该地址已分配给其他设备,请选择一个未占用地址后重试",gateway_outside_lan:"该网关不在当前局域网,请检查网关 IP 或选择其他路线",gateway_unreachable:"暂时无法连接该网关,请确认设备已开机并接入当前局域网后重试"})[s]||t||"保存失败",$A=s=>({pending_renewal:"等待设备重新获取地址",lease_observed_unverifiable:"已观察到新租约,终端网关与 DNS 无法验证",unverifiable:"服务器配置可读,终端效果无法验证",observation_error:"暂时无法读取续租状态",failed:"配置应用失败"})[s]||"状态未知",CA={class:"profile-editor"},SA={class:"profile-preview"},xA={key:0},PA=["placeholder"],TA={key:0,class:"scope-note"},MA={class:"two-columns"},EA=["placeholder"],IA=["value"],DA={class:"auto-icon"},LA={class:"auto-icon"},AA=["aria-label"],NA=["title"],OA=["value"],zA={class:"actions"},qA=["disabled"],RA=["disabled"],VA=X({__name:"deviceProfileEditor",props:{device:{}},emits:["saved"],setup(s,{emit:t}){const n=Ne(ye({},we),{DeviceMangement:xn()}),l=s,u=t,{$gettext:c}=Ae(),r=fA,p=x(),v=x(!0),h=x(!1),g=x(""),b=x(""),m=x("success"),f=x(""),k=x(""),$=x("computer"),w=x("auto"),S=x("computer"),C=x("persistent"),y=R(()=>!gA(f.value)||Array.from(k.value).length>64),P=R(()=>{var Q;return k.value||((Q=p.value)==null?void 0:Q.classification.brand)||""}),_=R(()=>{var ce,ve;const Q=(ve=(ce=p.value)==null?void 0:ce.icon)==null?void 0:ve.assetKey;return po(Q)?Q:po($.value)?$.value:"computer"}),D=R(()=>w.value==="manual"?S.value:_.value),E=Q=>c(Tl[Q]||Tl.computer),A=Q=>({phone:c("手机"),computer:c("电脑"),tablet:c("平板"),tv:c("电视与影音"),network:c("网络设备"),"smart-home":c("智能家居"),camera:c("摄像头"),gaming:c("游戏设备"),storage:c("存储与服务器"),printer:c("打印机"),wearable:c("穿戴设备"),unknown:c("未知设备")})[Q],U=Q=>({desktop:"computer",laptop:"computer","smart-speaker":"smart-home","smart-bulb":"smart-home",thermostat:"smart-home",sensor:"smart-home","door-lock":"smart-home","robot-vacuum":"smart-home","air-conditioner":"smart-home",projector:"tv","set-top-box":"tv","game-console":"gaming","handheld-game":"gaming","home-server":"storage","network-switch":"network","access-point":"network","network-bridge":"network","e-reader":"tablet"})[Q]||Q,q=Q=>{if(Q.error)throw Object.assign(new Error(Q.error.message),{code:Q.error.code});if(!Q.profile)throw new Error(c("设备资料不可用"));p.value=Q.profile,f.value=Q.profile.alias||"",k.value=Q.profile.manualBrand||"",$.value=Q.profile.manualCategory||Q.profile.classification.category,w.value=Q.profile.icon.mode;const ce=Q.profile.icon.preferenceKey||Q.profile.icon.assetKey;S.value=po(ce)?ce:"computer",C.value=Q.profile.scope,u("saved",{alias:f.value,classification:Q.profile.classification,iconKey:Q.profile.icon.assetKey})},z=()=>B(null,null,function*(){var Q;v.value=!0,g.value="",b.value="";try{q((Q=(yield n.DeviceMangement.deviceProfileV2.GET(l.device.deviceId)).data)==null?void 0:Q.result)}catch(ce){g.value=(ce==null?void 0:ce.message)||c("读取设备资料失败")}finally{v.value=!1}}),N=(Q,ce)=>B(null,null,function*(){var ve;h.value=!0,b.value="";try{const de=(ve=(yield n.DeviceMangement.deviceProfileV2.POST(ye({deviceId:l.device.deviceId,idempotencyKey:`${l.device.deviceId}:profile:${Date.now()}`},Q))).data)==null?void 0:ve.result;q(de),m.value="success",b.value=de.changed?ce:c("设置没有变化")}catch(O){m.value="error",b.value=O!=null&&O.code?c(Ts(O.code,O==null?void 0:O.message)):(O==null?void 0:O.message)||c("保存失败,请稍后重试")}finally{h.value=!1}}),F=()=>{var Q,ce;y.value||N(ye(Ne(ye({action:"patch",alias:f.value.trim(),brand:k.value.trim()},(Q=p.value)!=null&&Q.manualCategory||$.value!==((ce=p.value)==null?void 0:ce.classification.category)?{category:$.value}:{}),{iconMode:w.value}),w.value==="manual"?{iconKey:S.value}:{}),c("设备资料已更新"))},Z=()=>N({action:"reset"},c("已恢复系统自动推荐"));return We(()=>l.device.deviceId,z,{immediate:!0}),(Q,ce)=>{var ve;return i(),d("div",CA,[v.value?(i(),Y(yt,{key:0,kind:"loading",title:o(c)("正在读取设备资料")},null,8,["title"])):g.value?(i(),Y(yt,{key:1,kind:"error",title:o(c)("设备资料读取失败"),description:g.value,"action-label":o(c)("重新加载"),onAction:z},null,8,["title","description","action-label"])):p.value?(i(),d(V,{key:2},[e("div",SA,[G(Da,{scene:$.value,"icon-key":D.value,label:E(D.value)},null,8,["scene","icon-key","label"]),e("div",null,[e("strong",null,a(f.value||s.device.hostname||o(c)("未命名设备")),1),e("span",null,[P.value?(i(),d("b",xA,a(P.value),1)):T("",!0),P.value?(i(),d(V,{key:1},[ue(" · ")],64)):T("",!0),ue(a(A($.value)),1)]),e("small",null,a(w.value==="manual"?o(c)("已选择自定义图标"):o(c)("图标由品牌和类型自动推荐")),1)])]),e("label",null,[e("span",null,a(o(c)("设备备注名")),1),W(e("input",{"onUpdate:modelValue":ce[0]||(ce[0]=O=>f.value=O),maxlength:"64",placeholder:o(c)("例如:客厅电视")},null,8,PA),[[Oe,f.value]])]),e("small",null,a(o(c)("支持中文,只用于设备管理显示,不会写入网络主机名。")),1),C.value==="boot"?(i(),d("small",TA,a(o(c)("该设备身份仅本次开机有效,重启后资料可能需要重新确认。")),1)):T("",!0),e("div",MA,[e("label",null,[e("span",null,a(o(c)("品牌(可选)")),1),W(e("input",{"onUpdate:modelValue":ce[1]||(ce[1]=O=>k.value=O),maxlength:"64",placeholder:((ve=p.value.classification)==null?void 0:ve.brand)||o(c)("例如:ASUS")},null,8,EA),[[Oe,k.value,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(c)("设备类型")),1),W(e("select",{"onUpdate:modelValue":ce[2]||(ce[2]=O=>$.value=O)},[(i(!0),d(V,null,oe(o(r),O=>(i(),d("option",{key:O,value:O},a(A(O)),9,IA))),128))],512),[[Be,$.value]])])]),e("fieldset",null,[e("legend",null,a(o(c)("设备图标")),1),e("label",DA,[W(e("input",{"onUpdate:modelValue":ce[3]||(ce[3]=O=>w.value=O),type:"radio",value:"auto"},null,512),[[Mt,w.value]]),ue(a(o(c)("自动推荐"))+" ",1),e("small",null,a(o(c)("优先依据品牌,其次依据设备类型")),1)]),e("label",LA,[W(e("input",{"onUpdate:modelValue":ce[4]||(ce[4]=O=>w.value=O),type:"radio",value:"manual"},null,512),[[Mt,w.value]]),ue(a(o(c)("自行选择")),1)]),w.value==="manual"?(i(),d("div",{key:0,class:"icon-grid",role:"radiogroup","aria-label":o(c)("选择设备图标")},[(i(!0),d(V,null,oe(o(fi),O=>(i(),d("label",{key:O,class:_e({selected:S.value===O}),title:E(O)},[W(e("input",{"onUpdate:modelValue":ce[5]||(ce[5]=de=>S.value=de),type:"radio",name:"device-icon",value:O},null,8,OA),[[Mt,S.value]]),G(Da,{scene:U(O),"icon-key":O,label:E(O)},null,8,["scene","icon-key","label"]),e("span",null,a(E(O)),1)],10,NA))),128))],8,AA)):T("",!0)]),b.value?(i(),d("p",{key:1,class:_e(["feedback",m.value]),role:"status"},a(b.value),3)):T("",!0),e("div",zA,[e("button",{type:"button",class:"secondary",disabled:h.value,onClick:Z},a(o(c)("恢复全部自动推荐")),9,qA),e("button",{type:"button",disabled:h.value||y.value,onClick:F},a(h.value?o(c)("正在保存…"):o(c)("保存设备资料")),9,RA)])],64)):T("",!0)])}}}),BA=le(VA,[["__scopeId","data-v-a7373828"]]),Hi=[{id:"quickstart-native",key:"device_speed_limit",pkg:"quickstart-netpolicy",provider:"quickstart-native",zh:"智能设备限速",en:"Smart device limits",descriptionZh:"按设备身份管理 IPv4 与 IPv6 限速;是否就绪以组件检查为准。",descriptionEn:"Device-based IPv4 and IPv6 limits; readiness is checked separately."},{id:"eqos",key:"compat_speed_limit",pkg:"luci-app-eqos",provider:"eqos",zh:"兼容限速",en:"Compatible limits",descriptionZh:"按固定 IPv4 执行,适合使用现有兼容限速设置。",descriptionEn:"Limits by stable IPv4 address using the existing compatible settings."},{id:"floatip",key:"floating_gateway",pkg:"app-meta-floatip",provider:"",zh:"浮动网关",en:"Failover gateway",descriptionZh:"提供主备网关入口;节点职责、虚拟地址与实际持有者在设置中确认。",descriptionEn:"A shared gateway entry; configure node roles and verify the virtual IP holder in settings."}];class Bt extends Error{constructor(n){super(n);Nn(this,"code");this.code=n}}const Xn=s=>s&&typeof s=="object"&&!Array.isArray(s),Gi=["available","disabled","not_installed","unsupported","error"];function UA(s){if(!Xn(s)||s.schemaVersion!==1||typeof s.currentProvider!="string"||!Array.isArray(s.components)||s.components.length!==3)throw new Bt("invalid");for(const t of Hi){const n=s.components.filter(u=>(u==null?void 0:u.id)===t.id),l=n[0];if(n.length!==1||l.capabilityKey!==t.key||l.package!==t.pkg||l.provider!==t.provider&&!(t.provider===""&&l.provider===void 0)||typeof l.selected!="boolean"||!Xn(l.status)||!Gi.includes(l.status.state)||l.operation!==void 0&&!["running","pending"].includes(l.operation))throw new Bt("invalid");if(l.status.actions!==void 0&&(!Array.isArray(l.status.actions)||l.status.actions.some(u=>!Xn(u)||!["install","enable","retry"].includes(u.kind))))throw new Bt("invalid")}return s}function Co(s){var n;if(s.operation)return;const t=s.status.state==="not_installed"?"install":s.id==="quickstart-native"&&s.status.state==="disabled"?"enable":void 0;return t&&((n=s.status.actions)!=null&&n.some(l=>l.kind===t))?t:void 0}function FA(s=fetch,t){function n(u,c,r=!1,p){return B(this,null,function*(){const v=new AbortController,h=setTimeout(()=>v.abort(),r?45e3:1e4),g=()=>v.abort();p!=null&&p.aborted&&g(),p==null||p.addEventListener("abort",g,{once:!0});try{const b=yield s("/cgi-bin/luci/istore/lanctrl/v2/"+u+(t?"?network="+encodeURIComponent(t):""),{method:c?"POST":"GET",credentials:"same-origin",cache:"no-store",signal:v.signal,headers:c?{"Content-Type":"application/json"}:void 0,body:c?JSON.stringify(c):void 0});if(!b.ok)throw new Bt(b.status===401||b.status===403?"forbidden":b.status===404?"unsupported":"unavailable");const m=yield b.text();if(m.length>65536)throw new Bt("invalid");let f;try{f=JSON.parse(m)}catch(k){throw new Bt("invalid")}if(!Xn(f)||f.error||f.success!==void 0&&f.success!==0)throw new Bt((f==null?void 0:f.success)===-1001?"forbidden":"unavailable");if(!Xn(f.result))throw new Bt("invalid");return f.result}catch(b){throw r?new Bt(b instanceof Bt&&b.code==="forbidden"?"forbidden":"uncertain"):b instanceof Bt?b:new Bt("unavailable")}finally{clearTimeout(h),p==null||p.removeEventListener("abort",g)}})}return{read(u){return B(this,null,function*(){return UA(yield n("feature-components/",void 0,!1,u))})},plan(u,c,r){return B(this,null,function*(){const v=(yield n("capability-action/plan/",{capabilityKey:u.capabilityKey,action:c,draftToken:"components:"+u.id},!1,r)).plan;if(!Xn(v)||v.capabilityKey!==u.capabilityKey||v.action!==c||typeof v.canApply!="boolean"||v.requiresConfirmation!==!0)throw new Bt("invalid");if(v.error)throw new Bt(v.error.code||"unavailable");if(!Xn(v.current)||v.current.state!==(c==="install"?"not_installed":"disabled")||v.target!==(c==="install"?u.package:u.capabilityKey)||!v.canApply||c==="install"&&(!Number.isFinite(v.requiredFreeBytes)||v.requiredFreeBytes<0||!Number.isFinite(v.availableFreeBytes)||v.availableFreeByteswindow.vue_lang==="en"?re:j,c=Bi(),r=FA(fetch,c.legacy?void 0:c.networkId),p=x(),v=x(!1),h=x(""),g=x(""),b=x(""),m=x(),f=x(),k=x();let $=!1,w=0,S=0,C=!1,y,P,_=null,D="",E=[];const A=j=>Hi.find(re=>re.id===j),U=j=>{const re=A(j);return u(re.zh,re.en)},q=j=>{const re=A(j);return u(re.descriptionZh,re.descriptionEn)},z=j=>({dependency_not_installed:u("尚未安装此组件。","This component is not installed."),service_stopped:u("组件已安装,尚未运行。","Installed; the component is not running."),engine_unavailable:u("服务未就绪,请检查运行情况。","The service is not ready; check its status."),interface_not_supported:u("组件版本与当前接口不兼容。","The component version is incompatible."),kernel_not_supported:u("当前系统内核不支持。","The current kernel is unsupported."),status_unavailable:u("暂时无法确认状态,请重新检查。","Status is unavailable; check again.")})[j]||u("当前不可用,请检查组件或固件。","Unavailable; check the component and firmware."),N=j=>j.operation?u(j.operation==="running"?"正在处理":"结果待确认",j.operation==="running"?"Working":"Outcome unconfirmed"):{available:j.id==="floatip"?u("已启用","Enabled"):u("已就绪","Ready"),disabled:u("未启用","Not enabled"),not_installed:u("未安装","Not installed"),unsupported:u("不兼容","Unsupported"),error:u("需要检查","Needs attention")}[j.status.state],F=j=>{const re=j instanceof Bt?j.code:"unavailable";return{forbidden:u("登录已失效或没有操作权限,请重新登录。","Session expired or access denied. Sign in again."),unsupported:u("当前后端不支持组件管理,请更新后端后重试。","This backend does not support component management. Update it and retry."),invalid:u("组件信息不完整,未执行操作,请重新检查。","Component information is invalid. Check again before proceeding."),uncertain:u("操作结果尚未确认。请先检查状态,不要重复安装或启用。","Outcome unconfirmed. Check status before installing or enabling again."),component_busy:u("另一个组件操作正在进行,请检查状态。","Another component action is running. Check its status."),component_pending:u("组件操作结果待确认,请检查状态。","Component outcome is pending. Check its status."),install_pending:u("安装结果待确认,请检查状态。","Installation outcome is pending. Check its status."),enable_pending:u("启用结果待确认,请检查状态。","Enabling outcome is pending. Check its status."),insufficient_space:u("可用空间不足,无法安装组件。","There is not enough free storage to install this component."),conflict:u("组件状态已变化,请重新检查后确认。","Component state changed. Check it again before confirming.")}[re]||u("操作未完成,请检查软件源、组件和固件后重试。","The action could not finish. Check sources, component and firmware, then retry.")};function Z(j=!1){return B(this,null,function*(){if(v.value)return;const re=++w;y=new AbortController,v.value=!0,h.value="";try{const $e=yield r.read(y.signal);if($||re!==w)return;p.value=$e,j&&l("updated")}catch($e){!$&&re===w&&(h.value=F($e))}finally{!$&&re===w&&(v.value=!1)}})}function Q(j){return B(this,null,function*(){if(b.value||v.value||h.value)return;const re=Co(j);if(!re)return;const $e=++S;P=new AbortController,b.value="plan",m.value=void 0,g.value="";try{const qe=yield r.plan(j,re,P.signal);!$&&n.open&&$e===S&&(m.value=qe)}catch(qe){!$&&$e===S&&(g.value=F(qe),Z())}finally{$||(b.value="")}})}function ce(){return B(this,null,function*(){if(!m.value||b.value)return;const j=m.value;b.value=j.action,g.value="";try{yield r.apply(j),$||(g.value=u("操作已完成,请以重新检查的组件状态为准。","Action finished. Check the updated component state."))}catch(re){$||(g.value=F(re))}finally{$||(b.value="",m.value=void 0,yield Z(!0))}})}const ve=j=>n.allowConfigure!==!1&&!j.operation&&(j.status.state==="available"||j.id==="floatip"&&j.status.state==="disabled");function O(j){l("configure",j.id),de()}function de(){S++,P==null||P.abort(),y==null||y.abort(),w++,v.value=!1,m.value=void 0,l("close")}function K(j){if(n.open){if(j.key==="Escape")j.preventDefault(),j.stopImmediatePropagation(),de();else if(j.key==="Tab"){const re=Array.from(k.value.querySelectorAll('button:not(:disabled),[href],input,select,[tabindex="0"]')).filter(De=>De.getClientRects().length>0&&getComputedStyle(De).visibility!=="hidden"),$e=re[0],qe=re[re.length-1];if(!$e)return;j.shiftKey&&(document.activeElement===$e||document.activeElement===k.value)?(j.preventDefault(),qe.focus()):!j.shiftKey&&document.activeElement===qe&&(j.preventDefault(),$e.focus())}}}function xe(){if(C){C=!1,document.removeEventListener("keydown",K,!0);for(const j of E)j.value?j.node.setAttribute("inert",""):j.node.removeAttribute("inert");E=[],document.body.style.overflow=D,_!=null&&_.isConnected&&_.focus({preventScroll:!0})}}return We(b,j=>l("busy",!!j)),We(()=>n.open,j=>B(null,null,function*(){var $e,qe;if(!j){xe();return}if(C=!0,_=document.activeElement,D=document.body.style.overflow,document.body.style.overflow="hidden",document.addEventListener("keydown",K,!0),yield ot(),$||!n.open)return;let re=f.value;for(;re&&re.parentElement;){for(const De of Array.from(re.parentElement.children))De!==re&&De instanceof HTMLElement&&!["SCRIPT","STYLE"].includes(De.tagName)&&(E.push({node:De,value:De.hasAttribute("inert")}),De.setAttribute("inert",""));if(re.parentElement===document.body)break;re=re.parentElement}if(($e=k.value)==null||$e.focus({preventScroll:!0}),yield Z(),yield ot(),!$&&n.open&&n.focusId){const De=(qe=k.value)==null?void 0:qe.querySelector('[data-feature-component="'+n.focusId+'"]');De==null||De.focus({preventScroll:!0}),De==null||De.scrollIntoView({block:"nearest"})}}),{immediate:!0}),ga(()=>{$=!0,w++,y==null||y.abort(),P==null||P.abort(),n.open&&xe()}),(j,re)=>(i(),Y(Fo,{to:"body"},[W(e("div",{ref_key:"overlay",ref:f,class:"feature-overlay device-feature-surface",onClick:Ge(de,["self"]),"data-feature-overlay":""},[e("section",{ref_key:"panel",ref:k,class:"feature-drawer",role:"dialog","aria-modal":"true","aria-label":u("功能组件","Feature components"),tabindex:"-1","data-feature-components":""},[e("div",GA,[e("div",null,[e("h2",null,a(u("功能组件","Feature components")),1),e("p",null,a(u("按需准备组件,再选择需要的功能。","Prepare components, then choose how to use them.")),1)]),e("button",{class:"feature-close",type:"button",onClick:de,"aria-label":u("关闭功能组件","Close feature components"),"data-close-components":""},"×",8,jA)]),e("div",WA,[e("span",null,a(u("安装与启用不会自动切换当前限速方式。","Installing or enabling does not switch the selected limit mode.")),1),e("button",{type:"button",disabled:v.value,onClick:Z,"data-check-components":""},a(v.value?u("正在检查…","Checking…"):u("重新检查","Check again")),9,JA)]),g.value?(i(),d("p",KA,[e("span",null,a(g.value),1),e("button",{type:"button",onClick:re[0]||(re[0]=$e=>g.value=""),"aria-label":u("关闭提示","Dismiss message")},"×",8,ZA)])):T("",!0),h.value?(i(),d("p",YA,a(h.value),1)):T("",!0),v.value&&!p.value?(i(),d("p",QA,a(u("正在读取组件状态…","Reading component status…")),1)):T("",!0),p.value?(i(),d("div",{key:3,class:"feature-list","aria-busy":v.value},[(i(!0),d(V,null,oe(p.value.components,$e=>{var qe,De;return i(),d("article",{key:$e.id,class:_e(["feature-item",{target:s.focusId===$e.id}]),"data-feature-component":$e.id,tabindex:"-1"},[e("div",tN,[e("div",null,[e("h3",null,[G(Qe,{name:$e.id==="floatip"?"network":"activity"},null,8,["name"]),ue(a(U($e.id)),1)]),e("div",nN,[$e.id==="quickstart-native"?(i(),d("span",aN,a(u("推荐","Recommended")),1)):T("",!0),$e.selected?(i(),d("span",sN,a(u("当前使用","Currently selected")),1)):T("",!0)])]),e("span",{class:_e(["feature-state",$e.status.state])},a(N($e)),3)]),e("p",null,a(q($e.id)),1),$e.status.reason?(i(),d("p",oN,a(z($e.status.reason)),1)):T("",!0),e("div",lN,[o(Co)($e)?(i(),d("button",{key:0,class:"primary",type:"button",disabled:v.value||!!b.value||!!h.value,onClick:Ke=>Q($e),"data-prepare-component":$e.id},a(o(Co)($e)==="enable"?u("查看并启用","Review and enable"):u("查看并安装","Review and install")),9,iN)):$e.operation?(i(),d("button",{key:1,type:"button",disabled:v.value,onClick:Z},a(u("检查状态","Check status")),9,rN)):T("",!0),ve($e)?(i(),d("button",{key:2,type:"button",disabled:!!b.value||v.value||!!h.value,onClick:Ke=>O($e),"data-configure-component":$e.id},a($e.provider&&!$e.selected?u("预览切换","Review switch"):u("查看设置","View settings")),9,cN)):T("",!0)]),m.value&&m.value.capabilityKey===$e.capabilityKey?(i(),d("section",{key:1,class:"feature-confirm","aria-label":u("确认组件操作","Confirm component action"),"data-component-confirm":""},[e("h4",null,a(m.value.action==="install"?u("安装组件","Install component"):u("启用组件","Enable component")),1),e("dl",null,[e("div",null,[e("dt",null,a(u("组件","Component")),1),e("dd",null,a($e.package),1)]),m.value.action==="install"?(i(),d("div",uN,[e("dt",null,a(u("最低可用空间","Minimum free space")),1),e("dd",null,a(Math.ceil((m.value.requiredFreeBytes||0)/1048576))+" MB",1)])):T("",!0)]),e("p",null,a(m.value.action==="install"?u("安装会更新软件源,包脚本可能启动组件服务。当前执行方式和未提交设置会保留。","Installation updates package sources; package scripts may start the component. The selected mode and unsaved settings are retained."):u("将启动组件并设置开机启用,可能恢复该组件已有规则。当前限速方式的切换仍需另行确认。","Starts the component and enables it at boot; existing component rules may resume. Switching the selected limit mode needs a separate confirmation.")),1),m.value.operationScope==="system"||(((qe=m.value.affectedNetworks)==null?void 0:qe.length)||0)>1?(i(),d("p",vN,a(u("此操作影响局域网:","Affected LANs: "))+a(((De=m.value.affectedNetworks)==null?void 0:De.join(", "))||u("全部局域网","All LANs")),1)):T("",!0),e("div",pN,[e("button",{type:"button",disabled:!!b.value,onClick:re[1]||(re[1]=Ke=>m.value=void 0)},a(u("取消","Cancel")),9,hN),e("button",{class:"primary",type:"button",disabled:!!b.value,onClick:ce,"data-confirm-component":""},a(b.value?u("正在处理…","Working…"):m.value.action==="install"?u("确认安装","Confirm installation"):u("确认启用","Confirm enabling")),9,mN)])],8,dN)):T("",!0)],10,eN)}),128))],8,XA)):T("",!0),b.value?(i(),d("p",fN,a(u("操作已提交。关闭面板不会取消操作,请勿重复提交。","Action submitted. Closing this panel does not cancel it; do not submit it again.")),1)):T("",!0),s.allowConfigure===!1?(i(),d("p",bN,a(u("执行方式和网关配置可在“局域网设置”中调整。","Change the limit mode and gateway configuration in LAN settings.")),1)):T("",!0)],8,HA)],512),[[Bs,s.open]])]))}}),ji=le(gN,[["__scopeId","data-v-9f3d4c66"]]),_N={class:"policy-panel"},yN={key:1,class:"policy-plan","aria-live":"polite"},kN={key:0},wN=["disabled"],$N={key:2,class:"policy-card"},CN={class:"policy-card__heading"},SN={class:"policy-toggle"},xN=["disabled"],PN={key:0,class:"policy-reason"},TN={key:1,class:"policy-reason"},MN=["disabled"],EN=["value","disabled"],IN=["aria-label"],DN={key:0,class:"attention",role:"status"},LN={key:1},AN=["disabled"],NN={class:"field-hint"},ON={key:0,class:"field-error",role:"alert"},zN={class:"checkbox-line"},qN=["disabled"],RN={key:3,class:"policy-card"},VN={class:"policy-card__heading"},BN={class:"policy-toggle"},UN=["disabled"],FN=["disabled"],HN={key:0,class:"policy-reason"},GN={key:0},jN={key:1,class:"field-grid"},WN=["disabled"],JN={key:4,class:"policy-card"},KN={class:"policy-card__heading"},ZN={key:0,class:"policy-reason"},YN=["disabled"],QN=X({__name:"devicePolicyPanel",props:{device:{},mode:{default:"all"}},emits:["saved"],setup(s,{emit:t}){const n=Ne(ye({},we),{DeviceMangement:xn()}),l=s,u=R(()=>l.mode),c=t,{$gettext:r}=Ae(),p=x(!1),v=H=>({"已安装限速服务,但当前执行方式不可用;请到局域网设置选择并预览。":r("已安装限速服务,但当前执行方式不可用;请到局域网设置选择并预览。"),所需组件尚未安装:r("所需组件尚未安装"),请先在全局设置中启用该能力:r("请先在全局设置中启用该能力"),当前暂不可用:r("当前暂不可用"),该设置与现有规则冲突:r("该设置与现有规则冲突"),请检查填写内容:r("请检查填写内容"),"应用失败,原设置已恢复":r("应用失败,原设置已恢复"),"应用失败,原设置已恢复,可以重试":r("应用失败,原设置已恢复,可以重试"),"自动恢复未完成,请按提示处理":r("自动恢复未完成,请按提示处理"),"暂时无法安全保存,请稍后重试":r("暂时无法安全保存,请稍后重试"),"配置已写入,但状态记录需要恢复":r("配置已写入,但状态记录需要恢复"),保存失败:r("保存失败"),等待设备重新获取地址:r("等待设备重新获取地址"),"已观察到新租约,终端网关与 DNS 无法验证":r("已观察到新租约,终端网关与 DNS 无法验证"),"服务器配置可读,终端效果无法验证":r("服务器配置可读,终端效果无法验证"),暂时无法读取续租状态:r("暂时无法读取续租状态"),配置应用失败:r("配置应用失败"),状态未知:r("状态未知"),"该地址已分配给其他设备,请选择一个未占用地址后重试":r("该地址已分配给其他设备,请选择一个未占用地址后重试"),"该网关不在当前局域网,请检查网关 IP 或选择其他路线":r("该网关不在当前局域网,请检查网关 IP 或选择其他路线"),"暂时无法连接该网关,请确认设备已开机并接入当前局域网后重试":r("暂时无法连接该网关,请确认设备已开机并接入当前局域网后重试")})[H]||H,h=x(!0),g=x(""),b=x(""),m=x(""),f=x("success"),k=x(null),$=x(),w=x(),S=x(),C={enabled:!1,assignedIP:"",bindIP:!1,hostname:""},y=x({deviceId:"",static:ye({},C),path:{targetId:"",effect:{desired:{targetId:"",static:ye({},C)},applied:{targetId:"",configVersion:"",state:"server_configuration_observed"},observed:{state:"unverifiable",reason:"not_loaded"},needsAttention:!1}},targets:[],version:""}),P=x(null),_=Xe({enabled:!1,assignedIP:"",bindIP:!1,hostname:"",targetId:""}),D=Xe({enabled:!1,uploadSpeed:100,downloadSpeed:1e3}),E=()=>{k.value&&(Object.assign(_,{enabled:y.value.static.enabled,assignedIP:y.value.static.assignedIP||k.value.currentIPv4||"",bindIP:y.value.static.bindIP,hostname:y.value.static.hostname||"",targetId:y.value.path.targetId}),Object.assign(D,{enabled:k.value.speed.enabled,uploadSpeed:k.value.speed.uploadSpeed||100,downloadSpeed:k.value.speed.downloadSpeed||1e3}))},A=()=>B(null,null,function*(){var H,J,ge,ze,Fe,Ee,dt,tt,kt,ct,Tt;h.value=!0,g.value="",m.value="";try{const[ut,St,ht]=yield Promise.all([n.DeviceMangement.devicePolicyV2.GET(l.device.deviceId),n.DeviceMangement.deviceNetworkPolicyV2.GET(l.device.deviceId),n.DeviceMangement.routerContextV2.GET().catch(()=>null)]);if((J=(H=ut.data)==null?void 0:H.result)!=null&&J.error)throw new Error(ut.data.result.error.message);if((ze=(ge=St.data)==null?void 0:ge.result)!=null&&ze.error)throw new Error(St.data.result.error.message);if(!((Ee=(Fe=ut.data)==null?void 0:Fe.result)!=null&&Ee.policy)||!((tt=(dt=St.data)==null?void 0:dt.result)!=null&&tt.policy))throw new Error(r("设备策略不可用"));k.value=ut.data.result.policy,y.value=St.data.result.policy,P.value=((kt=ht==null?void 0:ht.data)==null?void 0:kt.result)||null,E(),re()}catch(ut){g.value=((Tt=(ct=ut==null?void 0:ut.response)==null?void 0:ct.data)==null?void 0:Tt.error)||(ut==null?void 0:ut.message)||r("读取结果失败")}finally{h.value=!1}}),U=H=>_A(k.value,H),q=H=>v(yA(k.value,H)),z=R(()=>!wA(_.hostname)),N=R(()=>{var H,J;return((J=(H=P.value)==null?void 0:H.routeEditability)==null?void 0:J.editable)===!1}),F=R(()=>{var H,J;return{verified:r("限速已生效"),loaded_unverified:r("限速已加载,效果待验证"),configured_not_loaded:r("限速已保存,服务尚未加载"),configured_unstable:r("限速地址不稳定"),configured_wrong_node:r("限速规则不在实际上网节点"),needs_address_reservation:r("需先预留当前地址"),unavailable:r("当前节点无法执行限速"),ready:r("可以设置限速"),inactive:r("未设置限速")}[((J=(H=k.value)==null?void 0:H.rateLimit)==null?void 0:J.state)||"inactive"]||r("限速状态待确认")}),Z=R(()=>{var H,J,ge,ze;return((J=(H=k.value)==null?void 0:H.rateLimit)==null?void 0:J.executionNode)==="local"?r("由本机执行"):(ze=(ge=k.value)==null?void 0:ge.rateLimit)!=null&&ze.gateway?`${r("应由上网网关执行")} · ${k.value.rateLimit.gateway}`:r("执行节点待确认")}),Q=R(()=>{var ge;const H=(ge=k.value)==null?void 0:ge.rateLimit;if(!H)return[];const J=[];return["stable","stable_identity"].includes(H.addressState)||J.push(r("当前实现按 IPv4 限速,预留当前地址后规则才不会漂移。")),H.ipv6State==="unsupported"&&J.push(r("这台设备的 IPv6 流量暂不受此限速约束。")),H.offloadState==="risk"&&J.push(r("检测到流量卸载,部分流量可能绕过限速。")),J}),ce=R(()=>{var H,J;return{external_dhcp_authority:r("本机当前不负责地址分配,请到实际分配地址的路由器上修改。"),multiple_dhcp_evidence:r("局域网角色需要确认"),multiple_external_dhcp_servers:r("局域网角色需要确认"),dhcp_authority_not_detected:r("当前仅提供查看与引导,不会自动修改其他设备。"),local_dhcp_unhealthy:r("当前无法读取地址分配状态,其他设置仍可使用。"),router_context_unavailable:r("暂时无法判断局域网角色")}[(J=(H=P.value)==null?void 0:H.routeEditability)==null?void 0:J.reason]||r("本机当前不负责地址分配,请到实际分配地址的路由器上修改。")}),ve=H=>H.kind==="default"||H.name==="跟随网络默认"?r("默认路线"):H.kind==="self"&&H.name==="本机路由"?r("本机路由"):H.kind==="bypass"&&H.name==="旁路由"?r("旁路由"):H.kind==="floating"&&H.name==="浮动网关"?r("浮动网关"):H.name==="自定义网关"?r("自定义网关"):H.name,O=R(()=>v($A(y.value.path.effect.observed.state))),de=R(()=>{const H=y.value.targets.find(J=>{var ge;return J.id===((ge=y.value.path.effect.desired)==null?void 0:ge.targetId)});return H?ve(H):r("默认路线")}),K=()=>{if(!k.value)return[];const H=kA(k.value);return y.value.path.targetId&&y.value.path.targetId!=="default"&&!H.includes("route")&&H.splice(k.value.static.enabled?1:0,0,"route"),H},xe=R(()=>{var H;return((H=y.value.path.effect.applied)==null?void 0:H.state)==="server_configuration_observed"?r("已写入"):r("等待确认")}),j=R(()=>`quickstart.device-policy-draft.${l.device.deviceId}`),re=()=>{try{const H=JSON.parse(sessionStorage.getItem(j.value)||"{}");H.speed&&Object.assign(D,H.speed)}catch(H){}},$e=R(()=>{var H;return S.value==="network"?r("将同时检查地址、上网路线、DNS 和 DHCP 分配权。"):((H=w.value)==null?void 0:H.kind)==="access"?r("将修改这台设备的联网权限。"):r("将修改这台设备的最高速度。")}),qe=H=>({address:r("地址预留"),internet_path:r("上网路线"),speed:r("设备限速"),access:r("联网权限")})[H]||H,De=()=>{$.value=void 0,w.value=void 0,S.value=void 0},Ke=(H,J)=>B(null,null,function*(){var ge;b.value="restriction-plan",m.value="";try{const ze={deviceId:l.device.deviceId,kind:H,idempotencyKey:`${l.device.deviceId}:${H}:${Date.now()}`,[H]:J},Fe=(ge=(yield n.DeviceMangement.deviceRestrictionsV2.PLAN(ze)).data)==null?void 0:ge.result;if(Fe!=null&&Fe.error)throw Object.assign(new Error(Fe.error.message),{code:Fe.error.code});if(!(Fe!=null&&Fe.canApply))throw new Error(r("当前不能应用这项修改"));$.value=Fe,w.value=ze,S.value="restrictions"}catch(ze){f.value="error",m.value=v(Ts(ze==null?void 0:ze.code,ze==null?void 0:ze.message))}finally{b.value=""}}),at=()=>B(null,null,function*(){var H;if(!z.value){b.value="network-plan",m.value="";try{const J={deviceId:l.device.deviceId,idempotencyKey:`${l.device.deviceId}:network:${Date.now()}`,static:{enabled:_.enabled,assignedIP:_.enabled?_.assignedIP:"",bindIP:_.enabled&&_.bindIP,hostname:_.enabled?Fi(_.hostname):""},targetId:_.targetId},ge=(H=(yield n.DeviceMangement.deviceNetworkPolicyV2.PLAN(J)).data)==null?void 0:H.result;if(ge!=null&&ge.error)throw Object.assign(new Error(ge.error.message),{code:ge.error.code});if(!(ge!=null&&ge.canApply))throw new Error(r("当前不能应用这项修改"));$.value=ge,w.value=J,S.value="network"}catch(J){f.value="error",m.value=v(Ts(J==null?void 0:J.code,J==null?void 0:J.message))}finally{b.value=""}}}),st=()=>B(null,null,function*(){var H,J;if(!(!$.value||!w.value||!S.value)){b.value="apply",m.value="";try{const ge=Ne(ye({},w.value),{expectedVersion:$.value.version});if(S.value==="network"){const ze=(H=(yield n.DeviceMangement.deviceNetworkPolicyV2.APPLY(ge)).data)==null?void 0:H.result;if(ze!=null&&ze.error)throw Object.assign(new Error(ze.error.message),{code:ze.error.code});if(!(ze!=null&&ze.policy))throw new Error(r("设备策略不可用"));y.value=ze.policy,k.value&&Object.assign(k.value.static,ze.policy.static),m.value=ze.changed?r("配置已保存,等待设备重新获取地址"):r("设置没有变化")}else{const ze=(J=(yield n.DeviceMangement.deviceRestrictionsV2.APPLY(ge)).data)==null?void 0:J.result;if(ze!=null&&ze.error)throw Object.assign(new Error(ze.error.message),{code:ze.error.code});if(!(ze!=null&&ze.policy))throw new Error(r("设备策略不可用"));k.value=ze.policy,m.value=ze.changed?r("已保存并生效"):r("设置没有变化")}f.value="success",De(),E(),k.value&&c("saved",K())}catch(ge){f.value="error",m.value=v(Ts(ge==null?void 0:ge.code,ge==null?void 0:ge.message))}finally{b.value=""}}}),et=()=>Ke("speed",ye({},D)),Ze=()=>{p.value=!0},it=()=>B(null,null,function*(){var H,J,ge,ze;try{const Fe=yield n.DeviceMangement.devicePolicyV2.GET(l.device.deviceId),Ee=(J=(H=Fe.data)==null?void 0:H.result)==null?void 0:J.policy;if((ge=Fe.data)!=null&&ge.error||(ze=Fe.data)!=null&&ze.success&&Fe.data.success!==0||!(Ee!=null&&Ee.capabilities)||!k.value)throw new Error("invalid_policy_observation");k.value.capabilities=Ee.capabilities,k.value.rateLimit=Ee.rateLimit}catch(Fe){f.value="error",m.value=r("组件观察未更新,输入内容仍保留,请稍后重试。")}}),he=()=>{if(!k.value)return;const H=!k.value.access.networkAccess;Ke("access",{networkAccess:H})};return We(()=>l.device.deviceId,A,{immediate:!0}),(H,J)=>(i(),d("div",_N,[h.value?(i(),Y(yt,{key:0,kind:"loading",title:o(r)("正在读取设备策略")},null,8,["title"])):g.value?(i(),Y(yt,{key:1,kind:"error",title:o(r)("策略读取失败"),description:g.value,"action-label":o(r)("重新加载"),onAction:A},null,8,["title","description","action-label"])):k.value?(i(),d(V,{key:2},[m.value?(i(),d("div",{key:0,class:_e(["policy-feedback",f.value]),role:"status"},a(m.value),3)):T("",!0),$.value?(i(),d("section",yN,[e("div",null,[e("strong",null,a(o(r)("确认这次修改")),1),e("small",null,a($e.value),1)]),e("ul",null,[(i(!0),d(V,null,oe($.value.changes,ge=>(i(),d("li",{key:ge.kind},a(qe(ge.kind)),1))),128))]),$.value.requiresRenewal?(i(),d("p",kN,a(o(r)("保存后设备需要重新获取地址,实际生效前会保持等待状态。")),1)):T("",!0),e("p",null,a(o(r)("预计重载"))+":"+a($.value.reloadServices.join("、")||o(r)("无需重载服务"))+" · "+a(o(r)("失败时恢复原设置")),1),e("div",null,[e("button",{type:"button",class:"secondary",onClick:De},a(o(r)("取消")),1),e("button",{type:"button",disabled:b.value!=="",onClick:st},a(b.value?o(r)("正在应用…"):o(r)("确认应用")),9,wN)])])):T("",!0),u.value==="all"||u.value==="network"?(i(),d("section",$N,[e("div",CN,[e("div",null,[e("strong",null,a(o(r)("地址与上网路线")),1),e("small",null,a(o(r)("固定设备地址,并选择它通过哪台路由器上网")),1)]),e("label",SN,[W(e("input",{"onUpdate:modelValue":J[0]||(J[0]=ge=>_.enabled=ge),type:"checkbox",disabled:!U("static")||N.value},null,8,xN),[[gt,_.enabled]]),e("span",null,a(o(r)("地址预留"))+" · "+a(_.enabled?o(r)("已启用"):o(r)("未启用")),1)])]),N.value?(i(),d("p",PN,a(ce.value),1)):T("",!0),q("static")?(i(),d("p",TN,a(q("static")),1)):(i(),d(V,{key:2},[e("label",null,[e("span",null,a(o(r)("上网路线")),1),W(e("select",{"onUpdate:modelValue":J[1]||(J[1]=ge=>_.targetId=ge),disabled:N.value||y.value.targets.length===0},[(i(!0),d(V,null,oe(y.value.targets,ge=>(i(),d("option",{key:ge.id,value:ge.id,disabled:!ge.supported},a(ve(ge))+a(ge.gateway?` · ${ge.gateway}`:"")+a(ge.supported?"":o(r)("(不可用)")),9,EN))),128))],8,MN),[[Be,_.targetId]])]),e("div",{class:"effect-flow","aria-label":o(r)("上网路线状态")},[e("span",null,[e("small",null,a(o(r)("想要的路线")),1),ue(a(de.value),1)]),e("span",null,[e("small",null,a(o(r)("路由器配置")),1),ue(a(xe.value),1)]),e("span",null,[e("small",null,a(o(r)("实际生效情况")),1),ue(a(O.value),1)])],8,IN),y.value.path.effect.needsAttention?(i(),d("small",DN,a(o(r)("设置已保存,但设备可能需要断开并重新连接后才会使用新路线。")),1)):T("",!0),_.enabled?(i(),d("label",LN,[e("span",null,a(o(r)("IPv4 地址")),1),W(e("input",{"onUpdate:modelValue":J[2]||(J[2]=ge=>_.assignedIP=ge),inputmode:"decimal",placeholder:"192.168.100.50",disabled:N.value},null,8,AN),[[Oe,_.assignedIP,void 0,{trim:!0}]])])):T("",!0),e("details",null,[e("summary",null,a(o(r)("高级选项")),1),e("label",null,[e("span",null,a(o(r)("DHCP 主机名(可选)")),1),W(e("input",{"onUpdate:modelValue":J[3]||(J[3]=ge=>_.hostname=ge),maxlength:"63",autocomplete:"off",autocapitalize:"none",spellcheck:"false"},null,512),[[Oe,_.hostname,void 0,{trim:!0}]])]),e("small",NN,a(o(r)("用于局域网名称解析,仅支持英文、数字和中间连字符;与可使用中文的设备备注名分开保存")),1),z.value?(i(),d("small",ON,a(o(r)("请输入 1~63 位英文、数字或中间连字符,不能以连字符开头或结尾")),1)):T("",!0),e("label",zN,[W(e("input",{"onUpdate:modelValue":J[4]||(J[4]=ge=>_.bindIP=ge),type:"checkbox"},null,512),[[gt,_.bindIP]]),ue(a(o(r)("绑定 MAC 与 IPv4")),1)])]),e("button",{type:"button",disabled:N.value||b.value!==""||z.value||!_.targetId,onClick:at},a(b.value==="network-plan"?o(r)("正在检查…"):o(r)("预览地址与上网路线")),9,qN)],64))])):T("",!0),u.value==="all"||u.value==="restrictions"?(i(),d("section",RN,[e("div",VN,[e("div",null,[e("strong",null,a(o(r)("设备限速")),1),e("small",null,a(o(r)("限制这台设备的最高速率")),1)]),e("label",BN,[W(e("input",{"onUpdate:modelValue":J[5]||(J[5]=ge=>D.enabled=ge),type:"checkbox",disabled:!U("speed")},null,8,UN),[[gt,D.enabled]]),e("span",null,a(D.enabled?o(r)("已启用"):o(r)("未启用")),1)])]),e("button",{type:"button",class:"policy-components-entry",disabled:b.value!=="",onClick:Ze,"data-device-components":""},a(o(r)("管理限速组件")),9,FN),q("speed")?(i(),d("div",HN,[e("span",null,a(q("speed")),1)])):(i(),d(V,{key:1},[k.value.rateLimit?(i(),d("div",{key:0,class:_e(["enforcement-card",k.value.rateLimit.state])},[e("div",null,[e("strong",null,a(F.value),1),e("small",null,a(Z.value),1)]),Q.value.length?(i(),d("ul",GN,[(i(!0),d(V,null,oe(Q.value,ge=>(i(),d("li",{key:ge},a(ge),1))),128))])):T("",!0)],2)):T("",!0),D.enabled?(i(),d("div",jN,[e("label",null,[e("span",null,a(o(r)("上传上限(Mbit/s)")),1),W(e("input",{"onUpdate:modelValue":J[6]||(J[6]=ge=>D.uploadSpeed=ge),type:"number",min:"1"},null,512),[[Oe,D.uploadSpeed,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(r)("下载上限(Mbit/s)")),1),W(e("input",{"onUpdate:modelValue":J[7]||(J[7]=ge=>D.downloadSpeed=ge),type:"number",min:"1"},null,512),[[Oe,D.downloadSpeed,void 0,{number:!0}]])])])):T("",!0),e("button",{type:"button",disabled:b.value!==""||D.enabled&&k.value.rateLimit&&!k.value.rateLimit.canApply,onClick:et},a(b.value==="restriction-plan"?o(r)("正在检查…"):o(r)("预览限速")),9,WN)],64))])):T("",!0),u.value==="all"||u.value==="restrictions"?(i(),d("section",JN,[e("div",KN,[e("div",null,[e("strong",null,a(o(r)("联网权限")),1),e("small",null,a(k.value.access.networkAccess?o(r)("当前允许访问互联网"):o(r)("当前已断开互联网")),1)]),e("span",{class:_e(["access-state",k.value.access.networkAccess?"allowed":"blocked"])},a(k.value.access.networkAccess?o(r)("允许"):o(r)("已断网")),3)]),q("access")?(i(),d("p",ZN,a(q("access")),1)):(i(),d("button",{key:1,type:"button",class:_e({danger:k.value.access.networkAccess}),disabled:b.value!=="",onClick:he},a(b.value==="restriction-plan"?o(r)("正在检查…"):k.value.access.networkAccess?o(r)("预览断开网络"):o(r)("预览恢复联网")),11,YN))])):T("",!0)],64)):T("",!0),G(ji,{open:p.value,"focus-id":"quickstart-native","allow-configure":!1,onClose:J[8]||(J[8]=ge=>p.value=!1),onUpdated:it},null,8,["open"])]))}}),jl=le(QN,[["__scopeId","data-v-8b1e95bf"]]),XN={class:"usage-policy","aria-labelledby":"usage-policy-title"},eO={class:"policy-heading"},tO={id:"usage-policy-title"},nO=["disabled"],aO={key:1,class:"feedback error",role:"alert"},sO={key:0,class:"feedback",role:"status"},oO={class:"effective-card"},lO={class:"timezone"},iO={class:"check"},rO={key:0,class:"schedule-editor"},cO={value:"block"},dO={value:"limit"},uO={key:0,class:"columns"},vO=["aria-label"],pO=["value"],hO={class:"columns"},mO={class:"check"},fO={key:0,class:"quota-editor"},bO={value:"daily"},gO={value:"weekly"},_O={value:"monthly"},yO={value:"notify"},kO={value:"block"},wO=["aria-label"],$O=["disabled"],CO={key:2,class:"actions"},SO=X({__name:"deviceUsagePolicyEditor",props:{deviceId:{}},setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),n=s,{$gettext:l}=Ae(),u=l("限制累计用量"),c=x(!0),r=x(!1),p=x(""),v=x(""),h=x("success"),g=x(!1),b=x(""),m=x(""),f=x({}),k=x(null),$=x([]),w=x("device-rest"),S=Xe({scheduleEnabled:!1,scheduleAction:"block",scheduleUpload:20,scheduleDownload:100,days:[1,2,3,4,5],start:"22:00",end:"07:00",quotaEnabled:!1,quotaPeriod:"monthly",quotaGB:10,quotaAction:"notify"}),C=R(()=>[{value:1,label:l("一")},{value:2,label:l("二")},{value:3,label:l("三")},{value:4,label:l("四")},{value:5,label:l("五")},{value:6,label:l("六")},{value:0,label:l("日")}]),y=O=>{const[de,K]=O.split(":").map(Number);return de*60+K},P=O=>`${String(Math.floor(O/60)).padStart(2,"0")}:${String(O%60).padStart(2,"0")}`,_=O=>O?new Date(O).toLocaleString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}):l("暂无计划"),D=R(()=>k.value?k.value.networkAccess?l("允许联网"):l("已暂停联网"):l("系统默认")),E=R(()=>{var K;return(((K=k.value)==null?void 0:K.sources)||[]).filter(xe=>xe!=="system_default").map(xe=>{var j;return xe==="global"?l("默认规则"):xe==="device"?l("本设备"):xe.startsWith("group:")?((j=$.value.find(re=>re.id===xe.slice(6)))==null?void 0:j.name)||l("设备分组"):xe}).join(" → ")||l("系统默认")}),A=R(()=>{var O;return _(((O=k.value)==null?void 0:O.nextScheduleAt)||"")}),U=R(()=>{const O=[S.scheduleEnabled?`${S.scheduleAction==="limit"?l("时段限速"):l("休息时段")} ${S.start}–${S.end}`:l("不设置时段规则")];return O.push(S.quotaEnabled?`${S.quotaGB} GB · ${q(S.quotaPeriod)}`:l("不设置流量额度")),O.join(";")}),q=O=>({daily:l("每天"),weekly:l("每周"),monthly:l("每月")})[O]||O,z=O=>{var xe,j,re,$e,qe,De,Ke,at;b.value=(O==null?void 0:O.version)||"",m.value=(O==null?void 0:O.timezone)||"",$.value=(O==null?void 0:O.groups)||[],k.value=((O==null?void 0:O.effective)||[]).find(st=>st.deviceId===n.deviceId)||null;const de=((xe=O==null?void 0:O.devicePolicies)==null?void 0:xe[n.deviceId])||{};f.value=Ne(ye({},de),{schedules:[...de.schedules||[]]});const K=f.value.schedules.find(st=>(st==null?void 0:st.action)==="block"||(st==null?void 0:st.action)==="limit");w.value=(K==null?void 0:K.id)||"device-schedule",S.scheduleEnabled=!!(K!=null&&K.enabled),S.days=(j=K==null?void 0:K.days)!=null&&j.length?[...K.days]:[1,2,3,4,5],S.start=K?P(K.startMinute):"22:00",S.end=K?P(K.endMinute):"07:00",S.scheduleAction=(K==null?void 0:K.action)||"block",S.scheduleUpload=((re=K==null?void 0:K.speed)==null?void 0:re.uploadSpeed)||20,S.scheduleDownload=(($e=K==null?void 0:K.speed)==null?void 0:$e.downloadSpeed)||100,S.quotaEnabled=!!((qe=de.quota)!=null&&qe.enabled),S.quotaPeriod=((De=de.quota)==null?void 0:De.period)||"monthly",S.quotaGB=(Ke=de.quota)!=null&&Ke.limitBytes?Math.round(de.quota.limitBytes/1073741824*10)/10:10,S.quotaAction=((at=de.quota)==null?void 0:at.action)||"notify"},N=x(!1),F=()=>B(null,null,function*(){try{const O=(yield t.DeviceMangement.trafficInsightsV2.GET(n.deviceId,"today")).data.result;return!O||O.error?!1:(N.value=!!O.legacyAccessReviewRequired,!0)}catch(O){return!1}}),Z=()=>B(null,null,function*(){c.value=!0,p.value="",g.value=!1;try{const O=(yield t.DeviceMangement.deviceGroupsV2.GET()).data.result;if(O!=null&&O.error)throw new Error(O.error.message);z(O),yield F()}catch(O){p.value=(O==null?void 0:O.message)||l("读取使用规则失败")}finally{c.value=!1}}),Q=()=>{if(v.value="",S.scheduleEnabled&&!S.days.length){h.value="error",v.value=l("请至少选择一天");return}if(S.scheduleEnabled&&(!S.start||!S.end)){h.value="error",v.value=l("请填写完整时间");return}if(S.scheduleEnabled&&S.scheduleAction==="limit"&&(!S.scheduleUpload||!S.scheduleDownload)){h.value="error",v.value=l("请填写完整的时段速度上限");return}if(S.quotaEnabled&&(!Number.isFinite(S.quotaGB)||S.quotaGB<.1)){h.value="error",v.value=l("流量额度至少为 0.1 GB");return}g.value=!0},ce=()=>{const O=(f.value.schedules||[]).filter(K=>(K==null?void 0:K.id)!==w.value);S.scheduleEnabled&&O.push({id:w.value,enabled:!0,days:[...S.days],startMinute:y(S.start),endMinute:y(S.end),action:S.scheduleAction,speed:S.scheduleAction==="limit"?{enabled:!0,uploadSpeed:S.scheduleUpload,downloadSpeed:S.scheduleDownload}:void 0});const de=Ne(ye({},f.value),{schedules:O,quota:S.quotaEnabled?{enabled:!0,period:S.quotaPeriod,limitBytes:Math.round(S.quotaGB*1073741824),action:S.quotaAction}:void 0});return de.access===void 0&&de.speed===void 0&&!de.targetId&&!de.quota&&!de.schedules.length?null:de},ve=()=>B(null,null,function*(){r.value=!0,v.value="";try{const O=(yield t.DeviceMangement.deviceGroupsV2.POST({action:"set_device_policy",deviceId:n.deviceId,devicePolicy:ce(),expectedVersion:b.value})).data.result;if(O!=null&&O.error)throw new Error(O.error.message);z(O),g.value=!1,h.value="success",v.value=(yield F())?l("使用规则已应用"):l("规则已应用,上网状态暂无法确认,请刷新检查")}catch(O){h.value="error",v.value=(O==null?void 0:O.message)||l("保存失败,原设置未改变")}finally{r.value=!1}});return We(()=>n.deviceId,Z,{immediate:!0}),(O,de)=>(i(),d("section",XN,[e("div",eO,[e("div",null,[e("h5",tO,a(o(l)("计划与额度")),1),e("p",null,a(o(l)("只为这台设备设置休息时段和累计流量额度;单设备设置优先于分组和默认规则。")),1)]),e("button",{type:"button",disabled:c.value,onClick:Z},a(o(l)("刷新")),9,nO)]),c.value?(i(),Y(yt,{key:0,kind:"loading",title:o(l)("正在读取使用规则")},null,8,["title"])):p.value?(i(),d("p",aO,[ue(a(p.value)+" ",1),e("button",{type:"button",onClick:Z},a(o(l)("重试")),1)])):(i(),d(V,{key:2},[N.value?(i(),d("p",sO,a(o(l)("旧版断网限制仍保留,取消额度或周期重置不会自动恢复上网。确认后,请使用“预览恢复联网”恢复。")),1)):T("",!0),e("div",oO,[e("span",null,[e("small",null,a(o(l)("当前生效")),1),e("strong",null,a(D.value),1)]),e("span",null,[e("small",null,a(o(l)("规则来源")),1),e("strong",null,a(E.value),1)]),e("span",null,[e("small",null,a(o(l)("下次变化")),1),e("strong",null,a(A.value),1)])]),e("p",lO,a(o(l)("按路由器时间执行"))+" · "+a(m.value||"—"),1),e("fieldset",null,[e("legend",null,a(o(l)("休息时段")),1),e("label",iO,[W(e("input",{"onUpdate:modelValue":de[0]||(de[0]=K=>S.scheduleEnabled=K),type:"checkbox"},null,512),[[gt,S.scheduleEnabled]]),ue(" "+a(o(l)("在指定时段执行规则")),1)]),S.scheduleEnabled?(i(),d("div",rO,[e("label",null,[e("span",null,a(o(l)("时段内执行")),1),W(e("select",{"onUpdate:modelValue":de[1]||(de[1]=K=>S.scheduleAction=K)},[e("option",cO,a(o(l)("暂停联网")),1),e("option",dO,a(o(l)("限制速度")),1)],512),[[Be,S.scheduleAction]])]),S.scheduleAction==="limit"?(i(),d("div",uO,[e("label",null,[e("span",null,a(o(l)("上传 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":de[2]||(de[2]=K=>S.scheduleUpload=K),type:"number",min:"1"},null,512),[[Oe,S.scheduleUpload,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(l)("下载 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":de[3]||(de[3]=K=>S.scheduleDownload=K),type:"number",min:"1"},null,512),[[Oe,S.scheduleDownload,void 0,{number:!0}]])])])):T("",!0),e("div",{class:"days",role:"group","aria-label":o(l)("执行日期")},[(i(!0),d(V,null,oe(C.value,K=>(i(),d("label",{key:K.value,class:_e({selected:S.days.includes(K.value)})},[W(e("input",{"onUpdate:modelValue":de[4]||(de[4]=xe=>S.days=xe),type:"checkbox",value:K.value},null,8,pO),[[gt,S.days]]),ue(a(K.label),1)],2))),128))],8,vO),e("div",hO,[e("label",null,[e("span",null,a(o(l)("开始")),1),W(e("input",{"onUpdate:modelValue":de[5]||(de[5]=K=>S.start=K),type:"time"},null,512),[[Oe,S.start]])]),e("label",null,[e("span",null,a(o(l)("结束")),1),W(e("input",{"onUpdate:modelValue":de[6]||(de[6]=K=>S.end=K),type:"time"},null,512),[[Oe,S.end]])])]),e("small",null,a(o(l)("结束时间早于开始时间时,会自动跨到第二天。")),1)])):T("",!0)]),e("fieldset",null,[e("legend",null,a(o(l)("流量额度")),1),e("label",mO,[W(e("input",{"onUpdate:modelValue":de[7]||(de[7]=K=>S.quotaEnabled=K),type:"checkbox"},null,512),[[gt,S.quotaEnabled]]),ue(" "+a(o(u)),1)]),S.quotaEnabled?(i(),d("div",fO,[e("label",null,[e("span",null,a(o(l)("周期")),1),W(e("select",{"onUpdate:modelValue":de[8]||(de[8]=K=>S.quotaPeriod=K)},[e("option",bO,a(o(l)("每天")),1),e("option",gO,a(o(l)("每周")),1),e("option",_O,a(o(l)("每月")),1)],512),[[Be,S.quotaPeriod]])]),e("label",null,[e("span",null,a(o(l)("额度 GB")),1),W(e("input",{"onUpdate:modelValue":de[9]||(de[9]=K=>S.quotaGB=K),type:"number",min:"0.1",max:"100000",step:"0.1"},null,512),[[Oe,S.quotaGB,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(l)("达到后")),1),W(e("select",{"onUpdate:modelValue":de[10]||(de[10]=K=>S.quotaAction=K)},[e("option",yO,a(o(l)("仅提醒")),1),e("option",kO,a(o(l)("暂停联网")),1)],512),[[Be,S.quotaAction]])])])):T("",!0)]),g.value?(i(),d("div",{key:1,class:"preview",role:"dialog","aria-label":o(l)("保存前预览")},[e("strong",null,a(o(l)("确认这次修改")),1),e("span",null,a(U.value),1),e("small",null,a(o(l)("应用后会立即重新计算这台设备的最终规则;失败时保留原设置。")),1),e("div",null,[e("button",{type:"button",onClick:de[11]||(de[11]=K=>g.value=!1)},a(o(l)("返回修改")),1),e("button",{class:"primary",type:"button",disabled:r.value,onClick:ve},a(r.value?o(l)("正在应用…"):o(l)("确认并应用")),9,$O)])],8,wO)):(i(),d("div",CO,[e("button",{class:"primary",type:"button",onClick:Q},a(o(l)("预览影响")),1)])),v.value?(i(),d("p",{key:3,class:_e(["feedback",h.value]),role:"status"},a(v.value),3)):T("",!0)],64))]))}}),xO=le(SO,[["__scopeId","data-v-b4b287b0"]]),el=(s,t="")=>{if(!Number.isFinite(s)||s<0)return"—";const n=["B","KB","MB","GB","TB"];let l=s,u=0;for(;l>=1e3&&u=100?0:l>=10?1:2;return`${l.toFixed(c)} ${n[u]}${t}`},PO=(s,t,n="采集中")=>{if(!s||s.state==="warming_up")return n;const l=t==="up"?s.uploadSpeed:s.downloadSpeed;return el(l,"/s")},TO=s=>Math.min(3e4,3e3*fs(2,Math.max(0,s-1))),MO=(s,t=n=>n.deviceId)=>new Map(s.map(n=>[t(n),n])),EO={class:"insights-panel"},IO={class:"insights-heading"},DO={class:"range-tabs",role:"tablist"},LO=["onClick"],AO={key:1,class:"message error"},NO={key:0,class:"message",role:"status"},OO={class:"totals"},zO=["aria-label"],qO=["title"],RO={key:2,class:"muted"},VO={class:"capability"},BO={class:"enable"},UO={value:"daily"},FO={value:"weekly"},HO={value:"monthly"},GO={value:"notify"},jO={value:"block"},WO=["disabled"],JO=X({__name:"trafficInsightsPanel",props:{deviceId:{},quotaEditable:{type:Boolean,default:!0}},setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),n=s,{$gettext:l}=Ae(),u=x("today"),c=x(!0),r=x(!1),p=x(""),v=x({}),h=x(!1),g=x(""),b=x("success"),m=Xe({enabled:!1,period:"monthly",gigabytes:10,action:"notify"}),f=R(()=>[{value:"today",label:l("今天")},{value:"week",label:l("本周")},{value:"month",label:l("本月")}]),k=E=>el(E||0),$=R(()=>{var E,A,U;return Math.min(100,Math.round((((E=v.value.quota)==null?void 0:E.usedBytes)||0)*100/Math.max(1,((U=(A=v.value.quota)==null?void 0:A.quota)==null?void 0:U.limitBytes)||1)))}),w=E=>({daily:l("每日额度"),weekly:l("每周额度"),monthly:l("每月额度")})[E]||E,S=E=>E.reason==="hardware_offload_enabled"?l("受硬件卸载限制"):E.state==="available"?l("可用"):E.state==="unsupported"?l("不支持"):l("未安装"),C=E=>{const A=Math.max(1,...(v.value.buckets||[]).map(U=>U.uploadBytes+U.downloadBytes));return Math.max(4,Math.round((E.uploadBytes+E.downloadBytes)*100/A))},y=()=>{var A;const E=(A=v.value.quota)==null?void 0:A.quota;m.enabled=!!(E!=null&&E.enabled),E&&(m.period=E.period,m.gigabytes=Math.round(E.limitBytes/1073741824*10)/10,m.action=E.action)},P=()=>B(null,null,function*(){var E;c.value=!0,p.value="";try{const A=yield t.DeviceMangement.trafficInsightsV2.GET(n.deviceId,u.value);if((E=A.data.result)!=null&&E.error)throw new Error(A.data.result.error.message);v.value=A.data.result||{},y()}catch(A){p.value=(A==null?void 0:A.message)||l("历史用量读取失败")}finally{c.value=!1}}),_=E=>{u.value!==E&&(u.value=E,P())},D=()=>B(null,null,function*(){var E;r.value=!0,g.value="";try{const A=yield t.DeviceMangement.trafficInsightsV2.QUOTA({deviceId:n.deviceId,enabled:m.enabled,period:m.period,limitBytes:Math.round(m.gigabytes*1073741824),action:m.action});if((E=A.data.result)!=null&&E.error)throw new Error(A.data.result.error.message);b.value="success",g.value=l("流量额度已保存"),yield P()}catch(A){b.value="error",g.value=(A==null?void 0:A.message)||l("保存失败")}finally{r.value=!1}});return P(),(E,A)=>{var U,q,z;return i(),d("div",EO,[e("div",IO,[e("div",null,[e("strong",null,a(o(l)("历史用量")),1),e("small",null,a(o(l)("这是累计流量额度,不是速度上限或定时限速。")),1)]),n.quotaEditable?(i(),d("button",{key:0,type:"button",onClick:A[0]||(A[0]=N=>h.value=!h.value)},a(h.value?o(l)("收起额度"):o(l)("设置额度")),1)):T("",!0)]),e("div",DO,[(i(!0),d(V,null,oe(f.value,N=>(i(),d("button",{key:N.value,type:"button",class:_e({active:u.value===N.value}),onClick:F=>_(N.value)},a(N.label),11,LO))),128))]),c.value?(i(),Y(yt,{key:0,kind:"loading",title:o(l)("正在读取历史用量")},null,8,["title"])):p.value?(i(),d("p",AO,[ue(a(p.value)+" ",1),e("button",{type:"button",onClick:P},a(o(l)("重试")),1)])):(i(),d(V,{key:2},[v.value.legacyAccessReviewRequired?(i(),d("p",NO,a(o(l)("旧版断网限制仍保留,取消额度或周期重置不会自动恢复上网。确认后,请使用“预览恢复联网”恢复。")),1)):T("",!0),e("div",OO,[e("span",null,[e("small",null,a(o(l)("上传")),1),ue(a(k(v.value.uploadBytes)),1)]),e("span",null,[e("small",null,a(o(l)("下载")),1),ue(a(k(v.value.downloadBytes)),1)]),e("span",null,[e("small",null,a(o(l)("合计")),1),ue(a(k((v.value.uploadBytes||0)+(v.value.downloadBytes||0))),1)])]),(U=v.value.buckets)!=null&&U.length?(i(),d("div",{key:1,class:"history-chart","aria-label":o(l)("历史流量趋势")},[(i(!0),d(V,null,oe(v.value.buckets,N=>(i(),d("i",{key:N.start,style:pt({height:C(N)+"%"}),title:`${new Date(N.start).toLocaleString()} · ${k(N.uploadBytes+N.downloadBytes)}`},null,12,qO))),128))],8,zO)):(i(),d("p",RO,a(o(l)("正在积累历史数据,首次使用后会按小时形成趋势。")),1)),(q=v.value.quota)!=null&&q.quota?(i(),d("div",{key:3,class:_e(["quota-status",{exceeded:v.value.quota.exceeded}])},[e("span",null,a(w(v.value.quota.quota.period))+" · "+a(k(v.value.quota.usedBytes))+" / "+a(k(v.value.quota.quota.limitBytes)),1),e("strong",null,a(v.value.quota.exceeded?o(l)("已达到额度"):$.value+"%"),1)],2)):T("",!0),e("p",VO,[ue(a(o(l)("本地轻量统计"))+" · "+a(o(l)("每 5 分钟最多写入一次")),1),((z=v.value.bandix)==null?void 0:z.state)!=="not_installed"?(i(),d(V,{key:0},[ue(" · Bandix: "+a(S(v.value.bandix)),1)],64)):T("",!0)])],64)),n.quotaEditable&&h.value?(i(),d("form",{key:3,class:"quota-form",onSubmit:Ge(D,["prevent"])},[e("label",BO,[W(e("input",{"onUpdate:modelValue":A[1]||(A[1]=N=>m.enabled=N),type:"checkbox"},null,512),[[gt,m.enabled]]),ue(a(o(l)("启用流量额度")),1)]),m.enabled?(i(),d(V,{key:0},[e("label",null,[e("span",null,a(o(l)("周期")),1),W(e("select",{"onUpdate:modelValue":A[2]||(A[2]=N=>m.period=N)},[e("option",UO,a(o(l)("每天")),1),e("option",FO,a(o(l)("每周")),1),e("option",HO,a(o(l)("每月")),1)],512),[[Be,m.period]])]),e("label",null,[e("span",null,a(o(l)("额度(GB)")),1),W(e("input",{"onUpdate:modelValue":A[3]||(A[3]=N=>m.gigabytes=N),type:"number",min:"0.1",max:"100000",step:"0.1",required:""},null,512),[[Oe,m.gigabytes,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(l)("达到后")),1),W(e("select",{"onUpdate:modelValue":A[4]||(A[4]=N=>m.action=N)},[e("option",GO,a(o(l)("仅提醒")),1),e("option",jO,a(o(l)("暂停联网")),1)],512),[[Be,m.action]])])],64)):T("",!0),e("button",{class:"save",type:"submit",disabled:r.value},a(r.value?o(l)("正在保存…"):o(l)("保存额度")),9,WO),g.value?(i(),d("p",{key:1,class:_e(["message",b.value])},a(g.value),3)):T("",!0)],32)):T("",!0)])}}}),KO=le(JO,[["__scopeId","data-v-3a828794"]]),ZO={key:1,class:"message error"},YO={key:2,class:"advanced-body"},QO={class:"capabilities"},XO={key:0},ez={class:"probe-actions"},tz=["disabled"],nz=["disabled"],az={class:"bounded-note"},sz={key:0},oz={key:1},lz={class:"webhook-toggle"},iz=["placeholder"],rz={class:"webhook-actions"},cz=["disabled"],dz={key:0},uz={class:"bundle-actions"},vz={key:0,class:"import-plan"},pz=["disabled"],hz=X({__name:"advancedNetworkTools",props:{device:{}},setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),n=s,{$gettext:l}=Ae(),u=x(!1),c=x(!1),r=x(""),p=x({}),v=x([]),h=x(!1),g=x(""),b=x("success"),m=x(!1),f=x(!1),k=x(""),$=x(!1),w=x(""),S=x("success"),C=x(null),y=x(null),P=x(!1),_=x(""),D=x("success"),E=R(()=>{var xe,j,re,$e,qe,De;return((re=(j=(xe=n.device.addresses)==null?void 0:xe.current)==null?void 0:j.find(Ke=>Ke.family===4))==null?void 0:re.address)||((De=(qe=($e=n.device.addresses)==null?void 0:$e.current)==null?void 0:qe[0])==null?void 0:De.address)||""}),A=xe=>({ipv6_reservation:l("IPv6 地址策略"),connection_insights:l("连接洞察"),dns_insights:l("DNS 洞察"),management_probe:l("管理入口探测"),segmentation:l("来宾 / IoT 分段"),multi_wan:l("多 WAN 策略"),identification_updates:l("识别规则更新")})[xe]||xe,U=xe=>({available:l("可用"),disabled:l("未启用"),not_installed:l("未安装"),unsupported:l("不支持"),error:l("异常")})[xe]||l("异常"),q=xe=>({firmware_contract_not_verified:l("当前固件尚未验证,未展示假控件"),bandix_not_installed:l("安装兼容的 Bandix 后才可用"),adapter_contract_not_verified:l("已检测到 Bandix,但当前固件尚未启用经验证的连接洞察适配器"),dns_privacy_default:l("默认不采集或记录 DNS 名称"),segmentation_adapter_not_installed:l("未安装分段适配器"),multi_wan_adapter_not_installed:l("未安装多 WAN 适配器"),built_in_rules_only:l("当前仅使用内置可回滚规则"),hardware_offload_enabled:l("硬件卸载已开启,统计可能不完整")})[xe.reason]||xe.detail||"",z=xe=>({policy_changed:l("策略变更"),address_conflict:l("地址冲突"),gateway_failover:l("网关切换"),probe:l("入口探测"),new_device:l("发现新设备"),device_online:l("设备上线"),device_offline:l("设备离线"),quota_exceeded:l("额度已用尽")})[xe]||xe,N=xe=>({device:l("设备状态"),device_policy:l("设备控制"),device_network_policy:l("地址与路线"),address_reservation:l("地址保留"),gateway_assignment:l("上网路线"),floating_gateway:l("浮动网关"),device_groups:l("设备分组"),network_rules:l("网络规则"),traffic_quota:l("流量额度"),management_probe:l("管理入口"),policy_bundle:l("策略备份")})[xe]||xe,F=xe=>xe==="Import replaces device groups and traffic quotas only; address, route, speed and firewall rules are unchanged."?l("只会替换设备分组、设备例外与流量额度;地址、路线、限速和防火墙规则保持不变。"):xe,Z=()=>B(null,null,function*(){var xe,j,re,$e;u.value=!0,r.value="";try{const qe=yield t.DeviceMangement.advancedNetworkV2.GET(n.device.deviceId);if((xe=qe.data.result)!=null&&xe.error)throw new Error(qe.data.result.error.message);p.value=((j=qe.data.result)==null?void 0:j.capabilities)||{},v.value=((re=qe.data.result)==null?void 0:re.events)||[];const De=(($e=qe.data.result)==null?void 0:$e.webhook)||{};m.value=!!De.enabled,f.value=De.url==="configured",c.value=!0}catch(qe){r.value=(qe==null?void 0:qe.message)||l("高级能力读取失败")}finally{u.value=!1}}),Q=xe=>{xe.target.open&&!c.value&&!u.value&&Z()},ce=(xe,j)=>B(null,null,function*(){h.value=!0,g.value="";try{const $e=(yield t.DeviceMangement.advancedNetworkV2.PROBE({deviceId:n.device.deviceId,address:E.value,scheme:xe,port:j})).data.result;if($e!=null&&$e.error)throw new Error($e.error.message);b.value="success",g.value=`${l("可访问")} · ${$e.url} · HTTP ${$e.statusCode} · ${$e.durationMs} ms`}catch(re){b.value="error",g.value=(re==null?void 0:re.message)||l("该入口当前不可访问")}finally{h.value=!1}}),ve=()=>B(null,null,function*(){var xe;$.value=!0,w.value="";try{const j=yield t.DeviceMangement.advancedNetworkV2.WEBHOOK(m.value?{enabled:!0,url:k.value,events:["new_device","gateway_failover"]}:{enabled:!1});if((xe=j.data.result)!=null&&xe.error)throw new Error(j.data.result.error.message);S.value="success",w.value=m.value?l("通知已启用"):l("通知已关闭"),f.value=m.value,k.value=""}catch(j){S.value="error",w.value=(j==null?void 0:j.message)||l("通知设置保存失败")}finally{$.value=!1}}),O=()=>B(null,null,function*(){var xe;try{const j=yield t.DeviceMangement.advancedNetworkV2.EXPORT();if((xe=j.data.result)!=null&&xe.error)throw new Error(j.data.result.error.message);const re=new Blob([JSON.stringify(j.data.result.bundle,null,2)],{type:"application/json"}),$e=document.createElement("a");$e.href=URL.createObjectURL(re),$e.download=`quickstart-policy-${new Date().toISOString().slice(0,10)}.json`,$e.click(),URL.revokeObjectURL($e.href)}catch(j){D.value="error",_.value=(j==null?void 0:j.message)||l("导出失败")}}),de=xe=>B(null,null,function*(){var j,re;C.value=null,_.value="";try{const $e=(j=xe.target.files)==null?void 0:j[0];if(!$e)return;const qe=JSON.parse(yield $e.text()),De=yield t.DeviceMangement.advancedNetworkV2.IMPORT_PLAN({bundle:qe});if((re=De.data.result)!=null&&re.error)throw new Error(De.data.result.error.message);y.value=qe,C.value=De.data.result.plan}catch($e){D.value="error",_.value=($e==null?void 0:$e.message)||l("策略包预检失败,未写入任何配置")}}),K=()=>B(null,null,function*(){var xe;if(!(!y.value||!C.value||!window.confirm(l("确认恢复这个策略包?现有分组和额度会被替换。")))){P.value=!0;try{const j=yield t.DeviceMangement.advancedNetworkV2.IMPORT_APPLY({bundle:y.value,planChecksum:C.value.checksum,expectedGroupVersion:C.value.groupVersion,confirmed:!0});if((xe=j.data.result)!=null&&xe.error)throw new Error(j.data.result.error.message);D.value="success",_.value=l("策略包已恢复"),C.value=null,yield Z()}catch(j){D.value="error",_.value=(j==null?void 0:j.message)||l("恢复失败,原配置已回滚")}finally{P.value=!1}}});return(xe,j)=>(i(),d("details",{class:"advanced-tools",onToggle:Q},[e("summary",null,[ue(a(o(l)("高级网络工具")),1),e("small",null,a(o(l)("按需诊断、审计和策略备份")),1)]),u.value?(i(),Y(yt,{key:0,kind:"loading",title:o(l)("正在读取高级能力")},null,8,["title"])):r.value?(i(),d("p",ZO,[ue(a(r.value)+" ",1),e("button",{type:"button",onClick:Z},a(o(l)("重试")),1)])):c.value?(i(),d("div",YO,[e("section",null,[e("h5",null,a(o(l)("能力与兼容性")),1),e("div",QO,[(i(!0),d(V,null,oe(p.value,(re,$e)=>(i(),d("div",{key:$e},[e("span",null,a(A($e)),1),e("b",{class:_e(re.state)},a(U(re.state)),3),e("small",null,a(q(re)),1)]))),128))])]),E.value?(i(),d("section",XO,[e("h5",null,a(o(l)("设备管理入口")),1),e("p",null,a(o(l)("只探测设备当前局域网地址和常用管理端口;不会扫描其他地址,也不会跟随跳转。")),1),e("div",ez,[e("button",{type:"button",disabled:h.value,onClick:j[0]||(j[0]=re=>ce("http",80))},"HTTP · 80",8,tz),e("button",{type:"button",disabled:h.value,onClick:j[1]||(j[1]=re=>ce("https",443))},"HTTPS · 443",8,nz)]),g.value?(i(),d("p",{key:0,class:_e(["message",b.value])},a(g.value),3)):T("",!0)])):T("",!0),e("section",null,[e("h5",null,a(o(l)("最近变更")),1),e("p",az,a(o(l)("最近变更仅在展开后读取,记录数量有上限。")),1),v.value.length?(i(),d("ul",sz,[(i(!0),d(V,null,oe(v.value,re=>(i(),d("li",{key:re.id},[e("span",null,a(z(re.action))+" · "+a(N(re.resource)),1),e("time",null,a(new Date(re.at).toLocaleString()),1)]))),128))])):(i(),d("p",oz,a(o(l)("暂无与此设备有关的审计事件")),1))]),e("section",null,[e("h5",null,a(o(l)("新设备与网关切换通知")),1),e("p",null,a(o(l)("此设置对本路由器全部设备生效。可选 Webhook 默认关闭,只发送事件类型、时间和设备标识,不发送 DNS 内容。")),1),e("label",lz,[W(e("input",{"onUpdate:modelValue":j[2]||(j[2]=re=>m.value=re),type:"checkbox"},null,512),[[gt,m.value]]),ue(a(m.value?o(l)("启用通知"):o(l)("不启用通知")),1)]),m.value?W((i(),d("input",{key:0,"onUpdate:modelValue":j[3]||(j[3]=re=>k.value=re),class:"webhook-url",type:"url",inputmode:"url",placeholder:f.value?o(l)("已配置;如需更换请输入新地址"):"https://example.com/webhook"},null,8,iz)),[[Oe,k.value,void 0,{trim:!0}]]):T("",!0),e("div",rz,[e("button",{type:"button",disabled:$.value||m.value&&!k.value,onClick:ve},a($.value?o(l)("正在保存…"):o(l)("保存通知设置")),9,cz),f.value&&m.value?(i(),d("small",dz,a(o(l)("现有地址已隐藏;更换时需重新输入。")),1)):T("",!0)]),w.value?(i(),d("p",{key:1,class:_e(["message",S.value])},a(w.value),3)):T("",!0)]),e("section",null,[e("h5",null,a(o(l)("策略备份与恢复")),1),e("p",null,a(o(l)("导出和恢复设备分组、单设备例外与流量额度;地址、路线、限速和防火墙规则不会被替换。")),1),e("div",uz,[e("button",{type:"button",onClick:O},a(o(l)("导出策略包")),1),e("label",null,[e("span",null,a(o(l)("选择策略包")),1),e("input",{type:"file",accept:"application/json,.json",onChange:de},null,32)])]),C.value?(i(),d("div",vz,[e("strong",null,a(o(l)("预检通过")),1),e("span",null,a(C.value.groupCount)+" "+a(o(l)("个分组"))+" · "+a(C.value.devicePolicyCount)+" "+a(o(l)("个设备例外"))+" · "+a(C.value.quotaCount)+" "+a(o(l)("个额度")),1),(i(!0),d(V,null,oe(C.value.warnings,re=>(i(),d("small",{key:re},a(F(re)),1))),128)),e("button",{type:"button",class:"danger",disabled:P.value,onClick:K},a(P.value?o(l)("正在恢复…"):o(l)("确认恢复")),9,pz)])):T("",!0),_.value?(i(),d("p",{key:1,class:_e(["message",D.value])},a(_.value),3)):T("",!0)])])):T("",!0)],32))}}),mz=le(hz,[["__scopeId","data-v-7f9d9207"]]),Ea=s=>typeof s=="string"&&s.trim()?s.trim():"",fz=(s,t)=>{var u;if(typeof s=="string")return Ea(s)||t;if(!s||typeof s!="object")return t;const n=s,l=(u=n.response)==null?void 0:u.data;return typeof l=="string"?Ea(l)||t:Ea(l==null?void 0:l.error)||Ea(l==null?void 0:l.message)||Ea(n.error)||Ea(n.message)||t},bz=["aria-label"],gz={class:"device-toolbar"},_z=["aria-label"],yz=["onClick"],kz={class:"device-center__tools"},wz={class:"device-search"},$z={class:"sr-only"},Cz=["placeholder"],Sz=["aria-label"],xz={value:"recent"},Pz={value:"name"},Tz=["disabled","aria-label"],Mz={class:"filter-panel"},Ez={key:0},Iz={class:"filter-panel__controls"},Dz={value:"all"},Lz={value:"lan"},Az={value:"unknown"},Nz={value:""},Oz=["value"],zz={value:"all"},qz={value:"none"},Rz={value:"static"},Vz={value:"route"},Bz={value:"limited"},Uz={value:"blocked"},Fz=["placeholder"],Hz=["disabled"],Gz={key:0,role:"alert"},jz={key:1,class:"telemetry-notice",role:"status"},Wz={key:6,class:"device-table-wrap"},Jz={class:"device-table"},Kz=["data-device-id","onClick","onKeydown"],Zz={class:"device-identity"},Yz=["title"],Qz={key:0},Xz={key:0,class:"network-label"},eq=["title"],tq={key:0},nq={class:"device-address"},aq={class:"mono"},sq={key:0},oq={class:"traffic-upload"},lq={class:"traffic-download"},iq={class:"policy-action"},rq={class:"policy-list"},cq={key:0,class:"muted"},dq=["onClick"],uq=["data-device-id","onClick","onKeydown"],vq={class:"device-card__top"},pq={class:"device-identity"},hq=["title"],mq={key:0,class:"network-label"},fq={class:"identity-meta"},bq={key:0},gq={class:"device-card__facts"},_q={class:"mono"},yq={class:"traffic-upload"},kq={class:"traffic-download"},wq=["aria-label"],$q={class:"drawer-header"},Cq={class:"device-identity"},Sq={class:"identity-meta"},xq={key:0},Pq=["aria-label"],Tq={key:0,class:"network-label"},Mq={class:"drawer-summary",role:"status"},Eq={class:"mono"},Iq={key:1,class:"context-notice",role:"status"},Dq=["aria-label"],Lq=["onClick"],Aq={key:2,class:"drawer-section"},Nq=["aria-label"],Oq={class:"chart-legend"},zq={key:3,class:"drawer-section"},qq={class:"technical-details"},Rq={class:"mono"},Vq={key:0},Bq={key:4,class:"drawer-section"},Uq={class:"technical-details"},Fq={key:0,class:"address-list"},Hq=["title","onClick"],Gq={key:1,class:"muted"},jq={key:2},Wq={class:"address-list"},Jq=["title","onClick"],Kq={key:5,class:"drawer-section"},Zq=["aria-label"],Yq={class:"mono"},Qq=X({__name:"deviceCenterList",setup(s){const t=Bi(),n=t.networkId==="all",l=oA,u=ke=>{var Se;return((Se=t.networks.find(ae=>ae.networkId===ke.networkId))==null?void 0:Se.displayName)||v("待确认归属")},c=Ne(ye({},we),{DeviceMangement:xn()}),r=ta(),p=as(),{$gettext:v}=Ae(),h=x([]),g=x({state:"ready",reasons:[]}),b=x(!0),m=x(!1),f=x(!1),k=x(""),$=x({alias:"",mac:""}),w=x(""),S=x(r.query.filter==="all"?"all":"online"),C=x("recent"),y=x(""),P=x({connection:"all",brand:"",policy:"all"}),_=x(null),D=x(null),E=x("overview"),A=x(""),U=x(new Map),q=x("warming_up"),z=x({});let N,F=0,Z=!1,Q=null,ce="";const ve=R(()=>BC(h.value)),O=R(()=>VC(h.value,S.value,y.value,C.value,P.value)),de=R(()=>[...new Set(h.value.map(ke=>ke.brand).filter(Boolean))].sort((ke,Se)=>ke.localeCompare(Se))),K=R(()=>+(P.value.connection!=="all")+ +!!P.value.brand+ +(P.value.policy!=="all")),xe=R(()=>!_.value||O.value.some(ke=>l(ke)===l(_.value))),j=R(()=>[{value:"online",label:v("在线")},{value:"all",label:v("全部")},{value:"controlled",label:v("已设置")}]),re=R(()=>[{id:"overview",label:v("概览")},{id:"profile",label:v("设备资料")},{id:"network",label:v("网络与上网")},{id:"management",label:v("使用管理")}]),$e=()=>B(null,null,function*(){var ke,Se;b.value=!0,w.value="";try{const[ae,He]=yield Promise.all([c.DeviceMangement.deviceInventoryV2.GET(),n?Promise.resolve(null):c.DeviceMangement.networkRulesV2.GET().catch(()=>null)]),Re=ae.data;if(!(Re!=null&&Re.result))throw(Re==null?void 0:Re.error)||v("设备清单不可用");const Ue=Re.result.devices||[],Et=(Se=(ke=He==null?void 0:He.data)==null?void 0:ke.result)==null?void 0:Se.rules;if(n){const Pt=yield Promise.all(t.networks.map(Ot=>B(null,null,function*(){var dn,Gt;const _t=yield Gs(Ot.networkId).networkRulesV2.GET().catch(()=>null);return Ps(Ue.filter(un=>un.networkId===Ot.networkId),[],void 0,(Gt=(dn=_t==null?void 0:_t.data)==null?void 0:dn.result)==null?void 0:Gt.rules)})));h.value=[...Pt.flat(),...Ps(Ue.filter(Ot=>!t.networks.some(_t=>_t.networkId===Ot.networkId)))]}else h.value=Ps(Ue,[],void 0,Et);xt(U.value),g.value=Re.result.health||{state:"ready",reasons:[]},_.value&&(_.value=h.value.find(Pt=>l(Pt)===l(_.value))||null)}catch(ae){w.value=fz(ae,`${v("读取结果失败")},${v("请刷新界面")}`)}finally{b.value=!1}}),qe=ke=>Do(ke,v),De=ke=>Lo(ke,v),Ke=ke=>ke.presenceState==="never_seen"?"never-seen":ke.online?"online":"offline",at=ke=>ke==="wifi"?"Wi-Fi":v(ke==="lan"?"有线":"未知"),st=ke=>Ds(ke,v),et=ke=>{const Se=Ze(ke);return Se.metaMode==="pending"?v("类型待确认"):Se.metaMode==="classification-source"?it(ke.classification.source):st(ke.scene)},Ze=ke=>TC(ke),it=ke=>({model:v("型号特征"),hostname:v("设备名称"),manufacturer_default:v("厂商默认类型"),fallback:v("安全回退"),manual:v("手动设置")})[ke],he=ke=>({high:v("高"),medium:v("中"),low:v("低")})[ke],H=ke=>({static:v("静态地址"),route:v("已指定路线"),limited:v("已限速"),blocked:v("已断网")})[ke]||ke,J=(ke,Se)=>PO(ke.telemetry,Se,v("采集中")),ge=(ke,Se)=>!ke.telemetry||ke.telemetry.state==="warming_up"?v("采集中"):el(Se==="up"?ke.telemetry.uploadBytes:ke.telemetry.downloadBytes),ze=(ke,Se)=>{const ae=z.value[ke]||[],He=Math.max(1,...ae.flatMap(Re=>[Re.up,Re.down]));return Math.max(3,Math.round(Se*100/He))},Fe=ke=>UC(ke,y.value),Ee=()=>{P.value={connection:"all",brand:"",policy:"all"}},dt=()=>{S.value="all",y.value="",Ee()},tt=ke=>B(null,null,function*(){var Se;Q=document.activeElement,ce=l(ke),_.value=ke,E.value="overview",(r.query.device!==ke.deviceId||r.query.deviceNetwork!==ke.networkId)&&p.replace({query:Ne(ye({},r.query),{device:ke.deviceId,deviceNetwork:ke.networkId})}),yield ot(),(Se=D.value)==null||Se.focus()}),kt=()=>B(null,null,function*(){var Se;_.value=null,r.query.device&&p.replace({query:Ne(ye({},r.query),{device:void 0,deviceNetwork:void 0})}),yield ot();const ke=Array.from(document.querySelectorAll("[data-device-id]")).find(ae=>ae.dataset.deviceId===ce&&ae.offsetParent!==null);(Se=Q!=null&&Q.isConnected?Q:ke)==null||Se.focus(),Q=null,ce=""}),ct=ke=>{_.value&&(_.value.policyLabels=ke,_.value.controlled=ke.length>0)},Tt=ke=>{if(!_.value)return;const Se=l(_.value);h.value=h.value.map(ae=>l(ae)===Se?Ne(ye({},ae),{displayName:ke.alias||ae.hostname||"",classification:ke.classification,scene:ke.classification.category,brand:ke.classification.brand,iconKey:ke.iconKey}):ae),_.value=h.value.find(ae=>l(ae)===Se)||null},ut=ke=>B(null,null,function*(){try{yield navigator.clipboard.writeText(ke)}catch(Se){const ae=document.createElement("textarea");ae.value=ke,ae.style.position="fixed",ae.style.opacity="0",document.body.appendChild(ae),ae.select(),document.execCommand("copy"),ae.remove()}A.value=ke,window.setTimeout(()=>{A.value===ke&&(A.value="")},1500)}),St=()=>B(null,null,function*(){var ke,Se,ae,He;f.value=!0,k.value="";try{const Re=yield c.DeviceMangement.deviceInventoryV2.POST(ye({},$.value));if(!((ke=Re.data)!=null&&ke.result))throw new Error(((Se=Re.data)==null?void 0:Se.error)||v("添加失败"));$.value={alias:"",mac:""},m.value=!1,yield $e(),S.value="all"}catch(Re){k.value=((He=(ae=Re==null?void 0:Re.response)==null?void 0:ae.data)==null?void 0:He.error)||(Re==null?void 0:Re.message)||v("添加失败,请检查 MAC 地址")}finally{f.value=!1}}),ht=ke=>{const Se=new Date(ke);return Number.isNaN(Se.getTime())?ke:Se.toLocaleString()},xt=ke=>{for(const Se of h.value)Se.telemetry=ke.get(l(Se));_.value&&(_.value=h.value.find(Se=>l(Se)===l(_.value))||null)},en=ke=>{const Se=ye({},z.value);for(const ae of ke)ae.state==="ready"&&(Se[l(ae)]=[...Se[l(ae)]||[],{up:ae.uploadSpeed,down:ae.downloadSpeed}].slice(-20));z.value=Se},qt=ke=>{N!==void 0&&window.clearTimeout(N),N=void 0,!Z&&!document.hidden&&(N=window.setTimeout(Ft,ke))},Ft=()=>B(null,null,function*(){var ke,Se,ae;if(!document.hidden)try{const He=yield c.DeviceMangement.deviceTrafficV2.GET();if(!((ke=He.data)!=null&&ke.result))throw((Se=He.data)==null?void 0:Se.error)||new Error("telemetry unavailable");const Re=He.data.result.items||[];U.value=MO(Re,l),q.value=((ae=He.data.result.health)==null?void 0:ae.state)||"ready",F=0,xt(U.value),en(Re),qt(3e3)}catch(He){q.value="partial",F++,qt(TO(F))}}),Ht=()=>{if(document.hidden){N!==void 0&&window.clearTimeout(N),N=void 0;return}Ft()};return We(()=>r.query.device,ke=>{ke||(_.value=null)}),nt(()=>B(null,null,function*(){if(yield $e(),Z)return;const ke=typeof r.query.device=="string"?r.query.device:"";if(ke){const Se=h.value.filter(He=>He.deviceId===ke&&(!r.query.deviceNetwork||He.networkId===r.query.deviceNetwork)),ae=Se.length===1?Se[0]:void 0;ae&&(S.value="all",yield tt(ae))}document.addEventListener("visibilitychange",Ht),Ft()})),lt(()=>{Z=!0,document.removeEventListener("visibilitychange",Ht),N!==void 0&&window.clearTimeout(N)}),(ke,Se)=>(i(),d("section",{class:"device-center","aria-label":o(v)("设备")},[e("div",gz,[e("nav",{class:"device-filters","aria-label":o(v)("设备筛选")},[(i(!0),d(V,null,oe(j.value,ae=>(i(),d("button",{key:ae.value,type:"button",class:_e({active:S.value===ae.value}),onClick:He=>S.value=ae.value},[ue(a(ae.label)+" ",1),e("span",null,a(ve.value[ae.value]),1)],10,yz))),128))],8,_z),e("div",kz,[e("label",wz,[e("span",$z,a(o(v)("搜索设备")),1),W(e("input",{"onUpdate:modelValue":Se[0]||(Se[0]=ae=>y.value=ae),type:"search",placeholder:o(v)("搜索名称、IP、MAC 或厂商")},null,8,Cz),[[Oe,y.value,void 0,{trim:!0}]])]),W(e("select",{"onUpdate:modelValue":Se[1]||(Se[1]=ae=>C.value=ae),"aria-label":o(v)("排序方式")},[e("option",xz,a(o(v)("最近活跃")),1),e("option",Pz,a(o(v)("按名称")),1)],8,Sz),[[Be,C.value]]),e("button",{class:"icon-button",type:"button",disabled:b.value,onClick:$e,"aria-label":o(v)("刷新")},"↻",8,Tz),n?T("",!0):(i(),d("button",{key:0,class:"add-device",type:"button",onClick:Se[2]||(Se[2]=ae=>m.value=!m.value)},a(m.value?o(v)("取消添加"):o(v)("添加设备")),1))]),e("details",Mz,[e("summary",null,[ue(a(o(v)("更多筛选")),1),K.value?(i(),d("small",Ez,a(K.value),1)):T("",!0)]),e("div",Iz,[e("label",null,[e("span",null,a(o(v)("连接方式")),1),W(e("select",{"onUpdate:modelValue":Se[3]||(Se[3]=ae=>P.value.connection=ae)},[e("option",Dz,a(o(v)("全部连接")),1),e("option",Lz,a(o(v)("有线")),1),Se[9]||(Se[9]=e("option",{value:"wifi"},"Wi-Fi",-1)),e("option",Az,a(o(v)("未知")),1)],512),[[Be,P.value.connection]])]),e("label",null,[e("span",null,a(o(v)("品牌")),1),W(e("select",{"onUpdate:modelValue":Se[4]||(Se[4]=ae=>P.value.brand=ae)},[e("option",Nz,a(o(v)("全部品牌")),1),(i(!0),d(V,null,oe(de.value,ae=>(i(),d("option",{key:ae,value:ae},a(ae),9,Oz))),128))],512),[[Be,P.value.brand]])]),e("label",null,[e("span",null,a(o(v)("策略状态")),1),W(e("select",{"onUpdate:modelValue":Se[5]||(Se[5]=ae=>P.value.policy=ae)},[e("option",zz,a(o(v)("全部策略")),1),e("option",qz,a(o(v)("无策略")),1),e("option",Rz,a(o(v)("静态地址")),1),e("option",Vz,a(o(v)("已指定路线")),1),e("option",Bz,a(o(v)("已限速")),1),e("option",Uz,a(o(v)("已断网")),1)],512),[[Be,P.value.policy]])]),K.value?(i(),d("button",{key:0,type:"button",class:"clear-filters",onClick:Ee},a(o(v)("清除筛选")),1)):T("",!0)])])]),m.value?(i(),d("form",{key:0,class:"add-device-form",onSubmit:Ge(St,["prevent"])},[e("div",null,[e("strong",null,a(o(v)("添加尚未上线的设备")),1),e("small",null,a(o(v)("保存 MAC 和备注,设备首次出现后会自动合并,不会创建孤立规则。")),1)]),e("label",null,[e("span",null,a(o(v)("设备备注")),1),W(e("input",{"onUpdate:modelValue":Se[6]||(Se[6]=ae=>$.value.alias=ae),maxlength:"64",placeholder:o(v)("例如:孩子的电脑")},null,8,Fz),[[Oe,$.value.alias,void 0,{trim:!0}]])]),e("label",null,[Se[10]||(Se[10]=e("span",null,"MAC",-1)),W(e("input",{"onUpdate:modelValue":Se[7]||(Se[7]=ae=>$.value.mac=ae),required:"",autocomplete:"off",placeholder:"AA:BB:CC:DD:EE:FF"},null,512),[[Oe,$.value.mac,void 0,{trim:!0}]])]),e("button",{type:"submit",disabled:f.value},a(f.value?o(v)("正在添加…"):o(v)("确认添加")),9,Hz),k.value?(i(),d("p",Gz,a(k.value),1)):T("",!0)],32)):T("",!0),q.value==="partial"||q.value==="stale"?(i(),d("div",jz,a(q.value==="stale"?o(v)("流量数据更新延迟,正在恢复采样"):o(v)("流量采样暂不可用,设备清单仍可正常使用")),1)):T("",!0),b.value?(i(),Y(yt,{key:2,kind:"loading",title:o(v)("正在加载设备"),description:o(v)("正在整理设备身份和在线状态…")},null,8,["title","description"])):w.value?(i(),Y(mA,{key:3,message:w.value,onRetry:$e},null,8,["message"])):g.value.state==="partial"?(i(),Y(yt,{key:4,kind:"info",title:o(v)("部分设备信息暂不可用"),description:o(v)("设备清单仍可使用,缺失的信息会在数据源恢复后自动补齐。")},null,8,["title","description"])):T("",!0),!b.value&&!w.value&&O.value.length===0?(i(),Y(yt,{key:5,kind:"empty",title:y.value?o(v)("没有匹配的设备"):o(v)("当前筛选下没有设备"),description:y.value?o(v)("请尝试名称、IP、MAC 或厂商的其他关键词。"):o(v)("可以切换到“全部”查看本次开机发现过的设备。"),"action-label":S.value==="online"&&ve.value.all>0&&!y.value&&!K.value?o(v)("查看全部设备"):"",onAction:Se[8]||(Se[8]=ae=>S.value="all")},null,8,["title","description","action-label"])):T("",!0),!b.value&&!w.value&&O.value.length?(i(),d("div",Wz,[e("table",Jz,[Se[11]||(Se[11]=e("colgroup",null,[e("col",{class:"identity-column"}),e("col",{class:"address-column"}),e("col",{class:"status-column"}),e("col",{class:"connection-column"}),e("col",{class:"traffic-column"}),e("col")],-1)),e("thead",null,[e("tr",null,[e("th",null,a(o(v)("设备")),1),e("th",null,a(o(v)("地址")),1),e("th",null,a(o(v)("状态")),1),e("th",null,a(o(v)("连接")),1),e("th",null,a(o(v)("实时流量")),1),e("th",null,a(o(v)("策略与操作")),1)])]),e("tbody",null,[(i(!0),d(V,null,oe(O.value,ae=>{var He;return i(),d("tr",{key:o(l)(ae),"data-device-id":o(l)(ae),tabindex:"0",onClick:Re=>tt(ae),onKeydown:[Qt(Ge(Re=>tt(ae),["prevent"]),["enter"]),Qt(Ge(Re=>tt(ae),["prevent"]),["space"])]},[e("td",null,[e("div",Zz,[G(Da,{scene:ae.scene,"icon-key":ae.iconKey,label:st(ae.scene)},null,8,["scene","icon-key","label"]),e("div",null,[e("strong",{title:qe(ae)},[(i(!0),d(V,null,oe(Fe(qe(ae)),(Re,Ue)=>(i(),d(V,{key:Ue},[Re.matched?(i(),d("mark",Qz,a(Re.text),1)):(i(),d(V,{key:1},[ue(a(Re.text),1)],64))],64))),128))],8,Yz),n?(i(),d("small",Xz,a(u(ae)),1)):T("",!0),e("span",{class:"identity-meta",title:ae.brand||et(ae)},[Ze(ae).showBrandInMeta?(i(),d("b",tq,a(ae.brand),1)):T("",!0),Ze(ae).showBrandInMeta?(i(),d(V,{key:1},[ue(" · ")],64)):T("",!0),ue(a(et(ae)),1)],8,eq)])])]),e("td",nq,[e("span",aq,a(ae.primaryAddress||"—"),1),ae.extraAddressCount?(i(),d("small",sq,"+"+a(ae.extraAddressCount),1)):T("",!0)]),e("td",null,[e("span",{class:_e(["status-pill",Ke(ae)])},a(De(ae)),3)]),e("td",null,a(at(ae.connection.kind)),1),e("td",null,[e("div",{class:_e(["traffic",{"traffic-ready":((He=ae.telemetry)==null?void 0:He.state)==="ready"}])},[e("span",oq,"↑ "+a(J(ae,"up")),1),e("span",lq,"↓ "+a(J(ae,"down")),1)],2)]),e("td",null,[e("div",iq,[e("div",rq,[(i(!0),d(V,null,oe(ae.policyLabels,Re=>(i(),d("span",{key:Re},a(H(Re)),1))),128)),ae.policyLabels.length===0?(i(),d("span",cq,a(o(v)("无策略")),1)):T("",!0)]),e("button",{type:"button",onClick:Ge(Re=>tt(ae),["stop"])},a(o(v)("详情")),9,dq)])])],40,Kz)}),128))])]),(i(!0),d(V,null,oe(O.value,ae=>{var He;return i(),d("article",{key:`card-${o(l)(ae)}`,"data-device-id":o(l)(ae),class:"device-card",tabindex:"0",onClick:Re=>tt(ae),onKeydown:[Qt(Ge(Re=>tt(ae),["prevent"]),["enter"]),Qt(Ge(Re=>tt(ae),["prevent"]),["space"])]},[e("div",vq,[e("div",pq,[G(Da,{scene:ae.scene,"icon-key":ae.iconKey,label:st(ae.scene)},null,8,["scene","icon-key","label"]),e("div",null,[e("strong",{title:qe(ae)},a(qe(ae)),9,hq),n?(i(),d("small",mq,a(u(ae)),1)):T("",!0),e("span",fq,[Ze(ae).showBrandInMeta?(i(),d("b",bq,a(ae.brand),1)):T("",!0),Ze(ae).showBrandInMeta?(i(),d(V,{key:1},[ue(" · ")],64)):T("",!0),ue(a(et(ae)),1)])])]),e("span",{class:_e(["status-pill",Ke(ae)])},a(De(ae)),3)]),e("div",gq,[e("span",null,[e("small",null,a(o(v)("地址")),1),e("span",_q,a(ae.primaryAddress||"—"),1)]),e("span",null,[e("small",null,a(o(v)("连接")),1),ue(a(at(ae.connection.kind)),1)]),e("span",{class:_e({"traffic-ready":((He=ae.telemetry)==null?void 0:He.state)==="ready"})},[e("small",null,a(o(v)("实时流量")),1),e("span",null,[e("span",yq,"↑ "+a(J(ae,"up")),1),Se[12]||(Se[12]=ue(" · ",-1)),e("span",kq,"↓ "+a(J(ae,"down")),1)])],2),e("span",null,[e("small",null,a(o(v)("策略")),1),ue(a(ae.policyLabels.length?ae.policyLabels.map(H).join(" · "):o(v)("无策略")),1)])])],40,uq)}),128))])):T("",!0),_.value?(i(),d("div",{key:7,class:"drawer-backdrop",onClick:Ge(kt,["self"])},[!n||o(t).networks.some(ae=>{var He;return ae.networkId===((He=_.value)==null?void 0:He.networkId)})?(i(),Y(Ui,{key:o(l)(_.value),"network-id":_.value.networkId||o(t).networkId,networks:o(t).networks,legacy:o(t).legacy},{default:pe(()=>{var ae,He,Re;return[e("aside",{ref_key:"drawer",ref:D,class:"device-drawer",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":o(v)("设备详情"),onKeydown:Qt(kt,["esc"])},[e("div",$q,[e("div",Cq,[G(Da,{scene:_.value.scene,"icon-key":_.value.iconKey,label:st(_.value.scene)},null,8,["scene","icon-key","label"]),e("div",null,[e("h3",null,a(qe(_.value)),1),e("span",Sq,[Ze(_.value).showBrandInMeta?(i(),d("b",xq,a(_.value.brand),1)):T("",!0),Ze(_.value).showBrandInMeta?(i(),d(V,{key:1},[ue(" · ")],64)):T("",!0),ue(a(et(_.value)),1)])])]),e("button",{type:"button",class:"drawer-close",onClick:kt,"aria-label":o(v)("关闭")},"×",8,Pq)]),n?(i(),d("p",Tq,a(o(v)("所在局域网"))+" · "+a(u(_.value)),1)):T("",!0),e("div",Mq,[e("span",null,[e("small",null,a(o(v)("状态")),1),ue(a(De(_.value)),1)]),e("span",null,[e("small",null,a(o(v)("主要地址")),1),e("b",Eq,a(_.value.primaryAddress||"—"),1)]),e("span",null,[e("small",null,a(o(v)("连接")),1),ue(a(at(_.value.connection.kind)),1)])]),xe.value?T("",!0):(i(),d("div",Iq,[e("span",null,a(o(v)("此设备不在当前筛选结果中")),1),e("button",{type:"button",onClick:dt},a(o(v)("清除筛选")),1)])),e("nav",{class:"drawer-tabs","aria-label":o(v)("设备详情区域")},[(i(!0),d(V,null,oe(re.value,Ue=>(i(),d("button",{key:Ue.id,type:"button",class:_e({active:E.value===Ue.id}),onClick:Et=>E.value=Ue.id},a(Ue.label),11,Lq))),128))],8,Dq),E.value==="overview"?(i(),d("div",Aq,[e("h4",null,a(o(v)("概览")),1),e("dl",null,[e("div",null,[e("dt",null,a(o(v)("当前速率")),1),e("dd",null,"↑ "+a(J(_.value,"up"))+" · ↓ "+a(J(_.value,"down")),1)]),e("div",null,[e("dt",null,a(o(v)("本次开机")),1),e("dd",null,"↑ "+a(ge(_.value,"up"))+" · ↓ "+a(ge(_.value,"down")),1)]),e("div",null,[e("dt",null,a(o(v)("连接数")),1),e("dd",null,a(((ae=_.value.telemetry)==null?void 0:ae.state)==="warming_up"||!_.value.telemetry?o(v)("采集中"):_.value.telemetry.connectionCount),1)])]),(He=z.value[o(l)(_.value)])!=null&&He.length?(i(),d("div",{key:0,class:"traffic-chart","aria-label":o(v)("近期流量趋势")},[(i(!0),d(V,null,oe(z.value[o(l)(_.value)],(Ue,Et)=>(i(),d("span",{key:Et,class:"traffic-chart__bar"},[e("i",{class:"upload",style:pt({height:`${ze(o(l)(_.value),Ue.up)}%`})},null,4),e("i",{class:"download",style:pt({height:`${ze(o(l)(_.value),Ue.down)}%`})},null,4)]))),128))],8,Nq)):T("",!0),e("small",Oq,[e("span",null,"↑ "+a(o(v)("上传")),1),e("span",null,"↓ "+a(o(v)("下载")),1)]),(i(),Y(KO,{key:_.value.deviceId,"device-id":_.value.deviceId,"quota-editable":!1},null,8,["device-id"])),(i(),Y(mz,{key:`advanced-${_.value.deviceId}`,device:_.value},null,8,["device"]))])):T("",!0),E.value==="profile"?(i(),d("div",zq,[e("h4",null,a(o(v)("设备资料")),1),G(BA,{device:_.value,onSaved:Tt},null,8,["device"]),e("details",qq,[e("summary",null,a(o(v)("识别与技术信息")),1),e("dl",null,[e("div",null,[e("dt",null,a(o(v)("原始厂商")),1),e("dd",null,a(_.value.classification.manufacturer||"—"),1)]),e("div",null,[e("dt",null,a(o(v)("原始主机名")),1),e("dd",null,a(_.value.hostname||"—"),1)]),e("div",null,[e("dt",null,a(o(v)("识别依据")),1),e("dd",null,a(it(_.value.classification.source)),1)]),e("div",null,[e("dt",null,a(o(v)("识别可信度")),1),e("dd",null,a(he(_.value.classification.confidence)),1)]),e("div",null,[Se[13]||(Se[13]=e("dt",null,"MAC",-1)),e("dd",Rq,a(_.value.mac||"—"),1)]),((Re=_.value.identity)==null?void 0:Re.scope)==="boot"?(i(),d("div",Vq,[e("dt",null,a(o(v)("身份稳定性")),1),e("dd",null,a(o(v)("本次开机")),1)])):T("",!0),e("div",null,[e("dt",null,a(o(v)("最近出现")),1),e("dd",null,a(ht(_.value.lastSeenAt)),1)])])])])):T("",!0),E.value==="network"?(i(),d("div",Bq,[e("h4",null,a(o(v)("网络与上网")),1),(i(),Y(jl,{key:`network-${_.value.deviceId}`,device:_.value,mode:"network",onSaved:ct},null,8,["device"])),e("details",Uq,[e("summary",null,a(o(v)("地址详情")),1),e("h4",null,a(o(v)("当前地址")),1),_.value.addresses.current.length?(i(),d("div",Fq,[(i(!0),d(V,null,oe(_.value.addresses.current,Ue=>(i(),d("button",{key:Ue.address,type:"button",class:"address-copy",title:o(v)("复制地址"),onClick:Et=>ut(Ue.address)},[e("code",null,a(Ue.address),1),e("span",null,a(A.value===Ue.address?o(v)("已复制"):o(v)("复制")),1)],8,Hq))),128))])):(i(),d("span",Gq,a(o(v)("当前没有地址")),1)),_.value.addresses.historical.length?(i(),d("h4",jq,a(o(v)("历史地址")),1)):T("",!0),e("div",Wq,[(i(!0),d(V,null,oe(_.value.addresses.historical,Ue=>(i(),d("button",{key:Ue.address,type:"button",class:"address-copy",title:o(v)("复制地址"),onClick:Et=>ut(Ue.address)},[e("code",null,a(Ue.address),1),e("span",null,a(A.value===Ue.address?o(v)("已复制"):o(v)("复制")),1)],8,Jq))),128))])])])):T("",!0),E.value==="management"?(i(),d("div",Kq,[e("h4",null,a(o(v)("使用管理")),1),(i(),Y(jl,{key:`restrictions-${_.value.deviceId}`,device:_.value,mode:"restrictions",onSaved:ct},null,8,["device"])),(i(),Y(xO,{key:`usage-policy-${_.value.deviceId}`,"device-id":_.value.deviceId},null,8,["device-id"]))])):T("",!0)],40,wq)]}),_:1},8,["network-id","networks","legacy"])):(i(),d("aside",{key:1,ref_key:"drawer",ref:D,class:"device-drawer",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":o(v)("设备详情"),onKeydown:Qt(kt,["esc"])},[e("h3",null,a(qe(_.value)),1),e("p",null,a(o(v)("归属尚未确认,暂时无法修改此设备")),1),e("p",Yq,a(_.value.mac),1),(i(!0),d(V,null,oe([..._.value.addresses.current,..._.value.addresses.historical],ae=>(i(),d("p",{key:ae.address,class:"mono"},a(ae.address),1))),128)),e("button",{type:"button",onClick:kt},a(o(v)("关闭")),1)],40,Zq))])):T("",!0)],8,bz))}}),Xq=le(Qq,[["__scopeId","data-v-6ca35503"]]),eR={class:"group-panel","aria-labelledby":"device-groups-title"},tR={class:"group-header"},nR={id:"device-groups-title"},aR={class:"header-actions"},sR={class:"evaluation"},oR={key:2,class:"group-grid"},lR={class:"group-card-title"},iR={class:"priority"},rR={class:"member-preview"},cR={class:"card-actions"},dR=["onClick"],uR=["onClick"],vR={key:3,class:"effective-explanation"},pR={class:"effective-list"},hR={class:"editor-heading"},mR=["aria-label"],fR={key:0,class:"form-grid"},bR=["placeholder"],gR={key:1,class:"advanced-group"},_R={key:2},yR=["placeholder"],kR={class:"device-options"},wR=["value"],$R={key:0},CR={class:"rules-grid"},SR={value:"inherit"},xR={value:"allow"},PR={value:"block"},TR={value:""},MR=["value","disabled"],ER={class:"check"},IR={key:0,class:"inline-fields"},DR={class:"check"},LR={key:1,class:"inline-fields quota"},AR={value:"daily"},NR={value:"weekly"},OR={value:"monthly"},zR={value:"notify"},qR={value:"block"},RR={class:"check"},VR={key:0,class:"schedule-box"},BR={value:"block"},UR={value:"limit"},FR={key:0,class:"inline-fields"},HR={class:"days"},GR=["value"],jR={class:"inline-fields"},WR=["aria-label"],JR={key:0},KR={key:1},ZR=["disabled"],YR={key:4,class:"feedback error"},QR={key:5,class:"editor-actions"},XR={class:"primary",type:"submit"},eV=X({__name:"deviceGroupsPanel",setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),{$gettext:n}=Ae(),l=x(!0),u=x(!1),c=x(""),r=x(""),p=x(""),v=x(""),h=x(""),g=x(!1),b=x(!1),m=x(!1),f=x(""),k=x(!1),$=x([]),w=x([]),S=x([]),C=x([]),y=x(),P=()=>({id:"",name:"",priority:10,access:"inherit",members:[],targetId:"",speedEnabled:!1,upload:100,download:1e3,quotaEnabled:!1,quotaPeriod:"monthly",quotaGB:10,quotaAction:"notify",scheduleEnabled:!1,scheduleAction:"block",scheduleUpload:20,scheduleDownload:100,days:[1,2,3,4,5],start:"22:00",end:"07:00"}),_=Xe(P()),D=R(()=>[{value:1,label:n("一")},{value:2,label:n("二")},{value:3,label:n("三")},{value:4,label:n("四")},{value:5,label:n("五")},{value:6,label:n("六")},{value:0,label:n("日")}]),E=R(()=>{const he=f.value.toLowerCase();return w.value.filter(H=>!he||[H.displayName,H.hostname,H.mac,...H.ipv4||[]].some(J=>String(J||"").toLowerCase().includes(he)))}),A=he=>{const[H,J]=he.split(":").map(Number);return H*60+J},U=he=>`${String(Math.floor(he/60)).padStart(2,"0")}:${String(he%60).padStart(2,"0")}`,q=he=>he?new Date(he).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—",z=he=>{const H=w.value.find(J=>J.deviceId===he);return(H==null?void 0:H.displayName)||(H==null?void 0:H.hostname)||he},N=he=>he.kind==="default"||he.name==="跟随网络默认"?n("默认路线"):he.kind==="self"&&he.name==="本机路由"?n("本机路由"):he.kind==="bypass"&&he.name==="旁路由"?n("旁路由"):he.kind==="floating"&&he.name==="浮动网关"?n("浮动网关"):he.name==="自定义网关"?n("自定义网关"):he.name,F=he=>he.slice(0,3).map(z).join("、")+(he.length>3?` +${he.length-3}`:"")||n("尚未选择设备"),Z=he=>{var H,J;return(J=(H=S.value.find(ge=>ge.deviceId===he))==null?void 0:H.sources)==null?void 0:J.includes("device")},Q=R(()=>_.members.filter(Z).length),ce=(he=[])=>he.slice(1).map(H=>{var J;return H==="global"?n("默认规则"):H==="device"?n("单设备例外"):H.startsWith("group:")?((J=$.value.find(ge=>ge.id===H.slice(6)))==null?void 0:J.name)||n("设备分组"):H}).join(" → ")||n("系统默认"),ve=he=>{var J,ge;const H=[he.networkAccess?n("允许联网"):n("暂停联网")];return(J=he.speed)!=null&&J.enabled&&H.push(n("已限速")),he.targetId&&he.targetId!=="default"&&H.push(n("已指定路线")),(ge=he.quota)!=null&&ge.enabled&&H.push(n("有流量额度")),H.join(" · ")},O=he=>{var J,ge,ze;const H=[];if((he==null?void 0:he.access)===!1?H.push(n("暂停联网")):(he==null?void 0:he.access)===!0&&H.push(n("允许联网")),(J=he==null?void 0:he.speed)!=null&&J.enabled&&H.push(n("速度上限")),he!=null&&he.targetId&&H.push(n("指定路线")),(ge=he==null?void 0:he.quota)!=null&&ge.enabled&&H.push(n("流量额度")),(ze=he==null?void 0:he.schedules)!=null&&ze.length){const Fe=he.schedules[0];H.push(`${Fe.action==="limit"?n("时段限速"):n("休息时段")} ${U(Fe.startMinute)}–${U(Fe.endMinute)}`)}return H.join(" · ")||n("仅分组,不覆盖设备设置")},de=R(()=>O(st())),K=he=>({all_success:n("批量规则已应用"),partial:n("部分设备需要处理"),failed:n("批量规则未应用")})[he]||n("批量检查完成"),xe=()=>Object.assign(_,P()),j=()=>{xe(),g.value=!0,b.value=!1,m.value=!1,k.value=!1,r.value=""},re=()=>{xe(),qe($e.value),g.value=!0,m.value=!0,b.value=!1,k.value=!1},$e=x(null),qe=he=>{var J,ge,ze,Fe,Ee,dt,tt,kt,ct,Tt;if(!he)return;_.access=he.access===!0?"allow":he.access===!1?"block":"inherit",_.targetId=he.targetId||"",_.speedEnabled=!!((J=he.speed)!=null&&J.enabled),_.upload=((ge=he.speed)==null?void 0:ge.uploadSpeed)||100,_.download=((ze=he.speed)==null?void 0:ze.downloadSpeed)||1e3,_.quotaEnabled=!!((Fe=he.quota)!=null&&Fe.enabled),_.quotaPeriod=((Ee=he.quota)==null?void 0:Ee.period)||"monthly",_.quotaGB=(dt=he.quota)!=null&&dt.limitBytes?he.quota.limitBytes/1073741824:10,_.quotaAction=((tt=he.quota)==null?void 0:tt.action)||"notify";const H=(kt=he.schedules)==null?void 0:kt[0];_.scheduleEnabled=!!H,H&&(_.scheduleAction=H.action||"block",_.scheduleUpload=((ct=H.speed)==null?void 0:ct.uploadSpeed)||20,_.scheduleDownload=((Tt=H.speed)==null?void 0:Tt.downloadSpeed)||100,_.days=[...H.days],_.start=U(H.startMinute),_.end=U(H.endMinute))},De=he=>{xe(),Object.assign(_,{id:he.id,name:he.name,priority:he.priority,members:[...he.members]}),qe(he.policy),g.value=!0,b.value=!0,m.value=!1,k.value=!1,r.value=""},Ke=()=>{g.value=!1,k.value=!1,r.value=""},at=()=>{if(r.value="",!(!m.value&&!_.name)){if(_.scheduleEnabled&&!_.days.length){r.value=n("请至少选择一天");return}if(_.scheduleEnabled&&_.scheduleAction==="limit"&&(!_.scheduleUpload||!_.scheduleDownload)){r.value=n("请填写完整的时段速度上限");return}k.value=!0}},st=()=>{const he=_.access==="inherit"?void 0:_.access==="allow",H=_.scheduleEnabled?[{id:"schedule",enabled:!0,days:[..._.days],startMinute:A(_.start),endMinute:A(_.end),action:_.scheduleAction,speed:_.scheduleAction==="limit"?{enabled:!0,uploadSpeed:_.scheduleUpload,downloadSpeed:_.scheduleDownload}:void 0}]:[];return{access:he,targetId:_.targetId||void 0,speed:_.speedEnabled?{enabled:!0,uploadSpeed:_.upload,downloadSpeed:_.download}:void 0,quota:_.quotaEnabled?{enabled:!0,period:_.quotaPeriod,limitBytes:Math.round(_.quotaGB*1073741824),action:_.quotaAction}:void 0,schedules:H}},et=()=>B(null,null,function*(){u.value=!0,r.value="";try{const he=m.value?{action:"set_global_policy",expectedVersion:p.value,globalPolicy:st()}:{action:"upsert_group",expectedVersion:p.value,group:{id:_.id||`group_${Date.now().toString(36)}`,name:_.name,priority:_.priority,members:[..._.members],policy:st()}},H=(yield t.DeviceMangement.deviceGroupsV2.POST(he)).data.result;if(H!=null&&H.error)throw new Error(H.error.message);g.value=!1,k.value=!1,yield it()}catch(he){r.value=(he==null?void 0:he.message)||n("保存失败")}finally{u.value=!1}}),Ze=he=>B(null,null,function*(){if(window.confirm(`${n("删除分组")}“${he.name}”?
${n("设备和单设备例外不会被删除。")}`))try{const H=(yield t.DeviceMangement.deviceGroupsV2.POST({action:"delete_group",groupId:he.id,expectedVersion:p.value})).data.result;if(H!=null&&H.error)throw new Error(H.error.message);yield it()}catch(H){c.value=(H==null?void 0:H.message)||n("删除失败")}}),it=()=>B(null,null,function*(){var he,H,J;l.value=!0,c.value="";try{const[ge,ze,Fe]=yield Promise.all([t.DeviceMangement.deviceGroupsV2.GET(),t.DeviceMangement.deviceInventoryV2.GET(),t.DeviceMangement.gatewayTargetsV2.GET().catch(()=>null)]),Ee=ge.data.result;if(Ee!=null&&Ee.error)throw new Error(Ee.error.message);$.value=(Ee==null?void 0:Ee.groups)||[],$e.value=(Ee==null?void 0:Ee.globalPolicy)||null,S.value=(Ee==null?void 0:Ee.effective)||[],p.value=(Ee==null?void 0:Ee.version)||"",v.value=(Ee==null?void 0:Ee.timezone)||"",h.value=(Ee==null?void 0:Ee.nextEvaluationAt)||"",y.value=Ee==null?void 0:Ee.lastBatch,w.value=((he=ze.data.result)==null?void 0:he.devices)||[],C.value=((J=(H=Fe==null?void 0:Fe.data)==null?void 0:H.result)==null?void 0:J.targets)||[]}catch(ge){c.value=(ge==null?void 0:ge.message)||n("读取设备分组失败")}finally{l.value=!1}});return it(),(he,H)=>(i(),d("section",eR,[e("header",tR,[e("div",null,[e("h2",nR,a(o(n)("分组与计划")),1),e("p",null,a(o(n)("把需要相同安排的设备放在一起,一次设置联网、速度、路线、时段或流量额度。")),1)]),e("div",aR,[e("button",{type:"button",onClick:re},a(o(n)("默认规则")),1),e("button",{type:"button",class:"primary",onClick:j},a(o(n)("新建分组")),1)])]),l.value?(i(),Y(yt,{key:0,kind:"loading",title:o(n)("正在读取设备分组")},null,8,["title"])):c.value?(i(),Y(yt,{key:1,kind:"error",title:o(n)("设备分组读取失败"),description:c.value,"action-label":o(n)("重新加载"),onAction:it},null,8,["title","description","action-label"])):(i(),d(V,{key:2},[e("div",sR,[e("span",null,a(o(n)("按路由器时间执行"))+" · "+a(v.value||"—"),1),e("span",null,a(o(n)("下次检查"))+" "+a(q(h.value)),1)]),y.value&&y.value.status!=="unchanged"?(i(),d("div",{key:0,class:_e(["batch-result",y.value.status]),role:"status"},[e("strong",null,a(K(y.value.status)),1),e("span",null,a(o(n)("成功"))+" "+a(y.value.applied)+" · "+a(o(n)("跳过"))+" "+a(y.value.skipped)+" · "+a(o(n)("失败"))+" "+a(y.value.failed),1)],2)):T("",!0),!$.value.length&&!g.value?(i(),Y(yt,{key:1,kind:"empty",title:o(n)("还没有设备分组"),description:o(n)("例如创建“儿童设备”,设置晚间暂停联网和每月流量额度。")},null,8,["title","description"])):(i(),d("div",oR,[(i(!0),d(V,null,oe($.value,J=>(i(),d("article",{key:J.id,class:"group-card"},[e("div",lR,[e("div",null,[e("strong",null,a(J.name),1),e("span",null,a(J.members.length)+" "+a(o(n)("台设备")),1)]),e("span",iR,"P"+a(J.priority),1)]),e("p",null,a(O(J.policy)),1),e("div",rR,a(F(J.members)),1),e("div",cR,[e("button",{type:"button",onClick:ge=>De(J)},a(o(n)("编辑")),9,dR),e("button",{type:"button",class:"danger-link",onClick:ge=>Ze(J)},a(o(n)("删除")),9,uR)])]))),128))])),S.value.length?(i(),d("details",vR,[e("summary",null,[ue(a(o(n)("查看最终生效结果与来源"))+" ",1),e("small",null,a(Math.min(S.value.length,50))+" / "+a(S.value.length),1)]),e("div",pR,[(i(!0),d(V,null,oe(S.value.slice(0,50),J=>(i(),d("div",{key:J.deviceId},[e("span",null,[e("strong",null,a(z(J.deviceId)),1),e("small",null,a(ve(J)),1)]),e("em",null,a(ce(J.sources)),1)]))),128))])])):T("",!0),g.value?(i(),d("form",{key:4,class:"editor",onSubmit:Ge(at,["prevent"])},[e("div",hR,[e("div",null,[e("h3",null,a(m.value?o(n)("默认规则"):b.value?o(n)("编辑分组"):o(n)("新建分组")),1),e("p",null,a(m.value?o(n)("只为没有更具体规则的设备提供默认值。"):o(n)("单设备例外始终优先;多个分组冲突时,优先级较高的生效。")),1)]),e("button",{type:"button",class:"close",onClick:Ke,"aria-label":o(n)("关闭")},"×",8,mR)]),m.value?T("",!0):(i(),d("div",fR,[e("label",null,[e("span",null,a(o(n)("分组名称")),1),W(e("input",{"onUpdate:modelValue":H[0]||(H[0]=J=>_.name=J),maxlength:"64",required:"",placeholder:o(n)("例如:儿童设备")},null,8,bR),[[Oe,_.name,void 0,{trim:!0}]])])])),m.value?T("",!0):(i(),d("details",gR,[e("summary",null,a(o(n)("高级设置")),1),e("label",null,[e("span",null,a(o(n)("优先级")),1),W(e("input",{"onUpdate:modelValue":H[1]||(H[1]=J=>_.priority=J),type:"number",min:"0",max:"999"},null,512),[[Oe,_.priority,void 0,{number:!0}]]),e("small",null,a(o(n)("单设备例外始终优先;多个分组冲突时,优先级较高的生效。")),1)])])),m.value?T("",!0):(i(),d("fieldset",_R,[e("legend",null,[ue(a(o(n)("选择设备"))+" ",1),e("small",null,a(o(n)("已选择"))+" "+a(_.members.length)+" "+a(o(n)("台设备")),1)]),W(e("input",{"onUpdate:modelValue":H[2]||(H[2]=J=>f.value=J),class:"device-search",type:"search",placeholder:o(n)("搜索名称、IP 或 MAC")},null,8,yR),[[Oe,f.value,void 0,{trim:!0}]]),e("div",kR,[(i(!0),d(V,null,oe(E.value,J=>{var ge;return i(),d("label",{key:J.deviceId},[W(e("input",{"onUpdate:modelValue":H[3]||(H[3]=ze=>_.members=ze),type:"checkbox",value:J.deviceId},null,8,wR),[[gt,_.members]]),e("span",null,[e("strong",null,a(J.displayName||J.hostname||o(n)("未命名设备")),1),e("small",null,a(((ge=J.ipv4)==null?void 0:ge[0])||J.mac||J.deviceId),1)]),Z(J.deviceId)?(i(),d("em",$R,a(o(n)("有单设备例外")),1)):T("",!0)])}),128))])])),e("fieldset",null,[e("legend",null,a(o(n)("共同规则")),1),e("div",CR,[e("label",null,[e("span",null,a(o(n)("联网权限")),1),W(e("select",{"onUpdate:modelValue":H[4]||(H[4]=J=>_.access=J)},[e("option",SR,a(o(n)("不设置")),1),e("option",xR,a(o(n)("允许联网")),1),e("option",PR,a(o(n)("暂停联网")),1)],512),[[Be,_.access]])]),e("label",null,[e("span",null,a(o(n)("上网路线")),1),W(e("select",{"onUpdate:modelValue":H[5]||(H[5]=J=>_.targetId=J)},[e("option",TR,a(o(n)("不设置")),1),(i(!0),d(V,null,oe(C.value,J=>(i(),d("option",{key:J.id,value:J.id,disabled:!J.supported},a(N(J))+a(J.supported?"":o(n)("(不可用)")),9,MR))),128))],512),[[Be,_.targetId]])]),e("label",ER,[W(e("input",{"onUpdate:modelValue":H[6]||(H[6]=J=>_.speedEnabled=J),type:"checkbox"},null,512),[[gt,_.speedEnabled]]),ue(a(o(n)("速度上限")),1)]),_.speedEnabled?(i(),d("div",IR,[e("label",null,[e("span",null,a(o(n)("上传 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":H[7]||(H[7]=J=>_.upload=J),type:"number",min:"1"},null,512),[[Oe,_.upload,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(n)("下载 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":H[8]||(H[8]=J=>_.download=J),type:"number",min:"1"},null,512),[[Oe,_.download,void 0,{number:!0}]])])])):T("",!0),e("label",DR,[W(e("input",{"onUpdate:modelValue":H[9]||(H[9]=J=>_.quotaEnabled=J),type:"checkbox"},null,512),[[gt,_.quotaEnabled]]),ue(a(o(n)("流量额度")),1)]),_.quotaEnabled?(i(),d("div",LR,[e("label",null,[e("span",null,a(o(n)("周期")),1),W(e("select",{"onUpdate:modelValue":H[10]||(H[10]=J=>_.quotaPeriod=J)},[e("option",AR,a(o(n)("每天")),1),e("option",NR,a(o(n)("每周")),1),e("option",OR,a(o(n)("每月")),1)],512),[[Be,_.quotaPeriod]])]),e("label",null,[e("span",null,a(o(n)("额度 GB")),1),W(e("input",{"onUpdate:modelValue":H[11]||(H[11]=J=>_.quotaGB=J),type:"number",min:"0.1",step:"0.1"},null,512),[[Oe,_.quotaGB,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(n)("达到后")),1),W(e("select",{"onUpdate:modelValue":H[12]||(H[12]=J=>_.quotaAction=J)},[e("option",zR,a(o(n)("仅提醒")),1),e("option",qR,a(o(n)("暂停联网")),1)],512),[[Be,_.quotaAction]])])])):T("",!0)])]),e("fieldset",null,[e("legend",null,a(o(n)("休息时段")),1),e("label",RR,[W(e("input",{"onUpdate:modelValue":H[13]||(H[13]=J=>_.scheduleEnabled=J),type:"checkbox"},null,512),[[gt,_.scheduleEnabled]]),ue(" "+a(o(n)("在指定时段执行规则")),1)]),_.scheduleEnabled?(i(),d("div",VR,[e("label",null,[e("span",null,a(o(n)("时段内执行")),1),W(e("select",{"onUpdate:modelValue":H[14]||(H[14]=J=>_.scheduleAction=J)},[e("option",BR,a(o(n)("暂停联网")),1),e("option",UR,a(o(n)("限制速度")),1)],512),[[Be,_.scheduleAction]])]),_.scheduleAction==="limit"?(i(),d("div",FR,[e("label",null,[e("span",null,a(o(n)("上传 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":H[15]||(H[15]=J=>_.scheduleUpload=J),type:"number",min:"1"},null,512),[[Oe,_.scheduleUpload,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(n)("下载 Mbit/s")),1),W(e("input",{"onUpdate:modelValue":H[16]||(H[16]=J=>_.scheduleDownload=J),type:"number",min:"1"},null,512),[[Oe,_.scheduleDownload,void 0,{number:!0}]])])])):T("",!0),e("div",HR,[(i(!0),d(V,null,oe(D.value,J=>(i(),d("label",{key:J.value,class:_e({selected:_.days.includes(J.value)})},[W(e("input",{"onUpdate:modelValue":H[17]||(H[17]=ge=>_.days=ge),type:"checkbox",value:J.value},null,8,GR),[[gt,_.days]]),ue(a(J.label),1)],2))),128))]),e("div",jR,[e("label",null,[e("span",null,a(o(n)("开始")),1),W(e("input",{"onUpdate:modelValue":H[18]||(H[18]=J=>_.start=J),type:"time"},null,512),[[Oe,_.start]])]),e("label",null,[e("span",null,a(o(n)("结束")),1),W(e("input",{"onUpdate:modelValue":H[19]||(H[19]=J=>_.end=J),type:"time"},null,512),[[Oe,_.end]])])]),e("small",null,a(o(n)("结束时间早于开始时间时,会自动跨到第二天。")),1)])):T("",!0)]),k.value?(i(),d("div",{key:3,class:"preview-card",role:"dialog","aria-label":o(n)("保存前预览")},[e("strong",null,a(o(n)("确认这次调整")),1),m.value?T("",!0):(i(),d("span",JR,a(o(n)("影响设备"))+":"+a(_.members.length),1)),e("span",null,a(de.value),1),Q.value?(i(),d("p",KR,a(Q.value)+" "+a(o(n)("台设备有单设备例外,最终值仍以例外为准。")),1)):T("",!0),e("div",null,[e("button",{type:"button",onClick:H[20]||(H[20]=J=>k.value=!1)},a(o(n)("返回修改")),1),e("button",{type:"button",class:"primary",disabled:u.value,onClick:et},a(u.value?o(n)("正在应用…"):o(n)("确认并应用")),9,ZR)])],8,WR)):T("",!0),r.value?(i(),d("p",YR,a(r.value),1)):T("",!0),k.value?T("",!0):(i(),d("div",QR,[e("button",{type:"button",onClick:Ke},a(o(n)("取消")),1),e("button",XR,a(o(n)("预览影响")),1)]))],32)):T("",!0)],64))]))}}),tV=le(eV,[["__scopeId","data-v-2a77cd21"]]),nV={class:"floating-wizard"},aV={key:2,class:"capability-card"},sV={class:"status-card"},oV={key:0,class:"configured-card"},lV=["aria-label"],iV={key:0,class:"wizard-card"},rV={class:"toggle-line"},cV={class:"role-grid"},dV={key:1,class:"wizard-card form-grid"},uV={key:2,class:"wizard-card review-card"},vV={key:0},pV={key:0},hV={key:1,class:"warning"},mV={key:2,class:"hint"},fV={class:"wizard-actions"},bV=["disabled"],gV=["disabled"],_V=["disabled"],yV=["disabled"],kV={key:3,class:"drill-box"},wV={key:0,class:"hint"},$V=X({__name:"floatingGatewayWizard",emits:["install"],setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),{$gettext:n}=Ae(),l=x(!0),u=x(!1),c=x(!1),r=x(!0),p=x(""),v=x(""),h=x("success"),g=x(""),b=x(1),m=x(""),f=x(null),k=Xe({capability:"",state:"disabled",holder:"none",peerState:"unverifiable",externalState:"unverifiable"}),$=Xe({enabled:!1,role:"preferred",virtualIP:"",peerIPs:[],healthURL:"",healthTimeoutSec:5}),w=R({get:()=>$.peerIPs.join(", "),set:Z=>{$.peerIPs=Z.split(/[,,\s]+/).map(Q=>Q.trim()).filter(Boolean)}}),S=R(()=>!!($.virtualIP||$.peerIPs.length)),C=R(()=>$.role==="takeover"?n("故障接管节点"):n("优先服务节点")),y=R(()=>({disabled:n("未启用"),starting:n("等待状态确认"),healthy:n("运行正常"),degraded:n("部分异常"),failover:n("正在接管"),error:n("运行异常")})[k.state]||n("未知")),P=R(()=>({local:n("当前节点"),peer:n("对端节点"),none:n("无人持有"),unknown:n("等待确认")})[k.holder]||n("等待确认")),_=Z=>({reachable:n("可达"),unreachable:n("不可达"),healthy:n("正常"),failed:n("失败"),unverifiable:n("尚未验证")})[Z]||n("尚未验证"),D=Z=>[n("节点职责"),n("地址与检测"),n("预检与应用")][Z-1],E=Z=>({change_enabled_state:n("更改启用状态"),change_node_responsibility:n("更改节点职责"),change_virtual_ip:n("更改虚拟 IP"),change_peer_nodes:n("更改对端节点"),change_health_check:n("更改健康检测")})[Z]||Z,A=()=>({config:ye({},$),expectedVersion:m.value}),U=()=>{r.value=!0,b.value=1,f.value=null,v.value=""},q=()=>B(null,null,function*(){var Z,Q,ce,ve,O;l.value=!0,p.value="";try{const{data:de}=yield t.DeviceMangement.floatingGatewayV2.GET();if((Z=de.result)!=null&&Z.error)throw new Error(de.result.error.message);Object.assign(k,((Q=de.result)==null?void 0:Q.status)||{}),Object.assign($,((ce=de.result)==null?void 0:ce.config)||{}),m.value=((O=(ve=de.result)==null?void 0:ve.plan)==null?void 0:O.version)||"",r.value=!S.value}catch(de){p.value=(de==null?void 0:de.message)||n("读取结果失败")}finally{l.value=!1}}),z=()=>B(null,null,function*(){var Z,Q;if(b.value<2){b.value++;return}b.value=3,u.value=!0,f.value=null;try{const{data:ce}=yield t.DeviceMangement.floatingGatewayV2.PLAN(A());f.value=(Z=ce.result)==null?void 0:Z.plan,m.value=((Q=f.value)==null?void 0:Q.version)||m.value}catch(ce){h.value="error",v.value=(ce==null?void 0:ce.message)||n("预检失败")}finally{u.value=!1}}),N=()=>B(null,null,function*(){var Z,Q,ce,ve,O,de,K,xe,j;c.value=!0,v.value="";try{const{data:re}=yield t.DeviceMangement.floatingGatewayV2.APPLY(A());if((Z=re.result)!=null&&Z.error||(ce=(Q=re.result)==null?void 0:Q.plan)!=null&&ce.error)throw new Error(((O=(ve=re.result)==null?void 0:ve.error)==null?void 0:O.message)||((xe=(K=(de=re.result)==null?void 0:de.plan)==null?void 0:K.error)==null?void 0:xe.message));h.value="success",v.value=(j=re.result)!=null&&j.changed?n("配置已保存,请在双端完成后验证实际持有者"):n("配置没有变化"),yield q()}catch(re){h.value="error",v.value=(re==null?void 0:re.message)||n("应用失败,原配置已恢复")}finally{c.value=!1}}),F=()=>B(null,null,function*(){var Z,Q;try{const{data:ce}=yield t.DeviceMangement.floatingGatewayV2.DRILL();g.value=((Q=(Z=ce.result)==null?void 0:Z.error)==null?void 0:Q.message)||n("演练计划已就绪")}catch(ce){g.value=(ce==null?void 0:ce.message)||n("无法生成演练计划")}});return q(),(Z,Q)=>{var ce,ve,O,de;return i(),d("div",nV,[l.value?(i(),Y(yt,{key:0,kind:"loading",title:o(n)("正在读取浮动网关状态")},null,8,["title"])):p.value?(i(),Y(yt,{key:1,kind:"error",title:o(n)("浮动网关状态不可用"),description:p.value,"action-label":o(n)("重新加载"),onAction:q},null,8,["title","description","action-label"])):k.capability==="not_installed"?(i(),d("div",aV,[e("strong",null,a(o(n)("尚未安装浮动网关组件")),1),e("span",null,a(o(n)("安装后可让两台路由器共同提供一个稳定的虚拟网关。")),1),e("button",{type:"button",onClick:Q[0]||(Q[0]=K=>Z.$emit("install"))},a(o(n)("立即安装")),1)])):(i(),d(V,{key:3},[e("div",sV,[e("div",null,[e("small",null,a(o(n)("运行状态")),1),e("strong",null,a(y.value),1)]),e("div",null,[e("small",null,a(o(n)("虚拟 IP 持有者")),1),e("strong",null,a(P.value),1)]),e("div",null,[e("small",null,a(o(n)("对端状态")),1),e("strong",null,a(_(k.peerState)),1)]),e("div",null,[e("small",null,a(o(n)("外网检测")),1),e("strong",null,a(_(k.externalState)),1)])]),S.value&&!r.value?(i(),d("section",oV,[e("div",null,[e("small",null,a(o(n)("虚拟网关 IPv4")),1),e("strong",null,a($.virtualIP||"—"),1)]),e("div",null,[e("small",null,a(o(n)("节点职责")),1),e("strong",null,a(C.value),1)]),e("div",null,[e("small",null,a(o(n)("对端节点 IPv4")),1),e("strong",null,a(w.value||"—"),1)]),e("button",{type:"button",class:"secondary",onClick:U},a(o(n)("编辑")),1)])):(i(),d(V,{key:1},[e("ol",{class:"wizard-steps","aria-label":o(n)("配置步骤")},[(i(),d(V,null,oe(3,K=>e("li",{key:K,class:_e({active:b.value===K,done:b.value>K})},[e("b",null,a(K),1),e("span",null,a(D(K)),1)],2)),64))],8,lV),b.value===1?(i(),d("section",iV,[e("label",rV,[W(e("input",{"onUpdate:modelValue":Q[1]||(Q[1]=K=>$.enabled=K),type:"checkbox"},null,512),[[gt,$.enabled]]),e("span",null,a(o(n)("启用浮动网关")),1)]),e("p",null,a(o(n)("两台节点必须配置相同的虚拟 IP,并选择互补的职责。")),1),e("div",cV,[e("label",{class:_e({selected:$.role==="preferred"})},[W(e("input",{"onUpdate:modelValue":Q[2]||(Q[2]=K=>$.role=K),type:"radio",value:"preferred"},null,512),[[Mt,$.role]]),e("strong",null,a(o(n)("优先服务节点")),1),e("small",null,a(o(n)("正常情况下提供虚拟网关")),1)],2),e("label",{class:_e({selected:$.role==="takeover"})},[W(e("input",{"onUpdate:modelValue":Q[3]||(Q[3]=K=>$.role=K),type:"radio",value:"takeover"},null,512),[[Mt,$.role]]),e("strong",null,a(o(n)("故障接管节点")),1),e("small",null,a(o(n)("优先节点不可达时接管")),1)],2)])])):b.value===2?(i(),d("section",dV,[e("label",null,[e("span",null,a(o(n)("虚拟网关 IPv4")),1),W(e("input",{"onUpdate:modelValue":Q[4]||(Q[4]=K=>$.virtualIP=K),inputmode:"decimal",placeholder:"192.168.100.3"},null,512),[[Oe,$.virtualIP,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(n)("对端节点 IPv4")),1),W(e("input",{"onUpdate:modelValue":Q[5]||(Q[5]=K=>w.value=K),inputmode:"decimal",placeholder:"192.168.100.2"},null,512),[[Oe,w.value,void 0,{trim:!0}]]),e("small",null,a(o(n)("多个地址用逗号分隔")),1)]),e("label",null,[e("span",null,a(o(n)("外网检测地址(可选)")),1),W(e("input",{"onUpdate:modelValue":Q[6]||(Q[6]=K=>$.healthURL=K),type:"url",placeholder:"https://example.com/health"},null,512),[[Oe,$.healthURL,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(n)("检测超时(秒)")),1),W(e("input",{"onUpdate:modelValue":Q[7]||(Q[7]=K=>$.healthTimeoutSec=K),type:"number",min:"1",max:"30"},null,512),[[Oe,$.healthTimeoutSec,void 0,{number:!0}]])])])):(i(),d("section",uV,[u.value?(i(),Y(yt,{key:0,kind:"loading",title:o(n)("正在预检配置")},null,8,["title"])):f.value?(i(),d(V,{key:1},[e("div",{class:_e(["review-state",f.value.error?"error":"ready"])},[e("strong",null,a(f.value.error?o(n)("预检未通过"):f.value.changed?o(n)("可以安全应用"):o(n)("配置没有变化")),1),f.value.error?(i(),d("span",vV,a(f.value.error.message),1)):T("",!0)],2),(ce=f.value.changes)!=null&&ce.length?(i(),d("ul",pV,[(i(!0),d(V,null,oe(f.value.changes,K=>(i(),d("li",{key:K},a(E(K)),1))),128))])):T("",!0),(ve=f.value.affectedDevices)!=null&&ve.length?(i(),d("p",hV,a(o(n)("已有设备使用该虚拟网关,请先迁移这些设备。"))+"("+a(f.value.affectedDevices.length)+")",1)):T("",!0),f.value.requiresDrill?(i(),d("p",mV,a(o(n)("应用后建议在维护窗口执行受控切换演练。")),1)):T("",!0)],64)):T("",!0)])),e("div",fV,[S.value&&b.value===1?(i(),d("button",{key:0,type:"button",class:"secondary",disabled:c.value,onClick:Q[8]||(Q[8]=K=>r.value=!1)},a(o(n)("取消")),9,bV)):T("",!0),b.value>1?(i(),d("button",{key:1,type:"button",class:"secondary",disabled:c.value,onClick:Q[9]||(Q[9]=K=>b.value--)},a(o(n)("上一步")),9,gV)):T("",!0),b.value<3?(i(),d("button",{key:2,type:"button",disabled:c.value,onClick:z},a(o(n)("下一步")),9,_V)):(i(),d("button",{key:3,type:"button",disabled:c.value||u.value||!!((O=f.value)!=null&&O.error)||!((de=f.value)!=null&&de.changed),onClick:N},a(c.value?o(n)("正在应用…"):o(n)("应用配置")),9,yV))])],64)),v.value?(i(),d("div",{key:2,class:_e(["feedback",h.value])},a(v.value),3)):T("",!0),$.enabled?(i(),d("details",kV,[e("summary",null,a(o(n)("故障切换演练")),1),e("p",null,a(o(n)("演练会短暂改变网关持有者,必须先完成双端配对校验。系统不会自动开始。")),1),e("button",{type:"button",class:"secondary",onClick:F},a(o(n)("查看演练计划")),1),g.value?(i(),d("p",wV,a(g.value),1)):T("",!0)])):T("",!0)],64))])}}}),CV=le($V,[["__scopeId","data-v-aec64bba"]]),SV={class:"rules-hub","aria-labelledby":"network-rules-title"},xV={class:"rules-header"},PV={id:"network-rules-title"},TV={class:"rule-toolbar"},MV=["placeholder"],EV={value:""},IV={value:"static"},DV={value:"route"},LV={value:"speed"},AV={value:"access"},NV={value:""},OV={value:"active"},zV={value:"orphaned"},qV={value:"unreachable"},RV={value:"unsupported"},VV={key:0,class:"selection-bar"},BV=["disabled"],UV={key:2,class:"rules-table-wrap"},FV=["checked","aria-label"],HV=["checked","onChange","aria-label"],GV={class:"kind-pill"},jV={key:0,class:"next-action"},WV=["onClick"],JV={key:3,class:"rule-cards"},KV={class:"rule-select"},ZV=["checked","onChange","aria-label"],YV={class:"rule-identity"},QV={class:"rule-result"},XV={class:"kind-pill"},eB={key:0,class:"next-action"},tB=["onClick"],nB=X({__name:"networkRulesHub",setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),{$gettext:n}=Ae(),l=x(!0),u=x(!1),c=x(""),r=x(""),p=x(""),v=x(""),h=x(""),g=x(""),b=x("success"),m=x([]),f=x(new Set),k=R(()=>{const z=r.value.toLowerCase();return m.value.filter(N=>(!p.value||N.kind===p.value)&&(!v.value||N.status===v.value)&&(!z||[N.displayName,N.mac,N.ip,N.summary].some(F=>String(F||"").toLowerCase().includes(z))))}),$=R(()=>k.value.length>0&&k.value.every(z=>f.value.has(z.id))),w=z=>({static:n("地址预留"),route:n("上网路线"),speed:n("设备限速"),access:n("联网权限")})[z]||z,S=z=>({active:n("正常"),orphaned:n("离线或孤立"),unreachable:n("网关不可达"),unsupported:n("需要修复")})[z]||z,C=z=>({restore_default_or_choose:n("恢复默认路线,或在设备详情中选择其他可用路线"),check_gateway_or_restore_default:n("确认网关设备已开机并接入当前局域网;仍不可达时恢复默认路线"),restore_default_or_edit:n("恢复默认路线,或编辑路线后重新应用")})[z]||n("请在设备详情中检查这条路线"),y=z=>{let N=String(z||"—");for(const[F,Z]of[["跟随网络默认",n("默认路线")],["本机路由",n("本机路由")],["旁路由",n("旁路由")],["浮动网关",n("浮动网关")],["自定义网关",n("自定义网关")]])N=N.replace(F,Z);return N},P=z=>{const N=new Set(f.value);N.has(z)?N.delete(z):N.size<128&&N.add(z),f.value=N},_=()=>{const z=new Set(f.value),N=$.value;for(const F of k.value)N?z.delete(F.id):z.size<128&&z.add(F.id);f.value=z},D=()=>B(null,null,function*(){var z,N,F;l.value=!0,c.value="";try{const{data:Z}=yield t.DeviceMangement.networkRulesV2.GET();if((z=Z.result)!=null&&z.error)throw new Error(Z.result.error.message);m.value=((N=Z.result)==null?void 0:N.rules)||[],h.value=((F=Z.result)==null?void 0:F.version)||"",f.value=new Set([...f.value].filter(Q=>m.value.some(ce=>ce.id===Q)))}catch(Z){c.value=(Z==null?void 0:Z.message)||n("读取结果失败")}finally{l.value=!1}}),E=(z,N)=>B(null,null,function*(){var Z;g.value="";const F={action:"delete",ruleIds:z,expectedVersion:h.value};try{const Q=(Z=(yield t.DeviceMangement.networkRulesV2.PLAN(F)).data.result)==null?void 0:Z.plan;if(Q!=null&&Q.error)throw new Error(Q.error.message);if(!window.confirm(`${N}
${n("影响规则")}:${Q.affectedCount}
${n("失败时将恢复")}:${Q.rollbackScope.join("、")}`))return;u.value=!0;const ce=(yield t.DeviceMangement.networkRulesV2.APPLY(F)).data.result;if(ce!=null&&ce.error)throw new Error(ce.error.message);b.value="success",g.value=n("规则已删除"),f.value=new Set,yield D()}catch(Q){b.value="error",g.value=(Q==null?void 0:Q.message)||n("删除失败,原配置已恢复")}finally{u.value=!1}}),A=()=>E([...f.value],n("确认删除所选规则?")),U=z=>z.kind==="route"&&["unreachable","unsupported"].includes(z.status),q=z=>E([z.id],n("恢复默认路线?设备重新获取地址后生效。"));return D(),(z,N)=>(i(),d("section",SV,[e("div",xV,[e("div",null,[e("h2",PV,a(o(n)("规则台账")),1),e("p",null,a(o(n)("集中检查离线、孤立或需要修复的规则;新设置请从对应设备详情进入。")),1)])]),l.value?(i(),Y(yt,{key:0,kind:"loading",title:o(n)("正在读取网络规则")},null,8,["title"])):c.value?(i(),Y(yt,{key:1,kind:"error",title:o(n)("网络规则读取失败"),description:c.value,"action-label":o(n)("重新加载"),onAction:D},null,8,["title","description","action-label"])):(i(),d(V,{key:2},[e("div",TV,[W(e("input",{"onUpdate:modelValue":N[0]||(N[0]=F=>r.value=F),type:"search",placeholder:o(n)("搜索设备、MAC、IP 或规则")},null,8,MV),[[Oe,r.value,void 0,{trim:!0}]]),W(e("select",{"onUpdate:modelValue":N[1]||(N[1]=F=>p.value=F)},[e("option",EV,a(o(n)("全部类型")),1),e("option",IV,a(o(n)("地址预留")),1),e("option",DV,a(o(n)("上网路线")),1),e("option",LV,a(o(n)("设备限速")),1),e("option",AV,a(o(n)("联网权限")),1)],512),[[Be,p.value]]),W(e("select",{"onUpdate:modelValue":N[2]||(N[2]=F=>v.value=F)},[e("option",NV,a(o(n)("全部状态")),1),e("option",OV,a(o(n)("正常")),1),e("option",zV,a(o(n)("离线或孤立")),1),e("option",qV,a(o(n)("网关不可达")),1),e("option",RV,a(o(n)("需要修复")),1)],512),[[Be,v.value]])]),f.value.size?(i(),d("div",VV,[e("span",null,a(o(n)("已选择"))+" "+a(f.value.size)+" / 128",1),e("button",{type:"button",class:"danger",disabled:u.value,onClick:A},a(u.value?o(n)("正在应用…"):o(n)("删除所选规则")),9,BV)])):T("",!0),k.value.length?(i(),d("div",UV,[e("table",null,[e("thead",null,[e("tr",null,[e("th",null,[e("input",{type:"checkbox",checked:$.value,onChange:_,"aria-label":o(n)("选择当前结果")},null,40,FV)]),e("th",null,a(o(n)("设备")),1),e("th",null,a(o(n)("规则类型")),1),e("th",null,a(o(n)("最终设置")),1),e("th",null,a(o(n)("状态")),1)])]),e("tbody",null,[(i(!0),d(V,null,oe(k.value,F=>(i(),d("tr",{key:F.id,class:_e({orphaned:F.orphaned})},[e("td",null,[e("input",{type:"checkbox",checked:f.value.has(F.id),onChange:Z=>P(F.id),"aria-label":`${o(n)("选择")} ${F.displayName}`},null,40,HV)]),e("td",null,[e("strong",null,a(F.displayName||o(n)("未命名设备")),1),e("small",null,a(F.mac||F.ip||"—"),1)]),e("td",null,[e("span",GV,a(w(F.kind)),1)]),e("td",null,[ue(a(y(F.summary)),1),F.nextAction?(i(),d("small",jV,a(C(F.nextAction)),1)):T("",!0)]),e("td",null,[e("span",{class:_e(["state-pill",F.status])},a(S(F.status)),3),U(F)?(i(),d("button",{key:0,type:"button",class:"repair",onClick:Z=>q(F)},a(o(n)("恢复默认路线")),9,WV)):T("",!0)])],2))),128))])])])):(i(),Y(yt,{key:1,kind:"empty",title:o(n)("没有匹配的网络规则"),description:o(n)("可从设备详情添加地址、路线和使用限制。")},null,8,["title","description"])),k.value.length?(i(),d("div",JV,[(i(!0),d(V,null,oe(k.value,F=>(i(),d("article",{key:`card-${F.id}`,class:_e({orphaned:F.orphaned})},[e("label",KV,[e("input",{type:"checkbox",checked:f.value.has(F.id),onChange:Z=>P(F.id),"aria-label":`${o(n)("选择")} ${F.displayName}`},null,40,ZV)]),e("div",YV,[e("strong",null,a(F.displayName||o(n)("未命名设备")),1),e("small",null,a(F.mac||F.ip||"—"),1)]),e("span",{class:_e(["state-pill",F.status])},a(S(F.status)),3),e("div",QV,[e("span",XV,a(w(F.kind)),1),e("span",null,a(y(F.summary)),1)]),F.nextAction?(i(),d("p",eB,a(C(F.nextAction)),1)):T("",!0),U(F)?(i(),d("button",{key:1,type:"button",class:"repair",onClick:Z=>q(F)},a(o(n)("恢复默认路线")),9,tB)):T("",!0)],2))),128))])):T("",!0),g.value?(i(),d("p",{key:4,class:_e(["feedback",b.value])},a(g.value),3)):T("",!0)],64))]))}}),aB=le(nB,[["__scopeId","data-v-c463c3c8"]]),sB=new Set(["available","disabled","not_installed","unsupported","error"]),oB={internetAccess:"internet_access",speedLimit:"device_speed_limit",floatGateway:"floating_gateway",trafficInsights:"traffic_insights"},So=(s,t)=>{var l,u,c,r;const n=(r=(u=(l=s==null?void 0:s.capabilities)==null?void 0:l.items)==null?void 0:u[oB[t]])!=null?r:(c=s==null?void 0:s.capabilities)==null?void 0:c[t];return n!=null&&n.state?sB.has(n.state)?n:{state:"error",reason:"capability_state_unknown"}:{state:"error",reason:"capability_missing"}},ha=s=>!!s&&typeof s=="object"&&!Array.isArray(s),Wi=s=>ha(s)&&!s.error&&(s.success===void 0||s.success===0),lB=s=>{if(!Wi(s))return;const t=s.result;if(!ha(t)||t.error||typeof t.editable!="boolean")return;const n=t.settings;if(!(!ha(n)||typeof n.enabled!="boolean"||!["poolStart","poolEnd","leaseTime","defaultTargetId"].every(l=>typeof n[l]=="string")))return t},Wl=s=>{var u,c,r,p;if(!Wi(s))throw new Error("invalid_service_snapshot");const t=s.result,n=t==null?void 0:t.speedLimit,l=(p=(c=(u=t==null?void 0:t.capabilities)==null?void 0:u.items)==null?void 0:c.device_speed_limit)!=null?p:(r=t==null?void 0:t.capabilities)==null?void 0:r.speedLimit;if(!ha(t)||!ha(n)||typeof n.provider!="string"||!Array.isArray(n.providers)||!n.providers.every(v=>ha(v)&&typeof v.id=="string"&&typeof v.available=="boolean"&&typeof v.installed=="boolean")||!ha(l)||!["available","disabled","not_installed","unsupported","error"].includes(l.state))throw new Error("invalid_service_snapshot");return{speedLimit:n,capability:l}},iB=["aria-label"],rB={class:"context-state"},cB={key:0,class:"migration-card","aria-labelledby":"migration-title"},dB={class:"migration-heading"},uB={id:"migration-title"},vB={class:"migration-body"},pB={key:0,class:"migration-more"},hB={key:1,class:"migration-warning"},mB={class:"migration-actions"},fB=["disabled"],bB={key:1,class:"migration-read-error",role:"status"},gB={class:"settings-navigation"},_B=["aria-label"],yB=["onClick"],kB=["disabled"],wB={key:2,class:"settings-stack"},$B={class:"setting-card dhcp-card"},CB={class:"card-heading"},SB={key:0},xB={key:0,class:"switch-line"},PB=["disabled"],TB={key:1,class:"context-state"},MB={key:0,class:"local-config-summary"},EB={class:"config-address"},IB={key:1,class:"setting-hint config-origin"},DB=["aria-expanded"],LB=["disabled"],AB={class:"two-columns"},NB=["placeholder"],OB=["placeholder"],zB=["placeholder"],qB=["value"],RB=["disabled"],VB={key:2,class:"impact-preview","aria-live":"polite"},BB={key:0},UB={key:1},FB={key:2},HB={key:3,class:"field-error"},GB={class:"preview-actions"},jB=["disabled"],WB=["aria-busy"],JB={class:"card-heading"},KB={class:"current-speed-provider"},ZB={class:"speed-component-entry"},YB=["disabled"],QB={key:0,class:"capability-action",role:"status"},XB={class:"switch-line"},eU={key:0,class:"two-columns"},tU={class:"setting-hint"},nU={key:1,class:"service-ready"},aU={key:2,class:"setting-hint"},sU=["disabled"],oU={key:2,class:"impact-preview","aria-live":"polite"},lU={key:0,class:"field-error"},iU={class:"preview-actions"},rU=["disabled"],cU={class:"speed-check-actions"},dU=["disabled"],uU=["open"],vU=["value","disabled"],pU={key:0,class:"legacy-migration","aria-labelledby":"rate-migration-title"},hU={id:"rate-migration-title"},mU=["disabled"],fU={key:0,class:"migration-review","aria-live":"polite"},bU={key:0,class:"field-error"},gU={key:1,class:"checkbox-line"},_U={class:"preview-actions"},yU=["disabled"],kU=["disabled"],wU={key:3,class:"settings-stack"},$U={class:"setting-card"},CU={class:"card-heading"},SU=["disabled"],xU={key:0,class:"state-message"},PU=["placeholder"],TU={value:"bypass"},MU={value:"custom"},EU=["disabled"],IU={key:2,class:"route-list"},DU={class:"route-actions"},LU=["disabled","onClick"],AU=["disabled","onClick"],NU={key:4,class:"impact-preview","aria-live":"polite"},OU={key:0},zU={key:1},qU={key:2},RU={key:3},VU={value:""},BU=["value"],UU={key:4,class:"field-error"},FU={class:"preview-actions"},HU=["disabled"],GU={class:"setting-card"},jU={class:"card-heading"},WU=["disabled"],JU={key:0,class:"capability-action"},Jl="quickstart.lan-settings-draft.v1",KU=X({__name:"lanSettingsPanel",setup(s){const t=Ne(ye({},we),{DeviceMangement:xn()}),{$gettext:n}=Ae(),l=n("启用设备限速"),u=(()=>{try{return JSON.parse(sessionStorage.getItem(Jl)||"{}")}catch(ee){return{}}})(),c=x(!0),r=x(""),p=x(""),v=x(!1),h=x(!1),g=x(""),b=x("success"),m=x(!1),f=x(),k=ee=>{f.value=ee,m.value=!0},$=x(["services","routes","rules"].includes(u.section)?u.section:"services"),w=x(),S=x({}),C=x({state:"error"}),y=x({state:"error"}),P=x(),_=x(!1),D=x(),E=x(!1),A=x(""),U=x(!1),q=Xe({enabled:!0,poolStart:"",poolEnd:"",leaseTime:"12h",defaultTargetId:"self"}),z=Xe({enabled:!1,upload:100,download:1e3,provider:""}),N=x(),F=x(),Z=x(),Q=x(!1),ce=x(!1),ve=x(),O=x(!1),de=x(""),K=x(!0);let xe,j=0,re;const $e=()=>{j++,xe==null||xe.abort(),window.clearTimeout(re),xe=void 0,re=void 0,O.value=!1};ga($e);const qe=x(!!u.routeEditor),De=Xe({targetId:"",name:u.routeName||"",kind:u.routeKind==="custom"?"custom":"bypass",gateway:u.routeGateway||""}),Ke=x([]),at=x(),st=x(),et=x(""),Ze=R(()=>[{id:"services",label:n("网络服务")},{id:"routes",label:n("上网路线")},{id:"rules",label:n("规则台账")}]),it=R(()=>{var ee;return!!((ee=N.value)!=null&&ee.editable&&N.value.settings)}),he=R(()=>Ke.value.filter(ee=>ee.kind==="bypass"||ee.kind==="custom")),H=R(()=>{var ee,se;return Array.isArray((se=(ee=S.value)==null?void 0:ee.speedLimit)==null?void 0:se.providers)?S.value.speedLimit.providers:[]}),J=R(()=>H.value.filter(ee=>ee.id!=="bandix"||z.provider==="bandix")),ge=R(()=>H.value.find(ee=>ee.id===z.provider)),ze=R(()=>H.value.find(ee=>ee.id==="bandix")),Fe=R(()=>{var ee,se;return((se=(ee=S.value)==null?void 0:ee.speedLimit)==null?void 0:se.provider)||""}),Ee=R(()=>{var ee;return!!((ee=ge.value)!=null&&ee.available)}),dt=R(()=>H.value.find(ee=>ee.id==="quickstart-native")),tt=ee=>({"quickstart-native":n("智能设备限速(推荐)"),bandix:n("现有 Bandix(仅用于迁移)"),eqos:n("兼容模式(按 IPv4)")})[ee]||ee,kt=ee=>({dependency_not_installed:n("未安装"),kernel_not_supported:n("系统内核不支持"),engine_unavailable:n("服务未运行"),interface_not_supported:n("版本不兼容")})[ee]||n("当前不可用"),ct=R(()=>C.value.reason==="selected_provider_unavailable"?n("已安装限速服务,但当前执行方式不可用。"):z.provider==="quickstart-native"?n("Quickstart 限速服务未就绪。请安装或启动服务后重新检查;系统不会自动改用其他方式。"):n("当前执行方式不可用,请先安装或启用对应服务。")),Tt=R(()=>z.provider==="quickstart-native"?n("按设备身份同时覆盖 IPv4 与 IPv6,并验证规则是否真正生效。"):z.provider==="bandix"?n("仅用于查看和迁移现有规则,不再作为新规则的默认执行方式。"):n("资源占用较低,按固定 IPv4 执行。")),ut=R(()=>{var ee,se;return!!((se=(ee=w.value)==null?void 0:ee.routeEditability)!=null&&se.editable)}),St=R(()=>{var ee,se;return((se=(ee=at.value)==null?void 0:ee.error)==null?void 0:se.code)==="replacement_required"}),ht=R(()=>Ke.value.filter(ee=>{var se,fe;return ee.supported&&ee.id!==((fe=(se=at.value)==null?void 0:se.target)==null?void 0:fe.id)})),xt=R(()=>{var ee;return{local:n("本机负责局域网地址分配"),external_observed:n("检测到其他设备负责地址分配"),none_detected:n("尚未检测到地址分配服务"),ambiguous:n("局域网角色需要确认"),error:n("暂时无法判断局域网角色")}[(ee=w.value)==null?void 0:ee.dhcpAuthority]||n("局域网角色待确认")}),en=R(()=>{var ee,se,fe,mt;return(se=(ee=w.value)==null?void 0:ee.routeEditability)!=null&&se.editable?n("可在设备详情中设置上网路线。"):{local_dhcp_unhealthy:n("当前无法读取地址分配状态,其他设置仍可使用。"),multiple_dhcp_evidence:n("局域网角色需要确认"),external_dhcp_authority:n("检测到其他设备负责地址分配,请在负责地址分配的路由器上管理相关设置。"),multiple_external_dhcp_servers:n("局域网角色需要确认"),dhcp_authority_not_detected:n("当前仅提供查看与引导,不会自动修改其他设备。"),router_context_unavailable:n("暂时无法判断局域网角色")}[(mt=(fe=w.value)==null?void 0:fe.routeEditability)==null?void 0:mt.reason]||n("当前仅提供查看与引导,不会自动修改其他设备。")}),qt=R(()=>[it.value?n("地址配置可编辑"):n("地址配置只读"),ut.value?n("路线可编辑"):n("路线只读"),n("其他服务按各自权限管理")].join(" · ")),Ft=ee=>({bypass:n("旁路由"),custom:n("指定网关")})[ee]||n("自定义路线"),Ht=ee=>({router:n("路由器地址"),floating_gateway:n("浮动网关"),gateway_node:n("网关节点"),address_reservation:n("固定地址")})[ee]||n("受保护地址"),ke=ee=>({available:n("可用"),disabled:n("未启用"),not_installed:n("未安装"),unsupported:n("不支持"),error:n("需要检查")})[ee]||n("未知"),Se=ee=>({alias:n("设备资料"),hostname:n("局域网主机名"),static:n("地址预留"),route:n("上网路线"),speed:n("设备限速"),access:n("联网权限"),floating_gateway:n("浮动网关")})[ee]||n("设备规则"),ae=ee=>({adopt:n("可以接管"),normalize:n("将安全整理"),conflict:n("存在冲突"),unresolved:n("需要确认")})[ee]||n("需要确认"),He=ee=>ee.kind==="default"||ee.name==="跟随网络默认"?n("默认路线"):ee.kind==="self"?n("本机路由"):ee.kind==="bypass"&&ee.name==="旁路由"?n("旁路由"):ee.kind==="floating"&&ee.name==="浮动网关"?n("浮动网关"):ee.name==="自定义网关"?n("自定义网关"):ee.name,Re=ee=>{if(!ee)return"—";for(const[se,fe]of[["本机路由",n("本机路由")],["旁路由",n("旁路由")],["浮动网关",n("浮动网关")],["自定义网关",n("自定义网关")]])if(ee===se||ee.startsWith(`${se} ·`))return ee.replace(se,fe);return ee};We([$,qe,()=>De.name,()=>De.kind,()=>De.gateway],()=>sessionStorage.setItem(Jl,JSON.stringify({section:$.value,routeEditor:qe.value,routeName:De.name,routeKind:De.kind,routeGateway:De.gateway})));const Et=()=>B(null,null,function*(){var ee,se,fe,mt,vn,_n,la,Pn,ia,Ce,Tn,ds,pn,$a,Ba,jn;$e(),c.value=!0,r.value="";try{const[hn,sn,us,ra,nn]=yield Promise.all([t.DeviceMangement.routerContextV2.GET(),t.DeviceMangement.globalConfigs.GET().catch(()=>{}),t.DeviceMangement.gatewayTargetsV2.GET(),t.DeviceMangement.lanDhcpSettingsV2.GET().catch(()=>{}),t.DeviceMangement.lanDeviceMigrationV2.PLAN().catch(()=>{})]);w.value=(ee=hn.data)==null?void 0:ee.result,S.value=((se=sn==null?void 0:sn.data)==null?void 0:se.result)||{},Ke.value=((mt=(fe=us.data)==null?void 0:fe.result)==null?void 0:mt.targets)||[],N.value=lB(ra==null?void 0:ra.data),P.value=(_n=(vn=nn==null?void 0:nn.data)==null?void 0:vn.result)==null?void 0:_n.plan,_.value=!nn,C.value=So(S.value,"speedLimit"),y.value=So(S.value,"floatGateway"),(la=N.value)!=null&&la.settings&&Object.assign(q,N.value.settings),z.enabled=!!((ia=(Pn=S.value)==null?void 0:Pn.speedLimit)!=null&&ia.enabled),z.upload=((Tn=(Ce=S.value)==null?void 0:Ce.speedLimit)==null?void 0:Tn.uploadSpeed)||100,z.download=((pn=(ds=S.value)==null?void 0:ds.speedLimit)==null?void 0:pn.downloadSpeed)||1e3,z.provider=((Ba=($a=S.value)==null?void 0:$a.speedLimit)==null?void 0:Ba.provider)||((jn=H.value.find(Mn=>Mn.available))==null?void 0:jn.id)||"";try{Wl(sn==null?void 0:sn.data),K.value=!0,de.value=""}catch(Mn){K.value=!1,de.value=n("检查失败,状态未更新。请重试,草稿已保留。")}}catch(hn){r.value=(hn==null?void 0:hn.message)||n("读取结果失败")}finally{c.value=!1}}),Pt=ee=>{ce.value=ee.target.open},Ot=()=>B(null,null,function*(){var ee,se;ce.value=!0,yield ot(),(ee=ve.value)==null||ee.focus({preventScroll:!0}),(se=ve.value)==null||se.scrollIntoView({block:"nearest"})}),_t=()=>B(null,null,function*(){if(O.value||p.value||v.value||U.value)return;const ee=++j,se=new AbortController;xe=se,O.value=!0,de.value="";let fe=!1;const mt=window.setTimeout(()=>{fe=!0,se.abort()},1e4);re=mt;try{const vn=yield t.DeviceMangement.globalConfigs.GET(se.signal);if(ee!==j)return;if(se.signal.aborted)throw new Error("aborted_service_check");const _n=Wl(vn.data);S.value=Ne(ye(ye({},S.value),vn.data.result),{speedLimit:_n.speedLimit}),y.value=So(S.value,"floatGateway"),C.value=_n.capability,K.value=!0}catch(vn){if(ee!==j)return;K.value=!1,de.value=n(fe?"检查超时,请重试。草稿已保留。":"检查失败,状态未更新。请重试,草稿已保留。")}finally{window.clearTimeout(mt),ee===j&&(O.value=!1,xe=void 0,re=void 0)}}),dn=()=>{F.value=void 0},Gt=(ee=!1)=>B(null,null,function*(){var se;p.value="dhcp-plan",g.value="";try{const fe=(se=(yield t.DeviceMangement.lanDhcpSettingsV2.PLAN({settings:ye({},q),confirmDisable:ee,idempotencyKey:`lan-dhcp-${Date.now().toString(36)}`})).data)==null?void 0:se.result;F.value=fe,fe!=null&&fe.error&&fe.error.code!=="confirmation_required"&&(b.value="error",g.value=fe.error.message)}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.message)||n("无法预览地址分配设置")}finally{p.value=""}}),un=()=>Gt(!1),wt=()=>Gt(!0),sa=()=>B(null,null,function*(){var ee,se;if((ee=F.value)!=null&&ee.canApply){p.value="dhcp-apply",g.value="";try{const fe=(se=(yield t.DeviceMangement.lanDhcpSettingsV2.APPLY({settings:ye({},q),confirmDisable:!q.enabled,expectedVersion:F.value.version,idempotencyKey:`lan-dhcp-${F.value.version}`})).data)==null?void 0:se.result;if(fe!=null&&fe.error)throw new Error(fe.error.message);b.value="success",g.value=fe.changed?n("地址分配设置已保存"):n("设置没有变化"),dn(),yield Et()}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.message)||n("应用失败,原设置已恢复")}finally{p.value=""}}}),tn=()=>({enabled:z.provider==="eqos"?z.enabled:!0,uploadSpeed:z.upload,downloadSpeed:z.download,provider:z.provider}),Zt=()=>B(null,null,function*(){var ee;if(!(z.enabled&&(!z.upload||!z.download))){p.value="speed-plan",g.value="";try{const se=(ee=(yield t.DeviceMangement.rateLimitSettingsV2.PLAN({settings:tn(),idempotencyKey:`rate-limit-${Date.now().toString(36)}`})).data)==null?void 0:ee.result;Z.value=se,se!=null&&se.error&&(b.value="error",g.value=se.error.message)}catch(se){b.value="error",g.value=(se==null?void 0:se.message)||n("无法预览限速服务设置")}finally{p.value=""}}}),be=()=>B(null,null,function*(){var ee,se;if((ee=Z.value)!=null&&ee.canApply){p.value="speed-apply",g.value="";try{const fe=(se=(yield t.DeviceMangement.rateLimitSettingsV2.APPLY({settings:tn(),expectedVersion:Z.value.version,idempotencyKey:`rate-limit-${Z.value.version}`})).data)==null?void 0:se.result;if(fe!=null&&fe.error)throw Object.assign(new Error(fe.error.message),{code:fe.error.code});b.value="success",g.value=fe!=null&&fe.changed?n("限速服务设置已应用"):n("设置没有变化"),Z.value=void 0,yield Et()}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.code)==="rolled_back"?n("应用失败,原设置已恢复"):(fe==null?void 0:fe.message)||n("应用失败,原设置已恢复")}finally{p.value=""}}}),Te=ee=>`${Math.round((ee.uploadBitsPerSecond||0)/1e6)} ↑ · ${Math.round((ee.downloadBitsPerSecond||0)/1e6)} ↓ Mbit/s`,ie=ee=>({convert:n("可以迁移"),unsupported:n("不支持"),conflict:n("存在冲突")})[ee.disposition]||n("需要确认"),Ye=()=>B(null,null,function*(){var ee;U.value=!0,g.value="",E.value=!1;try{const se=(ee=(yield t.DeviceMangement.rateLimitMigrationV2.PLAN()).data)==null?void 0:ee.result;if(se!=null&&se.error)throw new Error(se.error.message);D.value=se==null?void 0:se.plan}catch(se){b.value="error",g.value=(se==null?void 0:se.message)||n("无法扫描现有规则")}finally{U.value=!1}}),je=()=>B(null,null,function*(){var ee,se;if(!(!((ee=D.value)!=null&&ee.canApply)||!E.value)){U.value=!0,g.value="";try{const fe=(se=(yield t.DeviceMangement.rateLimitMigrationV2.APPLY({expectedVersion:D.value.version,plan:D.value})).data)==null?void 0:se.result;if(fe!=null&&fe.error)throw Object.assign(new Error(fe.error.message),{code:fe.error.code});A.value=(fe==null?void 0:fe.migrationId)||"",b.value="success",g.value=n("规则已写入并验证,执行方式已切换"),yield Et()}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.code)==="target_unavailable"?n("请先手动停止 Bandix,并启动 Quickstart 限速服务后重试。"):(fe==null?void 0:fe.message)||n("迁移失败,原设置已保留")}finally{U.value=!1}}}),vt=()=>B(null,null,function*(){var ee;if(A.value){U.value=!0,g.value="";try{const se=(ee=(yield t.DeviceMangement.rateLimitMigrationV2.ROLLBACK({migrationId:A.value})).data)==null?void 0:ee.result;if(se!=null&&se.error)throw new Error(se.error.message);b.value="success",g.value=n("已恢复迁移前设置"),A.value="",D.value=void 0,yield Et()}catch(se){b.value="error",g.value=(se==null?void 0:se.message)||n("恢复失败,请按提示处理")}finally{U.value=!1}}}),bn=()=>{qe.value=!1,De.targetId="",De.name="",De.kind="bypass",De.gateway=""},gn=()=>{at.value=void 0,st.value=void 0,et.value=""},ka=()=>{if(gn(),qe.value){bn();return}qe.value=!0,De.targetId="",De.name="",De.kind="bypass",De.gateway=""},Rt=ee=>{gn(),qe.value=!0,De.targetId=ee.id,De.name=ee.name,De.kind=ee.kind==="custom"?"custom":"bypass",De.gateway=ee.gateway||""},oa=ee=>B(null,null,function*(){var se,fe;p.value="route-plan",g.value="";try{const mt=(se=(yield t.DeviceMangement.gatewayTargetV2.PLAN(ee)).data)==null?void 0:se.result;at.value=mt,st.value=ee,((fe=mt==null?void 0:mt.error)==null?void 0:fe.code)!=="replacement_required"&&(mt!=null&&mt.error)&&(g.value=mt.error.message)}catch(mt){b.value="error",g.value=(mt==null?void 0:mt.message)||n("无法预览这次修改")}finally{p.value=""}}),Gn=()=>B(null,null,function*(){return oa({action:De.targetId?"update":"create",targetId:De.targetId||void 0,name:De.name,kind:De.kind,gateway:De.gateway,idempotencyKey:`route-${Date.now().toString(36)}`})}),wa=ee=>B(null,null,function*(){bn(),et.value="",yield oa({action:"delete",targetId:ee.id,idempotencyKey:`route-delete-${Date.now().toString(36)}`})}),Va=()=>B(null,null,function*(){!st.value||!et.value||(yield oa(Ne(ye({},st.value),{replacementTargetId:et.value})))}),cs=()=>B(null,null,function*(){var ee,se;if(!(!((ee=at.value)!=null&&ee.canApply)||!st.value)){p.value="route-apply",g.value="";try{const fe=(se=(yield t.DeviceMangement.gatewayTargetV2.APPLY(Ne(ye({},st.value),{expectedVersion:at.value.version}))).data)==null?void 0:se.result;if(fe!=null&&fe.error)throw new Error(fe.error.message);b.value="success",g.value=fe!=null&&fe.changed?n("上网路线已更新"):n("上网路线没有变化"),gn(),bn(),yield Et()}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.message)||n("应用失败,原设置已保留")}finally{p.value=""}}}),eo=()=>B(null,null,function*(){var ee,se;if(!(!((ee=P.value)!=null&&ee.canApply)||!window.confirm(n("确认接管现有设置?接管前会创建快照,失败时自动恢复。")))){h.value=!0,g.value="";try{const fe=(se=(yield t.DeviceMangement.lanDeviceMigrationV2.APPLY({expectedVersion:P.value.version})).data)==null?void 0:se.result;if(fe!=null&&fe.error)throw Object.assign(new Error(fe.error.message),{code:fe.error.code});b.value="success",g.value=fe!=null&&fe.changed?n("现有设置已安全接管"):n("现有设置无需重复接管"),yield Et()}catch(fe){b.value="error",g.value=(fe==null?void 0:fe.code)==="rolled_back"?n("接管失败,原设置已恢复,可以重试"):(fe==null?void 0:fe.code)==="recovery_required"?n("自动恢复未完成,请按提示处理"):(fe==null?void 0:fe.message)||n("接管失败,原设置已保留")}finally{h.value=!1}}}),to=ee=>B(null,null,function*(){if(ee==="floatip"){$.value="routes";return}$.value="services",yield _t();const se=H.value.find(fe=>fe.id===ee);!(se!=null&&se.available)||!K.value||(ee!==Fe.value&&(z.provider=ee,yield Zt()),yield Ot())});return Et(),(ee,se)=>{var fe,mt,vn,_n,la,Pn,ia;return i(),d("section",{class:"lan-settings","aria-label":o(n)("局域网设置")},[c.value||r.value?(i(),d("button",{key:0,type:"button",class:"components-fallback",onClick:se[0]||(se[0]=Ce=>k()),"data-open-components":""},[G(Qe,{name:"layers"}),ue(a(o(n)("功能组件")),1)])):T("",!0),c.value?(i(),Y(yt,{key:1,kind:"loading",title:o(n)("正在读取局域网设置")},null,8,["title"])):r.value?(i(),Y(yt,{key:2,kind:"error",title:o(n)("局域网设置读取失败"),description:r.value,"action-label":o(n)("重新加载"),onAction:Et},null,8,["title","description","action-label"])):(i(),d(V,{key:3},[e("article",{class:_e(["context-card",(fe=w.value)==null?void 0:fe.topologyPosition])},[e("div",null,[e("strong",null,a(xt.value),1),e("span",null,a(qt.value),1)]),e("span",rB,a(o(n)("权限说明")),1)],2),P.value&&!P.value.alreadyApplied&&((mt=P.value.items)!=null&&mt.length)?(i(),d("details",cB,[e("summary",dB,[e("div",null,[e("h3",uB,a(o(n)("发现现有设备设置")),1),e("p",null,a(o(n)("先预览并接管现有设置,之后只使用当前设备管理界面维护。")),1)]),e("strong",null,a(P.value.items.length)+" "+a(o(n)("项")),1)]),e("div",vB,[e("ul",null,[(i(!0),d(V,null,oe(P.value.items.slice(0,5),Ce=>(i(),d("li",{key:Ce.id},[e("span",null,a(Se(Ce.kind)),1),e("b",null,a(Re(Ce.summary)),1),e("em",{class:_e(Ce.disposition)},a(ae(Ce.disposition)),3)]))),128))]),P.value.items.length>5?(i(),d("p",pB,a(o(n)("其余设置会在同一次安全接管中处理。")),1)):T("",!0),P.value.canApply?T("",!0):(i(),d("p",hB,a(o(n)("发现冲突或无法识别的设置,当前不会写入任何配置。请先在规则台账中处理。")),1)),e("div",mB,[e("button",{type:"button",onClick:se[1]||(se[1]=Ce=>$.value="rules")},a(o(n)("查看规则台账")),1),e("button",{class:"primary",type:"button",disabled:!P.value.canApply||h.value,onClick:eo},a(h.value?o(n)("正在接管…"):o(n)("确认接管现有设置")),9,fB)])])])):_.value?(i(),d("p",bB,a(o(n)("暂时无法检查现有设置,不影响其他局域网设置。")),1)):T("",!0),e("div",gB,[e("nav",{class:"settings-nav","aria-label":o(n)("设置区域")},[(i(!0),d(V,null,oe(Ze.value,Ce=>(i(),d("button",{key:Ce.id,type:"button",class:_e({active:$.value===Ce.id}),onClick:Tn=>$.value=Ce.id},a(Ce.label),11,yB))),128))],8,_B),e("button",{type:"button",class:"components-entry",disabled:!!p.value||O.value,onClick:se[2]||(se[2]=Ce=>k()),"data-open-components":""},[G(Qe,{name:"layers"}),ue(a(o(n)("功能组件")),1)],8,kB)]),$.value==="services"?(i(),d("div",wB,[e("article",$B,[e("div",CB,[e("div",null,[e("h3",null,[G(Qe,{name:"network"}),ue(a(o(n)("地址分配服务")),1)]),it.value?(i(),d("p",SB,a(o(n)("由本机为局域网设备分配地址。关闭后,设备应由其他路由器分配地址。")),1)):T("",!0)]),it.value?(i(),d("label",xB,[W(e("input",{"onUpdate:modelValue":se[3]||(se[3]=Ce=>q.enabled=Ce),type:"checkbox",disabled:!it.value},null,8,PB),[[gt,q.enabled]]),ue(a(q.enabled?o(n)("已开启"):o(n)("已关闭")),1)])):(i(),d("span",TB,a(o(n)("配置只读")),1))]),N.value?(i(),d(V,{key:0},[it.value?T("",!0):(i(),d("dl",MB,[e("div",null,[e("dt",null,a(o(n)("本机配置")),1),e("dd",null,a(N.value.settings.enabled?o(n)("已开启"):o(n)("已关闭")),1)]),e("div",null,[e("dt",null,a(o(n)("地址池")),1),e("dd",EB,a(N.value.settings.poolStart||"—")+" – "+a(N.value.settings.poolEnd||"—"),1)]),e("div",null,[e("dt",null,a(o(n)("地址租期")),1),e("dd",null,a(N.value.settings.leaseTime||"—"),1)])])),it.value?T("",!0):(i(),d("p",IB,a(o(n)("以下为本机保存的配置,不代表其他路由器当前生效的配置。")),1)),it.value?T("",!0):(i(),d("button",{key:2,class:"config-disclosure",type:"button","aria-expanded":Q.value,"aria-controls":"lan-local-config",onClick:se[4]||(se[4]=Ce=>Q.value=!Q.value)},[G(Qe,{name:"arrow"}),ue(a(o(n)("查看本机配置")),1)],8,DB)),it.value||Q.value?(i(),d("fieldset",{key:3,id:"lan-local-config",disabled:!it.value},[e("div",AB,[e("label",null,[e("span",null,a(o(n)("地址池起始地址")),1),W(e("input",{"onUpdate:modelValue":se[5]||(se[5]=Ce=>q.poolStart=Ce),inputmode:"decimal",placeholder:it.value?"192.168.1.100":"—"},null,8,NB),[[Oe,q.poolStart,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(n)("地址池结束地址")),1),W(e("input",{"onUpdate:modelValue":se[6]||(se[6]=Ce=>q.poolEnd=Ce),inputmode:"decimal",placeholder:it.value?"192.168.1.249":"—"},null,8,OB),[[Oe,q.poolEnd,void 0,{trim:!0}]])])]),e("label",null,[e("span",null,a(o(n)("地址租期")),1),W(e("input",{"onUpdate:modelValue":se[7]||(se[7]=Ce=>q.leaseTime=Ce),placeholder:it.value?"12h":"—"},null,8,zB),[[Oe,q.leaseTime,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(n)("默认上网路线")),1),W(e("select",{"onUpdate:modelValue":se[8]||(se[8]=Ce=>q.defaultTargetId=Ce)},[(i(!0),d(V,null,oe(Ke.value.filter(Ce=>Ce.supported&&Ce.id!=="default"&&Ce.gateway),Ce=>(i(),d("option",{key:Ce.id,value:Ce.id},a(He(Ce))+a(Ce.gateway?` · ${Ce.gateway}`:""),9,qB))),128))],512),[[Be,q.defaultTargetId]])])],8,LB)):T("",!0),it.value?(i(),d("button",{key:4,class:"primary",type:"button",disabled:!it.value||p.value==="dhcp-plan",onClick:un},a(p.value==="dhcp-plan"?o(n)("正在检查…"):o(n)("预览地址分配设置")),9,RB)):T("",!0)],64)):(i(),Y(yt,{key:1,kind:"unavailable",title:o(n)("本机配置暂不可用"),description:o(n)("未能读取可靠的地址分配配置,其他服务仍可使用。")},null,8,["title","description"])),F.value?(i(),d("section",VB,[e("h4",null,a(o(n)("地址分配影响")),1),q.enabled?T("",!0):(i(),d("p",BB,a(o(n)("关闭后预计影响设备"))+":"+a(F.value.affectedDevices),1)),F.value.recoveryGuidance?(i(),d("p",UB,a(o(n)("恢复路径"))+":"+a(o(n)("通过路由器局域网地址重新进入,并重新开启地址分配;或先确认外部 DHCP 已就绪。")),1)):T("",!0),F.value.conflicts.length?(i(),d("ul",FB,[(i(!0),d(V,null,oe(F.value.conflicts,Ce=>(i(),d("li",{key:`${Ce.kind}:${Ce.address}`},a(Ce.address)+" · "+a(Ht(Ce.kind)),1))),128))])):T("",!0),F.value.error&&F.value.error.code!=="confirmation_required"?(i(),d("p",HB,a(F.value.error.message),1)):T("",!0),e("div",GB,[e("button",{type:"button",onClick:dn},a(o(n)("取消")),1),((vn=F.value.error)==null?void 0:vn.code)==="confirmation_required"?(i(),d("button",{key:0,class:"danger-link",type:"button",onClick:wt},a(o(n)("我已了解影响,继续")),1)):(i(),d("button",{key:1,class:"primary",type:"button",disabled:!F.value.canApply||p.value==="dhcp-apply",onClick:sa},a(p.value==="dhcp-apply"?o(n)("正在应用…"):o(n)("确认应用")),9,jB))])])):T("",!0)]),e("article",{class:"setting-card speed-card","aria-busy":O.value},[e("div",JB,[e("div",null,[e("h3",null,[G(Qe,{name:"activity"}),ue(a(o(n)("设备限速服务")),1)]),e("p",null,a(o(n)("为设备设置最高上传和下载速度;联网权限不依赖此服务。")),1)]),e("span",{class:_e(["capability-pill",K.value?C.value.state:"error"])},a(K.value?ke(C.value.state):o(n)("状态未更新")),3)]),e("p",KB,a(o(n)("当前方式"))+":"+a(tt(Fe.value)),1),e("div",ZB,[e("span",null,a(o(n)("智能设备限速(推荐)"))+" · "+a((_n=dt.value)!=null&&_n.available?o(n)("已就绪"):dt.value?kt(dt.value.reason):o(n)("状态待确认")),1),e("button",{type:"button",disabled:!!p.value||O.value,onClick:se[9]||(se[9]=Ce=>k("quickstart-native")),"data-manage-speed-component":""},a(((la=dt.value)==null?void 0:la.reason)==="dependency_not_installed"?o(n)("查看并安装"):o(n)("管理组件")),9,YB)]),!Ee.value||!K.value?(i(),d("div",QB,[e("p",null,a(de.value||ct.value),1)])):T("",!0),Ee.value?(i(),d(V,{key:1},[z.provider==="eqos"?(i(),d(V,{key:0},[e("label",XB,[W(e("input",{"onUpdate:modelValue":se[10]||(se[10]=Ce=>z.enabled=Ce),type:"checkbox"},null,512),[[gt,z.enabled]]),ue(a(o(l)),1)]),z.enabled?(i(),d("div",eU,[e("label",null,[e("span",null,a(o(n)("总上传带宽(Mbit/s)")),1),W(e("input",{"onUpdate:modelValue":se[11]||(se[11]=Ce=>z.upload=Ce),type:"number",min:"1"},null,512),[[Oe,z.upload,void 0,{number:!0}]])]),e("label",null,[e("span",null,a(o(n)("总下载带宽(Mbit/s)")),1),W(e("input",{"onUpdate:modelValue":se[12]||(se[12]=Ce=>z.download=Ce),type:"number",min:"1"},null,512),[[Oe,z.download,void 0,{number:!0}]])])])):T("",!0),e("p",tU,a(o(n)("总带宽用于计算设备限速队列,不会自动平均分配给每台设备。")),1)],64)):z.provider==="quickstart-native"&&K.value?(i(),d("p",nU,a(o(n)("服务已就绪,请在设备详情中为需要的设备设置速度上限。")),1)):z.provider==="bandix"?(i(),d("p",aU,a(o(n)("现有 Bandix 仅用于迁移,请先完成下方步骤。")),1)):T("",!0),z.provider==="eqos"||z.provider!==Fe.value?(i(),d("button",{key:3,class:"primary",type:"button",disabled:p.value==="speed-plan"||!Ee.value||O.value||!K.value,onClick:Zt},a(p.value==="speed-plan"?o(n)("正在检查…"):o(n)("预览限速服务设置")),9,sU)):T("",!0)],64)):T("",!0),Z.value?(i(),d("section",oU,[e("h4",null,a(o(n)("限速服务影响")),1),e("p",null,a((Pn=Z.value.changes)!=null&&Pn.length?o(n)("将更新限速执行方式,现有规则保持不变。"):o(n)("设置没有变化。")),1),Z.value.error?(i(),d("p",lU,a(Z.value.error.message),1)):T("",!0),e("div",iU,[e("button",{type:"button",onClick:se[13]||(se[13]=Ce=>Z.value=void 0)},a(o(n)("取消")),1),e("button",{class:"primary",type:"button",disabled:!Z.value.canApply||p.value==="speed-apply"||O.value||!K.value||!Ee.value,onClick:be},a(p.value==="speed-apply"?o(n)("正在应用…"):o(n)("确认应用")),9,rU)])])):T("",!0),e("div",cU,[e("button",{type:"button",class:"speed-recheck",disabled:O.value||!!p.value||v.value||U.value,onClick:_t},a(O.value?o(n)("正在检查…"):o(n)("重新检查")),9,dU),!Ee.value||!K.value?(i(),d("button",{key:0,type:"button",class:"speed-inspect",onClick:Ot},a(o(n)("查看执行方式")),1)):T("",!0)]),e("details",{class:"advanced-group",open:ce.value,onToggle:Pt},[e("summary",null,a(o(n)("高级:执行方式与迁移")),1),e("label",null,[e("span",null,a(o(n)("执行方式")),1),W(e("select",{ref_key:"speedProviderControl",ref:ve,"onUpdate:modelValue":se[14]||(se[14]=Ce=>z.provider=Ce),onChange:se[15]||(se[15]=Ce=>Z.value=void 0)},[(i(!0),d(V,null,oe(J.value,Ce=>(i(),d("option",{key:Ce.id,value:Ce.id,disabled:!Ce.available},a(tt(Ce.id))+a(Ce.available?"":` · ${kt(Ce.reason)}`),9,vU))),128))],544),[[Be,z.provider]]),e("small",null,a(Tt.value),1)]),(ia=ze.value)!=null&&ia.installed&&z.provider==="bandix"?(i(),d("section",pU,[e("h4",hU,a(o(n)("迁移现有 Bandix 规则")),1),e("p",null,a(o(n)("先扫描并逐条检查;不会自动停止、卸载或改写 Bandix。")),1),e("button",{type:"button",disabled:U.value,onClick:Ye},a(U.value?o(n)("正在扫描…"):o(n)("扫描现有规则")),9,mU),D.value?(i(),d("div",fU,[e("ul",null,[(i(!0),d(V,null,oe(D.value.items,Ce=>(i(),d("li",{key:`${Ce.id}:${Ce.mac}`},[e("span",null,a(Ce.mac),1),e("b",null,a(Te(Ce)),1),e("em",{class:_e(Ce.disposition)},a(ie(Ce)),3)]))),128))]),D.value.canApply?(i(),d("label",gU,[W(e("input",{"onUpdate:modelValue":se[16]||(se[16]=Ce=>E.value=Ce),type:"checkbox"},null,512),[[gt,E.value]]),ue(a(o(n)("我已手动停止 Bandix,并启动 Quickstart 限速服务")),1)])):(i(),d("p",bU,a(o(n)("存在不支持或冲突的规则,全部处理完成前不会迁移。")),1)),e("div",_U,[e("button",{class:"primary",type:"button",disabled:!D.value.canApply||!E.value||U.value,onClick:je},a(o(n)("确认迁移并验证")),9,yU)])])):T("",!0),A.value?(i(),d("button",{key:1,class:"danger-link",type:"button",disabled:U.value,onClick:vt},a(o(n)("恢复迁移前设置")),9,kU)):T("",!0)])):T("",!0)],40,uU)],8,WB)])):$.value==="routes"?(i(),d("div",wU,[e("article",$U,[e("div",CU,[e("div",null,[e("h3",null,a(o(n)("自定义上网路线")),1),e("p",null,a(o(n)("把复杂网络工作交给旁路由或指定网关,设备可在详情中选择路线。DNS 跟随路线。")),1)]),e("button",{type:"button",disabled:!ut.value,onClick:ka},a(qe.value?o(n)("取消"):o(n)("添加路线")),9,SU)]),ut.value?T("",!0):(i(),d("p",xU,a(en.value),1)),qe.value?(i(),d("form",{key:1,class:"route-form",onSubmit:Ge(Gn,["prevent"])},[e("label",null,[e("span",null,a(o(n)("路线名称")),1),W(e("input",{"onUpdate:modelValue":se[17]||(se[17]=Ce=>De.name=Ce),maxlength:"64",required:"",placeholder:o(n)("例如:旁路由")},null,8,PU),[[Oe,De.name,void 0,{trim:!0}]])]),e("label",null,[e("span",null,a(o(n)("路线类型")),1),W(e("select",{"onUpdate:modelValue":se[18]||(se[18]=Ce=>De.kind=Ce)},[e("option",TU,a(o(n)("旁路由")),1),e("option",MU,a(o(n)("指定网关")),1)],512),[[Be,De.kind]])]),e("label",null,[e("span",null,a(o(n)("网关地址")),1),W(e("input",{"onUpdate:modelValue":se[19]||(se[19]=Ce=>De.gateway=Ce),inputmode:"decimal",required:"",placeholder:"192.168.1.2"},null,512),[[Oe,De.gateway,void 0,{trim:!0}]])]),e("button",{class:"primary",type:"submit",disabled:p.value==="route-plan"},a(p.value==="route-plan"?o(n)("正在检查…"):De.targetId?o(n)("预览修改"):o(n)("预览添加")),9,EU)],32)):T("",!0),he.value.length?(i(),d("div",IU,[(i(!0),d(V,null,oe(he.value,Ce=>(i(),d("div",{key:Ce.id},[e("span",null,[e("strong",null,a(He(Ce)),1),e("small",null,a(Ce.gateway||"—")+" · "+a(Ft(Ce.kind)),1)]),e("div",DU,[e("button",{type:"button",disabled:!ut.value,onClick:Tn=>Rt(Ce)},a(o(n)("编辑")),9,LU),e("button",{type:"button",class:"danger-link",disabled:!ut.value,onClick:Tn=>wa(Ce)},a(o(n)("删除")),9,AU)])]))),128))])):(i(),Y(yt,{key:3,kind:"empty",title:o(n)("还没有自定义上网路线"),description:o(n)("设备默认通过本机上网;需要时再添加旁路由或指定网关。")},null,8,["title","description"])),at.value?(i(),d("section",NU,[e("h4",null,a(o(n)("影响范围")),1),at.value.action==="delete"?(i(),d("p",OU,a(o(n)("受影响设备"))+":"+a(at.value.referenceSummary.devices)+" · "+a(o(n)("受影响分组"))+":"+a(at.value.referenceSummary.groups),1)):(i(),d("p",zU,a(at.value.action==="create"?o(n)("将添加一条可供设备和分组选择的路线。"):o(n)("将更新路线名称和网关,已有引用会继续保留。")),1)),at.value.referenceSummary.globalPolicy||at.value.referenceSummary.lanDefault?(i(),d("p",qU,a(o(n)("同时影响全局或局域网默认路线。")),1)):T("",!0),St.value?(i(),d("label",RU,[e("span",null,a(o(n)("替代路线")),1),W(e("select",{"onUpdate:modelValue":se[20]||(se[20]=Ce=>et.value=Ce),onChange:Va},[e("option",VU,a(o(n)("请选择")),1),(i(!0),d(V,null,oe(ht.value,Ce=>(i(),d("option",{key:Ce.id,value:Ce.id},a(He(Ce))+a(Ce.gateway?` · ${Ce.gateway}`:""),9,BU))),128))],544),[[Be,et.value]])])):T("",!0),at.value.error&&!St.value?(i(),d("p",UU,a(at.value.error.message),1)):T("",!0),e("div",FU,[e("button",{type:"button",onClick:gn},a(o(n)("取消")),1),e("button",{class:"primary",type:"button",disabled:!at.value.canApply||p.value==="route-apply",onClick:cs},a(p.value==="route-apply"?o(n)("正在应用…"):o(n)("确认应用")),9,HU)])])):T("",!0)]),e("article",GU,[e("div",jU,[e("div",null,[e("h3",null,a(o(n)("浮动网关")),1),e("p",null,a(o(n)("主路由与旁路由共享一个稳定入口,旁路由异常时自动切回主路由。")),1)]),e("span",{class:_e(["capability-pill",y.value.state])},a(ke(y.value.state)),3)]),e("button",{type:"button",class:"floating-component-entry",disabled:!!p.value,onClick:se[21]||(se[21]=Ce=>k("floatip")),"data-manage-float-component":""},a(y.value.state==="not_installed"?o(n)("查看并安装"):o(n)("管理组件")),9,WU),y.value.state==="not_installed"?(i(),d("div",JU,[e("p",null,a(o(n)("只有浮动网关功能会被锁定,设备和其他路线仍可管理。")),1)])):(i(),Y(CV,{key:1}))])])):(i(),Y(aB,{key:4})),g.value?(i(),d("p",{key:5,class:_e(["feedback",b.value]),role:"status"},a(g.value),3)):T("",!0)],64)),G(ji,{open:m.value,"focus-id":f.value,onClose:se[22]||(se[22]=Ce=>m.value=!1),onBusy:se[23]||(se[23]=Ce=>v.value=Ce),onUpdated:_t,onConfigure:to},null,8,["open","focus-id"])],8,iB)}}}),ZU=le(KU,[["__scopeId","data-v-0801e069"]]),YU=["aria-label"],QU=["aria-label"],XU={key:0,role:"status"},eF={key:1,role:"alert"},tF={key:2,role:"alert"},nF={key:0,class:"network-sidebar"},aF=["aria-label"],sF=["aria-current"],oF=["data-network","aria-current","onClick"],lF={class:"workspace-panel"},iF={key:0,class:"lan-selector"},rF=["value"],cF={value:"all"},dF=["value"],uF={key:1,class:"scope-heading"},vF=["aria-label"],pF=["id","aria-selected","onClick"],hF=["aria-labelledby"],mF={key:0,class:"scope-notice",role:"status"},fF={key:1,class:"scope-placeholder",role:"status"},bF=X({__name:"index",setup(s){const{$gettext:t}=Ae(),n=ta(),l=as(),u=x([]),c=x(!0),r=x(""),p=x(!1),v=x(""),h=R(()=>typeof n.query.network=="string"?n.query.network:v.value),g=R(()=>u.value.find(P=>P.networkId===h.value)),b=R(()=>u.value.length>1);function m(P){var _,D;return P.state==="down"?t("未连接"):((_=P.ipv4Prefixes)==null?void 0:_[0])||((D=P.ipv6Prefixes)==null?void 0:D[0])||(P.readOnlyReason?t("暂时只读"):t("局域网"))}const f=R(()=>{var P,_;return((P=g.value)==null?void 0:P.readOnlyReason)==="network_down"?t("此局域网尚未连接,网络设置暂时只读"):((_=g.value)==null?void 0:_.readOnlyReason)==="shared_network_device"?t("此局域网与其他网络共用连接,请先确认独立的网络配置"):t("此局域网的地址或连接尚未就绪,网络设置暂时只读")}),k=R(()=>h.value==="all"&&!p.value||!!g.value),$=R(()=>["groups","settings"].includes(String(n.query.tab))?String(n.query.tab):"devices");function w(P){try{localStorage.setItem("quickstart.lan",P)}catch(_){}l.replace({query:Ne(ye({},n.query),{network:P,device:void 0})})}function S(P){l.replace({query:Ne(ye({},n.query),{tab:P})})}function C(){return B(this,null,function*(){c.value=!0,r.value="";try{const P=yield qi();u.value=P.networks,p.value=P.legacy;let _="";try{_=localStorage.getItem("quickstart.lan")||""}catch(D){}v.value=P.networks.length===1?P.networks[0].networkId:_==="all"||P.networks.some(D=>D.networkId===_)?_:"all"}catch(P){r.value=P instanceof Error?t(P.message):t("局域网列表不可用")}finally{c.value=!1}})}nt(C);const y=R(()=>[{id:"devices",icon:"devices",label:t("设备")},{id:"groups",icon:"layers",label:t("分组与计划")},{id:"settings",icon:"tune",label:t("局域网设置")}]);return(P,_)=>{var E,A;const D=At("router-link");return i(),d("main",{id:"page",class:"device-management","aria-label":o(t)("局域网设备管理")},[e("nav",{class:"breadcrumbs","aria-label":o(t)("面包屑")},[G(D,{to:"/"},{default:pe(()=>[ue(a(o(t)("首页")),1)]),_:1}),_[3]||(_[3]=e("span",{"aria-hidden":"true"},"›",-1)),e("span",null,a(o(t)("局域网设备管理")),1)],8,QU),c.value?(i(),d("p",XU,a(o(t)("正在读取局域网…")),1)):r.value?(i(),d("p",eF,[ue(a(r.value)+" ",1),e("button",{type:"button",onClick:C},a(o(t)("重试")),1)])):T("",!0),!c.value&&!r.value&&!k.value?(i(),d("p",tF,[ue(a(o(t)("此局域网已不存在或不可访问"))+" ",1),e("button",{type:"button",onClick:_[0]||(_[0]=U=>w(u.value.length===1?u.value[0].networkId:"all"))},a(o(t)("返回设备列表")),1)])):T("",!0),!c.value&&!r.value&&k.value?(i(),d("div",{key:3,class:_e(["device-workspace",{"has-network-nav":b.value}])},[b.value?(i(),d("aside",nF,[e("h2",null,a(o(t)("网络范围")),1),e("nav",{class:"network-navigation","aria-label":o(t)("选择局域网")},[e("button",{type:"button","data-network":"all","aria-current":h.value==="all"?"true":void 0,onClick:_[1]||(_[1]=U=>w("all"))},[G(Qe,{name:"layers"}),e("span",null,[e("strong",null,a(o(t)("全部局域网")),1),e("small",null,a(o(t)("设备总览")),1)])],8,sF),_[4]||(_[4]=e("div",{class:"network-divider"},null,-1)),(i(!0),d(V,null,oe(u.value,U=>(i(),d("button",{key:U.networkId,type:"button","data-network":U.networkId,"aria-current":h.value===U.networkId?"true":void 0,onClick:q=>w(U.networkId)},[G(Qe,{name:"network"}),e("span",null,[e("strong",null,a(U.displayName),1),e("small",null,a(m(U)),1)])],8,oF))),128))],8,aF),e("p",null,a(o(t)("网络配置请前往系统网络设置")),1)])):T("",!0),e("div",lF,[b.value?(i(),d("label",iF,[ue(a(o(t)("局域网"))+" ",1),e("select",{value:h.value,onChange:_[2]||(_[2]=U=>w(U.target.value))},[e("option",cF,a(o(t)("全部局域网")),1),(i(!0),d(V,null,oe(u.value,U=>(i(),d("option",{key:U.networkId,value:U.networkId},a(U.displayName),9,dF))),128))],40,rF)])):T("",!0),b.value?(i(),d("div",uF,[e("h1",null,a(((E=g.value)==null?void 0:E.displayName)||o(t)("全部局域网")),1),e("p",null,a(g.value?o(t)("此网络的设备、分组与设置"):o(t)("查看各个局域网中的设备")),1)])):T("",!0),e("nav",{class:"primary-tabs",role:"tablist","aria-label":o(t)("局域网设备管理")},[(i(!0),d(V,null,oe(y.value,U=>(i(),d("button",{id:`lan-tab-${U.id}`,key:U.id,type:"button",role:"tab","aria-controls":"lan-panel","aria-selected":$.value===U.id,class:_e({active:$.value===U.id}),onClick:q=>S(U.id)},[G(Qe,{name:U.icon},null,8,["name"]),ue(a(U.label),1)],10,pF))),128))],8,vF),e("section",{id:"lan-panel",class:"primary-content",role:"tabpanel","aria-labelledby":`lan-tab-${$.value}`},[(A=g.value)!=null&&A.readOnlyReason?(i(),d("p",mF,a(f.value),1)):T("",!0),h.value==="all"&&$.value!=="devices"?(i(),d("p",fF,a(o(t)("请选择一个局域网,管理分组、计划和网络设置")),1)):(i(),Y(Ui,{key:`${h.value}:${$.value}:${p.value}`,"network-id":h.value,networks:u.value,legacy:p.value},{default:pe(()=>[$.value==="devices"?(i(),Y(Xq,{key:0})):$.value==="groups"?(i(),Y(tV,{key:1})):(i(),Y(ZU,{key:2}))]),_:1},8,["network-id","networks","legacy"]))],8,hF)])],2)):T("",!0)],8,YU)}}}),gF=le(bF,[["__scopeId","data-v-443a52ed"]]),_F={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},yF=["fill"],kF=["fill"],wF=["fill"],Kl=X({__name:"wifi",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",_F,[e("path",{d:"M723 620.5C666.8 571.6 593.4 542 513 542s-153.8 29.6-210.1 78.6c-3.2 2.8-3.6 7.8-0.8 11.2l36 42.9c2.9 3.4 8 3.8 11.4 0.9C393.1 637.2 450.3 614 513 614s119.9 23.2 163.5 61.5c3.4 2.9 8.5 2.5 11.4-0.9l36-42.9c2.8-3.3 2.4-8.3-0.9-11.2zM840.4 480.4C751.7 406.5 637.6 362 513 362s-238.7 44.5-327.5 118.4c-3.4 2.8-3.8 7.9-1 11.3l36 42.9c2.8 3.4 7.9 3.8 11.2 1C308 472.2 406.1 434 513 434s205 38.2 281.2 101.6c3.4 2.8 8.4 2.4 11.2-1l36-42.9c2.8-3.4 2.4-8.5-1-11.3z","p-id":"5126",fill:s.color},null,8,yF),e("path",{d:"M957.1 341.4C835.7 241.8 680.3 182 511 182c-168.2 0-322.6 59-443.7 157.4-3.5 2.8-4 7.9-1.1 11.4l36 42.9c2.8 3.3 7.8 3.8 11.1 1.1C222 306.7 360.3 254 511 254c151.8 0 291 53.5 400 142.7 3.4 2.8 8.4 2.3 11.2-1.1l36-42.9c2.9-3.4 2.4-8.5-1.1-11.3z","p-id":"5127",fill:s.color},null,8,kF),e("path",{d:"M512 778m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z","p-id":"5128",fill:s.color},null,8,wF)]))}}),$F={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},CF=["fill"],SF=["fill"],xF=X({__name:"time",props:{color:{type:String,default:"#ffa847"}},setup(s){return(t,n)=>(i(),d("svg",$F,[e("path",{d:"M640.825806 900.129032c-18.167742 6.606452-37.987097 9.909677-57.806451 13.212903-26.425806 4.954839-44.593548 29.729032-41.290323 56.154839 4.954839 26.425806 29.729032 44.593548 56.154839 41.290323 24.774194-3.303226 47.896774-9.909677 71.019355-16.516129 26.425806-8.258065 41.290323-36.335484 33.032258-62.761291s-34.683871-39.63871-61.109678-31.380645zM974.451613 576.412903c-26.425806-6.606452-52.851613 9.909677-61.109678 36.335484-4.954839 19.819355-11.56129 37.987097-18.167741 56.154839-9.909677 24.774194 1.651613 54.503226 26.425806 64.412903 24.774194 9.909677 54.503226-1.651613 64.412903-26.425806 9.909677-23.122581 16.516129-46.245161 23.122581-69.367742 6.606452-28.077419-8.258065-54.503226-34.683871-61.109678zM814.245161 791.122581c-13.212903 14.864516-28.077419 28.077419-42.941935 39.638709-21.470968 16.516129-24.774194 47.896774-8.258065 69.367742 16.516129 21.470968 47.896774 24.774194 69.367742 8.258065 19.819355-14.864516 37.987097-31.380645 54.503226-49.548387 18.167742-19.819355 18.167742-51.2-1.651613-69.367742s-51.2-18.167742-71.019355 1.651613zM526.864516 341.883871c-28.077419 0-49.548387 21.470968-49.548387 49.548387v122.219355c0 14.864516 6.606452 28.077419 18.167742 37.987097l117.264516 97.445161c21.470968 18.167742 52.851613 14.864516 69.367742-6.606452s14.864516-52.851613-6.606452-69.367742l-99.096774-82.580645v-99.096774c0-26.425806-21.470968-49.548387-49.548387-49.548387z",fill:s.color,"p-id":"4722"},null,8,CF),e("path",{d:"M910.03871 327.019355c28.077419 1.651613 51.2-18.167742 52.851613-46.245161l9.909677-142.03871c1.651613-28.077419-18.167742-51.2-46.245161-52.851613-28.077419-1.651613-51.2 18.167742-52.851613 46.245161v16.516129c-1.651613-1.651613-3.303226-3.303226-4.954839-3.303226-1.651613-3.303226-4.954839-4.954839-6.606452-8.258064-18.167742-16.516129-36.335484-31.380645-57.806451-46.245161-1.651613-1.651613-4.954839-3.303226-6.606452-3.303226-46.245161-31.380645-99.096774-54.503226-155.251613-69.367742-1.651613 0-3.303226-1.651613-4.954838-1.651613-8.258065-1.651613-14.864516-3.303226-23.122581-4.954839h-1.651613c-6.606452-1.651613-13.212903-3.303226-21.470968-3.303225-4.954839-1.651613-11.56129-1.651613-16.516129-1.651613-3.303226 0-6.606452-1.651613-9.909677-1.651613h-1.651613C307.2-19.819355 69.367742 153.6 18.167742 412.903226c-52.851613 275.819355 125.522581 541.729032 401.341935 594.580645 26.425806 4.954839 52.851613-11.56129 57.806452-39.63871 4.954839-26.425806-11.56129-52.851613-39.63871-57.806451h-1.651613c-19.819355-3.303226-37.987097-9.909677-56.154838-16.516129h-3.303226c-44.593548-16.516129-84.232258-39.63871-118.916129-67.716129l-4.954839-4.954839c-14.864516-13.212903-29.729032-26.425806-41.290322-41.290323-1.651613-1.651613-3.303226-3.303226-6.606452-4.954838-28.077419-33.032258-51.2-71.019355-67.716129-112.309678 0-3.303226-1.651613-6.606452-1.651613-8.258064-6.606452-18.167742-13.212903-37.987097-16.516129-56.154839 0-3.303226-1.651613-6.606452-3.303226-9.909677-8.258065-41.290323-9.909677-82.580645-4.954838-125.522581 1.651613-3.303226 1.651613-6.606452 3.303225-9.909678 3.303226-19.819355 6.606452-37.987097 13.212904-57.806451 1.651613-3.303226 1.651613-6.606452 1.651612-9.909678 13.212903-41.290323 33.032258-80.929032 57.806452-115.612903 3.303226-1.651613 4.954839-4.954839 6.606452-6.606451 11.56129-14.864516 24.774194-29.729032 39.638709-44.593549 1.651613-1.651613 3.303226-4.954839 4.954839-6.606451 33.032258-31.380645 71.019355-56.154839 112.309677-74.322581 1.651613 0 3.303226 0 3.303226-1.651613 18.167742-8.258065 37.987097-14.864516 56.154839-19.819355 1.651613 0 1.651613-1.651613 3.303226-1.651613 47.896774-13.212903 100.748387-16.516129 153.6-9.909677 3.303226 0 6.606452 1.651613 9.909677 1.651613 6.606452 1.651613 11.56129 1.651613 18.167742 3.303226 80.929032 16.516129 153.6 54.503226 209.754839 112.309677l-29.729032-1.651613c-28.077419-1.651613-51.2 18.167742-52.851613 46.245161-1.651613 28.077419 18.167742 51.2 46.245161 52.851613l142.03871 8.258065z",fill:s.color,"p-id":"4723"},null,8,SF)]))}}),PF={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},TF=["fill"],MF=["fill"],EF=X({__name:"log",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",PF,[e("path",{d:"M762 942H262c-71.68 0-130-58.32-130-130V212c0-71.68 58.32-130 130-130h350c16.56 0 30 13.43 30 30v151.56c0 38.59 31.41 70 70 70h150c16.56 0 30 13.43 30 30V812c0 71.68-58.32 130-130 130zM262 142c-38.59 0-70 31.41-70 70v600c0 38.59 31.41 70 70 70h500c38.59 0 70-31.41 70-70V393.57H712c-71.68 0-130-58.32-130-130V142H262z","p-id":"13142",fill:s.color},null,8,TF),e("path",{d:"M862 393.57H712c-71.68 0-130-58.32-130-130V112c0-12.15 7.32-23.11 18.55-27.73a29.938 29.938 0 0 1 32.71 6.59l250 251.56c8.55 8.59 11.07 21.47 6.43 32.67s-15.58 18.48-27.69 18.48zM642 184.75v78.82c0 38.59 31.41 70 70 70h77.89L642 184.75zM487 379.5H312c-16.57 0-30-13.43-30-30s13.43-30 30-30h175c16.57 0 30 13.43 30 30s-13.43 30-30 30zM712 542H312c-16.57 0-30-13.43-30-30s13.43-30 30-30h400c16.56 0 30 13.43 30 30s-13.44 30-30 30zM712 704.5H312c-16.57 0-30-13.44-30-30s13.43-30 30-30h400c16.56 0 30 13.44 30 30s-13.44 30-30 30z","p-id":"13143",fill:s.color},null,8,MF)]))}}),IF={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},DF=["fill"],LF=X({__name:"upload",props:{color:{type:String,default:"#9810f9"}},setup(s){return(t,n)=>(i(),d("svg",IF,[e("path",{d:"M914.285714 548.571429a36.571429 36.571429 0 0 1 36.571429 36.571428v219.428572a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714v-219.428572a36.571429 36.571429 0 1 1 73.142857 0v219.428572a73.142857 73.142857 0 0 0 67.657143 72.96L219.428571 877.714286h585.142858a73.142857 73.142857 0 0 0 72.96-67.657143L877.714286 804.571429v-219.428572a36.571429 36.571429 0 0 1 36.571428-36.571428zM537.307429 83.858286l258.596571 258.596571a36.571429 36.571429 0 1 1-51.712 51.712L548.571429 198.509714 548.571429 634.733714a36.571429 36.571429 0 1 1-73.142858 0V197.485714L278.674286 394.166857a36.571429 36.571429 0 1 1-51.712-51.712l258.596571-258.596571a36.571429 36.571429 0 0 1 51.712 0z",fill:s.color,"p-id":"9077"},null,8,DF)]))}}),AF={class:"modal-header"},NF={class:"modal-title"},OF={class:"modal-content"},zF={key:0,class:"modal-footer"},qF=X({__name:"index",props:{modelValue:{type:Boolean},title:{default:"提示"},showClose:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!1},footerShow:{type:Boolean,default:!0},width:{default:"500px"}},emits:["update:modelValue","confirm","cancel","close"],setup(s,{expose:t,emit:n}){Dr(m=>({v45d231e9:c.value}));const{$gettext:l}=Ae(),u=s,c=R(()=>typeof u.width=="number"?`${u.width}px`:u.width),r=n,p=x(u.modelValue);We(()=>u.modelValue,m=>{p.value=m}),We(p,m=>{r("update:modelValue",m),m||r("close")}),R(()=>typeof u.width=="number"?`${u.width}px`:u.width);const v=()=>{p.value=!1},h=()=>{u.closeOnClickOverlay&&b()},g=()=>{r("confirm")},b=()=>{r("cancel"),v()};return t({show:()=>p.value=!0,hide:()=>p.value=!1}),(m,f)=>(i(),Y(fn,{name:"fade"},{default:pe(()=>[p.value?(i(),d("div",{key:0,class:"modal-overlay",onClick:Ge(h,["self"])},[G(fn,{name:"slide"},{default:pe(()=>[e("div",{class:"modal-container",style:pt({maxWidth:c.value})},[e("div",AF,[e("h3",NF,a(o(l)(s.title)),1),s.showClose?(i(),d("button",{key:0,class:"modal-close",onClick:b,"aria-label":"Close"}," × ")):T("",!0)]),e("div",OF,[Ct(m.$slots,"default")]),s.footerShow?(i(),d("div",zF,[Ct(m.$slots,"footer",{},()=>[e("button",{class:"modal-button cancel",onClick:b},a(o(l)("取消")),1),e("button",{class:"modal-button confirm",onClick:g},a(o(l)("保存")),1)])])):T("",!0)],4)]),_:3})])):T("",!0)]),_:3}))}}),RF={class:"item_container"},VF={class:"item"},BF={class:"item_title"},UF={class:"tip"},FF={class:"item"},HF={class:"item_title"},GF={class:"select_box"},jF={value:null,disabled:"",selected:""},WF=["value"],JF={class:"start_btn"},KF={key:0,class:"progress"},ZF={class:"item"},YF={class:"item_title"},QF={class:"log_info"},XF={class:"item"},eH={class:"item_title"},tH={class:"result_box"},nH={class:"result"},aH={class:"result_item"},sH={class:"speed_title"},oH={class:"result_item"},lH={class:"speed_title"},iH=X({__name:"item",setup(s){const{$gettext:t}=Ae(),n=x(!1),l=x([{title:"SpeedTest.Net",describe:"全球标准网速测试服务",value:"SpeedTest"},{title:"CDN节点测试",describe:"测试到主要CDN节点的连接速度",value:"CDN"},{title:"UST高校节点",describe:"中科大教育网节点测试",value:"UST"},{title:"NAT类型测速",describe:"检测网络NAT类型和连通性",value:"NAT"}]),u=x(null),c=x(!1),r=()=>{u.value&&(c.value=!0)};return(p,v)=>(i(),d(V,null,[e("div",RF,[e("div",VF,[e("div",BF,[G(Kl,{color:"#155dfc",class:"icon"}),e("span",null,a(o(t)("内网测速")),1)]),e("p",null,a(o(t)("检测本地网络环境,获取内网访问地址")),1),e("div",{class:"wifi_btn",onClick:v[0]||(v[0]=h=>n.value=!0)},[e("div",null,[G(Kl,{color:"#ffffff",class:"icon1"}),e("span",null,a(o(t)("开始内网测速")),1)])]),e("p",UF,a(o(t)("点击按钮获取内网测速地址,通过访问这些地址来测试内网连接速度")),1)]),e("div",FF,[e("div",HF,[G(zs,{color:"#2bb55e",class:"icon"}),e("span",null,a(o(t)("内网测速")),1)]),e("p",null,a(o(t)("选择测速节点,进行网络速度和连接质量测试")),1),e("div",GF,[e("div",null,a(o(t)("选择测速节点")),1),W(e("select",{"onUpdate:modelValue":v[1]||(v[1]=h=>u.value=h),id:"node",required:"",class:_e({"is-placeholder":!u.value})},[e("option",jF,a(o(t)("请选择测速节点")),1),(i(!0),d(V,null,oe(l.value,h=>(i(),d("option",{value:h},a(h.title)+" - "+a(h.describe),9,WF))),256))],2),[[Be,u.value]])]),e("div",{class:_e(["wifi_btn m-20",{"is-bg":!u.value||c.value}]),onClick:r},[e("div",JF,[c.value?(i(),d("span",{key:0,class:_e(["icon3-wrap",{"is-rotating":c.value}])},[G(xF,{color:"#ffffff",class:"icon3"})],2)):(i(),Y(zs,{key:1,color:"#ffffff",class:"icon2"})),e("span",null,a(o(t)("开始测速")),1)])],2),c.value?(i(),d("div",KF,[e("p",null,[ue(a(o(t)("测速进度"))+" ",1),v[3]||(v[3]=e("span",null,"25%",-1))]),G(Di,{percentage:25,showPercentage:!1,height:"10px",borderRadius:"10px",color:"#030213",backgroundColor:"#cdccd0"})])):T("",!0)]),e("div",ZF,[e("div",YF,[G(EF,{color:"#ff6900",class:"icon2"}),e("span",null,a(o(t)("测速日志")),1)]),e("p",null,a(o(t)("实时测速过程记录")),1),e("div",QF,[(i(),d(V,null,oe(20,h=>e("p",null,"[17:00:20] 正在连接到测试服务器...")),64))])]),e("div",XF,[e("div",eH,[G(Ni,{color:"#9865ff",class:"icon2"}),e("span",null,a(o(t)("测速结果")),1)]),e("p",null,a(o(t)("测速节点"))+":CDN节点 (北京)",1),e("div",tH,[e("div",nH,[e("div",aH,[G(Ia,{color:"#155dfc",class:"icon_speed"}),v[4]||(v[4]=e("div",{class:"speed_value"},"105.5",-1)),v[5]||(v[5]=e("span",{class:"unit"},"Mbps",-1)),v[6]||(v[6]=e("span",{class:"status status_bg1"},"优秀",-1)),e("div",sH,a(o(t)("下载速度")),1)]),e("div",oH,[G(LF,{color:"#00a63e",class:"icon_speed1"}),v[7]||(v[7]=e("div",{class:"speed_value"},"105.5",-1)),v[8]||(v[8]=e("span",{class:"unit"},"Mbps",-1)),v[9]||(v[9]=e("span",{class:"status status_bg2"},"良好",-1)),e("div",lH,a(o(t)("上传速度")),1)])]),v[10]||(v[10]=Hn('',2))])])]),G(qF,{modelValue:n.value,"onUpdate:modelValue":v[2]||(v[2]=h=>n.value=h),title:"内网访问地址",width:"550px",footerShow:!1,"show-close":!0},{default:pe(()=>[...v[11]||(v[11]=[e("div",{class:"custom-content"},[e("p",null,"以下是检测到的内网地址,请点击访问进行测速"),e("div",{class:"address_box"},[e("span",null,"http://192.168.1.1"),e("div",null,"访问")]),e("div",{class:"address_box"},[e("span",null,"http://192.168.1.1"),e("div",null,"访问")]),e("div",{class:"address_box"},[e("span",null,"http://192.168.1.1"),e("div",null,"访问")]),e("div",{class:"address_box"},[e("span",null,"http://192.168.1.1"),e("div",null,"访问")]),e("div",{class:"address_box"},[e("span",null,"http://192.168.1.1"),e("div",null,"访问")])],-1)])]),_:1},8,["modelValue"])],64))}}),rH=le(iH,[["__scopeId","data-v-c397f762"]]),cH={width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"none"},dH=["fill"],uH=X({__name:"signal",props:{color:{type:String,default:"#155dfc"}},setup(s){return(t,n)=>(i(),d("svg",cH,[e("path",{d:"M0 855.04a64.896 64.896 0 0 1 129.792 0v55.637333a64.896 64.896 0 0 1-129.792 0V855.04zM213.248 669.610667a64.896 64.896 0 0 1 129.792 0v241.066666a64.896 64.896 0 0 1-129.792 0v-241.066666zM426.496 484.181333a64.896 64.896 0 0 1 129.792 0v426.496a64.896 64.896 0 1 1-129.792 0v-426.496zM639.701333 298.752a64.896 64.896 0 1 1 129.792 0v611.925333a64.896 64.896 0 0 1-129.792 0V298.752zM852.949333 113.322667a64.896 64.896 0 0 1 129.792 0v797.354666a64.896 64.896 0 0 1-129.792 0V113.322667z",fill:s.color,"p-id":"11967"},null,8,dH)]))}}),vH={id:"page"},pH={style:{"text-align":"left",display:"flex","align-items":"center","margin-bottom":"20px","padding-top":"4px"}},hH={style:{"text-decoration":"none",color:"var(--breadcrumbs-tit-color1)","line-height":"1.5em"}},mH={class:"container",style:{color:"black"}},fH={class:"title"},bH=X({__name:"index",setup(s){const{$gettext:t}=Ae();return(n,l)=>{const u=At("router-link");return i(),d(V,null,[e("div",vH,[e("div",pH,[G(u,{to:"/",style:{"text-decoration":"none",color:"var(--breadcrumbs-tit-color)","line-height":"1.5em","margin-right":"4px"}},{default:pe(()=>[ue(a(o(t)("首页")),1)]),_:1}),l[0]||(l[0]=e("svg",{width:"20",height:"20",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M20 30 L50 50 L20 70",stroke:"#d6dbf8","stroke-width":"8","stroke-linecap":"round",fill:"none"})],-1)),e("a",hH,a(o(t)("网络测速")),1)])]),e("div",mH,[e("div",fH,[e("div",null,[G(uH,{class:"icon"}),l[1]||(l[1]=e("span",null,"网络测速工具",-1))]),l[2]||(l[2]=e("p",null,"专业的网络连接速度检测工具,支持内网和外网测速",-1))]),G(rH)])],64)}}}),gH=le(bH,[["__scopeId","data-v-1fb34484"]]),_H={class:"form-item"},yH={class:"label-name"},kH={class:"label-value switch_label"},wH={class:"label-flex pc-radio"},$H=["disabled"],CH=["disabled"],SH={key:0,class:"form-item"},xH={class:"label-name"},PH={class:"label-value"},TH=["disabled"],MH={value:100},EH={value:70},IH={value:50},DH={value:30},LH={key:0,class:"select-arrow"},AH={class:"form-item"},NH={class:"label-name"},OH={class:"label-value"},zH=["disabled","placeholder"],qH={class:"form-item"},RH={class:"label-name"},VH={class:"label-value"},BH=["disabled"],UH=["value"],FH={key:0,class:"select-arrow"},HH={class:"form-item"},GH={class:"label-name"},jH={class:"label-value"},WH=["type","disabled","placeholder"],JH={key:0,class:"seeIcon",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"},KH={key:1,class:"seeIcon",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"},ZH={class:"form-item"},YH={class:"label-name"},QH={class:"label-value"},XH=["disabled"],eG={value:!1},tG={value:!0},nG={key:0,class:"select-arrow"},aG={key:1,class:"form-item"},sG={class:"label-name"},oG={class:"label-value"},lG=["disabled"],iG=["value"],rG={key:0,class:"select-arrow"},cG={key:2,class:"form-item"},dG={class:"label-name"},uG={class:"label-value"},vG=["disabled"],pG={key:0,value:"auto"},hG={key:1,value:"80"},mG={key:2,value:"160"},fG={key:0,class:"select-arrow"},bG={key:3,class:"form-item"},gG={class:"label-name"},_G={class:"label-value"},yG=["disabled"],kG={value:0},wG=["value"],$G=["disabled"],CG={value:0},SG={key:2,class:"select-arrow"},xG={key:4,class:"form-item"},PG={class:"label-name"},TG={class:"label-value"},MG=["placeholder","disabled"],EG={class:"label-btns"},IG=["disabled"],DG=X({__name:"form",props:{data:{}},emits:["getData"],setup(s,{emit:t}){const{$gettext:n,$ngettext:l}=Ae(),u=s,c=x(Object.assign({},u.data)),r=t,p=ba("disabled"),v=x(!0),h=()=>{p.value||(c.value.disabled=!c.value.disabled)};We(()=>c.value.disabled,k=>{b()});const g=()=>B(null,null,function*(){if(c.value.txpower===u.data.txpower)return;const k=ne.Loading("配置中...");try{const{data:$}=yield we.Quickwifi.Power.POST({device:c.value.device||"",txpower:c.value.txpower||0}),{error:w,success:S}=$;if(w)throw w;(S==null||S==0)&&ne.Success("配置完成")}catch($){throw ne.Error("配置失败,请重试"),$}finally{k.Close()}}),b=()=>B(null,null,function*(){const k=ne.Loading("配置中...");try{const{data:$}=yield we.Quickwifi.Switch.POST({ifaceName:c.value.ifaceName||"",enable:!c.value.disabled}),{error:w,success:S}=$;if(w)throw w;(S==null||S==0)&&ne.Success("配置完成")}catch($){throw console.error("请求出错:",$),ne.Error("配置失败,请重试"),$}finally{k.Close()}}),m=()=>B(null,null,function*(){const k=ye({},c.value);delete k.encryptSelects,delete k.hwmodeSelects,delete k.disabled,delete k.txpower;const{data:$}=yield we.Quickwifi.Edit.POST(k),{error:w,success:S}=$;if(w)throw w;(S==null||S==0)&&ne.Success("配置完成")}),f=()=>B(null,null,function*(){if(p.value)return;p.value=!0;const k=ne.Loading("配置中...");try{yield m(),yield r("getData")}catch($){const w=ne.Error(`${$}`);setTimeout(()=>{w.Close()},2e3)}finally{k.Close(),p.value=!1}});return(k,$)=>(i(),d("form",{class:"form-container",onSubmit:Ge(f,["prevent"])},[e("div",_H,[e("div",yH,[e("span",null,a(o(n)("启用Wi-Fi")),1)]),e("div",kH,[e("div",wH,[e("label",null,[W(e("input",{type:"radio",value:!1,"onUpdate:modelValue":$[0]||($[0]=w=>c.value.disabled=w),disabled:o(p)},null,8,$H),[[Mt,c.value.disabled]]),ue(" "+a(o(n)("开启")),1)]),e("label",null,[W(e("input",{type:"radio",value:!0,"onUpdate:modelValue":$[1]||($[1]=w=>c.value.disabled=w),disabled:o(p)},null,8,CH),[[Mt,c.value.disabled]]),ue(" "+a(o(n)("关闭")),1)])]),e("div",{class:"mobile-switch",onClick:h},[e("div",{class:_e(["switch-core",{"is-checked":!c.value.disabled,"is-disabled":o(p)}])},[...$[13]||($[13]=[e("div",{class:"switch-button"},null,-1)])],2)])])]),c.value.isGuest?T("",!0):(i(),d("div",SH,[e("div",xH,[e("span",null,a(o(n)("发射功率")),1)]),e("div",PH,[W(e("select",{"onUpdate:modelValue":$[2]||($[2]=w=>c.value.txpower=w),disabled:o(p),onChange:g},[e("option",MH,a(o(n)("最大")),1),e("option",EH,a(o(n)("高")),1),e("option",IH,a(o(n)("中")),1),e("option",DH,a(o(n)("低")),1)],40,TH),[[Be,c.value.txpower]]),o(p)?T("",!0):(i(),d("div",LH))])])),e("div",AH,[e("div",NH,[e("span",null,a(o(n)("Wi-Fi名称(SSID)")),1)]),e("div",OH,[W(e("input",{"onUpdate:modelValue":$[3]||($[3]=w=>c.value.ssid=w),disabled:o(p),placeholder:o(n)("请输入WIFI名称")},null,8,zH),[[Oe,c.value.ssid]])])]),e("div",qH,[e("div",RH,[e("span",null,a(o(n)("Wi-Fi 安全性")),1)]),e("div",VH,[W(e("select",{"onUpdate:modelValue":$[4]||($[4]=w=>c.value.encryption=w),disabled:o(p)},[(i(!0),d(V,null,oe(c.value.encryptSelects,w=>(i(),d("option",{value:w},a(w),9,UH))),256))],8,BH),[[Be,c.value.encryption]]),o(p)?T("",!0):(i(),d("div",FH))])]),e("div",HH,[e("div",GH,[e("span",null,a(o(n)("Wi-Fi 密码")),1)]),e("div",jH,[W(e("input",{"onUpdate:modelValue":$[5]||($[5]=w=>c.value.key=w),class:"password_input",type:v.value?"password":"",disabled:o(p),placeholder:o(n)("请输入WIFI密码")},null,8,WH),[[Lr,c.value.key]]),o(p)?T("",!0):(i(),d("div",{key:0,onClick:$[6]||($[6]=w=>v.value=!v.value)},[v.value?(i(),d("svg",JH,[...$[14]||($[14]=[e("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z",fill:"currentColor"},null,-1)])])):(i(),d("svg",KH,[...$[15]||($[15]=[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:"currentColor"},null,-1)])]))]))])]),e("div",ZH,[e("div",YH,[e("span",null,a(o(n)("SSID 可见性")),1)]),e("div",QH,[W(e("select",{"onUpdate:modelValue":$[7]||($[7]=w=>c.value.hidden=w),disabled:o(p)},[e("option",eG,a(o(n)("显示")),1),e("option",tG,a(o(n)("隐藏")),1)],8,XH),[[Be,c.value.hidden]]),o(p)?T("",!0):(i(),d("div",nG))])]),c.value.isGuest?T("",!0):(i(),d("div",aG,[e("div",sG,[e("span",null,a(o(n)("无线模式")),1)]),e("div",oG,[W(e("select",{"onUpdate:modelValue":$[8]||($[8]=w=>c.value.hwmode=w),disabled:o(p)},[(i(!0),d(V,null,oe(c.value.hwmodeSelects,w=>(i(),d("option",{value:w},a(w),9,iG))),256))],8,lG),[[Be,c.value.hwmode]]),o(p)?T("",!0):(i(),d("div",rG))])])),c.value.isGuest?T("",!0):(i(),d("div",cG,[e("div",dG,[e("span",null,a(o(n)("频宽")),1)]),e("div",uG,[W(e("select",{"onUpdate:modelValue":$[9]||($[9]=w=>c.value.htmode=w),disabled:o(p)},[$[16]||($[16]=e("option",{value:"20"},"20 MHz",-1)),$[17]||($[17]=e("option",{value:"40"},"40 MHz",-1)),c.value.band==="2g"?(i(),d("option",pG," 20/40 MHz ")):T("",!0),c.value.band==="5g"?(i(),d("option",hG," 80 MHz ")):T("",!0),c.value.band==="5g"?(i(),d("option",mG," 160 MHz ")):T("",!0)],8,vG),[[Be,c.value.htmode]]),o(p)?T("",!0):(i(),d("div",fG))])])),c.value.isGuest?T("",!0):(i(),d("div",bG,[e("div",gG,[e("span",null,a(o(n)("信道")),1)]),e("div",_G,[c.value.band==="2g"?W((i(),d("select",{key:0,"onUpdate:modelValue":$[10]||($[10]=w=>c.value.channel=w),disabled:o(p)},[e("option",kG,a(o(n)("自动")),1),(i(),d(V,null,oe(13,w=>e("option",{value:w},a(w),9,wG)),64))],8,yG)),[[Be,c.value.channel,void 0,{number:!0}]]):T("",!0),c.value.band==="5g"?W((i(),d("select",{key:1,"onUpdate:modelValue":$[11]||($[11]=w=>c.value.channel=w),disabled:o(p)},[e("option",CG,a(o(n)("自动")),1),$[18]||($[18]=e("option",{value:36},"36",-1)),$[19]||($[19]=e("option",{value:40},"40",-1)),$[20]||($[20]=e("option",{value:44},"44",-1)),$[21]||($[21]=e("option",{value:48},"48",-1)),$[22]||($[22]=e("option",{value:52},"52(DFS)",-1)),$[23]||($[23]=e("option",{value:56},"56(DFS)",-1)),$[24]||($[24]=e("option",{value:60},"60(DFS)",-1)),$[25]||($[25]=e("option",{value:64},"64(DFS)",-1)),$[26]||($[26]=e("option",{value:149},"149",-1)),$[27]||($[27]=e("option",{value:153},"153",-1)),$[28]||($[28]=e("option",{value:157},"157",-1)),$[29]||($[29]=e("option",{value:161},"161",-1))],8,$G)),[[Be,c.value.channel,void 0,{number:!0}]]):T("",!0),o(p)?T("",!0):(i(),d("div",SG))])])),c.value.isGuest?T("",!0):(i(),d("div",xG,[e("div",PG,[e("span",null,a(o(n)("网络")),1)]),e("div",TG,[W(e("input",{type:"text",placeholder:o(n)("请配置网络名称"),required:"","onUpdate:modelValue":$[12]||($[12]=w=>c.value.network=w),disabled:o(p)},null,8,MG),[[Oe,c.value.network]])])])),e("div",EG,[e("button",{class:"btn primary-btn",disabled:o(p),onClick:f},a(o(n)("保存配置")),9,IG)])],32))}}),LG=le(DG,[["__scopeId","data-v-d46f20af"]]),AG={id:"page",class:"page-container"},NG={class:"mobile-tags-container"},OG={class:"tags-wrapper"},zG={class:"tags-scroll"},qG=["onClick"],RG={class:"more-btn-wrapper"},VG={class:"page-flex"},BG={class:"page-sidebar"},UG=["onClick"],FG={class:"page-main"},HG={class:"popup-content"},GG={class:"popup-tags"},jG=["onClick"],WG={class:"popup-footer"},JG=X({__name:"index",setup(s){var $;const{$gettext:t}=Ae(),n=x(!1);ma("disabled",n);const l=x([]),u=ta(),c=as(),r=x(String(($=u==null?void 0:u.query)==null?void 0:$.tab)),p=x(!1),v=w=>{var S;return(S=w.band)==null?void 0:S.toUpperCase()},h=w=>w.isGuest?w.band+"_Guest":w.ssid,g=w=>{n.value||(r.value=h(w),p.value=!1,r.value!==u.query.tab&&c.push({query:{tab:r.value}}))},b=x(),m=w=>{n.value||(b.value=h(w))},f=()=>{p.value=!1,b.value!==u.query.tab&&c.push({query:{tab:b.value}})};We(()=>p.value,w=>{w?b.value=r.value:r.value=b.value});const k=()=>B(null,null,function*(){try{const{data:w}=yield we.Quickwifi.List.GET(),{error:S,result:C}=w;if(S)throw S;C!=null&&C.ifaces&&(l.value=C.ifaces.map(P=>Ne(ye({},P),{hidden:P.hidden||!1,disabled:P.disabled||!1,isGuest:P.isGuest||!1,channel:P.channel||0,txpower:P.txpower||0,ifaceIndex:P.ifaceIndex||0})));let y=!1;for(let P=0;P0&&g(l.value[0])}catch(w){console.log(w)}});return k(),(w,S)=>(i(),d("div",AG,[e("div",NG,[e("div",OG,[e("div",zG,[(i(!0),d(V,null,oe(l.value,C=>(i(),d("div",{key:h(C),class:_e(r.value===h(C)?"tag-item active":"tag-item"),onClick:Ge(y=>g(C),["stop"])},a(v(C))+" "+a(C.isGuest?` ${o(t)("访客")}`:"")+" Wi-Fi "+a(C.ifaceIndex?`[${C.ifaceIndex}]`:""),11,qG))),128))]),e("div",RG,[S[4]||(S[4]=e("div",{class:"fade-overlay"},null,-1)),e("div",{class:"more-btn",onClick:S[0]||(S[0]=C=>p.value=!0)},[...S[3]||(S[3]=[e("div",{class:"line"},null,-1),e("div",{class:"line"},null,-1),e("div",{class:"line"},null,-1)])])])])]),e("div",VG,[e("div",BG,[(i(!0),d(V,null,oe(l.value,C=>(i(),d("div",{key:h(C),class:_e(r.value===h(C)?"item activeItem":"item"),onClick:Ge(y=>g(C),["stop"])},a(v(C))+" "+a(C.isGuest?` ${o(t)("访客")}`:"")+" Wi-Fi "+a(C.ifaceIndex?`[${C.ifaceIndex}]`:""),11,UG))),128))]),e("div",FG,[(i(!0),d(V,null,oe(l.value,C=>(i(),d(V,{key:h(C)},[r.value===h(C)?(i(),Y(LG,{key:0,data:C,onGetData:k},null,8,["data"])):T("",!0)],64))),128))])]),p.value?(i(),d("div",{key:0,class:"popup-overlay",onClick:S[2]||(S[2]=Ge(C=>p.value=!1,["self"]))},[e("div",HG,[e("div",GG,[(i(!0),d(V,null,oe(l.value,C=>(i(),d("div",{key:h(C),class:_e(b.value===h(C)?"popup-tag-item active":"popup-tag-item"),onClick:Ge(y=>m(C),["stop"])},a(v(C))+" "+a(C.isGuest?` ${o(t)("访客")}`:"")+" Wi-Fi "+a(C.ifaceIndex?`[${C.ifaceIndex}]`:""),11,jG))),128))]),e("div",WG,[e("button",{class:"cancel-btn",onClick:S[1]||(S[1]=C=>p.value=!1)},a(o(t)("取消")),1),e("button",{class:"confirm-btn",onClick:f},a(o(t)("确定")),1)])])])):T("",!0)]))}}),KG=le(JG,[["__scopeId","data-v-aa1ba5db"]]),ZG=()=>window.vue_base||"/cgi-bin/luci/admin/quickstart",YG=Ur({history:Fr(ZG()),routes:[{name:"IndexPage",path:"/",meta:{title:"控制台"},component:YC},{name:"NetworkPage",path:"/network",meta:{title:"网络设置向导"},component:eS,children:[{path:"",component:TS},{path:"pppoe",component:ZS},{path:"dhcp",component:Ax},{path:"gateway",component:wP}]},{path:"/quickwifi",component:KG},{name:"RaidPage",path:"/raid",meta:{title:"raid向导"},component:FM},{name:"SmartPage",path:"/smart",meta:{title:"smart检测"},component:KM,children:[{path:"",component:FD},{path:"task",component:sL},{path:"log",component:rL}]},{path:"/interfaceconfig",component:sA},{path:"/devicemanagement",component:gF},{path:"/networkSpeedTest",component:gH}]});YG.beforeEach((s,t)=>(s.meta.title,!0));export{nj as A,Ta as E,na as N,aj as S,Qe as _,sj as a,oj as b,lj as c,ij as d,rj as e,cj as f,dj as g,uj as h,js as i,vj as j,Jc as k,Pd as l,tj as m,le as n,Fd as o,Nc as p,hi as q,YG as r};