System.register(["./index-legacy-sO5zj2jA.js?v=1773287522785","./index-legacy-DgZ0-E4f.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-CW1cWg4C.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BtujQJPk.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./php-legacy-BZUQ59eS.js?v=1773287522785","./useLoading-legacy-IiShPpjk.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./index-legacy-DGWsVoxN.js?v=1773287522785","./index-legacy-BJO1GMTD.js?v=1773287522785","./logs-legacy-32yr6NrT.js?v=1773287522785","./file-legacy-Bt6Hxu9s.js?v=1773287522785","./useTableColumns-legacy-DP6ypvsQ.js?v=1773287522785","./alarm-legacy-B0l3BTRO.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BCiDzEG_.js?v=1773287522785","./alarm-legacy-wcthH3Ek.js?v=1773287522785","./index-legacy-DaNJUJqN.js?v=1773287522785","./theme-monokai-legacy-fuYB_bfX.js?v=1773287522785","./ace-legacy-ConAV8RQ.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785","./index-legacy-hh1mlQOF.js?v=1773287522785","./copy-legacy-CoXPjkKf.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-B9P08_gB.js?v=1773287522785","./index-legacy-BFkuWVH1.js?v=1773287522785"],(function(e,n){"use strict";var a,l,t,s,i,o,u,_,c,r,d,f,b,p,y,m,g,x,h,z,v,k,w,q,j,P,M,S,B,N,C,I,$,T,U,L,R,F,G,K,Q,O,D,A,E,X,Z,H,J,V,W,Y,ee,ne,ae,le,te,se,ie,oe,ue;return{setters:[e=>{a=e._},e=>{l=e._},e=>{t=e._,s=e.a},e=>{i=e.k,o=e.$,u=e.Z,_=e.a0,c=e.a9,r=e._,d=e.aa,f=e.F,b=e.R,p=e.S,y=e.j,m=e.a8,g=e.r,x=e.X,h=e.e,z=e.P},e=>{v=e._},e=>{k=e.eK,w=e.eL,q=e.h,j=e.eM,P=e.eN,M=e.eO,S=e.eP,B=e.aq,N=e.eQ,C=e.i,I=e.w,$=e.C,T=e.eR,U=e.eS,L=e.eT,R=e.eU,F=e.ar,G=e.eV,K=e.n,Q=e.eW,O=e.eX},e=>{D=e.B,A=e.k,E=e._,X=e.ad,Z=e.a8,H=e.a0,J=e.ak,V=e.aj,W=e.a9,Y=e.a6},e=>{ee=e.s},e=>{ne=e.u},e=>{ae=e._},e=>{le=e.u},e=>{te=e._},e=>{se=e._},e=>{ie=e.o},e=>{oe=e.a},e=>{ue=e.u},null,null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){const n=i({__name:"index",setup:e=>(e,n)=>{const a=l;return o(),u(f,null,[_(t),_(a,{class:"mt-10px"},{default:c((()=>[r("li",null,d(e.$t("Plugin.Mysql.index_25")),1)])),_:1})],64)}}),_e=i({__name:"index",setup(e,{expose:n}){const{t:a}=b(),t=()=>{q({title:a("Plugin.Mysql.index_16"),content:a("Plugin.Mysql.index_17",[w.datadir]),onConfirm:async()=>{await j({datadir:w.datadir})}})};return k(),n({init:k}),(e,n)=>{const a=v,s=D,i=A,b=l;return o(),u(f,null,[_(i,null,{default:c((()=>[_(a,{value:p(w).datadir,"onUpdate:value":n[0]||(n[0]=e=>p(w).datadir=e),class:"w-300px"},null,8,["value"]),_(s,{type:"primary",onClick:t},{default:c((()=>[y(d(e.$t("Plugin.Mysql.index_13")),1)])),_:1})])),_:1}),_(b,{class:"mt-10px"},{default:c((()=>[r("li",null,d(e.$t("Plugin.Mysql.index_14")),1),r("li",null,d(e.$t("Plugin.Mysql.index_15")),1)])),_:1})],64)}}}),ce=i({__name:"index",setup(e,{expose:n}){const a=async()=>{await P({port:w.port})};return k(),n({init:k}),(e,n)=>{const l=E,t=D,s=A;return o(),m(s,null,{default:c((()=>[_(l,{class:"w-100px!","show-button":!1,value:p(w).port,"onUpdate:value":n[0]||(n[0]=e=>p(w).port=e),placeholder:e.$t("Site.TableRow.index_16")},null,8,["value","placeholder"]),_(t,{type:"primary",onClick:a},{default:c((()=>[y(d(e.$t("Public.Btn.Conf")),1)])),_:1})])),_:1})}}}),re=i({__name:"index",setup(e,{expose:n}){const{t:a}=b(),t=g(!1),s=async()=>{try{await S()}catch{t.value=!t.value}},i=()=>{q({title:a("Plugin.Mysql.index_22",[M.title]),content:a("Plugin.Mysql.index_24",[M.title]),onConfirm:async()=>{await ee({name:"mysqld",type:"restart"})}})},m=()=>{B(encodeURIComponent("/www/server/data/ssl.zip"))},{loading:h,setLoading:z}=ne(),v=async()=>{try{z(!0);const{message:e}=await N();C(e)&&(t.value=e.status)}finally{z(!1)}};return v(),n({init:v}),(e,n)=>{const a=X,b=Z,g=D,z=A,v=H,k=l;return o(),u(f,null,[_(a,{class:"mb-16px",type:"info"},{default:c((()=>n[1]||(n[1]=[y(" This feature will be discontinued in the next version ")]))),_:1,__:[1]}),_(z,{class:"items-center"},{default:c((()=>[r("span",null,d(e.$t("Plugin.Mysql.index_30"))+" Mysql SSL",1),_(b,{value:p(t),"onUpdate:value":[n[0]||(n[0]=e=>x(t)?t.value=e:null),s],loading:p(h)},null,8,["value","loading"]),_(g,{onClick:i,type:"primary"},{default:c((()=>[y(d(e.$t("Plugin.Mysql.index_22",[p(M).title])),1)])),_:1})])),_:1}),_(v,{class:"my-16px!"}),_(k,{class:"mb-16px"},{default:c((()=>[r("li",null,d(e.$t("Database.Mysql.index_27")),1),r("li",null,[y(d(e.$t("Database.Mysql.index_28"))+" ",1),r("a",{class:"bt-link",onClick:m},"【SSL.zip】")])])),_:1})],64)}}}),de=[{label:"Launch Time",value:"Run",isTime:!0},{label:"Total Connections",value:"Connections"},{label:"Send",value:"Bytes_sent",isSize:!0},{label:"Receive",value:"Bytes_received",isSize:!0},{label:"Query per second",value:"query"},{label:"Transaction per second",value:"transaction"},{label:"File",value:"File"},{label:"Position",value:"Position"}],fe=[{name:"Active/Max connections",function:e=>e.Threads_running+"/"+e.Max_used_connections,value:"",ps:"If too high, increase max_connections"},{name:"Thread cache hit rate",value:"",function:e=>{const n=(100*(1-Number(e.Threads_created)/Number(e.Connections))).toFixed(2);return n?n+"%":"0"},ps:"If too low, increase thread_cache_size"},{value:"",name:"Index hit rate",function:e=>{const n=Number(e.Key_reads),a=Number(e.Key_read_requests);return(a>0?(100*(1-n/a)).toFixed(2):"0.00")+"%"},ps:"If too low, increase key_buffer_size"},{value:"",name:"Innodb index hit rate",function:e=>{const n=(100*(1-Number(e.Innodb_buffer_pool_reads)/Number(e.Innodb_buffer_pool_read_requests))).toFixed(2);return n||"0"},ps:"If too low, increase innodb_buffer_pool_size"},{value:"",name:"Query cache hit rate",function:e=>{let n=(parseInt(e.Qcache_hits)/(parseInt(e.Qcache_hits)+parseInt(e.Qcache_inserts))*100).toFixed(2)+"%";return"NaN%"==n&&(n="OFF"),n},ps:"If too low, increase query_cache_size"},{value:"",name:"Created temporary tables to disk",function:e=>{const n=(Number(e.Created_tmp_disk_tables)/Number(e.Created_tmp_tables)*100).toFixed(2);return n?n+"%":"0"},ps:"If too high, increase tmp_table_size"},{value:"",name:"Opened table",function:e=>e.Open_tables,ps:"If too high, increase table_open_cache"},{value:"",name:"Amount unindexed",function:e=>e.Select_full_join,ps:"If not 0, please check index of database table"},{value:"",name:"Amount unindexed in table join",function:e=>e.Select_range_check,ps:"If not 0, please check index of database table"},{value:"",name:"Number of merges after sorting",function:e=>e.Sort_merge_passes,ps:"If too high, increase sort_buffer_size"},{value:"",name:"Number of lock tables",function:e=>e.Table_locks_waited,ps:"If too high, consider increase your database performance"}],be=i({__name:"index",setup(e,{expose:n}){const{t:a}=b(),l=h({}),{table:t,columns:s}=le([{title:a("Plugin.Apache.index_12"),key:"name",width:"30%"},{title:a("Plugin.Apache.index_13"),key:"value",width:"20%"},{title:a("Public.Table.Note"),key:"ps",ellipsis:{tooltip:!0}}]),i=e=>{if("query"===e.value)return parseInt((Number(l.Questions)/Number(l.Uptime)).toString());if("transaction"===e.value)return parseInt(((parseInt(l.Com_commit)+parseInt(l.Com_rollback))/Number(l.Uptime)).toString());const n=l[e.value];return void 0===n?"--":e.isTime?I(n):e.isSize?$(n):n},{loading:r,setLoading:g}=ne(),x=async()=>{try{g(!0);const{message:e}=await T();C(e)&&(Object.assign(l,e),fe.forEach((e=>{e.function&&(e.value=e.function(l))})),t.data=fe)}finally{g(!1)}};return x(),n({init:x}),(e,n)=>{const a=V,l=J,b=W,g=ae;return o(),u(f,null,[_(b,{show:p(r)},{default:c((()=>[_(l,{"label-placement":"left",bordered:"",column:2},{default:c((()=>[(o(!0),u(f,null,z(p(de),(e=>(o(),m(a,{label:e.label,key:e.value},{default:c((()=>[y(d(i(e)),1)])),_:2},1032,["label"])))),128))])),_:1})])),_:1},8,["show"]),_(g,{class:"mt-10px",loading:p(r),data:p(t).data,columns:p(s)},null,8,["loading","data","columns"])],64)}}}),pe=[{label:"1-2GB",value:"1-2GB",data:{key_buffer_size:32,query_cache_size:32,tmp_table_size:32,innodb_buffer_pool_size:64,sort_buffer_size:256,read_buffer_size:256,read_rnd_buffer_size:256,join_buffer_size:512,thread_stack:256,binlog_cache_size:64,thread_cache_size:64,table_open_cache:128,max_connections:100}},{label:"2-4GB",value:"2-4GB",data:{key_buffer_size:64,query_cache_size:64,tmp_table_size:64,innodb_buffer_pool_size:128,sort_buffer_size:512,read_buffer_size:512,read_rnd_buffer_size:512,join_buffer_size:1024,thread_stack:256,binlog_cache_size:64,thread_cache_size:96,table_open_cache:192,max_connections:200}},{label:"4-8GB",value:"4-8GB",data:{key_buffer_size:128,query_cache_size:128,tmp_table_size:128,innodb_buffer_pool_size:256,sort_buffer_size:1024,read_buffer_size:1024,read_rnd_buffer_size:768,join_buffer_size:2048,thread_stack:256,binlog_cache_size:128,thread_cache_size:128,table_open_cache:384,max_connections:300}},{label:"8-16GB",value:"8-16GB",data:{key_buffer_size:256,query_cache_size:256,tmp_table_size:256,innodb_buffer_pool_size:512,sort_buffer_size:1024,read_buffer_size:2048,read_rnd_buffer_size:1024,join_buffer_size:2048,thread_stack:384,binlog_cache_size:192,thread_cache_size:192,table_open_cache:1024,max_connections:400}},{label:"16-32GB",value:"16-32GB",data:{key_buffer_size:1024,query_cache_size:384,tmp_table_size:1024,innodb_buffer_pool_size:1024,sort_buffer_size:4096,read_buffer_size:4096,read_rnd_buffer_size:2048,join_buffer_size:4096,thread_stack:512,binlog_cache_size:256,thread_cache_size:256,table_open_cache:2048,max_connections:500}}],ye={key_buffer_size:"MB, Buffer size for indexing",query_cache_size:"MB, Query cache, set to 0 for not enabled",tmp_table_size:"MB, Temporary table cache size",innodb_buffer_pool_size:"MB, Innodb buffer size",innodb_log_buffer_size:"MB, Innodb log buffer size",sort_buffer_size:"KB * Num of connections, Buffer size per thread sort",read_buffer_size:"KB * Num of connections, Read buffer size",read_rnd_buffer_size:"KB * Num of connections, Random read buffer size",join_buffer_size:"KB * Num of connections, Join table buffer size",thread_stack:"KB * Num of connections, Stack size per thread",binlog_cache_size:"KB * Num of connections, Bin log cache size (multiples of 4096)",thread_cache_size:"Thread cache size",table_open_cache:"Table open cache (NOT exceed 2048 at most)",max_connections:"Max connections"},me={class:"w-150px!"},ge={class:"w-250px! color-#666"},xe={class:"color-#666"},he=i({__name:"index",setup(e,{expose:n}){const{t:a}=b(),l=g(),t=g(),s=h({}),i=(e,n)=>{for(const a in n.data)s[a]=n.data[a];v()},v=()=>{const e=new Set(["key_buffer_size","query_cache_size","tmp_table_size","innodb_buffer_pool_size","innodb_log_buffer_size"]),n=new Set(["sort_buffer_size","read_buffer_size","read_rnd_buffer_size","join_buffer_size","thread_stack","binlog_cache_size"]),a=Number(s.max_connections||0),{a:l,b:i}=Object.entries(s).reduce(((a,[l,t])=>{const s=Number(t);return e.has(l)?a.a+=s:n.has(l)&&(a.b+=s/1024),a}),{a:0,b:0});t.value=(l+i*a).toString()},k=async()=>{const e={...s,query_cache_type:s.query_cache_size>0?1:0,max_heap_table_size:s.tmp_table_size};await U(e),v()},w=()=>{q({title:a("Plugin.Mysql.index_22",[M.title]),content:a("Plugin.Mysql.index_24",[M.title]),onConfirm:async()=>{await ee({name:"mysqld",type:"restart"})}})},{loading:j,setLoading:P}=ne(),S=async()=>{try{P(!0),l.value=null;const{message:e}=await L();if(C(e)){const n=e.mem;n.join_buffer_size??=512,n.thread_stack??=256,n.binlog_cache_size??=32;for(const e in ye)e in n&&(s[e]=n[e]);v()}}finally{P(!1)}};return S(),n({init:S}),(e,n)=>{const a=Y,b=A,g=te,h=H,v=E,q=D,P=W;return o(),u(f,null,[_(b,{class:"justify-center!"},{default:c((()=>[_(b,{class:"items-center"},{default:c((()=>[r("span",null,d(e.$t("Plugin.Mysql.index_20")),1),_(a,{class:"w-150px",value:p(l),"onUpdate:value":[n[0]||(n[0]=e=>x(l)?l.value=e:null),i],options:p(pe),placeholder:e.$t("Ftp.Placeholder.Index_2")},null,8,["value","options","placeholder"])])),_:1}),_(b,{class:"items-center"},{default:c((()=>[y(d(e.$t("Plugin.Mysql.index_21")),1),_(g,{text:"MB",class:"w-150px!",value:p(t),"onUpdate:value":n[1]||(n[1]=e=>x(t)?t.value=e:null),readonly:""},null,8,["value"])])),_:1})])),_:1}),_(h,{class:"my-10px!"}),_(P,{show:p(j)},{default:c((()=>[(o(!0),u(f,null,z(p(s),((e,n)=>(o(),m(b,{class:"items-center flex-nowrap! py-2px",key:n},{default:c((()=>[r("div",me,d(n),1),_(v,{class:"w-150px!",value:p(s)[n],"onUpdate:value":e=>p(s)[n]=e,min:0,"show-button":!1},null,8,["value","onUpdate:value"]),r("div",ge,d(p(ye)[n]),1)])),_:2},1024)))),128)),_(b,{class:"items-center justify-center! mt-10px"},{default:c((()=>[_(q,{type:"primary",onClick:k},{default:c((()=>[y(d(e.$t("Public.Btn.Save")),1)])),_:1}),_(q,{onClick:w},{default:c((()=>[y(d(e.$t("Plugin.Mysql.index_22",[p(M).title])),1)])),_:1}),r("span",xe,"*"+d(e.$t("Plugin.Mysql.index_23")),1)])),_:1})])),_:1},8,["show"])],64)}}}),ze=i({__name:"index",setup(e,{expose:n}){const a=g("None"),{loading:l,setLoading:t}=ne(),s=async()=>{await ie({close:1}),i()},i=async()=>{try{t(!0);const{message:e}=await ie();C(e)&&(a.value=e.result?e.result:"None")}finally{t(!1)}};return i(),n({init:i}),(e,n)=>{const t=D,i=se,r=W;return o(),u(f,null,[_(t,{class:"mb-10px",onClick:s},{default:c((()=>[y(d(e.$t("Crontab.Planned.index_25")),1)])),_:1}),_(r,{class:"h-580px",show:p(l)},{default:c((()=>[_(i,{log:p(a)},null,8,["log"])])),_:1},8,["show"])],64)}}}),ve=i({__name:"index",setup(e,{expose:n}){const a=g("None"),{loading:l,setLoading:t}=ne(),s=async()=>{try{t(!0);const{message:e}=await R();C(e)&&(a.value=e.result?e.result:"None")}finally{t(!1)}};return s(),n({init:s}),(e,n)=>{const t=se,s=W;return o(),m(s,{class:"h-610px",show:p(l)},{default:c((()=>[_(t,{log:p(a)},null,8,["log"])])),_:1},8,["show"])}}}),ke={class:"ml-20px"},we=i({__name:"index",setup(e,{expose:n}){const{t:a}=b(),t=h({binlog_status:!1,size:0}),{table:s,columns:i}=le([{key:"name",title:a("Site.TableRow.index_22")},{key:"title",title:a("Site.TableRow.index_23"),render:e=>$(e.size)},{key:"title",title:a("Plugin.Mysql.index_8"),render:e=>I(e.last_modified)},ue({width:70,options:e=>[{label:a("Public.Btn.Del"),onClick:()=>{F({title:a("Plugin.Mysql.index_9"),content:a("Plugin.Mysql.index_10",[e.name]),onConfirm:async()=>{await oe({path:e.path}),z()}})}}]})]),y=e=>{const n=a(e?"Public.Confirm.Enable":"Public.Status.Disable"),l=a(e?"Plugin.Mysql.index_11":"Plugin.Mysql.index_12");q({title:`${n} ${a("Plugin.Mysql.index_6")}`,content:l,onConfirm:async()=>{await Q(),x()}})},{loading:m,setLoading:g}=ne(),x=async()=>{const{message:e}=await Q({status:1});C(e)&&(t.binlog_status=e.binlog_status,t.size=e.size)},z=async()=>{try{g(!0);const{message:e}=await G();K(e)&&(s.data=e)}finally{g(!1)}},v=()=>{x(),z()};return v(),n({init:v}),(e,n)=>{const a=Z,b=A,g=H,x=l,h=ae;return o(),u(f,null,[_(b,{class:"items-center"},{default:c((()=>[r("span",null,d(e.$t("Plugin.Mysql.index_6")),1),_(a,{value:p(t).binlog_status,loading:p(m),"onUpdate:value":y},null,8,["value","loading"]),r("span",ke,d(p($)(p(t).size)),1)])),_:1}),_(g,{class:"my-16px!"}),_(x,{class:"mb-16px"},{default:c((()=>[r("li",null,d(e.$t("Plugin.Mysql.index_7")),1)])),_:1}),_(h,{loading:p(m),data:p(s).data,columns:p(i),"max-height":400},null,8,["loading","data","columns"])],64)}}}),qe=i({__name:"index",setup(e,{expose:n}){const a=g(!1),t=async e=>{await O({status:e?1:0}),b()},{loading:s,setLoading:i}=ne(),b=async()=>{try{i(!0),await O(),a.value=!0}catch{a.value=!1}finally{i(!1)}};return b(),n({init:b}),(e,n)=>{const i=Z,b=A,y=H,m=l;return o(),u(f,null,[_(b,{class:"items-center"},{default:c((()=>[r("span",null,d(e.$t("Plugin.Mysql.index_18")),1),_(i,{value:p(a),"onUpdate:value":[n[0]||(n[0]=e=>x(a)?a.value=e:null),t],loading:p(s)},null,8,["value","loading"])])),_:1}),_(y,{class:"my-16px!"}),_(m,{class:"mb-16px"},{default:c((()=>[r("li",null,d(e.$t("Plugin.Mysql.index_19")),1)])),_:1})],64)}}});e("default",i({__name:"index",setup(e){const{t:l}=b(),t=g("service"),i=[{key:"service",label:l("Security.History.Index_10"),component:n},{key:"file",label:l("Site.Config.index_15"),data:{path:"/etc/my.cnf"},component:s},{key:"location",label:l("Plugin.Mysql.index_26"),component:_e},{key:"port",label:l("Site.TableRow.index_16"),component:ce},{key:"ssl",label:"SSL",show:!1,component:re},{key:"status",label:l("Docker.Setting.index_2"),component:be},{key:"optimization",label:l("Plugin.Mysql.index_27"),component:he},{key:"logs",label:l("Site.Config.index_101"),component:ze},{key:"slow",label:l("Plugin.Mysql.index_28"),component:ve},{key:"binary",label:l("Plugin.Mysql.index_6"),component:we},{key:"memory",label:l("Plugin.Mysql.index_18"),component:qe}];return(e,n)=>{const l=a;return o(),m(l,{value:p(t),"onUpdate:value":n[0]||(n[0]=e=>x(t)?t.value=e:null),data:i},null,8,["value"])}}}))}}}));