k5web/assets/index.48ea796a.js

2 lines
6.1 KiB
JavaScript
Raw Normal View History

2024-06-09 13:12:48 +00:00
import{e as X,u as Y,s as _,ak as Z,_ as tt}from"./index.a80546b8.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as et,r as A,o as ot,bP as at,bH as nt,C as d,D as f,aI as t,aH as e,G as m,u as p,aK as b,aM as l,aN as r,aJ as x,aE as C,a_ as E,b9 as st,bQ as it,bR as lt,bI as ut,bJ as rt,be as dt,bf as ct}from"./arco.768e32d2.js";import{f as pt}from"./vue.5a5bc6a2.js";import{R as mt,L as _t,a as ft,D as wt,T as gt,U as ht}from"./index.0a751878.js";import{P as bt,s as yt}from"./dep-6deb4e3a.734d1bc4.js";import{B as kt}from"./index.474df5bd.js";import{L as Ft,F as vt,a as At}from"./index.d281caad.js";import{I as xt}from"./form-model.8dfede09.js";import"./chart.affe3403.js";import"./dialog.91335f47.js";import"./useConfig.9d5a43c3.js";import"./index.4b039ab0.js";import"./slot.c4b1e65e.js";import"./index.4886fd12.js";import"./index.75d62663.js";const Ct=w=>(dt("data-v-210af5f8"),w=w(),ct(),w),Et={class:"container"},It={style:{"margin-right":"20px"}},Lt={style:{display:"flex","align-items":"center","justify-content":"space-between"}},$t={style:{display:"flex",width:"100%"}},Bt={style:{width:"90%"}},Ut=Ct(()=>m("br",null,null,-1)),Dt={style:{width:"10%",margin:"auto","text-align":"center"}},Vt={name:"Backup"},St=et({...Vt,setup(w){X();const u=Y(),I=pt(),n=A({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),i=A({title:"",desc:"",firmware:[]});ot(async()=>{k({current:1})});const k=async s=>{n.page=s.current;const a=await _.get("https://k5.vicicode.com/wsapi/list?type=0&limit=12&page="+s.current+"&t="+Date.now());n.total=a.total,n.nowpage=a.data},g=async()=>{n.refLoading=!0,n.showPanel=!0;const s=await _.post("https://k5.vicicode.com/wsapi/my_list",{type:0,token:u.accountId});n.myList=s.data,n.refLoading=!1},L=()=>{i.title="",i.desc="",i.firmware=[],n.showUpload=!0},$=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 _.post("https://k5.vicicode.com/wsapi/upload",{type:0,token:u.accountId,title:i.title,desc:i.desc,data:i.firmware[0].url}),n.showUpload=!1,g()},B=async s=>{await _.post("https://k5.vicicode.com/wsapi/delete",{id:s,token:u.accountId}),g()},U=async s=>{await _.post("https://k5.vicicode.com/wsapi/star",{id:s}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},D=()=>{g()},V=s=>{I.push({path:"/tool/flash",query:{url:s}})};return(s,a)=>{const S=Z,c=st,P=it,R=lt,z=at,N=bt,T=nt,M=ut,H=rt,y=kt,J=yt,j=Ft,q=_t,G=ft,F=wt,K=xt,h=vt,Q=gt,O=ht,W=At;return d(),f("div",Et,[t(S,{items:[s.$t("menu.workshop"),s.$t("menu.firmware")]},null,8,["items"]),t(H,{gutter:20,align:"stretch"},{default:e(()=>[t(M,{span:24},{default:e(()=>[t(T,{class:"general-card",title:s.$t("menu.firmware")},{extra:e(()=>[m("div",It,[p(u).name?(d(),f(b,{key:0},[t(c,{onClick:g},{default:e(()=>[l("\xA0\xA0"+r(p(u).name)+"\xA0\xA0",1)]),_:1}),t(c,{onClick:a[0]||(a[0]=o=>p(u).logout())},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(d(),f(b,{key:1},[t(c,{onClick:a[1]||(a[1]=o=>p(u).setInfo({showLogin:!0}))},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.login"))+"\xA0\xA0",1)]),_:1}),t(c,{onClick:a[2]||(a[2]=o=>p(u).setInfo({showRegister:!0}))},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.register"))+"\xA0\xA0",1)]),_:1})],64))])]),default:e(()=>[t(z,null,{default:e(()=>[(d(!0),f(b,null,x(n.nowpage,o=>(d(),C(R,{style:{width:"100%"}},{actions:e(()=>[t(c,{onClick:v=>U(o.id)},{default:e(()=>[l("\u{1F44D}")]),_:2},1032,["onClick"]),t(c,{onClick:v=>V("https://k5.vicicode.com/wsapi/download?id="+o.id+"&n=/"+o.title)},{default:e(()=>[l(r(s.$t("global.use")),1)]),_:2},1032,["onClick"])]),default:e(()=>[t(P,{title:o.title,description:o.desc},null,8,["title","description"])]),_:2},1024))),256))]),_:1}),t(N,{onChange:k,style:{margin:"10px"},total:n.total,current:n.page,pageSize:12,showPageNumber:"",showPage