planche 0.8.13 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/1p4z4GHT.js +2 -0
- package/app/assets/{DkPnEF-y.js → 6NUleTnS.js} +1 -1
- package/app/assets/ANL7Od0T.js +1 -0
- package/app/assets/B7zF7RU4.js +2 -0
- package/app/assets/B8zpsP_u.js +959 -0
- package/app/assets/B9DHeSQH.js +1 -0
- package/app/assets/B9NCreMu.js +1 -0
- package/app/assets/{CjoKIEBz.js → B9dhM8vw.js} +1 -1
- package/app/assets/BFw3KCAr.js +1 -0
- package/app/assets/BGuDcBB_.js +1 -0
- package/app/assets/BHe42P9W.js +1 -0
- package/app/assets/BJFk0Zzq.js +2 -0
- package/app/assets/BMGo7X_N.js +2 -0
- package/app/assets/BRZhVXRC.js +1 -0
- package/app/assets/BVwlLPu6.js +1 -0
- package/app/assets/BYWnKgIY.js +3 -0
- package/app/assets/BYvM8E39.js +1 -0
- package/app/assets/B_1rFijd.js +1 -0
- package/app/assets/Bgu3teFB.js +11 -0
- package/app/assets/BgvMpmFj.js +1 -0
- package/app/assets/BhPOHTk7.js +7 -0
- package/app/assets/BiyRPyXV.js +1 -0
- package/app/assets/Bkq2aetC.js +1 -0
- package/app/assets/BnI4D_rY.js +1 -0
- package/app/assets/BniymiMs.js +2 -0
- package/app/assets/Br4335vw.js +1 -0
- package/app/assets/BsYZ-U7K.js +1 -0
- package/app/assets/BvEGx3Si.js +4 -0
- package/app/assets/Bvu_eiyU.js +3 -0
- package/app/assets/C1gqjEN3.js +1 -0
- package/app/assets/C2S2GXdP.js +1 -0
- package/app/assets/C3w9xAkk.js +1 -0
- package/app/assets/C4QyqQoa.js +1 -0
- package/app/assets/C5Yv1gpQ.js +1 -0
- package/app/assets/CCQ6oQgi.js +1 -0
- package/app/assets/{Bajzqc8D.js → CDfSdkjY.js} +1 -1
- package/app/assets/CIIDOG9Y.js +1 -0
- package/app/assets/CP2U-viH.js +1 -0
- package/app/assets/CVZ3Bw6o.js +1 -0
- package/app/assets/CWb3a6Xp.js +1 -0
- package/app/assets/CWota0kb.js +1 -0
- package/app/assets/{B1pia_Rg.js → CYz610vE.js} +1 -1
- package/app/assets/Cdop6jK1.js +2 -0
- package/app/assets/CgQ0qqq4.js +1 -0
- package/app/assets/CiL8zoYm.js +1 -0
- package/app/assets/CkIm3SJy.js +1 -0
- package/app/assets/ClytWHSf.js +1 -0
- package/app/assets/CnoXRrek.js +1 -0
- package/app/assets/CqTgU2vp.css +2 -0
- package/app/assets/Cu_sGzNJ.js +1 -0
- package/app/assets/CwsH45Wr.js +2 -0
- package/app/assets/D3_CBO8-.js +1 -0
- package/app/assets/D4l4mWtD.js +1 -0
- package/app/assets/D6oRJsd8.js +1 -0
- package/app/assets/D8_hwGjG.js +1 -0
- package/app/assets/{CEtGUZGE.js → D8dVzi6I.js} +1 -1
- package/app/assets/DDeeBXtX.js +1 -0
- package/app/assets/DDjCZLb0.js +1 -0
- package/app/assets/DFeHpd8Y.js +1 -0
- package/app/assets/DKf3DkR6.js +1 -0
- package/app/assets/DO0W14Ho.js +1 -0
- package/app/assets/DPnYgSl3.js +1 -0
- package/app/assets/DU-Eln5x.js +1 -0
- package/app/assets/DY1k-USH.js +1 -0
- package/app/assets/DeNEO8HN.js +1 -0
- package/app/assets/DkqeIq13.js +1 -0
- package/app/assets/DnRoHgQS.js +1 -0
- package/app/assets/Dy6-E_uL.js +1 -0
- package/app/assets/DyQ8cEic.js +1 -0
- package/app/assets/DzRyVlxz.js +41 -0
- package/app/assets/FAouNaq9.js +1 -0
- package/app/assets/Nro86Y63.js +1 -0
- package/app/assets/Q6DQerac.js +8 -0
- package/app/assets/S7HbowYz.js +373 -0
- package/app/assets/UX-csQNt.js +2 -0
- package/app/assets/Udlj1Cgf.js +1 -0
- package/app/assets/{C0bzfYFC.js → XCH_yrJ8.js} +1 -1
- package/app/assets/_zaonxnw.js +1 -0
- package/app/assets/f6MhVR01.js +27 -0
- package/app/assets/tQiLT0zv.js +2 -0
- package/app/index.html +35 -27
- package/app/landing.css +17 -0
- package/dist/{chunk-XAI7WLQN.js → chunk-SDRLD5PK.js} +995 -121
- package/dist/embed.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -2
- package/app/assets/8RmjiG1u.js +0 -1
- package/app/assets/9kM6GVHV.js +0 -7
- package/app/assets/B2csuorb.js +0 -1
- package/app/assets/BCmzDvBt.js +0 -1
- package/app/assets/BHsXOlR9.js +0 -2
- package/app/assets/BO_H_8D-.js +0 -1
- package/app/assets/BRc4Nt6e.js +0 -1
- package/app/assets/BW4K9UH-.js +0 -1
- package/app/assets/BbdU8Zop.js +0 -2
- package/app/assets/BgkATqP8.js +0 -1
- package/app/assets/Bhquh17w.js +0 -959
- package/app/assets/Bjm-okwb.js +0 -1
- package/app/assets/Bs-p2SdN.js +0 -1
- package/app/assets/CF6jyexg.js +0 -41
- package/app/assets/CMoC9sLj.js +0 -1
- package/app/assets/COfwwXGO.js +0 -3
- package/app/assets/CS2mpWDL.js +0 -1
- package/app/assets/CUK2WAdf.js +0 -1
- package/app/assets/CVpOAP2j.js +0 -1
- package/app/assets/CVpzA8TC.js +0 -8
- package/app/assets/CZoj-eMm.js +0 -1
- package/app/assets/CbmIWIww.js +0 -1
- package/app/assets/CeXMO4BR.js +0 -1
- package/app/assets/Cf8o-5U6.js +0 -2
- package/app/assets/CiFkP-9S.js +0 -1
- package/app/assets/CpSudzcZ.js +0 -1
- package/app/assets/CqK9ewb_.js +0 -1
- package/app/assets/CrT26gRf.js +0 -1
- package/app/assets/D0jMUNSI.js +0 -2
- package/app/assets/D6kbK-ng.js +0 -1
- package/app/assets/DEEGN6UG.js +0 -6
- package/app/assets/DIJgEIiP.js +0 -27
- package/app/assets/DMRY-PmY.js +0 -1
- package/app/assets/DPdwSUSw.js +0 -1
- package/app/assets/DSmKDd5u.js +0 -1
- package/app/assets/DTDWV2fP.js +0 -2
- package/app/assets/DW8BZVdB.js +0 -1
- package/app/assets/DWMVPRon.js +0 -1
- package/app/assets/DbqogdCK.js +0 -356
- package/app/assets/Dc12Sye0.js +0 -1
- package/app/assets/DzVnJu74.js +0 -2
- package/app/assets/KuSp3gJs.css +0 -2
- package/app/assets/OjAiMU9J.js +0 -2
- package/app/assets/SFsWRs4-.js +0 -1
- package/app/assets/bgQ-QVd7.js +0 -1
- package/app/assets/fI8KJgQa.js +0 -1
- package/app/assets/hrOpaTVU.js +0 -1
- package/app/assets/p4yYbMPY.js +0 -2
- package/app/assets/pjlgs2cl.js +0 -1
- package/app/assets/pneb1la9.js +0 -1
- package/app/assets/qXWuX5B-.js +0 -1
- package/app/assets/useqs8Jk.js +0 -1
- package/app/assets/y4cmNs6-.js +0 -1
- package/app/assets/y664aOTm.js +0 -1
- package/app/assets/zspOy9D_.js +0 -2
package/app/assets/DEEGN6UG.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./D0jMUNSI.js";import{t}from"./Bit0Kfog.js";var n=new Set([`neon`,`supabase`]);function r(e){return e===`postgres`||n.has(e)}var i=`_rowid_`,a=`http://127.0.0.1:8888`,o=t(`tunnelAgent`,()=>({url:null,token:null}));function s(e){o.url=e.url?.replace(/\/+$/,``)||null,o.token=e.token?.trim()||null}var c=new Set([`127.0.0.1`,`localhost`,`[::1]`,`::1`]);function l(e){try{let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&c.has(t.hostname)}catch{return!1}}function u(e){try{return typeof window<`u`&&new URL(e).origin===window.location.origin}catch{return!1}}function d(e){return l(e)||u(e)}function f(){return o.url!==null&&o.url!==`/api`&&!d(o.url)}function p(){return o.url??a}function m(){let t=p();return t===`/api`?e.t(`services.agent.devProxyUrl`,{url:`http://localhost:8888`}):t}async function h(){let t=m(),n;try{let e={};o.token&&(e.Authorization=`Bearer ${o.token}`),n=await(await fetch(`${p()}/health`,{cache:`no-store`,headers:e})).json()}catch(e){return{state:`offline`,url:t,message:e instanceof Error?e.message:String(e)}}return n.name!==`planche`||typeof n.version!=`string`||!/^[\w.+-]{1,32}$/.test(n.version)?{state:`offline`,url:t,message:e.t(`services.agent.notPlanche`)}:n.protocolVersion===2?n.authorized===!1||o.token===null&&n.authorized===void 0?{state:`unauthorized`,url:t,version:n.version}:{state:`online`,url:t,version:n.version,activeConnections:n.activeConnections??0,...n.gateway?{gateway:n.gateway}:{}}:{state:`outdated`,url:t,version:n.version,protocolVersion:n.protocolVersion??0,install:n.install===`standalone`?`standalone`:`npx`}}async function g(){let t=await fetch(`${p()}/profiles`,{cache:`no-store`,headers:N()}),n=await t.json().catch(()=>null);if(!t.ok||!n||n.success!==!0)throw new P(n?.message??e.t(`services.agent.httpError`,{status:t.status,statusText:t.statusText}),t.status);return n}async function _(){return D(`/ai/config`,{method:`GET`})}async function v(e){return D(`/ai/config`,{method:`PUT`,body:JSON.stringify(e)})}async function y(){return D(`/ai/config`,{method:`DELETE`})}async function b(){try{return(await(await fetch(`${p()}/health`,{cache:`no-store`,headers:N()})).json()).ai?.tools===!0}catch{return!1}}async function x(e){await D(`/bridge/tools`,{method:`POST`,body:JSON.stringify({tools:e})})}async function S(e,t,n){await D(`/bridge/result`,{method:`POST`,body:JSON.stringify({id:e,content:t,isError:n})})}async function C(t,n){let r=new AbortController,i=await fetch(`${p()}/bridge/events`,{headers:N(),signal:r.signal,cache:`no-store`});if(!i.ok||!i.body)throw new P(e.t(`services.agent.httpError`,{status:i.status,statusText:i.statusText}),i.status);return(async()=>{let e=i.body.getReader(),r=new TextDecoder,a=``;try{for(;;){let{done:n,value:i}=await e.read();if(n)break;a+=r.decode(i,{stream:!0});let o=a.indexOf(`
|
|
2
|
-
|
|
3
|
-
`);for(;o!==-1;){let e=a.slice(0,o);a=a.slice(o+2);for(let n of e.split(`
|
|
4
|
-
`))n.startsWith(`data: `)&&t(n.slice(6));o=a.indexOf(`
|
|
5
|
-
|
|
6
|
-
`)}}}catch{}n()})(),()=>r.abort()}async function w(){return D(`/mcp/setup`,{method:`POST`})}async function T(){await D(`/mcp/setup`,{method:`DELETE`})}async function E(e,t){return D(`/ai/run`,{method:`POST`,body:JSON.stringify(e),signal:t})}async function D(t,n){let r=await fetch(`${p()}${t}`,{cache:`no-store`,headers:N(),...n}),i=await r.json().catch(()=>null);if(!r.ok||!i||i.success!==!0)throw new P(i?.message??e.t(`services.agent.httpError`,{status:r.status,statusText:r.statusText}),r.status);return i}function O(e){let t=e.ssh;if(t?.enabled)return{host:t.host,port:t.port,user:t.user,auth:t.auth,password:t.auth===`password`?t.password??``:void 0,privateKey:t.auth===`key`?t.privateKey:void 0,passphrase:t.auth===`key`&&t.passphrase||void 0}}function k(e){return e.gatewayProfile?{profile:e.gatewayProfile}:e.dbms===`sqlite`?{driver:`sqlite`,file:e.file??``,createIfMissing:e.createIfMissing??!1,readonly:e.readOnly??!1}:e.dbms===`do`?{driver:`do`,devUrl:e.devUrl??``}:e.dbms===`d1`?e.devUrl?{driver:`d1`,devUrl:e.devUrl,databaseId:e.databaseId||void 0}:{driver:`d1`,accountId:e.accountId??``,databaseId:e.databaseId??``,apiToken:e.pass}:e.dbms===`postgres`?{driver:`postgres`,host:e.host,port:e.port,user:e.user,password:e.pass,database:e.database||`postgres`,ssl:e.ssl??!1,sslVerify:e.sslVerify??!1,ssh:O(e)}:n.has(e.dbms)?{driver:`postgres`,host:e.host,port:e.port,user:e.user,password:e.pass,database:e.database||`postgres`,ssl:!0,sslVerify:e.dbms===`neon`}:e.dbms===`mssql`?{driver:`mssql`,host:e.host,port:e.port,user:e.user,password:e.pass,database:e.database||`master`,ssl:e.ssl??!1,sslVerify:e.sslVerify??!1,ssh:O(e)}:e.dbms===`oracle`?{driver:`oracle`,host:e.host,port:e.port,user:e.user,password:e.pass,serviceName:e.database||`FREEPDB1`,ssh:O(e)}:{driver:`mysql`,host:e.host,port:e.port,user:e.user,password:e.pass,charset:e.charset===`utf8`?`utf8mb4`:e.charset,ssl:e.ssl??!1,sslVerify:e.sslVerify??!1,ssh:O(e)}}var A=t(`tunnelAuthTokens`,()=>new Map);function j(e,t){let n=t?.trim();n?A.set(e,n):A.delete(e)}function M(e){return e?.trim()||o.token||void 0}function N(e){let t={"Content-Type":`application/json`},n=M(e);return n&&(t.Authorization=`Bearer ${n}`),t}var P=class extends Error{status;body;constructor(e,t,n=null){super(e),this.status=t,this.body=n}};function F(e){if(!(e instanceof P)||e.status!==409)return null;let t=e.body,n=t?.hostKey;if(t?.code!==`host-key-unknown`||!n)return null;let r=typeof n.host==`string`&&/^[A-Za-z0-9._:[\]-]{1,253}$/.test(n.host)?n.host:null,i=typeof n.type==`string`&&/^[\w.@-]{1,64}$/.test(n.type)?n.type:null,a=typeof n.fingerprint==`string`&&/^SHA256:[A-Za-z0-9+/]{43}$/.test(n.fingerprint)?n.fingerprint:null,o=Number.isInteger(n.port)&&n.port>0&&n.port<65536?n.port:null;return r&&i&&a&&o?{host:r,port:o,type:i,fingerprint:a}:null}async function I(t,n){let r=await fetch(`${t.replace(/\/+$/,``)}/pair`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:n})}),i=await r.json().catch(()=>null);if(!r.ok||!i?.success||typeof i.token!=`string`)throw Error(i?.message??e.t(`services.agent.httpError`,{status:r.status,statusText:r.statusText}));return i.token}async function L(t,n,r){let i;try{i=await fetch(`${p()}${t}`,{method:`POST`,headers:N(r),body:JSON.stringify(n)})}catch(t){throw Error(e.t(`services.agent.unreachable`,{url:m(),message:t instanceof Error?t.message:String(t)}))}let a=null;try{a=await i.json()}catch{a=null}if(!i.ok)throw new P(a?.message??e.t(`services.agent.httpError`,{status:i.status,statusText:i.statusText}),i.status,a);if(!a)throw Error(e.t(`services.agent.emptyResponse`));return a}async function R(e,t){let n=await L(`/connect`,e,t);return n.success&&n.connectionId&&(j(n.connectionId,M(t)),V()),n}async function z(e){try{let t=await L(`/cancel`,{connectionId:e},A.get(e));return t.cancelled?t.abandoned?`abandoned`:`cancelled`:`unsupported`}catch(e){return e instanceof P&&e.status===404?`agent-outdated`:`failed`}}async function B(e,t,n){let r=performance.now(),i=await L(`/query`,{connectionId:e,sql:t,database:n},A.get(e));return i.execTime||=Math.round(performance.now()-r),i}function V(){if(typeof window>`u`)return;let e=t(`tunnelPageHide`,()=>({done:!1}));e.done||(e.done=!0,window.addEventListener(`pagehide`,()=>{for(let[e,t]of A)fetch(`${p()}/disconnect`,{method:`POST`,headers:N(t),body:JSON.stringify({connectionId:e}),keepalive:!0}).catch(()=>void 0)}))}async function H(e){try{await L(`/disconnect`,{connectionId:e},A.get(e))}finally{A.delete(e)}}async function U(e,t){return L(`/test-connection`,e,t)}var W=0;function G(e){W>=3||(async()=>{try{(await fetch(`${p()}/usage`,{method:`POST`,headers:N(),body:JSON.stringify({feature:e})})).ok?W=0:W+=1}catch{W+=1}})()}export{E as C,i as D,n as E,r as O,T as S,k as T,I as _,h as a,v as b,y as c,_ as d,g as f,C as g,d as h,z as i,H as l,F as m,f as n,s as o,w as p,b as r,R as s,P as t,B as u,S as v,U as w,x,G as y};
|
package/app/assets/DIJgEIiP.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./hePW80VL.js";import{h as t,n}from"./B1pia_Rg.js";import{l as r,m as i,t as a}from"./pjlgs2cl.js";import{a as o,i as s,n as c,r as l,t as u}from"./CiFkP-9S.js";import{t as d}from"./BCmzDvBt.js";import{n as f}from"./BO_H_8D-.js";import{S as p,a as m}from"./CS2mpWDL.js";import{n as h}from"./pneb1la9.js";import{o as g,r as _}from"./CjoKIEBz.js";import{c as v,lt as y}from"./Bhquh17w.js";import{a as b,i as x,n as S,o as C,t as w}from"./BgkATqP8.js";import{t as T}from"./CnYBZPf9.js";var E=e(t(),1),D=r();function O(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function k(){let{t:e}=i(),{activeDialog:t,closeDialog:r}=n(),{activeConnectionId:k,activeConnections:A}=d(),{trees:j}=p(),M=f(),N=t===`export-html`,P=(0,E.useMemo)(()=>k?_(j[k]??[]):[],[k,j]),F=(0,E.useMemo)(()=>{if(!k)return``;let e=M.activeTabId[k];return(M.tabs[k]??[]).find(t=>t.id===e)?.database||``},[k,M.activeTabId,M.tabs]),[I,L]=(0,E.useState)(``),R=(0,E.useMemo)(()=>!k||!I?[]:g(j[k]??[],I),[k,I,j]),[z,B]=(0,E.useState)([]),[V,H]=(0,E.useState)(!0),[U,W]=(0,E.useState)(!0),[G,K]=(0,E.useState)(!0),[q,J]=(0,E.useState)(!1);(0,E.useEffect)(()=>{N&&F&&L(F)},[N,F]);function Y(e){e||(r(),L(``),B([]),H(!0),W(!0),K(!0))}function X(e){B(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function Z(){B(R.length===z.length?[]:[...R])}async function Q(){if(z.length===0||!k)return;let t=A.find(e=>e.id===k);if(!t?.serverConnectionId)return;J(!0);let{introspect:n}=h(k),i=m(t.serverConnectionId),a=(e,t,n)=>{let r=`<h3>${O(e)}</h3>\n<table border="1" cellpadding="4" cellspacing="0">\n`;r+=`<tr>${t.map(e=>`<th>${O(e)}</th>`).join(``)}</tr>\n`;for(let e of n)r+=`<tr>${e.map(e=>`<td>${O(e==null?`NULL`:String(e))}</td>`).join(``)}</tr>\n`;return r+`</table>
|
|
2
|
-
`};try{let t=[];for(let r of z){let o=`<h2>${O(r)}</h2>\n`;if(V){let t=await n.listColumns(i,I,r);t.length>0&&(o+=a(e(`database.html.sectionColumns`),[`Field`,`Type`,`Null`,`Key`,`Default`,`Extra`,`Comment`],t.map(e=>[e.name,e.type,e.nullable?`YES`:`NO`,e.key,e.defaultValue,e.extra,e.comment])))}if(U){let t=await n.listIndexes(i,I,r);t.length>0&&(o+=a(e(`database.html.sectionIndexes`),[`Key_name`,`Type`,`Columns`],t.map(e=>[e.name,e.type,e.columns.join(`, `)])))}if(G){let t=await n.getTableInfo(i,I,r);t&&(o+=a(e(`database.html.sectionProperties`),[`Name`,`Engine`,`Collation`,`Rows`,`Data_length`,`Create_time`,`Update_time`,`Comment`],[[t.name,t.engine,t.collation,t.rows,t.dataLength,t.createTime,t.updateTime,t.comment]]))}t.push(o)}let r=`<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<title>${O(e(`database.html.docTitle`,{database:I}))}</title>
|
|
7
|
-
<style>
|
|
8
|
-
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 20px; color: #333; }
|
|
9
|
-
h1 { border-bottom: 2px solid #333; padding-bottom: 8px; }
|
|
10
|
-
h2 { margin-top: 30px; color: #1a5276; border-bottom: 1px solid #ddd; padding-bottom: 4px; }
|
|
11
|
-
h3 { color: #555; margin-top: 12px; }
|
|
12
|
-
table { border-collapse: collapse; width: 100%; margin-bottom: 16px; font-size: 13px; }
|
|
13
|
-
th { background: #f0f0f0; text-align: left; }
|
|
14
|
-
td, th { padding: 6px 10px; border: 1px solid #ccc; }
|
|
15
|
-
tr:nth-child(even) { background: #fafafa; }
|
|
16
|
-
.footer { margin-top: 40px; font-size: 12px; color: #999; }
|
|
17
|
-
</style>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<h1>${O(e(`database.html.heading`,{database:I}))}</h1>
|
|
21
|
-
<p>${O(e(`database.html.summary`,{count:z.length,date:new Date().toLocaleString()}))}</p>
|
|
22
|
-
${t.join(`
|
|
23
|
-
<hr>
|
|
24
|
-
`)}
|
|
25
|
-
<div class="footer">${O(e(`database.html.footer`))}</div>
|
|
26
|
-
</body>
|
|
27
|
-
</html>`,o=new Blob([r],{type:`text/html;charset=utf-8;`}),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=T(`${I}_schema.html`),c.click(),URL.revokeObjectURL(s)}finally{J(!1),r()}}return(0,D.jsx)(w,{open:N,onOpenChange:Y,children:(0,D.jsxs)(S,{className:`sm:max-w-[500px]`,children:[(0,D.jsx)(b,{children:(0,D.jsx)(C,{children:e(`database.html.title`)})}),(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(v,{children:e(`database.html.database`)}),(0,D.jsxs)(u,{value:I,onValueChange:e=>{L(e),B([])},children:[(0,D.jsx)(s,{className:`w-full`,children:(0,D.jsx)(o,{placeholder:e(`database.html.selectDatabase`)})}),(0,D.jsx)(c,{children:P.map(e=>(0,D.jsx)(l,{value:e,children:e},e))})]})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(v,{children:e(`database.html.tables`)}),(0,D.jsx)(a,{variant:`ghost`,size:`sm`,className:`h-6 text-xs`,onClick:Z,children:z.length===R.length?e(`database.html.deselectAll`):e(`database.html.selectAll`)})]}),(0,D.jsx)(y,{className:`h-[200px] border rounded-md p-2`,children:R.length===0?(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`database.html.noTables`)}):(0,D.jsx)(`div`,{className:`space-y-1`,children:R.map(e=>(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer hover:bg-muted/50 rounded px-1 py-0.5`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:z.includes(e),onChange:()=>X(e)}),e]},e))})})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(v,{children:e(`database.html.include`)}),(0,D.jsxs)(`div`,{className:`space-y-1`,children:[(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:V,onChange:e=>H(e.target.checked)}),e(`database.html.includeColumns`)]}),(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked)}),e(`database.html.includeIndexes`)]}),(0,D.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:G,onChange:e=>K(e.target.checked)}),e(`database.html.includeProperties`)]})]})]})]}),(0,D.jsxs)(x,{children:[(0,D.jsx)(a,{variant:`outline`,onClick:()=>Y(!1),children:e(`database.html.cancel`)}),(0,D.jsx)(a,{onClick:Q,disabled:z.length===0||q,children:e(q?`database.html.generating`:`database.html.generate`)})]})]})})}export{k as SchemaToHTMLDialog};
|
package/app/assets/DMRY-PmY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./hePW80VL.js";import{h as t,n,t as r}from"./B1pia_Rg.js";import{l as i,m as a,t as o}from"./pjlgs2cl.js";import{t as s}from"./BCmzDvBt.js";import{a as c}from"./CS2mpWDL.js";import{n as l}from"./pneb1la9.js";import{l as u,m as d}from"./OjAiMU9J.js";import{U as f,W as p,c as m,l as h}from"./Bhquh17w.js";import{a as g,i as _,n as v,o as y,t as b}from"./BgkATqP8.js";var x=e(t(),1),S=i();function C(){let{t:e}=a(),{activeDialog:t,closeDialog:i}=n(),C=r(`copy-database`),w=t===`copy-database`,T=C?.database??``,[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(`structure_data`),[A,j]=(0,x.useState)(null),[M,N]=(0,x.useState)(null);function P(e){e||(i(),N(null),j(null),D(``),k(`structure_data`))}async function F(){let t=s.getState().activeConnectionId,n=E.trim();if(!t||!n||!T)return;N(null);let r=l(t),i=s.getState().activeConnections.find(e=>e.id===t);if(i?.serverConnectionId)try{j(e(`database.copy.creating`,{database:n})),await u(t,r.getQuery(`CREATE_DATABASE`,n,`utf8mb4`,`utf8mb4_general_ci`));let a=c(i.serverConnectionId),o=await r.introspect.listTables(a,T);for(let[r,i]of o.entries()){j(e(`database.copy.copying`,{table:i.name,index:r+1,total:o.length}));let a={connectionId:t,database:T,table:i.name},s={connectionId:t,database:n,table:i.name},c=await f(a,s);await p({source:a,target:s,mode:O,onConflict:`abort`,createSql:l(t).ddl.createTable(c)})}await d(t),P(!1)}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(null)}}return(0,S.jsx)(b,{open:w,onOpenChange:P,children:(0,S.jsxs)(v,{className:`sm:max-w-[450px]`,children:[(0,S.jsx)(g,{children:(0,S.jsx)(y,{children:e(`database.copy.title`)})}),(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{children:e(`database.copy.source`)}),(0,S.jsx)(h,{value:T,disabled:!0})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{htmlFor:`target-db-name`,children:e(`database.copy.target`)}),(0,S.jsx)(h,{id:`target-db-name`,value:E,onChange:e=>D(e.target.value),placeholder:e(`database.copy.targetPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{children:e(`database.copy.options`)}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,S.jsx)(`input`,{type:`radio`,name:`copy-option`,value:`structure_data`,checked:O===`structure_data`,onChange:()=>k(`structure_data`)}),e(`database.copy.structureAndData`)]}),(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,S.jsx)(`input`,{type:`radio`,name:`copy-option`,value:`structure_only`,checked:O===`structure_only`,onChange:()=>k(`structure_only`)}),e(`database.copy.structureOnly`)]})]})]})]}),A&&(0,S.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:A}),M&&(0,S.jsx)(`p`,{className:`px-1 text-xs text-destructive leading-relaxed`,children:M}),(0,S.jsxs)(_,{children:[(0,S.jsx)(o,{variant:`outline`,onClick:()=>P(!1),children:e(`database.copy.cancel`)}),(0,S.jsx)(o,{onClick:()=>void F(),disabled:!E.trim()||A!==null,children:e(`database.copy.copy`)})]})]})})}export{C as CopyDatabaseDialog};
|
package/app/assets/DPdwSUSw.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./BCmzDvBt.js";import{y as t}from"./DEEGN6UG.js";function n(n){t(n),e(n)}export{n as t};
|
package/app/assets/DSmKDd5u.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./B1pia_Rg.js";import{l as t,m as n,t as r}from"./pjlgs2cl.js";import{a as i,i as a,n as o,r as s,t as c}from"./CiFkP-9S.js";import{n as l}from"./D6kbK-ng.js";import{c as u,l as d}from"./Bhquh17w.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./BgkATqP8.js";import{t as v}from"./DkPnEF-y.js";var y=t();function b(){let t=e(e=>e.activeDialog),b=e(e=>e.closeDialog),x=l(),S=x.update,{t:C}=n();return(0,y.jsx)(_,{open:t===`query-settings`,onOpenChange:e=>{e||b()},children:(0,y.jsxs)(m,{className:`sm:max-w-[560px]`,children:[(0,y.jsxs)(f,{children:[(0,y.jsx)(h,{children:C(`settings.query.title`)}),(0,y.jsx)(g,{children:C(`settings.query.description`)})]}),(0,y.jsxs)(`div`,{className:`grid gap-2`,children:[(0,y.jsx)(v,{id:`s-dryrun`,checked:x.previewAffectedRows,onChange:e=>S({previewAffectedRows:e}),pro:!0,label:`Dry run`,hint:`Before an UPDATE or DELETE runs, read its WHERE (joins included) as a SELECT and show how many rows it would change, with a sample of them, to confirm.`}),(0,y.jsxs)(`div`,{className:`grid grid-cols-[1fr_140px] items-center gap-3 rounded-md border p-3`,children:[(0,y.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,y.jsx)(u,{htmlFor:`s-limit`,className:`text-sm font-medium`,children:`Result row limit`}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`LIMIT appended to SELECTs that have none. 0 disables.`})]}),(0,y.jsx)(d,{id:`s-limit`,type:`number`,min:0,step:100,value:x.resultRowLimit,onChange:e=>S({resultRowLimit:Math.max(0,Number(e.target.value)||0)})})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-[1fr_200px] items-center gap-3 rounded-md border p-3`,children:[(0,y.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,y.jsx)(`span`,{className:`text-sm font-medium`,children:`F9 / Run button executes`}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Ctrl+Enter always runs the statement at the cursor; Ctrl+Shift+Enter the whole script.`})]}),(0,y.jsxs)(c,{value:x.executeScope,onValueChange:e=>S({executeScope:e}),children:[(0,y.jsx)(a,{children:(0,y.jsx)(i,{})}),(0,y.jsxs)(o,{children:[(0,y.jsx)(s,{value:`script`,children:`Whole script`}),(0,y.jsx)(s,{value:`statement`,children:`Statement at cursor`})]})]})]})]}),(0,y.jsx)(p,{children:(0,y.jsx)(r,{onClick:b,children:C(`settings.done`)})})]})})}export{b as QuerySettingsDialog};
|
package/app/assets/DTDWV2fP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./hePW80VL.js";import{h as t,n,t as r}from"./B1pia_Rg.js";import{l as i,m as a,t as o}from"./pjlgs2cl.js";import{a as s,i as c,n as l,r as u,t as d}from"./CiFkP-9S.js";import{t as f}from"./BCmzDvBt.js";import{a as p}from"./CS2mpWDL.js";import{n as m}from"./pneb1la9.js";import{l as h,p as g}from"./OjAiMU9J.js";import{$t as _,C as v,D as y,E as b,G as ee,O as te,S as x,T as S,Z as C,b as w,c as T,ct as ne,k as E,l as D,lt as O,st as k,v as A,x as j,y as M}from"./Bhquh17w.js";import{a as N,i as P,n as F,o as I,t as L}from"./BgkATqP8.js";var R=e(t(),1);function z(){return{id:crypto.randomUUID(),field:``,type:`varchar`,length:``,defaultValue:``,pk:!1,notNull:!1,unsigned:!1,autoIncrement:!1,zerofill:!1,comment:``}}function B(){return{id:crypto.randomUUID(),name:``,type:`INDEX`,columns:[]}}function re(){return{engine:`InnoDB`,charset:`utf8mb4`,collation:`utf8mb4_general_ci`,autoIncrement:``,comment:``}}function ie(e,t,n,r,i){return{database:e,name:t,columns:n.map(e=>({name:e.field,type:e.type,length:e.length,defaultValue:e.defaultValue,primaryKey:e.pk,notNull:e.notNull,unsigned:e.unsigned,autoIncrement:e.autoIncrement,zerofill:e.zerofill,comment:e.comment})),indexes:r.map(e=>({name:e.name,type:e.type,columns:[...e.columns]})),options:{...i}}}var V=i(),H=`w-auto min-w-full [&_td]:bg-muted [&_td]:border-r [&_td]:border-border/60 [&_td:last-child]:border-r-0 [&_td]:p-0 [&_td]:h-8 [&_tr:nth-child(even)_td]:bg-muted/60 [&_tr:focus-within_td]:bg-primary/5`,U=`sticky top-0 z-10 bg-catppuccin-crust shadow-[inset_0_-1px_0_var(--border)] [&_th]:h-8 [&_th]:bg-catppuccin-crust [&_th]:font-semibold [&_th]:text-foreground [&_th]:uppercase [&_th]:tracking-wide [&_th]:text-[11px]`,W=`h-8 w-full min-w-0 rounded-none border-0 bg-transparent px-2 text-xs shadow-none ring-0 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary dark:bg-transparent`,G=`h-8 w-full min-w-0 rounded-none border-0 bg-transparent px-2 text-xs shadow-none focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary data-[state=open]:bg-primary/10 dark:bg-transparent dark:hover:bg-transparent`;function ae({columns:e,onChange:t}){let{t:n}=a(),r=k().getDataTypes(),i=(0,R.useCallback)((n,r,i)=>{t(e.map(e=>e.id===n?{...e,[r]:i}:e))},[e,t]);function f(){t([...e,z()])}function p(){e.length>0&&t(e.slice(0,-1))}return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsx)(O,{className:`flex-1`,children:(0,V.jsxs)(A,{className:H,children:[(0,V.jsx)(x,{className:U,children:(0,V.jsxs)(v,{children:[(0,V.jsx)(j,{className:`w-[120px]`,children:n(`table.schema.colField`)}),(0,V.jsx)(j,{className:`w-[120px]`,children:n(`table.schema.colType`)}),(0,V.jsx)(j,{className:`w-[60px]`,children:n(`table.schema.colLength`)}),(0,V.jsx)(j,{className:`w-[100px]`,children:n(`table.schema.colDefault`)}),(0,V.jsx)(j,{className:`w-[40px]`,children:n(`table.schema.colPk`)}),(0,V.jsx)(j,{className:`w-[60px]`,children:n(`table.schema.colNotNull`)}),(0,V.jsx)(j,{className:`w-[60px]`,children:n(`table.schema.colUnsigned`)}),(0,V.jsx)(j,{className:`w-[70px]`,children:n(`table.schema.colAutoIncrement`)}),(0,V.jsx)(j,{className:`w-[60px]`,children:n(`table.schema.colZerofill`)}),(0,V.jsx)(j,{children:n(`table.schema.colComment`)})]})}),(0,V.jsx)(M,{children:e.length===0?(0,V.jsx)(v,{children:(0,V.jsx)(w,{colSpan:10,className:`text-center text-muted-foreground`,children:n(`table.schema.empty`)})}):e.map(e=>(0,V.jsxs)(v,{children:[(0,V.jsx)(w,{children:(0,V.jsx)(D,{className:W,value:e.field,onChange:t=>i(e.id,`field`,t.target.value),placeholder:`column_name`})}),(0,V.jsx)(w,{children:(0,V.jsxs)(d,{value:e.type,onValueChange:t=>i(e.id,`type`,t),children:[(0,V.jsx)(c,{className:G,children:(0,V.jsx)(s,{})}),(0,V.jsx)(l,{children:r.map(e=>(0,V.jsx)(u,{value:e,children:e},e))})]})}),(0,V.jsx)(w,{children:(0,V.jsx)(D,{className:W,value:e.length,onChange:t=>i(e.id,`length`,t.target.value)})}),(0,V.jsx)(w,{children:(0,V.jsx)(D,{className:W,value:e.defaultValue,onChange:t=>i(e.id,`defaultValue`,t.target.value),placeholder:`NULL`})}),(0,V.jsx)(w,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.pk,onChange:t=>i(e.id,`pk`,t.target.checked)})}),(0,V.jsx)(w,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.notNull,onChange:t=>i(e.id,`notNull`,t.target.checked)})}),(0,V.jsx)(w,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.unsigned,onChange:t=>i(e.id,`unsigned`,t.target.checked)})}),(0,V.jsx)(w,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.autoIncrement,onChange:t=>i(e.id,`autoIncrement`,t.target.checked)})}),(0,V.jsx)(w,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.zerofill,onChange:t=>i(e.id,`zerofill`,t.target.checked)})}),(0,V.jsx)(w,{children:(0,V.jsx)(D,{className:W,value:e.comment,onChange:t=>i(e.id,`comment`,t.target.value)})})]},e.id))})]})}),(0,V.jsxs)(`div`,{className:`flex gap-2 p-2 border-t`,children:[(0,V.jsx)(o,{size:`sm`,variant:`outline`,onClick:f,children:n(`table.schema.add`)}),(0,V.jsx)(o,{size:`sm`,variant:`outline`,onClick:p,disabled:e.length===0,children:n(`table.schema.remove`)})]})]})}var K=[`PRIMARY`,`UNIQUE`,`INDEX`,`FULLTEXT`];function q({open:e,index:t,availableColumns:n,onSave:r,onClose:i}){let{t:f}=a(),[p,m]=(0,R.useState)(t.name),[h,g]=(0,R.useState)(t.type),[_,v]=(0,R.useState)(t.columns);function y(e){v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function b(){r({id:t.id,name:h===`PRIMARY`?`PRIMARY`:p,type:h,columns:_})}return(0,V.jsx)(L,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(F,{className:`sm:max-w-[500px]`,children:[(0,V.jsx)(N,{children:(0,V.jsx)(I,{children:t.name?f(`table.index.editTitle`):f(`table.index.addTitle`)})}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`idx-name`,children:f(`table.index.name`)}),(0,V.jsx)(D,{id:`idx-name`,value:h===`PRIMARY`?`PRIMARY`:p,onChange:e=>m(e.target.value),disabled:h===`PRIMARY`,placeholder:f(`table.index.namePlaceholder`)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`idx-type`,children:f(`table.index.type`)}),(0,V.jsxs)(d,{value:h,onValueChange:e=>g(e),children:[(0,V.jsx)(c,{id:`idx-type`,className:`w-full`,children:(0,V.jsx)(s,{})}),(0,V.jsx)(l,{children:K.map(e=>(0,V.jsx)(u,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{children:f(`table.index.columns`)}),(0,V.jsx)(`div`,{className:`border rounded-md p-2 max-h-[200px] overflow-y-auto space-y-1`,children:n.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f(`table.index.noColumns`)}):n.map(e=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer hover:bg-muted/50 rounded px-1 py-0.5`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_.includes(e.field),onChange:()=>y(e.field)}),(0,V.jsx)(`span`,{children:e.field||f(`table.index.unnamed`)}),(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.type,`)`]})]},e.id))})]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(o,{variant:`outline`,onClick:i,children:f(`table.index.cancel`)}),(0,V.jsx)(o,{onClick:b,disabled:_.length===0,children:f(`table.index.ok`)})]})]})})}function oe({indexes:e,availableColumns:t,onChange:n}){let{t:r}=a(),[i,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(!1);function u(){let e=B();s(e),l(!0)}function d(e){s({...e}),l(!0)}function f(){e.length>0&&n(e.slice(0,-1))}function p(t){e.find(e=>e.id===t.id)?n(e.map(e=>e.id===t.id?t:e)):n([...e,t]),l(!1),s(null)}function m(){l(!1),s(null)}return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsx)(O,{className:`flex-1`,children:(0,V.jsxs)(A,{className:H+` [&_td]:px-2`,children:[(0,V.jsx)(x,{className:U,children:(0,V.jsxs)(v,{children:[(0,V.jsx)(j,{className:`w-[150px]`,children:r(`table.indexes.colName`)}),(0,V.jsx)(j,{className:`w-[120px]`,children:r(`table.indexes.colType`)}),(0,V.jsx)(j,{children:r(`table.indexes.colColumns`)})]})}),(0,V.jsx)(M,{children:e.length===0?(0,V.jsx)(v,{children:(0,V.jsx)(w,{colSpan:3,className:`text-center text-muted-foreground`,children:r(`table.indexes.empty`)})}):e.map(e=>(0,V.jsxs)(v,{className:`cursor-pointer`,onDoubleClick:()=>d(e),children:[(0,V.jsx)(w,{children:e.name}),(0,V.jsx)(w,{children:e.type}),(0,V.jsx)(w,{children:e.columns.join(`, `)})]},e.id))})]})}),(0,V.jsxs)(`div`,{className:`flex gap-2 p-2 border-t`,children:[(0,V.jsx)(o,{size:`sm`,variant:`outline`,onClick:u,children:r(`table.indexes.add`)}),(0,V.jsx)(o,{size:`sm`,variant:`outline`,onClick:f,disabled:e.length===0,children:r(`table.indexes.remove`)})]}),i&&(0,V.jsx)(q,{open:c,index:i,availableColumns:t,onSave:p,onClose:m})]})}var J=[`InnoDB`,`MyISAM`,`MEMORY`,`CSV`,`ARCHIVE`,`BLACKHOLE`,`MRG_MYISAM`,`FEDERATED`,`PERFORMANCE_SCHEMA`],Y=[`utf8mb4`,`utf8`,`latin1`,`ascii`,`binary`,`cp1251`,`euckr`,`gb2312`,`gbk`,`sjis`,`ucs2`,`utf16`,`utf32`],X={utf8mb4:[`utf8mb4_general_ci`,`utf8mb4_unicode_ci`,`utf8mb4_bin`,`utf8mb4_0900_ai_ci`],utf8:[`utf8_general_ci`,`utf8_unicode_ci`,`utf8_bin`],latin1:[`latin1_swedish_ci`,`latin1_general_ci`,`latin1_bin`],ascii:[`ascii_general_ci`,`ascii_bin`],binary:[`binary`],cp1251:[`cp1251_general_ci`,`cp1251_bin`],euckr:[`euckr_korean_ci`,`euckr_bin`],gb2312:[`gb2312_chinese_ci`,`gb2312_bin`],gbk:[`gbk_chinese_ci`,`gbk_bin`],sjis:[`sjis_japanese_ci`,`sjis_bin`],ucs2:[`ucs2_general_ci`,`ucs2_unicode_ci`,`ucs2_bin`],utf16:[`utf16_general_ci`,`utf16_unicode_ci`,`utf16_bin`],utf32:[`utf32_general_ci`,`utf32_unicode_ci`,`utf32_bin`]};function se({properties:e,onChange:t}){let{t:n}=a();function r(n,r){let i={...e,[n]:r};n===`charset`&&(i.collation=X[r]?.[0]??``),t(i)}let i=X[e.charset]??[];return(0,V.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`prop-engine`,children:n(`table.properties.engine`)}),(0,V.jsxs)(d,{value:e.engine,onValueChange:e=>r(`engine`,e),children:[(0,V.jsx)(c,{id:`prop-engine`,className:`w-full`,children:(0,V.jsx)(s,{})}),(0,V.jsx)(l,{children:J.map(e=>(0,V.jsx)(u,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`prop-charset`,children:n(`table.properties.charset`)}),(0,V.jsxs)(d,{value:e.charset,onValueChange:e=>r(`charset`,e),children:[(0,V.jsx)(c,{id:`prop-charset`,className:`w-full`,children:(0,V.jsx)(s,{})}),(0,V.jsx)(l,{children:Y.map(e=>(0,V.jsx)(u,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`prop-collation`,children:n(`table.properties.collation`)}),(0,V.jsxs)(d,{value:e.collation,onValueChange:e=>r(`collation`,e),children:[(0,V.jsx)(c,{id:`prop-collation`,className:`w-full`,children:(0,V.jsx)(s,{})}),(0,V.jsx)(l,{children:i.map(e=>(0,V.jsx)(u,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`prop-auto-incr`,children:n(`table.properties.autoIncrement`)}),(0,V.jsx)(D,{id:`prop-auto-incr`,type:`number`,value:e.autoIncrement,onChange:e=>r(`autoIncrement`,e.target.value),placeholder:n(`table.properties.autoIncrementPlaceholder`)})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(T,{htmlFor:`prop-comment`,children:n(`table.properties.comment`)}),(0,V.jsx)(D,{id:`prop-comment`,value:e.comment,onChange:e=>r(`comment`,e.target.value)})]})]})}function ce({connectionId:e,database:t,tableName:n,columns:r,indexes:i,properties:a}){let o=C(e=>e.themeId),s=ne(e),c=S(o),l=(0,R.useMemo)(()=>s.ddl.createTable(ie(t,n,r,i,a)),[s,t,n,r,i,a]);return(0,V.jsx)(`div`,{className:`h-[320px]`,children:(0,V.jsx)(_,{height:`100%`,language:`sql`,theme:c,value:l,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:`on`,wordWrap:`on`}})})}function Z(e){return JSON.stringify([e.type,e.length,e.defaultValue,e.pk,e.notNull,e.unsigned,e.autoIncrement,e.zerofill,e.comment])}function Q(e){return{name:e.field,type:e.length?`${e.type}(${e.length})`:e.type,nullable:!e.notNull,key:e.pk?`PRI`:``,defaultValue:e.defaultValue===``?null:e.defaultValue,extra:e.autoIncrement?`auto_increment`:``,comment:e.comment,collation:null}}function $(e){return{name:e.name,type:e.type,columns:[...e.columns]}}function le(e,t){return e.name===t.name&&e.type===t.type&&e.columns.join(`,`)===t.columns.join(`,`)}function ue({engine:e,database:t,table:n,before:r,after:i}){let{ddl:a}=e,o=[],s=[],c=[],l=new Map(r.columns.map(e=>[e.id,e])),u=new Map(i.columns.map(e=>[e.id,e])),d=new Map(r.indexes.map(e=>[e.id,e])),f=new Map(i.indexes.map(e=>[e.id,e])),p=[];for(let[e,r]of d){let i=f.get(e);i?le(r,i)||(o.push(a.dropIndex(t,n,r.name)),p.push(i)):o.push(a.dropIndex(t,n,r.name))}for(let[e,r]of u){let i=l.get(e);if(!i){r.field.trim()&&o.push(a.addColumn(t,n,Q(r)));continue}if(i.field!==r.field&&o.push(a.renameColumn(t,n,i.field,r.field)),Z(i)!==Z(r)){let e=a.alterColumn(t,n,Q(r));e?o.push(e):c.push(r.field)}}for(let[e,r]of l)if(!u.has(e)){let e=a.dropColumn(t,n,r.field);o.push(e),s.push(e)}for(let e of p)o.push(a.createIndex(t,n,$(e)));for(let[e,r]of f)!d.has(e)&&r.columns.length>0&&o.push(a.createIndex(t,n,$(r)));return{statements:o,destructive:s,unsupported:c}}function de(){let{t:e}=a(),{activeDialog:t,closeDialog:i}=n(),s=r(`create-table`,`alter-table`,`duplicate-table-structure`),c=t===`create-table`||t===`alter-table`||t===`duplicate-table-structure`,l=t===`alter-table`,u=t===`duplicate-table-structure`,d=s?.nodeText??``,_=s?.metadata?.database??``,[v,x]=(0,R.useState)(``),[S,C]=(0,R.useState)([z()]),[w,O]=(0,R.useState)([]),[k,A]=(0,R.useState)(re()),[j,M]=(0,R.useState)(!1),[B,H]=(0,R.useState)(!1),[U,W]=(0,R.useState)(null),[G,K]=(0,R.useState)(null),q=s?.connectionId??f.getState().activeConnectionId,J=ne(q);(0,R.useEffect)(()=>{c&&(W(null),K(null),l||u?(x(u?`${d}_copy`:d),Y()):(x(``),C([z()]),O([]),A(re())))},[c,t]);async function Y(){let e=f.getState(),t=s?.connectionId??e.activeConnectionId,n=e.activeConnections.find(e=>e.id===t)?.serverConnectionId;if(!n||!_||!d)return;M(!0);let{introspect:r,capabilities:i}=m(t),a=p(n);try{let e=await r.listColumns(a,_,d),t=[];if(e.length>0){let n=e.map(e=>{let t=e.type,n=t.match(/^(\w+)(?:\(([^)]+)\))?/);return{id:crypto.randomUUID(),field:e.name,type:n?.[1]?.toLowerCase()??t.toLowerCase(),length:n?.[2]??``,defaultValue:e.defaultValue??``,pk:e.key===`PRI`,notNull:!e.nullable,unsigned:t.includes(`unsigned`),autoIncrement:e.extra.includes(`auto_increment`),zerofill:t.includes(`zerofill`),comment:e.comment}});C(n),t=n}let n=await r.listIndexes(a,_,d),o=[];if(n.length>0&&(o=n.map(e=>({id:crypto.randomUUID(),name:e.name,type:e.type===`SPATIAL`?`INDEX`:e.type,columns:[...e.columns]})),O(o)),K({columns:t,indexes:o}),i.tableProperties){let e=await r.getTableInfo(a,_,d);e&&A({engine:e.engine??`InnoDB`,charset:(e.collation??`utf8mb4`).replace(/_.*/,``),collation:e.collation??`utf8mb4_unicode_ci`,autoIncrement:e.autoIncrement??``,comment:e.comment})}}catch(e){console.error(`Failed to load table schema:`,e),W(e instanceof Error?e.message:String(e))}finally{M(!1)}}function X(e){e||i()}async function Z(){let t=s?.connectionId??f.getState().activeConnectionId;if(!t||!v.trim())return;let n=m(t);W(null);let r,a=[];if(l){if(!G)return;let t=ue({engine:n,database:_,table:d,before:G,after:{columns:S,indexes:w}});if(t.unsupported.length>0){W(e(`table.dialog.cannotAlterColumns`,{engine:n.label,columns:t.unsupported.join(`, `)}));return}if(t.statements.length===0){i();return}r=t.statements.join(`
|
|
2
|
-
`),a=t.destructive}else{let e=u?w.map(e=>({...e,name:ee(e.name,d,v.trim())})):w;r=n.ddl.createTable(ie(_,v.trim(),S,e,k))}H(!0);try{await h(t,r,{skipDestructiveConfirm:a.length===0}),await g(t,_),i()}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}}let Q=e(l?`table.dialog.alterTitle`:u?`table.dialog.duplicateTitle`:`table.dialog.createTitle`),$=e(l?`table.dialog.alter`:`table.dialog.create`);return(0,V.jsx)(L,{open:c,onOpenChange:X,children:(0,V.jsxs)(F,{className:`sm:max-w-[1000px] max-h-[80vh] flex flex-col`,children:[(0,V.jsx)(N,{children:(0,V.jsx)(I,{children:Q})}),(0,V.jsxs)(`div`,{className:`space-y-3 flex-1 overflow-hidden flex flex-col min-h-0`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5 px-1`,children:[(0,V.jsx)(T,{htmlFor:`table-name`,children:e(`table.dialog.tableName`)}),(0,V.jsx)(D,{id:`table-name`,value:v,onChange:e=>x(e.target.value),placeholder:e(`table.dialog.tableNamePlaceholder`),disabled:l})]}),j?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:e(`table.dialog.loading`)}):(0,V.jsxs)(b,{defaultValue:`schema`,className:`flex-1 min-h-0 flex flex-col`,children:[(0,V.jsxs)(te,{children:[(0,V.jsx)(E,{value:`schema`,children:e(`table.dialog.tabSchema`)}),(0,V.jsx)(E,{value:`indexes`,children:e(`table.dialog.tabIndexes`)}),J.capabilities.tableProperties&&(0,V.jsx)(E,{value:`properties`,children:e(`table.dialog.tabProperties`)}),(0,V.jsx)(E,{value:`sql`,children:`SQL`})]}),(0,V.jsx)(y,{value:`schema`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(ae,{columns:S,onChange:C})}),(0,V.jsx)(y,{value:`indexes`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(oe,{indexes:w,availableColumns:S,onChange:O})}),(0,V.jsx)(y,{value:`properties`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(se,{properties:k,onChange:A})}),(0,V.jsx)(y,{value:`sql`,className:`flex-1 min-h-0 border rounded-md`,children:(0,V.jsx)(ce,{connectionId:q,database:_,tableName:v,columns:S,indexes:w,properties:k})})]})]}),U&&(0,V.jsx)(`p`,{className:`px-1 text-xs text-destructive leading-relaxed`,children:U}),(0,V.jsxs)(P,{children:[(0,V.jsx)(o,{variant:`outline`,onClick:()=>X(!1),children:e(`table.dialog.cancel`)}),(0,V.jsx)(o,{onClick:()=>void Z(),disabled:j||B||!v.trim(),children:B?e(`table.dialog.applying`):$})]})]})})}export{de as EditSchemaDialog};
|
package/app/assets/DW8BZVdB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./B1pia_Rg.js";import{l as t,m as n,t as r}from"./pjlgs2cl.js";import{n as i,t as a}from"./D6kbK-ng.js";import{a as o,i as s,n as c,o as l,r as u,t as d}from"./BgkATqP8.js";import{t as f}from"./DkPnEF-y.js";var p=t();function m(){let t=e(e=>e.activeDialog),m=e(e=>e.closeDialog),h=i(),g=h.update,{t:_}=n();return(0,p.jsx)(d,{open:t===`safety-settings`,onOpenChange:e=>{e||m()},children:(0,p.jsxs)(c,{className:`sm:max-w-[560px]`,children:[(0,p.jsxs)(o,{children:[(0,p.jsx)(l,{children:_(`settings.title`)}),(0,p.jsx)(u,{children:_(`settings.description`)})]}),(0,p.jsxs)(`div`,{className:`grid gap-2`,children:[(0,p.jsx)(f,{id:`s-confirm`,checked:h.confirmDestructive,onChange:e=>g({confirmDestructive:e}),label:`Confirm destructive statements`,hint:`Ask before DROP TABLE/DATABASE, TRUNCATE, DELETE or UPDATE without WHERE, and ALTER … DROP COLUMN.`}),(0,p.jsx)(f,{id:`s-warn`,checked:h.warnInEditor,onChange:e=>g({warnInEditor:e}),label:`Warn in the editor`,hint:`Underline destructive statements and statements a read-only connection would refuse.`}),(0,p.jsx)(f,{id:`s-override`,checked:h.allowReadOnlyOverride,onChange:e=>g({allowReadOnlyOverride:e}),label:`Allow "Run anyway" on read-only connections`,hint:`When off, writes on a read-only connection are refused with no override.`}),(0,p.jsx)(f,{id:`s-preview`,checked:h.previewGridCommit,onChange:e=>g({previewGridCommit:e}),label:`Preview SQL before committing grid edits`,hint:`Show the generated UPDATE statements and ask for confirmation.`})]}),(0,p.jsxs)(s,{children:[(0,p.jsx)(r,{variant:`ghost`,onClick:()=>g(a),children:_(`settings.resetDefaults`)}),(0,p.jsx)(r,{onClick:m,children:_(`settings.done`)})]})]})})}export{m as SafetySettingsDialog};
|
package/app/assets/DWMVPRon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./hePW80VL.js";import{h as t,n}from"./B1pia_Rg.js";import{l as r,m as i,t as a}from"./pjlgs2cl.js";import{a as o,i as s,n as c,r as l,t as u}from"./CiFkP-9S.js";import{t as d}from"./BCmzDvBt.js";import{c as f,l as p}from"./Bhquh17w.js";import{a as m,i as h,n as g,o as _,t as v}from"./BgkATqP8.js";import{n as y}from"./C0bzfYFC.js";var b=e(t(),1),x=r();function S(){let{t:e}=i(),{activeDialog:t,closeDialog:r,setFooterMessage:S}=n(),C=d(e=>e.activeConnectionId)??``,w=y(e=>e.addUser),[T,E]=(0,b.useState)(``),[D,O]=(0,b.useState)(`%`),[k,A]=(0,b.useState)(``),[j,M]=(0,b.useState)(``),[N,P]=(0,b.useState)(`caching_sha2_password`),F=t===`user-add`;function I(e){e||(L(),r())}function L(){E(``),O(`%`),A(``),M(``),P(`caching_sha2_password`)}function R(){if(!T.trim()){S(e(`user.add.usernameRequired`));return}if(k!==j){S(e(`user.add.passwordMismatch`));return}w(C,{user:T.trim(),host:D.trim()||`%`,privileges:[],maxQuestions:0,maxUpdates:0,maxConnections:0,maxUserConnections:0,plugin:N,authenticationString:``,passwordExpired:!1,accountLocked:!1}),S(e(`user.add.added`,{user:T,host:D})),L(),r()}return(0,x.jsx)(v,{open:F,onOpenChange:I,children:(0,x.jsxs)(g,{className:`sm:max-w-[450px]`,children:[(0,x.jsx)(m,{children:(0,x.jsx)(_,{children:e(`user.add.title`)})}),(0,x.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(f,{htmlFor:`user-add-username`,children:e(`user.add.username`)}),(0,x.jsx)(p,{id:`user-add-username`,value:T,onChange:e=>E(e.target.value),placeholder:e(`user.add.usernamePlaceholder`)})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(f,{htmlFor:`user-add-host`,children:e(`user.add.host`)}),(0,x.jsx)(p,{id:`user-add-host`,value:D,onChange:e=>O(e.target.value),placeholder:`%`})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(f,{htmlFor:`user-add-password`,children:e(`user.add.password`)}),(0,x.jsx)(p,{id:`user-add-password`,type:`password`,value:k,onChange:e=>A(e.target.value),placeholder:e(`user.add.passwordPlaceholder`)})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(f,{htmlFor:`user-add-confirm-password`,children:e(`user.add.confirmPassword`)}),(0,x.jsx)(p,{id:`user-add-confirm-password`,type:`password`,value:j,onChange:e=>M(e.target.value),placeholder:e(`user.add.confirmPasswordPlaceholder`)})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(f,{children:e(`user.add.plugin`)}),(0,x.jsxs)(u,{value:N,onValueChange:P,children:[(0,x.jsx)(s,{className:`w-full`,children:(0,x.jsx)(o,{})}),(0,x.jsxs)(c,{children:[(0,x.jsx)(l,{value:`mysql_native_password`,children:`mysql_native_password`}),(0,x.jsx)(l,{value:`caching_sha2_password`,children:`caching_sha2_password`})]})]})]})]}),(0,x.jsxs)(h,{children:[(0,x.jsx)(a,{variant:`outline`,onClick:()=>I(!1),children:e(`user.add.cancel`)}),(0,x.jsx)(a,{onClick:R,children:e(`user.add.add`)})]})]})})}export{S as UserAddDialog};
|