5 lines
30 KiB
JavaScript
5 lines
30 KiB
JavaScript
var De=Object.defineProperty,Ie=Object.defineProperties;var Me=Object.getOwnPropertyDescriptors;var ce=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var ie=(e,s,n)=>s in e?De(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n,L=(e,s)=>{for(var n in s||(s={}))Le.call(s,n)&&ie(e,n,s[n]);if(ce)for(var n of ce(s))Pe.call(s,n)&&ie(e,n,s[n]);return e},ue=(e,s)=>Ie(e,Me(s));var Ae=(e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports);var V=(e,s,n)=>new Promise((a,o)=>{var l=r=>{try{i(n.next(r))}catch(v){o(v)}},d=r=>{try{i(n.throw(r))}catch(v){o(v)}},i=r=>r.done?a(r.value):Promise.resolve(r.value).then(l,d);i((n=n.apply(e,s)).next())});import{c as Ge,d as Ne,a as F,r as w,w as ze,v as Oe,o as p,b as h,e as t,t as m,p as B,f as T,g as O,u as k,F as x,n as X,h as j,i as je,j as qe,k as Q,l as ve,m as He,q as P,s as Ue,x as Z,y as q,z as ee,A,B as Ve}from"./vendor.js?c6e33ea3";var En=Ae(J=>{const We=function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};We();const Re=Ge(),Ye=Ne("theme",{state:()=>({popups:0}),getters:{}}),pe=()=>Re,I=window.L;var de;const he=((de=window==null?void 0:window.ThemeDog)==null?void 0:de.BaseURL)||"";var _e;const me=((_e=window==null?void 0:window.ThemeDog)==null?void 0:_e.HostName)||"",Xe=(window==null?void 0:window.ThemeDog.BG)||"/luci-static/themedog/image/bg.gif",ge=e=>he+"/icons/"+e+".png",fe=()=>me,ye=()=>new Promise((e,s)=>{if(!I){s([]);return}I.require("ui").then(function(n){if(n.menu){window.onbeforeunload=o=>{n.menu.flushCache()};const a=(o,l,d)=>{let i=[],r=(d||0)+1,v=n.menu.getChildren(o);if(v.length==0||r>2)return[];for(let g=0;g<v.length;g++){let f={title:window._(v[g].title),name:v[g].name,href:window.L.url(l,v[g].name),level:r,paths:[],isActive:window.L.env.dispatchpath[r]==v[g].name,children:[]};f.paths!=null&&(f.paths.push(o.name,v[g].name),f.children=a(v[g],l+"/"+v[g].name,r),i.push(f))}return i};n.menu.load().then(function(){let o=n.menu.getChildren();for(let l=0;l<o.length;l++)if(o[l].order&&o[l].order,I.env.requestpath.length?o[l].name==I.env.requestpath[0]:l==0){const i=a(o[l],o[l].name,0);e(i)}})}else e([])})}),we=()=>I.rpc.declare({object:"system",method:"board",expect:{}}),Ke=()=>I.rpc.declare({object:"system",method:"info",expect:{memory:{}}}),Je=()=>new Promise((e,s)=>{I.rpc.declare({object:"system",method:"info",expect:{localtime:0}})().then(a=>{e(a||0)}).catch(a=>{s(a)})}),Qe=()=>{window.L.network.getDevices().then(e=>{for(let s=0;s<e.length;s++)if(e[s].getCarrier())return!0;return!1})},Ze=()=>new Promise((e,s)=>{try{window.L.network.getWANNetworks().then(n=>{for(let a=0;a<n.length;a++){const l=n[a].isUp();if(l){e(l);return}}e(!1)})}catch(n){s(n)}}),$e=()=>window.L.rpc.declare({object:"system",method:"reboot"}),et=()=>window.L.network.getHostHints(),K=()=>new Promise((e,s)=>{try{I.require("network").then(n=>{n&&(n.getNetwork("wan").then(a=>{if(a){const o=a.getDevice();if(o)return e({up:o.getTXBytes(),down:o.getRXBytes()})}}),n.flushCache())})}catch(n){s(n)}});var tt=Object.freeze(Object.defineProperty({__proto__:null,BaseURL:he,HostName:me,BG:Xe,getIconBasePath:ge,getLOGO:fe,getNavMenus:ye,getSystemInfoBoard:we,getSystemInfoMemory:Ke,getSystemInfoLocaltime:Je,getNetworkDevices:Qe,getNetworksIsUp:Ze,reboot:$e,getNetworkHostHints:et,getUpDownData:K},Symbol.toStringTag,{value:"Module"}));const te=()=>new Date().getTime(),ke=(e,s)=>V(J,null,function*(){return new Promise((n,a)=>V(J,null,function*(){try{const o=yield fetch(e,s),l=L({},o);l.data=yield o.json(),n(l)}catch(o){a(o)}}))}),H=(e,s)=>ke(`/cgi-bin/luci/admin/themedog/api${e}`,s),be={GET(){return H("/status",{method:"GET"})}},Ce={GET(){return H("/cpu",{method:"GET"})}},xe={GET(){return H("/memory",{method:"GET"})}},Ee={GET(){return H("/version",{method:"GET"})}},Fe={GET(){return ke(`https://cdn.jsdelivr.net/gh/Carseason/openwrt-themedog/rpc/version.json?t=${te()}`,{method:"GET"})}},Be={BG:{POST(e){return H("/upload-bg",{method:"POST",body:e})}}};var st=Object.freeze(Object.defineProperty({__proto__:null,getTime:te,Status:be,Cpu:Ce,Memory:xe,LocalVersion:Ee,RemotelyVersion:Fe,Upload:Be},Symbol.toStringTag,{value:"Module"}));L(L({},tt),st);var S=(e,s)=>{const n=e.__vccOpts||e;for(const[a,o]of s)n[a]=o;return n};const se=e=>(B("data-v-f620deee"),e=e(),T(),e),nt={class:"themedog-iframe"},ot={class:"themedog-iframe_header"},at={class:"btns"},lt=se(()=>t("svg",{t:"1646852632231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2159",width:"128",height:"128"},[t("path",{d:"M515.1 932C286 932 99.5 745.6 99.5 516.4c0-16.5 13.4-29.9 29.9-29.9s29.9 13.4 29.9 29.9c0 196.2 159.6 355.8 355.8 355.8 118.4 0 228.7-58.6 295-156.9 9.3-13.7 27.9-17.3 41.6-8.1 13.7 9.3 17.3 27.9 8.1 41.6C782.3 863.6 653.4 932 515.1 932zM900.9 546.3c-16.5 0-29.9-13.4-29.9-29.9 0-196.2-159.6-355.8-355.8-355.8-114 0-221.9 55.2-288.7 147.8-9.7 13.4-28.3 16.5-41.8 6.7-13.4-9.7-16.4-28.4-6.7-41.8 78-108 204-172.6 337.1-172.6 229.2 0 415.7 186.5 415.7 415.7 0 16.5-13.4 29.9-29.9 29.9z",fill:"#666666","p-id":"2160"}),t("path",{d:"M53 636c-5 0-10.1-1.3-14.7-3.9-14.4-8.2-19.4-26.4-11.3-40.8l69.2-121.9c4.5-7.9 12.4-13.4 21.4-14.8 9-1.5 18.2 1.3 24.9 7.5l108.3 99.2c12.2 11.2 13 30.1 1.8 42.3-11.2 12.2-30.1 13-42.3 1.8l-80.6-73.9L79 620.8c-5.5 9.7-15.6 15.2-26 15.2zM904.4 579.5c-7.4 0-14.6-2.7-20.1-7.8l-104.1-94.6c-12.2-11.1-13.1-30.1-2-42.3 11.1-12.2 30-13.1 42.3-2l76.3 69.3 47.4-84.2c8.1-14.4 26.3-19.6 40.8-11.4 14.4 8.1 19.5 26.4 11.4 40.8l-65.8 116.9c-4.5 8-12.3 13.4-21.3 14.9-1.7 0.3-3.3 0.4-4.9 0.4z",fill:"#666666","p-id":"2161"})],-1)),ct=[lt],it=se(()=>t("svg",{t:"1646853987071",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3832",width:"128",height:"128"},[t("path",{d:"M864 448l-768 0C78.08 448 64 462.08 64 480 64 497.92 78.08 512 96 512l768 0C881.92 512 896 497.92 896 480 896 462.08 881.92 448 864 448z","p-id":"3833"})],-1)),ut=[it],rt=se(()=>t("svg",{t:"1646854000338",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3981",width:"128",height:"128"},[t("path",{d:"M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128l-265.344 263.936-263.04-263.84C236.64 191.584 216.384 191.52 203.84 204 191.328 216.48 191.296 236.736 203.776 249.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248 6.24 6.272 14.464 9.44 22.688 9.44 8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408 8.192 0 16.352-3.136 22.592-9.344 12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z","p-id":"3982"})],-1)),dt=[rt],_t={class:"themedog-iframe_body"},vt=["src","task"],pt=F({props:{task:{type:Object,required:!0},i:{type:Number,required:!0},ontask:{type:String,required:!0},onHiddenTask:{type:Function,required:!0},onClearTask:{type:Function,required:!0},onOpenTask:{type:Function,required:!0}},setup(e){const s=e,n=w();w(!0);const a=w(0),o=d=>{if(n.value){const i=n.value;if(i.contentWindow){let r=document.createElement("style");r.setAttribute("rel","stylesheet"),r.innerHTML=`html,body{
|
|
background: none !important;
|
|
color-scheme: none !important;
|
|
}`,i.contentWindow.document.head.appendChild(r)}}if(s.task.href=="/cgi-bin/luci/admin/store"&&n.value){const i=n.value;i.contentWindow&&(i.contentWindow.onclick=r=>{l(r)})}},l=d=>{var i,r;if(d.target){const v=d.target;if(v.tagName=="A"&&v.className=="app-btn cbi-button cbi-button-apply"&&v.textContent=="\u6253\u5F00"){const g=d.composedPath();let f="",$="";const C=v.getAttribute("href")||"";if(g.length>2){const D=g[2];$=((i=D.querySelector(".app-title"))==null?void 0:i.getAttribute("title"))||"",f=((r=D.querySelector("span.app-name"))==null?void 0:r.textContent)||""}s.onOpenTask({title:f,name:$,href:C,paths:[],level:0,isActive:!1,children:[]}),d.preventDefault()}}};return(d,i)=>ze((p(),h("div",nt,[(p(),h("div",{class:"themedog-iframe_main",key:a.value},[t("div",ot,[t("span",null,m(e.task.title),1),t("div",at,[t("button",{class:"btn-refresh",onClick:i[0]||(i[0]=r=>a.value++)},ct),t("button",{class:"btn-full",onClick:i[1]||(i[1]=r=>e.onHiddenTask(e.i))},ut),t("button",{class:"btn-close",onClick:i[2]||(i[2]=r=>e.onClearTask(e.i))},dt)])]),t("div",_t,[t("iframe",{class:"themedog-iframe_container",allowfullscreen:"true",mozallowfullscreen:"mozallowfullscreen",msallowfullscreen:"msallowfullscreen",oallowfullscreen:"oallowfullscreen",webkitallowfullscreen:"webkitallowfullscreen",src:e.task.href,task:e.task.href=="/cgi-bin/luci/admin/store",onLoad:o,ref_key:"el",ref:n},null,40,vt)])]))],512)),[[Oe,e.task.href==e.ontask]])}});var ht=S(pt,[["__scopeId","data-v-f620deee"]]);const mt=e=>{if(e)try{var s=new Date(Number(e)*1e3),n=s.getHours(),a=s.getMinutes();let o=s.getSeconds();return n<10&&(n=`0${n}`),a<10&&(a=`0${a}`),o<10&&(o=`0${o}`),`${n}:${a} ${o}`}catch(o){}return""},gt=e=>{if(e)try{var s=new Date(Number(e)*1e3),n=s.getFullYear(),a=s.getMonth()+1,o=s.getDate();return n+"\u5E74"+a+"\u6708"+o+"\u65E5 "}catch(l){}return""},ft=e=>{if(e<1e3)return`${e}/B`;let n=1e3,a=0;for(let d=e/1e3;d>=1e3;d/=1e3)n*=1e3,a++;let o=["/KB","/MB","/GB","/TB","/PB","/EB"];return(e/100/(n/100)).toFixed(1)+o[a]},yt=e=>{if(e<1024)return""+e+"KB";let n=1024,a=0;for(let l=e/1024;l>=1024;l/=1024)n*=1024,a++;let o=["M","G","T","P","E"];return(e/100/(n/100)).toFixed(2)+o[a]};var wt=Object.freeze(Object.defineProperty({__proto__:null,dateForm:mt,dateYearDayForm:gt,byteToSize:ft,numberToSize:yt},Symbol.toStringTag,{value:"Module"})),W=L({},wt);const Te=e=>(B("data-v-38a7653c"),e=e(),T(),e),$t={class:"total"},kt={class:"memory"},bt=Te(()=>t("span",null,"CPU",-1)),Ct={class:"progress"},xt={class:"memory"},Et=Te(()=>t("span",null,"\u5185\u5B58",-1)),Ft={class:"progress"},Bt={class:"up"},Tt={class:"date"},St=F({setup(e){const s=w(""),n=w(""),a=w(),o=w(),l=w(0),d=w(0),i=()=>{r(),v(),setInterval(()=>{v()},5e3)},r=()=>{be.GET().then(c=>{var _;if(((_=c==null?void 0:c.data)==null?void 0:_.success)==!0){const u=c.data.result;if(u!=null){let y=u.locallTime||0;n.value=W.dateForm(`${y}`),s.value=W.dateYearDayForm(`${y}`),setInterval(()=>{n.value=W.dateForm(`${y++}`)},1e3)}}})},v=()=>V(this,null,function*(){Ce.GET().then(c=>{var _;if(((_=c==null?void 0:c.data)==null?void 0:_.success)==!0){const u=c.data.result;u!=null&&(a.value=u)}}),xe.GET().then(c=>{var _;if(((_=c==null?void 0:c.data)==null?void 0:_.success)==!0){const u=c.data.result;u!=null&&(o.value=u)}});try{let c=0,_=0,u=0,y=0;const b=yield K();b&&(c=b.up||0,_=b.down||0);const Y=yield g();Y&&(u=Y.up||0,y=Y.down||0);const ae=u-c,le=y-_;ae>=0&&le>=0?(l.value=ae,d.value=le):(l.value=0,d.value=0)}catch(c){}}),g=()=>new Promise((c,_)=>{setTimeout(()=>{const u=K();c(u)},1e3)});i();const f=O(()=>{if(o.value==null)return null;const c=o.value;return c.available!=null&&c.total!=null?(100-c.available/c.total*100).toFixed(2):0}),$=O(()=>{if(a.value==null)return null;const c=a.value;return c.available!=null&&c.total!=null?(100-c.available/c.total*100).toFixed(2):0}),C=W.byteToSize,D=c=>{let _={height:`${c}%`};return c>=80?_.background="#ff0000":c>=60?_.background="#ff9900":c>=40&&(_.background="#3eff08"),_};return(c,_)=>(p(),h("div",$t,[k($)!=null?(p(),h(x,{key:0},[t("div",kt,[t("span",null,m(k($))+"%",1),bt]),t("div",Ct,[t("em",{style:X(D(k($)))},null,4)])],64)):j("",!0),k(f)!=null?(p(),h(x,{key:1},[t("div",xt,[t("span",null,m(k(f))+"%",1),Et]),t("div",Ft,[t("em",{style:X(D(k(f)))},null,4)])],64)):j("",!0),t("div",Bt,[t("span",null,m(k(C)(l.value))+" | \u4E0A\u4F20",1),t("span",null,m(k(C)(d.value))+" | \u4E0B\u8F7D",1)]),t("div",Tt,[t("span",null,m(n.value),1),t("span",null,m(s.value),1)])]))}});var Dt=S(St,[["__scopeId","data-v-38a7653c"]]);const R=e=>(B("data-v-2b644944"),e=e(),T(),e),It={key:0,class:"loading icon"},Mt=R(()=>t("svg",{t:"1631799919469",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3453",width:"128",height:"128"},[t("path",{d:"M522.695111 1.991111c-26.339556 0.170667-47.416889 21.475556-47.672889 48.753778-0.284444 26.453333-0.056889 52.963556-0.056889 79.445333 0 27.249778-0.369778 54.528 0.113778 81.777778 0.483556 27.050667 22.016 47.132444 49.351111 46.904889a47.786667 47.786667 0 0 0 47.729778-47.445333c0.284444-53.76 0.284444-107.52-0.028444-161.251556-0.170667-27.676444-21.902222-48.355556-49.436445-48.184889m-195.896889 88.092445c-8.334222-14.222222-21.646222-21.276444-38.314666-21.333334-35.128889 0-56.576 36.949333-38.968889 68.152889a11616.995556 11616.995556 0 0 0 78.961777 137.614222 44.942222 44.942222 0 0 0 61.838223 16.896c21.304889-12.202667 29.667556-38.968889 17.379555-60.871111-26.453333-47.104-53.560889-93.866667-80.896-140.458666m-228.693333 234.524444c44.316444 25.799111 88.746667 51.342222 133.176889 76.970667 6.712889 3.896889 13.681778 6.912 21.703111 6.428444 20.138667 0.142222 35.953778-11.946667 41.301333-31.573333 5.006222-18.261333-2.673778-36.721778-20.224-46.990222-44.629333-26.026667-89.372444-51.882667-134.115555-77.710223-22.528-12.999111-47.815111-7.025778-59.818667 13.909334-12.231111 21.248-4.977778 45.624889 17.948444 58.965333m34.161778 235.975111c26.396444 0 52.821333 0.199111 79.217778-0.085333 23.409778-0.256 39.139556-16.412444 38.798222-39.139556-0.341333-21.617778-16.924444-37.347556-39.594666-37.376-51.655111-0.056889-103.310222-0.056889-154.965334 0.028445-24.177778 0.056889-40.704 15.985778-40.561778 38.684444 0.142222 22.186667 16.583111 37.745778 40.192 37.859556 25.656889 0.142222 51.285333 0.028444 76.913778 0m151.722667 100.238222a34.247111 34.247111 0 0 0-46.876445-12.942222 13764.778667 13764.778667 0 0 0-139.008 80.583111c-11.093333 6.485333-16.327111 16.867556-16.497777 25.372444 0.085333 30.549333 27.249778 47.957333 50.403555 35.072 47.160889-26.197333 93.724444-53.475556 140.145778-80.924444 17.180444-10.154667 21.504-30.378667 11.832889-47.160889m91.875555 101.660444c-14.250667-4.067556-27.619556 1.422222-35.84 15.644445a24375.466667 24375.466667 0 0 0-77.312 134.485333c-10.012444 17.550222-5.859556 35.669333 9.784889 45.027556 16.014222 9.557333 34.247111 4.039111 44.714667-13.994667 25.543111-44.088889 50.915556-88.263111 76.373333-132.352 3.299556-5.745778 5.688889-11.690667 5.745778-14.933333 0-17.834667-9.272889-29.866667-23.466667-33.877334m147.456 44.288c-16.384 0.085333-27.306667 11.918222-27.448888 30.151111-0.142222 25.372444-0.028444 50.716444-0.028445 76.060445h-0.085333c0 26.112-0.113778 52.252444 0.056889 78.364444 0.113778 18.261333 11.064889 30.065778 27.448889 30.208 16.952889 0.142222 28.046222-11.832889 28.103111-30.748444 0.113778-51.086222 0.142222-102.172444 0.056889-153.258667 0-18.773333-11.207111-30.862222-28.103112-30.776889m177.208889-26.112c-7.509333-12.8-21.902222-16.014222-33.792-8.874666a23.722667 23.722667 0 0 0-8.533333 32.995555c26.282667 46.279111 52.906667 92.330667 79.644444 138.353778 4.494222 7.765333 11.633778 11.946667 20.906667 11.804444 18.545778-0.142222 30.520889-19.342222 21.219556-35.868444-26.026667-46.392889-52.650667-92.444444-79.473778-138.410667m239.957333-41.187555c-45.283556-26.254222-90.595556-52.48-135.964444-78.648889-4.693333-2.702222-9.728-4.323556-15.36-2.958222-9.102222 2.247111-14.933333 8.049778-16.497778 17.095111-1.877333 10.894222 3.84 18.204444 12.885333 23.438222 29.809778 17.180444 59.562667 34.417778 89.344 51.598222 15.217778 8.789333 30.236444 17.976889 45.738667 26.225778 14.677333 7.793778 31.061333-2.048 31.061333-18.033778-0.056889-8.448-4.096-14.592-11.207111-18.716444m48.867556-234.638222c-24.888889-0.085333-49.749333 0-74.609778 0v-0.085334c-25.258667 0-50.517333-0.056889-75.776 0.028445-13.425778 0.056889-20.963556 6.343111-21.162667 17.294222-0.199111 11.150222 7.082667 17.521778 20.679111 17.550222 50.488889 0.113778 100.977778 0.142222 151.495112 0.085333 13.368889 0 21.191111-6.485333 21.390222-17.152 0.227556-10.808889-8.106667-17.664-22.016-17.720888m-187.960889-127.146667c45.084444-26.026667 90.140444-52.110222 135.168-78.222222 4.864-2.844444 8.248889-6.855111 8.135111-12.942223-0.142222-11.036444-11.207111-17.436444-21.504-11.548444-45.511111 26.055111-90.851556 52.394667-136.135111 78.819556-7.68 4.494222-10.524444 11.52-5.575111 19.569777 4.835556 7.850667 12.088889 8.817778 19.911111 4.323556m-122.311111-115.114667c5.205333-0.256 8.220444-3.413333 10.609778-7.651555 4.920889-8.647111 10.040889-17.208889 14.990222-25.827556 20.48-35.555556 40.931556-71.025778 61.297778-106.609778 5.091556-8.874667 3.015111-16.668444-4.778667-18.517333-7.68-1.848889-10.894222 3.697778-14.051556 9.159111l-68.778666 119.495111c-2.844444 4.977778-6.030222 9.870222-8.305778 15.104-3.128889 7.196444 1.678222 14.648889 9.045333 14.848","p-id":"3454"})],-1)),Lt=[Mt],Pt={key:1,class:"success icon"},At=R(()=>t("svg",{t:"1632451272305",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2204",width:"128",height:"128"},[t("path",{d:"M1001.305115 275.874141 431.461709 845.718571c-28.221762 28.221762-73.977875 28.221762-102.20066 0L22.661116 539.116591c-28.222785-28.221762-28.222785-73.979922 0-102.20066 28.221762-28.221762 73.977875-28.221762 102.20066 0l255.500115 255.502162 518.743588-518.743588c28.221762-28.221762 73.977875-28.221762 102.199637 0C1029.5279 201.89422 1029.5279 247.65238 1001.305115 275.874141z","p-id":"2205"})],-1)),Gt=[At],Nt={key:2,class:"error icon"},zt=R(()=>t("svg",{t:"1632451325789",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2204",width:"128",height:"128"},[t("path",{d:"M823.04 840.32 524.16 540.16l296.32-294.4c12.8-12.8 12.8-33.28 0-45.44-12.8-12.8-33.28-12.8-46.08 0L478.08 494.08 184.96 200.32c-12.8-12.8-33.28-12.8-45.44 0s-12.8 33.28 0 45.44l292.48 293.76-302.72 300.8c-12.8 12.8-12.8 33.28 0 45.44 12.8 12.8 33.28 12.8 46.08 0l302.72-300.16 299.52 300.16c12.8 12.8 33.28 12.8 45.44 0C835.2 873.6 835.2 853.12 823.04 840.32z","p-id":"2205"})],-1)),Ot=[zt],jt={key:3,class:"warning icon"},qt=R(()=>t("svg",{t:"1632451401172",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1638",width:"128",height:"128"},[t("path",{d:"M512 1021.45211835a60.32985613 60.32985613 0 1 1 60.32985613-60.32985611 60.32985613 60.32985613 0 0 1-60.32985613 60.32985611z m86.85823451-924.97400238L572.32985613 719.80283775a60.32985613 60.32985613 0 0 1-120.65971226 0l-26.52837838-623.32472178c-0.16758294-2.22885301-0.28489098-4.49122263-0.284891-6.78710881a87.14312551 87.14312551 0 0 1 174.28625102 0c0 2.2958862-0.11730806 4.5582558-0.284891 6.78710881z","p-id":"1639"})],-1)),Ht=[qt],Ut=F({props:{type:String,message:String,Close:Function},setup(e){const s=e,n=w(!1);je(()=>{n.value=!0});const a=()=>{(s==null?void 0:s.type)!="loading"&&(n.value=!1,s.Close&&s.Close())};return(o,l)=>n.value?(p(),h("div",{key:0,class:"toast",onClick:l[1]||(l[1]=d=>a())},[e.type=="loading"?(p(),h("div",It,Lt)):e.type=="success"?(p(),h("div",Pt,Gt)):e.type=="error"?(p(),h("div",Nt,Ot)):e.type=="warning"?(p(),h("div",jt,Ht)):j("",!0),t("div",{class:"message",onClick:l[0]||(l[0]=qe(()=>{},["stop"]))},m(e.message),1)])):j("",!0)}});var Vt=S(Ut,[["__scopeId","data-v-2b644944"]]);const z=new Map,M=e=>{const s=Q(Vt,ue(L({},e),{Close:()=>{a()}})),n=document.createElement("div");document.body.append(n),s.mount(n);const a=()=>{n.remove(),z.get(s._uid)&&z.delete(s._uid)};return e.type=="loading"&&z.set(s._uid,{Close:a}),(e==null?void 0:e.duration)==0||((e==null?void 0:e.duration)>0?setTimeout(()=>{a()},e==null?void 0:e.duration):setTimeout(()=>{a()},3e3)),{Close:a}},E=e=>M(e);E.Loading=e=>M({type:"loading",message:e||"\u52A0\u8F7D\u4E2D...",duration:0});E.Success=e=>M({type:"success",message:e});E.Error=e=>M({type:"error",message:e});E.Warning=e=>M({type:"warning",message:e});E.Message=e=>M({message:e});E.Message=e=>M({message:e});E.Clear=()=>{z.forEach((e,s)=>{e.Close(),z.delete(s)})};const Se=e=>(B("data-v-1c9a06dc"),e=e(),T(),e),Wt={class:"title"},Rt=Se(()=>t("div",{class:"auto"},null,-1)),Yt={class:"btns"},Xt=Se(()=>t("svg",{t:"1646854000338",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3981",width:"128",height:"128"},[t("path",{d:"M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128l-265.344 263.936-263.04-263.84C236.64 191.584 216.384 191.52 203.84 204 191.328 216.48 191.296 236.736 203.776 249.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248 6.24 6.272 14.464 9.44 22.688 9.44 8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408 8.192 0 16.352-3.136 22.592-9.344 12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z","p-id":"3982"})],-1)),Kt=[Xt],Jt={class:"themedog-popups_body"},Qt=F({props:{title:{type:String}},setup(e){const s=Ue(),n=w(!1),a=w(null),o=ve({left:"",top:""}),l=()=>{s&&s.appContext.config.globalProperties.$close()},d=f=>{const $=a.value;if($==null||n.value)return;let C=f.clientX-$.offsetLeft,D=f.clientY-$.offsetTop,c=document.body.clientWidth-$.offsetWidth,_=document.body.clientHeight-$.offsetHeight;document.onmousemove=u=>{let y=u.clientX-C,b=u.clientY-D;b<0&&(b=0),y<0&&(y=0),y>c&&(y=c),b>_&&(b=_),o.left=y+"px",o.top=b+"px"},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null}},i=()=>{n.value=!n.value},r=Ye();r.popups=s==null?void 0:s.appContext.config.globalProperties.$uid;const v=O(()=>s?r.popups==(s==null?void 0:s.appContext.config.globalProperties.$uid):!1),g=()=>{s&&(r.popups=s.appContext.config.globalProperties.$uid)};return(f,$)=>(p(),h("div",{class:P(["themedog-popups",{full:n.value,index:k(v)}]),style:X(n.value?{}:k(o)),ref_key:"popus",ref:a},[t("div",{class:"themedog-popups_header",onMousedown:d,onClick:g,onDblclick:i},[t("span",Wt,m(e.title),1),Rt,t("div",Yt,[t("button",{class:"btn-close",onClick:$[0]||($[0]=C=>l())},Kt)])],32),t("div",Jt,[He(f.$slots,"default",{},void 0,!0)])],6))}});var Zt=S(Qt,[["__scopeId","data-v-1c9a06dc"]]);const G=e=>(B("data-v-6788ac0c"),e=e(),T(),e),es=G(()=>t("div",{class:"action_key"},"kernel:",-1)),ts={class:"action_value"},ss=G(()=>t("div",{class:"action_key"},"hostname:",-1)),ns={class:"action_value"},os=G(()=>t("div",{class:"action_key"},"system:",-1)),as={class:"action_value"},ls=G(()=>t("div",{class:"action_key"},"model:",-1)),cs={class:"action_value"},is=G(()=>t("div",{class:"action_key"},"board_name:",-1)),us={class:"action_value"},rs=G(()=>t("div",{class:"action_key"},"release:",-1)),ds={class:"action_value"},_s=F({setup(e){const s=w();return(()=>{we()().then(o=>{o&&(s.value=o)})})(),(a,o)=>{const l=Z("popups");return p(),q(l,{title:"\u7CFB\u7EDF\u4FE1\u606F"},{default:ee(()=>{var d,i,r,v,g,f,$;return[t("li",null,[es,t("div",ts,m((d=s.value)==null?void 0:d.kernel),1)]),t("li",null,[ss,t("div",ns,m((i=s.value)==null?void 0:i.hostname),1)]),t("li",null,[os,t("div",as,m((r=s.value)==null?void 0:r.system),1)]),t("li",null,[ls,t("div",cs,m((v=s.value)==null?void 0:v.model),1)]),t("li",null,[is,t("div",us,m((g=s.value)==null?void 0:g.board_name),1)]),t("li",null,[rs,t("div",ds,m(($=(f=s.value)==null?void 0:f.release)==null?void 0:$.description),1)])]}),_:1})}}});var vs=S(_s,[["__scopeId","data-v-6788ac0c"]]);const N=e=>(B("data-v-12b13536"),e=e(),T(),e),ps=N(()=>t("li",null,[t("div",{class:"action_key"},"\u4E3B\u9898\u540D\u79F0:"),t("div",{class:"action_value"}," \u4E3B\u9898\u72D7 ")],-1)),hs=N(()=>t("li",null,[t("div",{class:"action_key"},"\u4F5C\u8005:"),t("div",{class:"action_value"}," Carseason ")],-1)),ms=N(()=>t("div",{class:"action_key"},"\u5F53\u524D\u7248\u672C:",-1)),gs={class:"action_value"},fs=N(()=>t("div",{class:"action_key"},"\u6700\u65B0\u7248\u672C:",-1)),ys={class:"action_value"},ws=N(()=>t("li",null,[t("div",{class:"action_key"},"\u9879\u76EE\u5730\u5740:"),t("div",{class:"action_value"},[t("a",{href:"https://github.com/Carseason/openwrt-themedog",target:"_blank",rel:"noopener noreferrer"},"\u67E5\u770B\u5730\u5740")])],-1)),$s=N(()=>t("div",{class:"action_key"},"\u66F4\u65B0\u5185\u5BB9:",-1)),ks={class:"action_value"},bs=F({setup(e){const s=w(""),n=ve({version:"",description:""});return(()=>{Ee.GET().then(o=>{o.data.result&&(s.value=o.data.result.version)}),Fe.GET().then(o=>{o.data.result&&(n.version=o.data.result.version,n.description=o.data.result.description)})})(),(o,l)=>{const d=Z("popups");return p(),q(d,{title:"\u4E3B\u9898\u4FE1\u606F"},{default:ee(()=>[ps,hs,t("li",null,[ms,t("div",gs,m(s.value),1)]),t("li",null,[fs,t("div",ys,m(k(n).version),1)]),ws,t("li",null,[$s,t("div",ks,m(k(n).description),1)])]),_:1})}}});var Cs=S(bs,[["__scopeId","data-v-12b13536"]]);const ne=e=>(B("data-v-79553133"),e=e(),T(),e),xs={class:"label"},Es=ne(()=>t("div",{class:"key"},[t("span",null,"\u684C\u9762\u80CC\u666F")],-1)),Fs={class:"value"},Bs=["src"],Ts={class:"label"},Ss=ne(()=>t("div",{class:"key"},null,-1)),Ds={class:"value"},Is={class:"upload",title:"\u4E0A\u4F20\u80CC\u666F"},Ms=ne(()=>t("span",null,"\u4E0A\u4F20\u80CC\u666F",-1)),Ls=F({setup(e){const s=te(),n=w(0),a=l=>{if(l&&(l==null?void 0:l.target)){const i=l.target.files;if(i){const r=i[0];o(r)}}},o=l=>{const d=new FormData;d.append("file",l),Be.BG.POST(d).then(i=>{if(i.data.result){const r=i.data.result;if(n.value++,r!=null&&r.filename!=""){E.Success("\u4E0A\u4F20\u6210\u529F,\u8BF7\u5237\u65B0\u7F13\u5B58\u67E5\u770B");return}E.Warning("\u4E0A\u4F20\u5931\u8D25")}})};return(l,d)=>{const i=Z("popups");return p(),q(i,{title:"\u684C\u9762\u7BA1\u7406"},{default:ee(()=>[t("div",xs,[Es,t("div",Fs,[t("img",{src:`/luci-static/themedog/image/bg.gif?v=${k(s)}t=${n.value}`,alt:""},null,8,Bs)])]),t("div",Ts,[Ss,t("div",Ds,[t("label",Is,[t("input",{type:"file",accept:"image/jpeg, image/jpg, image/png, image/gif",hidden:"",onChange:a},null,32),Ms])])])]),_:1})}}});var Ps=S(Ls,[["__scopeId","data-v-79553133"]]);const re={count:0},oe=(e,s)=>{const n=document.createElement("div");document.body.appendChild(n);const a=Q(e,s);a.config.globalProperties.$uid=re.count,a.config.globalProperties.$close=()=>{o()};const o=()=>{a.unmount(),n.remove()};return a.use(pe()),a.component("popups",Zt),a.mount(n),re.count++,{Close:o}},As=()=>oe(vs),Gs=()=>oe(Cs),Ns=()=>oe(Ps),zs=e=>(B("data-v-3f4f714e"),e=e(),T(),e),Os={class:"system-tool_container"},js={class:"system-tool_container-nav"},qs=["onClick"],Hs={class:"system-tool_container-btns"},Us=zs(()=>t("a",{href:"/cgi-bin/luci/admin/logout"},"\u6CE8\u9500\u767B\u5F55",-1)),Vs=F({emits:["click"],setup(e,{emit:s}){const n=()=>{s("click")},a=w([{title:"\u684C\u9762\u7BA1\u7406",func:()=>{Ns()}},{title:"\u4E3B\u9898\u4FE1\u606F",func:()=>{Gs()}}]),o=()=>{if(!confirm("\u662F\u5426\u91CD\u542F\u8BBE\u5907?"))return;$e()().then(()=>{})};return(l,d)=>(p(),h("div",{class:"system-tool",onClick:d[1]||(d[1]=i=>n())},[t("div",Os,[t("div",js,[(p(!0),h(x,null,A(a.value,i=>(p(),h("a",{onClick:i.func},m(i.title),9,qs))),256))]),t("div",Hs,[t("a",{onClick:d[0]||(d[0]=i=>o())},"\u91CD\u542F\u8BBE\u5907"),Us])])]))}});var Ws=S(Vs,[["__scopeId","data-v-3f4f714e"]]);const U=e=>(B("data-v-2deb27d6"),e=e(),T(),e),Rs={class:"themedog-main"},Ys=U(()=>t("div",{class:"themedog-header"},null,-1)),Xs={class:"themedog-body"},Ks={class:"themedog-container"},Js={class:"themedog-container_nav"},Qs={class:"nav-list use"},Zs=U(()=>t("div",{class:"nav-list_header"},"\u5FEB\u901F\u5F00\u59CB",-1)),en={class:"nav-list_children"},tn=["onClick"],sn={class:"nav-list_item-icon"},nn=["src"],on={class:"nav-list_item-text"},an={class:"nav-list_header"},ln={class:"nav-list_children"},cn=["onClick"],un={class:"nav-list_item-icon"},rn=["src"],dn={class:"nav-list_item-text"},_n=["onClick"],vn={class:"nav-list_item-icon"},pn=["src"],hn={class:"nav-list_item-text"},mn={class:"themedog-footer"},gn=U(()=>t("em",null,[t("i")],-1)),fn={class:"logo"},yn={class:"tasks"},wn=["title","onClick"],$n=U(()=>t("i",null,null,-1)),kn=U(()=>t("div",{class:"auto"},null,-1)),bn=F({setup(e){const s=w(fe()),n=w([]),a=w(!1),o=w([]),l=w(""),d=O(()=>{let c=[{name:"system-info",title:"\u7CFB\u7EDF\u4FE1\u606F",callback:()=>{As()}}];for(let _=0;_<n.value.length;_++){const u=n.value[_];switch(u.name){case"quickstart":case"network_guide":case"store":c.push(u);break}}return c}),i=O(()=>{let c=[];for(let _=0;_<n.value.length;_++){const u=n.value[_];switch(u.name){case"logout":case"quickstart":case"network_guide":case"store":continue;default:c.push(u)}}return c}),r=ge,v=c=>{if(c.target){const _=c.target;_.src=r("app-icon")}},g=c=>{c.callback?c.callback():f(c)},f=c=>{for(let _=0;_<o.value.length;_++)if(c.href==o.value[_].href){l.value==c.href?l.value="":l.value=c.href||"";return}o.value.push(c),l.value=c.href||""},$=c=>{o.value[c],o.value.splice(c,1),l.value=""},C=c=>{l.value=""};return(()=>{ye().then(c=>{n.value=c})})(),(c,_)=>(p(),h(x,null,[t("div",Rs,[Ys,t("div",Xs,[t("div",Ks,[t("div",Js,[t("ul",Qs,[Zs,t("div",en,[(p(!0),h(x,null,A(k(d),u=>(p(),h("a",{class:P(["nav-list_item",u.name]),onClick:y=>g(u)},[t("div",sn,[t("img",{src:k(r)(u.name),alt:"\u56FE\u6807\u8D70\u4E22\u4E86\uFF5E",onError:v},null,40,nn)]),t("div",on,m(u.title),1)],10,tn))),256))])]),(p(!0),h(x,null,A(k(i),u=>(p(),h("ul",{class:P(["nav-list",u.name])},[t("div",an,m(u.title),1),t("div",ln,[u.children!=null&&u.children.length>0?(p(!0),h(x,{key:0},A(u.children,y=>(p(),h("a",{class:P(["nav-list_item",y.name]),onClick:b=>g(y)},[t("div",un,[t("img",{src:k(r)(y.name),alt:"\u56FE\u6807\u8D70\u4E22\u4E86\uFF5E",onError:v},null,40,rn)]),t("div",dn,m(y.title),1)],10,cn))),256)):(p(),h("a",{key:1,class:P(["nav-list_item",u.name]),onClick:y=>g(u)},[t("div",vn,[t("img",{src:k(r)(u.name),alt:"\u56FE\u6807\u8D70\u4E22\u4E86\uFF5E",onError:v},null,40,pn)]),t("div",hn,m(u.title),1)],10,_n))])],2))),256))])])]),a.value?(p(),q(Ws,{key:0,onClick:_[0]||(_[0]=u=>a.value=!1)})):j("",!0),t("div",mn,[t("div",{class:"system",onClick:_[1]||(_[1]=u=>a.value=!a.value)},[gn,t("div",fn,m(s.value),1)]),t("div",yn,[(p(!0),h(x,null,A(o.value,u=>(p(),h("a",{class:P({on:u.href==l.value}),title:u.title,onClick:y=>g(u)},[$n,t("span",null,m(u.title),1)],10,wn))),256))]),kn,Ve(Dt)])]),(p(!0),h(x,null,A(o.value,(u,y)=>(p(),q(ht,{task:u,i:y,onHiddenTask:C,onClearTask:$,onOpenTask:f,ontask:l.value},null,8,["task","i","ontask"]))),256))],64))}});var Cn=S(bn,[["__scopeId","data-v-2deb27d6"]]);const xn=()=>{const e=document.createElement("div");document.body.appendChild(e),e.id="themedog";const s=Q(Cn),n=pe();s.use(n),s.mount(e)};xn()});export default En();
|