k5web/assets/index.0c03ba31.js

2 lines
6.7 KiB
JavaScript
Raw Normal View History

2024-09-02 02:23:47 +00:00
import{t as Y,u as Z,N as g,ad as tt,O as et,_ as ot}from"./index.abba0c49.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 h,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.b087a425.js";import{g as _t}from"./vue.23fb8a9a.js";import{R as ft,L as wt,a as gt,D as ht,T as bt,U as yt}from"./index.f84ec5f5.js";import{s as kt,P as vt}from"./dep-71c4f289.dccc98fb.js";import{L as At}from"./index.82fa7dea.js";import{I as Ft}from"./index.eda8ee4b.js";import{F as xt,a as Ct}from"./index.8300d0d3.js";import"./chart.836a9fe2.js";import"./slot.b022806d.js";import"./index.b6534759.js";import"./form-model.9a62c8df.js";import"./index.a603a429.js";const Lt=b=>(pt("data-v-70f49e16"),b=b(),mt(),b),$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(b){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://k5.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://k5.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://k5.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://k5.vicicode.cn/wsapi/delete",{id:a,token:d.accountId}),f()},V=async a=>{await g.post("https://k5.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,O=lt,j=dt,K=ct,v=et,q=At,G=wt,H=gt,x=ht,J=Ft,y=xt,Q=bt,W=yt,X=Ct;return p(),h("div",$t,[t(w,{items:[a.$t("menu.workshop"),a.$t("menu.firmware")]},null,8,["items"]),t(K,{gutter:20,align:"stretch"},{default:e(()=>[t(j,{span:24},{default:e(()=>[t(O,{class:"general-card",title:a.$t("menu.firmware")},{extra:e(()=>[m("div",Et,[_(d).name?(p(),h(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(),h(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),h(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://k5.