mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
1 line
6.7 KiB
JavaScript
1 line
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("https://k6.vicicode.cn/wsapi/download?id="+o.id,o.title)},{default:e(()=>[l(u(a.$t("global.download")),1)]),_:2},1032,["onClick"]),t(r,{onClick:A=>P("https://k6.vicicode.cn/wsapi/download?id="+o.id)},{default:e(()=>[l(u(a.$t("global.use")),1)]),_:2},1032,["onClick"])]),default:e(()=>[t(N,{description:o.desc},{title:e(()=>[t(c,{theme:"primary",variant:"outline"},{default:e(()=>[l(u(o.upload),1)]),_:2},1024),l(" "+u(o.title),1)]),_:2},1032,["description"])]),_:2},1024))),256))]),_:1}),t(M,{onChange:x,style:{margin:"10px"},total:s.total,current:s.page,pageSize:12,showPageNumber:"",showPageSize:!1},null,8,["total","current"])]),_:1},8,["title"])]),_:1})]),_:1}),t(C,{visible:s.showPanel,"onUpdate:visible":n[3]||(n[3]=o=>s.showPanel=o),size:"50%",header:"\u6211\u7684\u5206\u4EAB",footer:!1},{default:e(()=>[m("div",Bt,[t(v,{style:{margin:"10px"},onClick:B},{default:e(()=>[l("\u4E0A\u4F20\u65B0\u5206\u4EAB")]),_:1}),t(v,{loading:s.refLoading,shape:"circle",theme:"outline",onClick:S},{icon:e(()=>[t(_(ft))]),_:1},8,["loading"])]),t(H,{split:!0},{default:e(()=>[(p(!0),b(k,null,L(s.myList,o=>(p(),$(G,null,{default:e(()=>[m("div",It,[m("div",Dt,[t(c,{theme:"primary",variant:"outline"},{default:e(()=>[l(u(o.audit?"\u5DF2\u5BA1\u6838":"\u5BA1\u6838\u4E2D"),1)]),_:2},1024),l(" "+u(o.title)+" ",1),Vt,l(" "+u(o.desc),1)]),m("div",St,[t(q,{theme:"primary",hover:"color",onClick:A=>D(o.id)},{default:e(()=>[l("\u5220\u9664")]),_:2},1032,["onClick"])])])]),_:2},1024))),256))]),_:1})]),_:1},8,["visible"]),t(C,{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(X,{data:i,"reset-type":"initial",colon:"",onSubmit:I},{default:e(()=>[t(y,{label:"\u5206\u4EAB\u540D\u79F0",name:"title","label-align":"top"},{default:e(()=>[t(J,{modelValue:i.title,"onUpdate:modelValue":n[4]||(n[4]=o=>i.title=o)},null,8,["modelValue"])]),_:1}),t(y,{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(y,{label:"\u4FE1\u9053\u6587\u4EF6",name:"firmware","label-align":"top"},{default:e(()=>[t(W,{modelValue:i.firmware,"onUpdate:modelValue":n[6]||(n[6]=o=>i.firmware=o),action:"https://k6.vicicode.cn/wsapi/base64","abridge-name":[8,6],theme:"file-input",placeholder:"\u672A\u9009\u62E9\u6587\u4EF6"},null,8,["modelValue"])]),_:1}),t(y,{"label-align":"top"},{default:e(()=>[t(v,{theme:"primary",type:"submit",block:""},{default:e(()=>[l("\u63D0\u4EA4\u5BA1\u6838")]),_:1})]),_:1})]),_:1},8,["data"])]),_:1},8,["visible"])])}}});const se=ot(Rt,[["__scopeId","data-v-b144015b"]]);export{se as default};
|