Files
yakpanel-core/YakPanel/static/vite/js/index-CoLIBf5T.js

2 lines
3.8 KiB
JavaScript
Raw Normal View History

2026-04-07 02:04:22 +05:30
import{_ as q}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as A}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as L}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{gd as x,ge as D,gf as k,gg as N,i as V,n as j,ao as g}from"./index-BTglIPU2.js?v=1773287522785";import{u as O}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as E}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as K}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{B as U}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as X,R as Z,e as F,$ as G,Z as H,a0 as d,au as J,S as m,a9 as n,j as c,aa as e,X as P,_ as b}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const Q={class:"p-20px"},W={class:"flex items-center h-34px px-16px rounded-4px bg-#ececec text-#555 text-13px font-bold"},Y={class:"ml-8px"},ya=X({__name:"index",props:{row:{}},setup(w){const h=w,{row:l}=h,{t}=Z(),p=F({name:"--",size:"--"}),$=async()=>{await x({db_name:l.name,tables:s.value}),i()},B=async()=>{await D({db_name:l.name,tables:s.value}),i()},y=async a=>{await k({db_name:l.name,tables:s.value,table_type:a}),i()},T=async a=>{await x({db_name:l.name,tables:[a.table_name]}),i()},v=async a=>{await D({db_name:l.name,tables:[a.table_name]}),i()},z=async a=>{const o=a.type==="InnoDB"?"MyISAM":"InnoDB";await k({db_name:l.name,tables:[a.table_name],table_type:o}),i()},{keys:s,table:r,columns:C}=E([{type:"selection",width:40},{key:"table_name",title:t("Database.tools.index_10"),width:150,ellipsis:{tooltip:!0}},{key:"type",title:t("Database.tools.index_11"),width:80},{key:"collation",title:t("Database.tools.index_12"),ellipsis:{tooltip:{width:"trigger"}}},{key:"rows_count",title:t("Database.tools.index_13"),width:100},{key:"data_size",title:t("Database.tools.index_14"),width:90},K({width:240,options:a=>[{label:t("Database.tools.index_15"),onClick:()=>{T(a)}},{label:t("Database.tools.index_16"),onClick:()=>{v(a)}},{label:a.type==="InnoDB"?t("Database.tools.index_6"):t("Database.tools.index_5"),onClick:()=>{z(a)}}]})]),{loading:M,setLoading:f}=O(),i=async()=>{try{f(!0);const{message:a}=await N({db_name:l.name});V(a)?(r.data=j(a.tables)?a.tables:[],p.name=g(a.database)?a.database:"--",p.size=g(a.data_size)?a.data_size:"--"):(r.data=[],p.name="--",p.size="--"),s.value=[]}finally{f(!1)}};return i(),(a,o)=>{const _=U,I=L,S=A,R=q;return G(),H("div",Q,[d(S,null,J({toolsLeft:n(()=>[b("div",W,[b("span",null,e(a.$t("Database.tools.index_1"))+e(m(p).name),1),b("span",Y,e(a.$t("Database.tools.index_2"))+e(m(p).size),1)])]),table:n(()=>[d(I,{"checked-row-keys":m(s),"onUpdate:checkedRowKeys":o[2]||(o[2]=u=>P(s)?s.value=u:null),"row-key":"table_name",loading:m(M),"max-height":356,data:m(r).data,columns:m(C)},null,8,["checked-row-keys","loading","data","columns"])]),_:2},[m(s).length>0?{name:"toolsRight",fn:n(()=>[d(_,{onClick:$},{default:n(()=>[c(e(a.$t("Database.tools.index_3")),1)]),_:1}),d(_,{onClick:B},{default:n(()=>[c(e(a.$t("Database.tools.index_4")),1)]),_:1}),d(_,{onClick:o[0]||(o[0]=u=>y("InnoDB"))},{default:n(()=>[c(e(a.$t("Database.tools.index_5")),1)]),_:1}),d(_,{onClick:o[1]||(o[1]=u=>y("MyISAM"))},{default:n(()=>[c(e(a.$t("Database.tools.index_6")),1)]),_:1})]),key:"0"}:void 0]),1024),d(R,{class:"mt-16px"},{default:n(()=>[b("li",null,e(a.$t("Database.tools.index_7")),1),b("li",null,e(a.$t("Database.tools.index_8")),1),b("li",null,e(a.$t("Database.tools.index_9")),1)]),_:1})])}}});export{ya as default};