k5web/assets/index.da4041d4.js
2024-07-06 17:01:56 +08:00

2 lines
6.6 KiB
JavaScript

import{m as X,u as Y,E as f,ak as Z,_ as tt}from"./index.b6739c82.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,bI as nt,C as p,D as g,aI as t,aH as e,G as c,u as m,aK as b,aM as l,aN as r,aJ as C,aE as B,a_ as E,b9 as st,bR as it,bS as lt,bJ as rt,bL as ut,be as dt,bf as pt}from"./arco.7f845a67.js";import{g as ct}from"./vue.0bef8fc5.js";import{R as mt,L as _t,a as ft,D as gt,T as wt,U as ht}from"./index.edb98c91.js";import{s as bt,P as yt}from"./dep-6deb4e3a.b3c03c78.js";import{B as kt}from"./index.7d4adf29.js";import{L as At}from"./index.fd74ba5c.js";import{I as vt}from"./index.8c1c2ce0.js";import{F as xt,a as Ft}from"./index.ca2c0233.js";import"./chart.95d38b48.js";import"./useGlobalIcon.bbf3fb38.js";import"./helper.20cd41f2.js";import"./useConfig.5840ccf9.js";import"./index.43ce54ec.js";import"./dialog.282b01d2.js";import"./slot.39309d60.js";import"./index.c4cc3f04.js";import"./index.959dad5e.js";import"./form-model.b21f662c.js";import"./useDisabled.86718829.js";const Ct=w=>(dt("data-v-6a3d506b"),w=w(),pt(),w),Bt={class:"container"},Et={style:{"margin-right":"20px"}},Lt={style:{color:"#373737",margin:"10px"}},It={style:{display:"flex","align-items":"center","justify-content":"space-between"}},$t={style:{display:"flex",width:"100%"}},Ut={style:{width:"90%"}},Dt=Ct(()=>c("br",null,null,-1)),St={style:{width:"10%",margin:"auto","text-align":"center"}},Vt={name:"Backup"},Pt=et({...Vt,setup(w){X();const u=Y(),L=ct(),s=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 a=>{s.page=a.current;const n=await f.get("https://k5.vicicode.com/wsapi/list?type=2&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.com/wsapi/my_list",{type:2,token:u.accountId});s.myList=a.data,s.refLoading=!1},I=()=>{i.title="",i.desc="",i.firmware=[],s.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 f.post("https://k5.vicicode.com/wsapi/upload",{type:2,token:u.accountId,title:i.title,desc:i.desc,data:i.firmware[0].url}),s.showUpload=!1,_()},U=async a=>{await f.post("https://k5.vicicode.com/wsapi/delete",{id:a,token:u.accountId}),_()},D=async a=>{await f.post("https://k5.vicicode.com/wsapi/star",{id:a}),E.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{_()},V=a=>{L.push({path:"/chirp/channel",query:{url:a}})};return(a,n)=>{const P=Z,d=st,A=bt,R=it,z=lt,N=at,T=yt,M=nt,J=rt,j=ut,y=kt,q=At,G=_t,H=ft,v=gt,K=vt,h=xt,Q=wt,O=ht,W=Ft;return p(),g("div",Bt,[t(P,{items:[a.$t("menu.workshop"),a.$t("menu.channel")]},null,8,["items"]),t(j,{gutter:20,align:"stretch"},{default:e(()=>[t(J,{span:24},{default:e(()=>[t(M,{class:"general-card",title:a.$t("menu.channel")},{extra:e(()=>[c("div",Et,[m(u).name?(p(),g(b,{key:0},[t(d,{onClick:_},{default:e(()=>[l("\xA0\xA0"+r(m(u).name)+"\xA0\xA0",1)]),_:1}),t(d,{onClick:_},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),t(d,{onClick:n[0]||(n[0]=o=>m(u).logout())},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(p(),g(b,{key:1},[t(d,{onClick:n[1]||(n[1]=o=>m(u).setInfo({showLogin:!0}))},{default:e(()=>[l("\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(()=>[l("\xA0\xA0"+r(a.$t("global.register"))+"\xA0\xA0",1)]),_:1}),c("span",Lt,r(a.$t("global.loginUpload")),1)],64))])]),default:e(()=>[t(N,null,{default:e(()=>[(p(!0),g(b,null,C(s.nowpage,o=>(p(),B(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(a.$t("global.use")),1)]),_:2},1032,["onClick"])]),default:e(()=>[t(R,{description:o.desc},{title:e(()=>[t(A,{theme:"primary",variant:"outline"},{default:e(()=>[l(r(o.upload),1)]),_:2},1024),l(" "+r(o.title),1)]),_:2},1032,["description"])]),_:2},1024))),256))]),_:1}),t(T,{onChange:k,style:{margin:"10px"},total:s.total,current:s.page,pageSize:12,showPageNumber:"",showPageSize:!1},null,8,["total","current"])]),_:1},8,["title"])]),_:1})]),_:1}),t(v,{visible:s.showPanel,"onUpdate:visible":n[3]||(n[3]=o=>s.showPanel=o),size:"50%",header:"\u6211\u7684\u5206\u4EAB",footer:!1},{default:e(()=>[c("div",It,[t(y,{style:{margin:"10px"},onClick:I},{default:e(()=>[l("\u4E0A\u4F20\u65B0\u5206\u4EAB")]),_:1}),t(y,{loading:s.refLoading,shape:"circle",theme:"outline",onClick:S},{icon:e(()=>[t(m(mt))]),_:1},8,["loading"])]),t(H,{split:!0},{default:e(()=>[(p(!0),g(b,null,C(s.myList,o=>(p(),B(G,null,{default:e(()=>[c("div",$t,[c("div",Ut,[t(A,{theme:"primary",variant:"outline"},{default:e(()=>[l(r(o.audit?"\u5DF2\u5BA1\u6838":"\u5BA1\u6838\u4E2D"),1)]),_:2},1024),l(" "+r(o.title)+" ",1),Dt,l(" "+r(o.desc),1)]),c("div",St,[t(q,{theme:"primary",hover:"color",onClick:x=>U(o.id)},{default:e(()=>[l("\u5220\u9664")]),_:2},1032,["onClick"])])])]),_:2},1024))),256))]),_:1})]),_:1},8,["visible"]),t(v,{visible:s.showUpload,"onUpdate:visible":n[7]||(n[7]=o=>s.showUpload=o),size:"25%",header:"\u4E0A\u4F20\u65B0\u56FA\u4EF6",footer:!1},{default:e(()=>[t(W,{data:i,"reset-type":"initial",colon:"",onSubmit:$},{default:e(()=>[t(h,{label:"\u5206\u4EAB\u540D\u79F0",name:"title","label-align":"top"},{default:e(()=>[t(K,{modelValue:i.title,"onUpdate:modelValue":n[4]||(n[4]=o=>i.title=o)},null,8,["modelValue"])]),_:1}),t(h,{label:"\u5206\u4EAB\u63CF\u8FF0",name:"desc","label-align":"top"},{default:e(()=>[t(Q,{autosize:{minRows:5,maxRows:10},modelValue:i.desc,"onUpdate:modelValue":n[5]||(n[5]=o=>i.desc=o),clearable:""},null,8,["modelValue"])]),_:1}),t(h,{label:"\u4FE1\u9053\u6587\u4EF6",name:"firmware","label-align":"top"},{default:e(()=>[t(O,{modelValue:i.firmware,"onUpdate:modelValue":n[6]||(n[6]=o=>i.firmware=o),action:"https://k5.vicicode.com/wsapi/base64","abridge-name":[8,6],theme:"file-input",placeholder:"\u672A\u9009\u62E9\u6587\u4EF6"},null,8,["modelValue"])]),_:1}),t(h,{"label-align":"top"},{default:e(()=>[t(y,{theme:"primary",type:"submit",block:""},{default:e(()=>[l("\u63D0\u4EA4\u5BA1\u6838")]),_:1})]),_:1})]),_:1},8,["data"])]),_:1},8,["visible"])])}}});const pe=tt(Pt,[["__scopeId","data-v-6a3d506b"]]);export{pe as default};