2024-06-15 04:47:13 +00:00
|
|
|
import{k as X,u as Y,B as _,ak as Z,_ as tt}from"./index.1f70c53a.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as et,r as F,o as ot,bQ as at,bH as nt,C as c,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 B,aE as C,a_ as E,b9 as st,bR as it,bS as lt,bI as rt,bK as ut,be as ct,bf as dt}from"./arco.949c921a.js";import{f as pt}from"./vue.d12e9c08.js";import{R as mt,L as _t,a as ft,D as wt,T as gt,U as ht}from"./index.3d7c7a8c.js";import{s as bt,P as yt}from"./dep-6deb4e3a.32e5f9ab.js";import{B as kt}from"./index.f1a70d8e.js";import{L as vt}from"./index.f9582800.js";import{I as At}from"./form-model.9da38913.js";import{F as xt,a as Ft}from"./index.d557df11.js";import"./chart.b6f2f6d9.js";import"./dialog.89dc80fd.js";import"./useConfig.5730cadb.js";import"./index.6a5ebb36.js";import"./helper.0c72187c.js";import"./slot.9fc12176.js";import"./index.2e79486b.js";import"./index.7483d75d.js";import"./useDisabled.e1a20f2c.js";const Bt=w=>(ct("data-v-8fc936f5"),w=w(),dt(),w),Ct={class:"container"},Et={style:{"margin-right":"20px"}},It={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Lt={style:{display:"flex",width:"100%"}},$t={style:{width:"90%"}},Ut=Bt(()=>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(),I=pt(),n=F({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),i=F({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=2&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:2,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:2,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}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{g()},V=s=>{I.push({path:"/chirp/channel",query:{url:s}})};return(s,a)=>{const P=Z,d=st,v=bt,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,h=xt,Q=gt,O=ht,W=Ft;return c(),f("div",Ct,[t(P,{items:[s.$t("menu.workshop"),s.$t("menu.channel")]},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.channel")},{extra:e(()=>[m("div",Et,[p(u).name?(c(),f(b,{key:0},[t(d,{onClick:g},{default:e(()=>[l("\xA0\xA0"+r(p(u).name)+"\xA0\xA0",1)]),_:1}),t(d,{onClick:a[0]||(a[0]=o=>p(u).logout())},{default:e(()=>[l("\xA0\xA0"+r(s.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(c(),f(b,{key:1},[t(d,{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(d,{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(N,null,{default:e(()=>[(c(!0),f(b,null,B(n.nowpage,o=>(c(),C(z,{style:{width:"100%"}},{actions:e(()=>[t(d,{onClick:x=>D(o.id)},{default:e(()=>[l("\u{1F44D}")]),_:2},1032,["onClick"]),t(d,{onClick:x=>V("https://k5.vicicode.com/wsapi/download?id="+o.id)},{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"},{default:e(()=>
|