k5web/assets/index.5137a78a.js

2 lines
6.4 KiB
JavaScript
Raw Normal View History

2024-07-30 14:11:44 +00:00
import{s as X,u as Y,M as f,ac as Z,N as tt,_ as et}from"./index.c98a7b8a.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as ot,r as x,o as at,bQ as nt,bI as st,C as c,D as g,aI as t,aH as e,G as p,u as m,aK as b,aM as i,aN as r,aJ as C,aE as L,b7 as E,bh as lt,bR as it,bS as rt,bJ as ut,bL as dt,bm as ct,bn as pt}from"./arco.c29bba08.js";import{g as mt}from"./vue.437ba699.js";import{R as _t,L as ft,a as gt,D as wt,T as ht,U as bt}from"./index.29239e83.js";import{s as yt,P as At}from"./dep-6deb4e3a.14007380.js";import{L as kt}from"./index.0cdb7fbc.js";import{I as vt}from"./index.75f952a8.js";import{F as Ft,a as xt}from"./index.b31a12d7.js";import"./chart.34708d29.js";import"./slot.0d495437.js";import"./index.900986da.js";import"./index.b8fd624b.js";import"./form-model.db8d573c.js";const Ct=w=>(ct("data-v-ac0fde76"),w=w(),pt(),w),Lt={class:"container"},Et={style:{"margin-right":"20px"}},It={style:{color:"#373737",margin:"10px"}},$t={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Ut={style:{display:"flex",width:"100%"}},Bt={style:{width:"90%"}},Dt=Ct(()=>p("br",null,null,-1)),St={style:{width:"10%",margin:"auto","text-align":"center"}},Vt={name:"Backup"},Pt=ot({...Vt,setup(w){X();const u=Y(),I=mt(),s=x({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),l=x({title:"",desc:"",firmware:[]});at(async()=>{A({current:1})});const A=async a=>{s.page=a.current;const n=await f.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},_=async()=>{s.refLoading=!0,s.showPanel=!0;const a=await f.post("https://k5.vicicode.cn/wsapi/my_list",{type:0,token:u.accountId});s.myList=a.data,s.refLoading=!1},$=()=>{l.title="",l.desc="",l.firmware=[],s.showUpload=!0},U=async()=>{if(l.title==""||l.firmware.length==0){E.error({content:"\u672A\u586B\u5199\u540D\u79F0\u53CA\u4E0A\u4F20\u6587\u4EF6",duration:5*1e3});return}await f.post("https://k5.vicicode.cn/wsapi/upload",{type:0,token:u.accountId,title:l.title,desc:l.desc,data:l.firmware[0].url}),s.showUpload=!1,_()},B=async a=>{await f.post("https://k5.vicicode.cn/wsapi/delete",{id:a,token:u.accountId}),_()},D=async a=>{await f.post("https://k5.vicicode.cn/wsapi/star",{id:a}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{_()},V=a=>{I.push({path:"/tool/flash",query:{url:a}})};return(a,n)=>{const P=Z,d=lt,k=yt,R=it,N=rt,z=nt,M=At,T=st,J=ut,j=dt,y=tt,q=kt,G=ft,H=gt,v=wt,K=vt,h=Ft,Q=ht,O=bt,W=xt;return c(),g("div",Lt,[t(P,{items:[a.$t("menu.workshop"),a.$t("menu.firmware")]},null,8,["items"]),t(j,{gutter:20,align:"stretch"},{default:e(()=>[t(J,{span:24},{default:e(()=>[t(T,{class:"general-card",title:a.$t("menu.firmware")},{extra:e(()=>[p("div",Et,[m(u).name?(c(),g(b,{key:0},[t(d,{onClick:_},{default:e(()=>[i("\xA0\xA0"+r(m(u).name)+"\xA0\xA0",1)]),_:1}),t(d,{onClick:_},{default:e(()=>[i("\xA0\xA0"+r(a.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),t(d,{onClick:n[0]||(n[0]=o=>m(u).logout())},{default:e(()=>[i("\xA0\xA0"+r(a.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(c(),g(b,{key:1},[t(d,{onClick:n[1]||(n[1]=o=>m(u).setInfo({showLogin:!0}))},{default:e(()=>[i("\xA0\xA0"+r(a.$t("global.login"))+"\xA0\xA0",1)]),_:1}),t(d,{onClick:n[2]||(n[2]=o=>m(u).setInfo({showRegister:!0}))},{default:e(()=>[i("\xA0\xA0"+r(a.$t("global.register"))+"\xA0\xA0",1)]),_:1}),p("span",It,r(a.$t("global.loginUpload")),1)],64))])]),default:e(()=>[t(z,null,{default:e(()=>[(c(!0),g(b,null,C(s.nowpage,o=>(c(),L(N,{style:{width:"100%"}},{actions:e(()=>[t(d,{onClick:F=>D(o.id)},{default:e(()=>[i("\u{1F44D}")]),_:2},1032,["onClick"]),t(d,{onClick:F=>V("https://k5.vicicode.cn/wsapi/download?id="+o.id+"&n=/"+o.title)},{default:e(()=>[i(r(a.$t("global.use")),1)]),_:2},1032,["onClick"])]),default:e(()=>[t(R,{description:o.desc},{title:e(()=>[t(k,{theme:"primary",var