mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
2 lines
6.7 KiB
JavaScript
2 lines
6.7 KiB
JavaScript
|
import{s as Y,u as Z,M as w,ac as tt,N as et,_ as ot}from"./index.413febc1.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as at,r as F,o as nt,bT as st,bI as lt,C as p,D as b,aI as t,aH as e,G as m,u as _,aK as k,aM as l,aN as u,aJ as L,aE as $,b7 as E,bh as it,bU as ut,bV as rt,bK as dt,bO as ct,bm as pt,bn as mt}from"./arco.76adc92f.js";import{g as _t}from"./vue.107cc2d0.js";import{R as ft,L as gt,a as wt,D as bt,T as ht,U as yt}from"./index.350c144b.js";import{s as kt,P as vt}from"./dep-6deb4e3a.3da13c94.js";import{L as At}from"./index.f132f61a.js";import{I as xt}from"./index.d49b744e.js";import{F as Ct,a as Ft}from"./index.6d7e872a.js";import"./chart.d41e8c5b.js";import"./slot.c1690aae.js";import"./index.df9fea37.js";import"./index.43e2a6eb.js";import"./form-model.553a3655.js";const Lt=h=>(pt("data-v-b144015b"),h=h(),mt(),h),$t={class:"container"},Et={style:{"margin-right":"20px"}},Ut={style:{color:"#373737",margin:"10px"}},Bt={style:{display:"flex","align-items":"center","justify-content":"space-between"}},It={style:{display:"flex",width:"100%"}},Dt={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(h){Y();const d=Z(),U=_t(),s=F({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),i=F({title:"",desc:"",firmware:[]});nt(async()=>{x({current:1})});const x=async a=>{s.page=a.current;const n=await w.get("https://k6.vicicode.cn/wsapi/list?type=2&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 w.post("https://k6.vicicode.cn/wsapi/my_list",{type:2,token:d.accountId});s.myList=a.data,s.refLoading=!1},B=()=>{i.title="",i.desc="",i.firmware=[],s.showUpload=!0},I=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 w.post("https://k6.vicicode.cn/wsapi/upload",{type:2,token:d.accountId,title:i.title,desc:i.desc,data:i.firmware[0].url}),s.showUpload=!1,f()},D=async a=>{await w.post("https://k6.vicicode.cn/wsapi/delete",{id:a,token:d.accountId}),f()},V=async a=>{await w.post("https://k6.vicicode.cn/wsapi/star",{id:a}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{f()},P=a=>{U.push({path:"/chirp/channel",query:{url:a}})},R=(a,n)=>{fetch(a).then(g=>g.blob()).then(g=>{const r=URL.createObjectURL(g),c=document.createElement("a");c.href=r,c.download=n+".xlsx",document.body.appendChild(c),c.click(),document.body.removeChild(c)})};return(a,n)=>{const g=tt,r=it,c=kt,N=ut,T=rt,z=st,M=vt,j=lt,K=dt,O=ct,v=et,q=At,G=gt,H=wt,C=bt,J=xt,y=Ct,Q=ht,W=yt,X=Ft;return p(),b("div",$t,[t(g,{items:[a.$t("menu.workshop"),a.$t("menu.channel")]},null,8,["items"]),t(O,{gutter:20,align:"stretch"},{default:e(()=>[t(K,{span:24},{default:e(()=>[t(j,{class:"general-card",title:a.$t("menu.channel")},{extra:e(()=>[m("div",Et,[_(d).name?(p(),b(k,{key:0},[t(r,{onClick:f},{default:e(()=>[l("\xA0\xA0"+u(_(d).name)+"\xA0\xA0",1)]),_:1}),t(r,{onClick:f},{default:e(()=>[l("\xA0\xA0"+u(a.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),t(r,{onClick:n[0]||(n[0]=o=>_(d).logout())},{default:e(()=>[l("\xA0\xA0"+u(a.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(p(),b(k,{key:1},[t(r,{onClick:n[1]||(n[1]=o=>_(d).setInfo({showLogin:!0}))},{default:e(()=>[l("\xA0\xA0"+u(a.$t("global.login"))+"\xA0\xA0",1)]),_:1}),t(r,{onClick:n[2]||(n[2]=o=>_(d).setInfo({showRegister:!0}))},{default:e(()=>[l("\xA0\xA0"+u(a.$t("global.register"))+"\xA0\xA0",1)]),_:1}),m("span",Ut,u(a.$t("global.loginUpload")),1)],64))])]),default:e(()=>[t(z,null,{default:e(()=>[(p(!0),b(k,null,L(s.nowpage,o=>(p(),$(T,{style:{width:"100%"}},{actions:e(()=>[t(r,{onClick:A=>V(o.id)},{default:e(()=>[l("\u{1F44D}")]),_:2},1032,["onClick"]),t(r,{onClick:A=>R("ht
|