k5web/assets/index.a5a1814c.js

2 lines
6.7 KiB
JavaScript
Raw Normal View History

2024-08-04 06:03:13 +00:00
import{s as Y,u as Z,M as g,ac as tt,N as et,_ as ot}from"./index.413febc1.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as at,r as C,o as nt,bT as st,bI as lt,C as p,D as b,aI as t,aH as e,G as m,u as _,aK as k,aM as l,aN as r,aJ as L,aE as $,b7 as E,bh as it,bU as rt,bV as ut,bK as dt,bO as ct,bm as pt,bn as mt}from"./arco.76adc92f.js";import{g as _t}from"./vue.107cc2d0.js";import{R as ft,L as wt,a as gt,D as bt,T as ht,U as yt}from"./index.350c144b.js";import{s as kt,P as vt}from"./dep-6deb4e3a.3da13c94.js";import{L as At}from"./index.f132f61a.js";import{I as Ft}from"./index.d49b744e.js";import{F as xt,a as Ct}from"./index.6d7e872a.js";import"./chart.d41e8c5b.js";import"./slot.c1690aae.js";import"./index.df9fea37.js";import"./index.43e2a6eb.js";import"./form-model.553a3655.js";const Lt=h=>(pt("data-v-b7fd0e1a"),h=h(),mt(),h),$t={class:"container"},Et={style:{"margin-right":"20px"}},Ut={style:{color:"#373737",margin:"10px"}},It={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Dt={style:{display:"flex",width:"100%"}},Bt={style:{width:"90%"}},Vt=Lt(()=>m("br",null,null,-1)),St={style:{width:"10%",margin:"auto","text-align":"center"}},Pt={name:"Backup"},Rt=at({...Pt,setup(h){Y();const d=Z(),U=_t(),s=C({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),i=C({title:"",desc:"",firmware:[]});nt(async()=>{F({current:1})});const F=async a=>{s.page=a.current;const n=await g.get("https://k6.vicicode.cn/wsapi/list?type=0&limit=12&page="+a.current+"&t="+Date.now());s.total=n.total,s.nowpage=n.data},f=async()=>{s.refLoading=!0,s.showPanel=!0;const a=await g.post("https://k6.vicicode.cn/wsapi/my_list",{type:0,token:d.accountId});s.myList=a.data,s.refLoading=!1},I=()=>{i.title="",i.desc="",i.firmware=[],s.showUpload=!0},D=async()=>{if(i.title==""||i.firmware.length==0){E.error({content:"\u672A\u586B\u5199\u540D\u79F0\u53CA\u4E0A\u4F20\u6587\u4EF6",duration:5*1e3});return}await g.post("https://k6.vicicode.cn/wsapi/upload",{type:0,token:d.accountId,title:i.title,desc:i.desc,data:i.firmware[0].url}),s.showUpload=!1,f()},B=async a=>{await g.post("https://k6.vicicode.cn/wsapi/delete",{id:a,token:d.accountId}),f()},V=async a=>{await g.post("https://k6.vicicode.cn/wsapi/star",{id:a}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{f()},P=a=>{U.push({path:"/tool/flash",query:{url:a}})},R=(a,n)=>{fetch(a).then(w=>w.blob()).then(w=>{const u=URL.createObjectURL(w),c=document.createElement("a");c.href=u,c.download=n,document.body.appendChild(c),c.click(),document.body.removeChild(c)})};return(a,n)=>{const w=tt,u=it,c=kt,N=rt,T=ut,z=st,M=vt,j=lt,K=dt,O=ct,v=et,q=At,G=wt,H=gt,x=bt,J=Ft,y=xt,Q=ht,W=yt,X=Ct;return p(),b("div",$t,[t(w,{items:[a.$t("menu.workshop"),a.$t("menu.firmware")]},null,8,["items"]),t(O,{gutter:20,align:"stretch"},{default:e(()=>[t(K,{span:24},{default:e(()=>[t(j,{class:"general-card",title:a.$t("menu.firmware")},{extra:e(()=>[m("div",Et,[_(d).name?(p(),b(k,{key:0},[t(u,{onClick:f},{default:e(()=>[l("\xA0\xA0"+r(_(d).name)+"\xA0\xA0",1)]),_:1}),t(u,{onClick:f},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),t(u,{onClick:n[0]||(n[0]=o=>_(d).logout())},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(p(),b(k,{key:1},[t(u,{onClick:n[1]||(n[1]=o=>_(d).setInfo({showLogin:!0}))},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.login"))+"\xA0\xA0",1)]),_:1}),t(u,{onClick:n[2]||(n[2]=o=>_(d).setInfo({showRegister:!0}))},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.register"))+"\xA0\xA0",1)]),_:1}),m("span",Ut,r(a.$t("global.loginUpload")),1)],64))])]),default:e(()=>[t(z,null,{default:e(()=>[(p(!0),b(k,null,L(s.nowpage,o=>(p(),$(T,{style:{width:"100%"}},{actions:e(()=>[t(u,{onClick:A=>V(o.id)},{default:e(()=>[l("\u{1F44D}")]),_:2},1032,["onClick"]),t(u,{onClick:A=>R("https://k6.