k5web/assets/index.12f87303.js

2 lines
6.3 KiB
JavaScript
Raw Normal View History

2024-06-14 23:21:15 +00:00
import{k as X,u as Y,B as _,ak as Z,_ as tt}from"./index.2a65a066.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as et,r as x,o as ot,bQ as at,bH as nt,C as d,D as f,aI as t,aH as e,G as m,u as c,aK as h,aM as l,aN as r,aJ as C,aE as E,a_ as I,b9 as st,bR as it,bS as lt,bI as rt,bK as ut,be as dt,bf as pt}from"./arco.949c921a.js";import{f as ct}from"./vue.d12e9c08.js";import{R as mt,L as _t,a as ft,D as wt,T as gt,U as bt}from"./index.c2217682.js";import{s as ht,P as yt}from"./dep-6deb4e3a.3d639f24.js";import{B as kt}from"./index.c2b2794b.js";import{L as vt}from"./index.eb7b11d0.js";import{I as At}from"./form-model.612c795e.js";import{F as Ft,a as xt}from"./index.98021a69.js";import"./chart.b6f2f6d9.js";import"./dialog.1ba30eca.js";import"./useConfig.6cf5b795.js";import"./index.911ac6d9.js";import"./helper.71009a45.js";import"./slot.fc3b26fa.js";import"./index.60106d77.js";import"./index.cd6bf855.js";import"./useDisabled.bde84ef9.js";const Ct=w=>(dt("data-v-a7b47494"),w=w(),pt(),w),Et={class:"container"},It={style:{"margin-right":"20px"}},Lt={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Bt={style:{display:"flex",width:"100%"}},$t={style:{width:"90%"}},Ut=Ct(()=>m("br",null,null,-1)),Dt={style:{width:"10%",margin:"auto","text-align":"center"}},St={name:"Backup"},Vt=et({...St,setup(w){X();const u=Y(),L=ct(),n=x({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),i=x({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},B=()=>{i.title="",i.desc="",i.firmware=[],n.showUpload=!0},$=async()=>{if(i.title==""||i.firmware.length==0){I.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()},U=async s=>{await _.post("https://k5.vicicode.com/wsapi/delete",{id:s,token:u.accountId}),g()},D=async s=>{await _.post("https://k5.vicicode.com/wsapi/star",{id:s}),I.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{g()},V=s=>{L.push({path:"/tool/flash",query:{url:s}})};return(s,a)=>{const P=Z,p=st,v=ht,R=it,z=lt,N=at,T=yt,M=nt,H=rt,K=ut,y=kt,j=vt,q=_t,G=ft,A=wt,J=At,b=Ft,Q=gt,O=bt,W=xt;return d(),f("div",Et,[t(P,{items:[s.$t("menu.workshop"),s.$t("menu.firmware")]},null,8,["items"]),t(K,{gutter:20,align:"stretch"},{default:e(()=>[t(H,{span:24},{default:e(()=>[t(M,{class:"general-card",title:s.$t("menu.firmware")},{extra:e(()=>[m("div",It,[c(u).name?(d(),f(h,{key:0},[t(p,{onClick:g},{default:e(()=>[l("\xA0\xA0"+r(c(u).name)+"\xA0\xA0",1)]),_:1}),t(p,{onClick:a[0]||(a[0]=o=>c(u).logout())},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(d(),f(h,{key:1},[t(p,{onClick:a[1]||(a[1]=o=>c(u).setInfo({showLogin:!0}))},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.login"))+"\xA0\xA0",1)]),_:1}),t(p,{onClick:a[2]||(a[2]=o=>c(u).setInfo({showRegister:!0}))},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.register"))+"\xA0\xA0",1)]),_:1})],64))])]),default:e(()=>[t(N,null,{default:e(()=>[(d(!0),f(h,null,C(n.nowpage,o=>(d(),E(z,{style:{width:"100%"}},{actions:e(()=>[t(p,{onClick:F=>D(o.id)},{default:e(()=>[l("\u{1F44D}")]),_:2},1032,["onClick"]),t(p,{onClick:F=>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(R,{description:o.desc},{title:e(()=>[t(v,{theme:"primary",variant:"outline"},{