diff --git a/.gitignore b/.gitignore index d7c20d7..bc165d6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ dist/ .DS_Store .gemini-clipboard GoNavi-Wails -GoNavi-Wails.exe \ No newline at end of file +GoNavi-Wails.exe +.ace-tool/ diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 88764a2..40c2497 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -27,6 +27,7 @@ "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@types/react-resizable": "^3.0.8", + "@types/uuid": "^9.0.7", "@vitejs/plugin-react": "^4.2.1", "typescript": "^5.2.2", "vite": "^5.0.8" @@ -1565,6 +1566,13 @@ "optional": true, "peer": true }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "dev": true, + "license": "MIT" + }, "node_modules/@vitejs/plugin-react": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 108a97b..0f8f4fe 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -c1af19c07654ec9f98628c358ae49b1a \ No newline at end of file +5b8157374dae5f9340e31b2d0bd2c00e \ No newline at end of file diff --git a/frontend/src/components/ConnectionModal.tsx b/frontend/src/components/ConnectionModal.tsx index 534e58c..8fa0bb9 100644 --- a/frontend/src/components/ConnectionModal.tsx +++ b/frontend/src/components/ConnectionModal.tsx @@ -1,8 +1,8 @@ import React, { useState, useEffect } from 'react'; -import { Modal, Form, Input, InputNumber, Button, message, Checkbox, Divider, Select, Alert, Card, Row, Col, Typography } from 'antd'; +import { Modal, Form, Input, InputNumber, Button, message, Checkbox, Divider, Select, Alert, Card, Row, Col, Typography, Collapse } from 'antd'; import { DatabaseOutlined, ConsoleSqlOutlined, FileTextOutlined, CloudServerOutlined, AppstoreAddOutlined } from '@ant-design/icons'; import { useStore } from '../store'; -import { MySQLConnect, MySQLGetDatabases } from '../../wailsjs/go/app/App'; +import { DBConnect, DBGetDatabases, TestConnection } from '../../wailsjs/go/app/App'; import { SavedConnection } from '../types'; const { Meta } = Card; @@ -42,7 +42,8 @@ const ConnectionModal: React.FC<{ open: boolean; onClose: () => void; initialVal sshPassword: initialValues.config.ssh?.password, sshKeyPath: initialValues.config.ssh?.keyPath, driver: (initialValues.config as any).driver, - dsn: (initialValues.config as any).dsn + dsn: (initialValues.config as any).dsn, + timeout: (initialValues.config as any).timeout || 30 }); setUseSSH(initialValues.config.useSSH || false); setDbType(initialValues.config.type); @@ -63,7 +64,7 @@ const ConnectionModal: React.FC<{ open: boolean; onClose: () => void; initialVal const config = await buildConfig(values); - const res = await MySQLConnect(config as any); + const res = await DBConnect(config as any); setLoading(false); if (res.success) { @@ -101,11 +102,11 @@ const ConnectionModal: React.FC<{ open: boolean; onClose: () => void; initialVal setLoading(true); setTestResult(null); const config = await buildConfig(values); - const res = await (window as any).go.app.App.TestConnection(config); + const res = await TestConnection(config as any); setLoading(false); if (res.success) { setTestResult({ type: 'success', message: res.message }); - const dbRes = await MySQLGetDatabases(config as any); + const dbRes = await DBGetDatabases(config as any); if (dbRes.success) { const dbs = (dbRes.data as any[]).map((row: any) => row.Database || row.database); setDbList(dbs); @@ -137,7 +138,8 @@ const ConnectionModal: React.FC<{ open: boolean; onClose: () => void; initialVal useSSH: !!values.useSSH, ssh: sshConfig, driver: values.driver, - dsn: values.dsn + dsn: values.dsn, + timeout: Number(values.timeout || 30) }; }; @@ -196,7 +198,7 @@ const ConnectionModal: React.FC<{ open: boolean; onClose: () => void; initialVal