mirror of
https://github.com/silenty4ng/k5web
synced 2024-11-14 22:35:31 +00:00
2 lines
6.6 KiB
JavaScript
2 lines
6.6 KiB
JavaScript
|
import{m as X,u as Y,E as f,ak as Z,_ as tt}from"./index.c5405c09.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,bI as nt,C as d,D as g,aI as t,aH as e,G as c,u as m,aK as h,aM as l,aN as r,aJ as C,aE as E,a_ as L,b9 as st,bR as it,bS as lt,bJ as rt,bL as ut,be as pt,bf as dt}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 bt}from"./index.afc6061e.js";import{s as ht,P as yt}from"./dep-6deb4e3a.355b5fc9.js";import{B as At}from"./index.9447cec4.js";import{L as kt}from"./index.f4ca8c3f.js";import{I as vt}from"./index.3c1bf074.js";import{F as Ft,a as xt}from"./index.3f02f4cc.js";import"./chart.3e6cb2f1.js";import"./useGlobalIcon.c6c61ccc.js";import"./helper.4ea41844.js";import"./useConfig.b5d89e07.js";import"./index.ab8a635e.js";import"./dialog.30d78e3d.js";import"./slot.0936fab4.js";import"./index.f02cc964.js";import"./index.08cc7013.js";import"./form-model.e2f8f96d.js";import"./useDisabled.5ccd65e2.js";const Ct=w=>(pt("data-v-c85a7ffb"),w=w(),dt(),w),Et={class:"container"},Lt={style:{"margin-right":"20px"}},It={style:{color:"#373737",margin:"10px"}},$t={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Ut={style:{display:"flex",width:"100%"}},Bt={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(),I=ct(),s=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()=>{A({current:1})});const A=async a=>{s.page=a.current;const n=await f.get("https://k5.vicicode.com/wsapi/list?type=0&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:0,token:u.accountId});s.myList=a.data,s.refLoading=!1},$=()=>{i.title="",i.desc="",i.firmware=[],s.showUpload=!0},U=async()=>{if(i.title==""||i.firmware.length==0){L.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:0,token:u.accountId,title:i.title,desc:i.desc,data:i.firmware[0].url}),s.showUpload=!1,_()},B=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}),L.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},S=()=>{_()},V=a=>{I.push({path:"/tool/flash",query:{url:a}})};return(a,n)=>{const P=Z,p=st,k=ht,R=it,z=lt,N=at,T=yt,M=nt,J=rt,j=ut,y=At,q=kt,G=_t,H=ft,v=gt,K=vt,b=Ft,Q=wt,O=bt,W=xt;return d(),g("div",Et,[t(P,{items:[a.$t("menu.workshop"),a.$t("menu.firmware")]},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.firmware")},{extra:e(()=>[c("div",Lt,[m(u).name?(d(),g(h,{key:0},[t(p,{onClick:_},{default:e(()=>[l("\xA0\xA0"+r(m(u).name)+"\xA0\xA0",1)]),_:1}),t(p,{onClick:_},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),t(p,{onClick:n[0]||(n[0]=o=>m(u).logout())},{default:e(()=>[l("\xA0\xA0"+r(a.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(d(),g(h,{key:1},[t(p,{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(p,{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",It,r(a.$t("global.loginUpload")),1)],64))])]),default:e(()=>[t(N,null,{default:e(()=>[(d(!0),g(h,null,C(s.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,{o
|