diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml new file mode 100644 index 00000000..143722c5 --- /dev/null +++ b/.github/workflows/build-test.yaml @@ -0,0 +1,50 @@ +# 当前工作流的名字 随便取 +name: Build Docusaurus Test + +# 指定 workflow 触发的 event +# 在main分支提交的时候触发 +on: + push: + branches: + - main + +# 一个 workflow 由一个或多个 job 组成 +jobs: + # job id: 是 job 的唯一标识 + build_and_deploy: + # 在 Github 中显示的 job 名称 + name: Build and Deploy + # job 运行的环境配置 + runs-on: ubuntu-latest + # 一个 job 由多个 step 组成 + steps: + # 当前 step 的名字 + - name: Checkout + # checkout action 主要用于向 github 仓库拉取源代码 + # https://github.com/actions/checkout + uses: actions/checkout@v3 + with: + ref: main + # 安装node.js + - name: Use Node.js + uses: actions/setup-node@main + with: + node-version: 16 + cache: "yarn" + - name: Build + # 安装 Node 之后就可以执行构建脚本 + run: | + yarn + yarn run build + + # 把文件上传到OSS 方便下载 + - name: Set up oss utils + uses: yizhoumo/setup-ossutil@v1 + with: + endpoint: "oss-accelerate.aliyuncs.com" + access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }} + access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} + ossutil-version: "latest" + - name: Upload to oss + run: | + ossutil cp -rf --acl=public-read ./build/ oss://chat2db-website-test/ \ No newline at end of file diff --git a/docs/intro.md b/docs/guides/intro.md similarity index 100% rename from docs/intro.md rename to docs/guides/intro.md diff --git a/docs/guides/user-guide.md b/docs/guides/user-guide.md new file mode 100644 index 00000000..864f2a6f --- /dev/null +++ b/docs/guides/user-guide.md @@ -0,0 +1,176 @@ +--- +title: 'UserGuide' +sidebar_position: 3 +description: Chat2DB is a database client and BI reporting tool that integrates AI capabilities and supports management of various databases including MySQL, Oracle, etc. +--- + +# User Guide + +## 10-minute Quick Start Video + +Coming soon + +## Access the DEMO Database + +Open Chat2DB client, click the "Connections" button on the left, select "DEMO Database", right-click the "Connect" button or double-click to connect to the DEMO database. + + +⚠ Tips: Accessing the DEMO data requires an internet connection. If you cannot connect to the internet, ignore the error and delete the DEMO data. Then connect to your own database. + +As shown in the image below, Chat2DB has connected to the DEMO database and can be used directly. The block 2 and 3 represent database schemas, you can click there to switch databases. The block 4 and 5 show the database tables, you can click here to view table structures. The block 6 can add a new console where you can execute sql on your database. + + + +Click the dashboard button on the left to view the dashboard features + + + + +## Datasource Management +Click the "Connection" button on the left and select your database type when you add new connection. + + + + +### Configure Database Connection +Configure the database connection, click the "Test" button. If the connection is successful, click the "Save" button to save the connection. Then double click the connection to connect to your database. + + + +### Configure Database Driver + +Connecting to a database requires downloading the corresponding driver. If the driver is empty, there are two ways to configure the driver: + +1. If you can connect to the internet, click the "Download Driver" button to download the driver, then choose the driver. +2. If you cannot connect to the internet or the default driver does not match your database, you can download the driver manually. Click the "Upload Driver" button, select the driver file to upload. You can use your local driver after uploading. + + + + + +### Configure SSH Tunnel +If the database needs to be connected via an SSH tunnel, set "Use SSH" as true to configure SSH tunnel. Then click the "Test the SSH Tunnel" button, you can connect to your database via ssh after the test is successful. + + + +### ⚠ Error Prompts + +If the connection fails, there will be error prompts. You can troubleshoot based on the error prompts. 99%+ of issues are configuration errors or driver version mismatches with your database version. Most can be resolved by searching online. + +If you still cannot resolve the issue, copy the error details and submit an issue on GitHub. We will check all the issues regularly, so submitting an issue is the most effective way to resolve problems. + + + +## Database Management +Click the first button on the left to view the connected databases. The block 2 and 3 represent database schemas, you can click here to switch databases. The block 4 and 5 represent database tables, click table to view table structures. Click button in block 6 can create a new SQL console where you can perform operations on the database. + + + +Select the SQL in the console, then you can click the "Run" button to execute the SQL. The bottom of console will display the execution results, you can page through the results or export them. Also, you can click the Format button to format the selected SQL. +Meanwhile, you can click the "Save" button in the console to save the SQL. Then you can view saved records in the block "Saved" and directly open them next time. + + + +## AI Management + +### Option1 : ⚠ Use AI through OpenAI key + +⚠ Tips: Using the OpenAI key makes direct requests to the OpenAI API. Chat2DB does not limit the use of OpenAI, if you have any objections you can review the code directly. +If you encounter errors using OpenAI, 95% are due to OpenAI restrictions: + +Accessing OpenAI requires being able to bypass the firewall and enable global proxies. Many proxy tools do not support global proxies which lead AI to not work. Please troubleshoot your proxy by yourself. +Most people buy a shared key on Taobao or other platforms to access OpenAI which were restricted - if multiple people use the same key, OpenAI will limit its usage. +Please refer the OpenAI official document here: https://platform.openai.com/docs/guides/rate-limits/overview + + + +If you have resolved the above issues, you can follow the below steps to configure and use OpenAI. + +Click Settings in the lower left corner --> Custom AI --> OpenAI, enter the OpenAI key and click Save. The API Host usually does not need to be configured. If you have a private OpenAI proxy, you can modify the API Host. HTTP Proxy Host and HTTP Proxy Port are usually not needed, configure them if your network needs a proxy to access OpenAI. + + + + +### Option2: ✅ Use AI through Chat2DB AI (recommended) +Chat2DB AI does not require bypassing the firewall. Scan the QR code below to follow the Chat2DB Official Account, reply "AI" to get an AI key, then configure it in Chat2DB to use AI capabilities. + + + +Click Settings in the lower left corner --> Custom AI --> Chat2DB AI, enter the AI key and click Save. + + + + +### Other options: + +We also support AzureAI or custom AI. The configuration is similar, just modify the AI type and key. + +## Using AI + +### 1、AI generates SQL + +In Database Management -> select the database -> create a new SQL console. There is an input box above the console, enter the natural language that you want AI to generate, then press Enter button. AI will automatically generate the SQL you wanted in the console. Click the Execute button to execute it. The results will display on the bottom of the console, you can page through them or export them. + + + + +### 2、Explain SQL + +Right-click the selected SQL -> click Explain SQL. AI will explain the SQL in the popup window on the right of the console. + + + + +### 3、Optimize SQL + +Right-click the selected SQL -> click Optimize SQL. AI will generate suggestions in the popup window. + +### 4、Convert SQL + +Right-click the selected SQL -> click Convert SQL. AI will convert the current SQL syntax to another database syntax in the popup window. + +## BI Reports Dashboard + +Click the second button on the left to view created reports. Click the report and view the corresponding data. + + + +Click the "+" button to create a new dashboard -> enter the dashboard name -> click Save. Then select the newly created dashboard to start editing data. + + + +- 1、Select the data source for the current chart which you can choose from the connected databases. +- 2、Enter the data to query for this report chart, AI will start generating the SQL. +- 3、Click the "Run" button to return the data format. +- 4、Select the chart type, x axis and y axis. +- 5、Click "Confirm" button to save the current chart. +- 6、Click the "+" under the chart to continue adding chart to the current report dashboard. + + + +## Local Debugging + +- git clone to your local repository + +```bash +$ git clone git@github.com:chat2db/Chat2DB.git +``` + +- Frontend debugging + +```bash +Node version must be 16+ +Execute below command to install nodejs +$ cd Chat2DB/chat2db-client +$ yarn +$ yarn run start:web +``` + +- Backend debugging + +```bash +$ cd ../chat2db-server +$ mvn clean install # Requires maven 3.8+ +$ cd chat2db-server/chat2db-server-start/target/ +$ java -jar -Dloader.path=/lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 +``` diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..8a2e69d9 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 1 +--- + +# Tutorial Intro + +Let's discover **Docusaurus in less than 5 minutes**. + +## Getting Started + +Get started by **creating a new site**. + +Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. + +### What you'll need + +- [Node.js](https://nodejs.org/en/download/) version 16.14 or above: + - When installing Node.js, you are recommended to check all checkboxes related to dependencies. + +## Generate a new site + +Generate a new Docusaurus site using the **classic template**. + +The classic template will automatically be added to your project after you run the command: + +```bash +npm init docusaurus@latest my-website classic +``` + +You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. + +The command also installs all necessary dependencies you need to run Docusaurus. + +## Start your site + +Run the development server: + +```bash +cd my-website +npm run start +``` + +The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. + +The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. + +Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. diff --git a/docs/tutorial-basics/_category_.json b/docs/tutorial-basics/_category_.json deleted file mode 100644 index 2e6db55b..00000000 --- a/docs/tutorial-basics/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Tutorial - Basics", - "position": 2, - "link": { - "type": "generated-index", - "description": "5 minutes to learn the most important Docusaurus concepts." - } -} diff --git a/docs/tutorial-basics/congratulations.md b/docs/tutorial-basics/congratulations.md deleted file mode 100644 index 04771a00..00000000 --- a/docs/tutorial-basics/congratulations.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_position: 6 ---- - -# Congratulations! - -You have just learned the **basics of Docusaurus** and made some changes to the **initial template**. - -Docusaurus has **much more to offer**! - -Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**. - -Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610) - -## What's next? - -- Read the [official documentation](https://docusaurus.io/) -- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config) -- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration) -- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout) -- Add a [search bar](https://docusaurus.io/docs/search) -- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase) -- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support) diff --git a/docs/tutorial-basics/create-a-blog-post.md b/docs/tutorial-basics/create-a-blog-post.md deleted file mode 100644 index ea472bba..00000000 --- a/docs/tutorial-basics/create-a-blog-post.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -sidebar_position: 3 ---- - -# Create a Blog Post - -Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed... - -## Create your first Post - -Create a file at `blog/2021-02-28-greetings.md`: - -```md title="blog/2021-02-28-greetings.md" ---- -slug: greetings -title: Greetings! -authors: - - name: Joel Marcey - title: Co-creator of Docusaurus 1 - url: https://github.com/JoelMarcey - image_url: https://github.com/JoelMarcey.png - - name: Sébastien Lorber - title: Docusaurus maintainer - url: https://sebastienlorber.com - image_url: https://github.com/slorber.png -tags: [greetings] ---- - -Congratulations, you have made your first post! - -Feel free to play around and edit this post as much you like. -``` - -A new blog post is now available at [http://localhost:3000/blog/greetings](http://localhost:3000/blog/greetings). diff --git a/docs/tutorial-basics/create-a-document.md b/docs/tutorial-basics/create-a-document.md deleted file mode 100644 index ffddfa8e..00000000 --- a/docs/tutorial-basics/create-a-document.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -sidebar_position: 2 ---- - -# Create a Document - -Documents are **groups of pages** connected through: - -- a **sidebar** -- **previous/next navigation** -- **versioning** - -## Create your first Doc - -Create a Markdown file at `docs/hello.md`: - -```md title="docs/hello.md" -# Hello - -This is my **first Docusaurus document**! -``` - -A new document is now available at [http://localhost:3000/docs/hello](http://localhost:3000/docs/hello). - -## Configure the Sidebar - -Docusaurus automatically **creates a sidebar** from the `docs` folder. - -Add metadata to customize the sidebar label and position: - -```md title="docs/hello.md" {1-4} ---- -sidebar_label: 'Hi!' -sidebar_position: 3 ---- - -# Hello - -This is my **first Docusaurus document**! -``` - -It is also possible to create your sidebar explicitly in `sidebars.js`: - -```js title="sidebars.js" -module.exports = { - tutorialSidebar: [ - 'intro', - // highlight-next-line - 'hello', - { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], -}; -``` diff --git a/docs/tutorial-basics/create-a-page.md b/docs/tutorial-basics/create-a-page.md deleted file mode 100644 index 20e2ac30..00000000 --- a/docs/tutorial-basics/create-a-page.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Create a Page - -Add **Markdown or React** files to `src/pages` to create a **standalone page**: - -- `src/pages/index.js` → `localhost:3000/` -- `src/pages/foo.md` → `localhost:3000/foo` -- `src/pages/foo/bar.js` → `localhost:3000/foo/bar` - -## Create your first React Page - -Create a file at `src/pages/my-react-page.js`: - -```jsx title="src/pages/my-react-page.js" -import React from 'react'; -import Layout from '@theme/Layout'; - -export default function MyReactPage() { - return ( - -

My React page

-

This is a React page

-
- ); -} -``` - -A new page is now available at [http://localhost:3000/my-react-page](http://localhost:3000/my-react-page). - -## Create your first Markdown Page - -Create a file at `src/pages/my-markdown-page.md`: - -```mdx title="src/pages/my-markdown-page.md" -# My Markdown page - -This is a Markdown page -``` - -A new page is now available at [http://localhost:3000/my-markdown-page](http://localhost:3000/my-markdown-page). diff --git a/docs/tutorial-basics/deploy-your-site.md b/docs/tutorial-basics/deploy-your-site.md deleted file mode 100644 index 1c50ee06..00000000 --- a/docs/tutorial-basics/deploy-your-site.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -sidebar_position: 5 ---- - -# Deploy your site - -Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). - -It builds your site as simple **static HTML, JavaScript and CSS files**. - -## Build your site - -Build your site **for production**: - -```bash -npm run build -``` - -The static files are generated in the `build` folder. - -## Deploy your site - -Test your production build locally: - -```bash -npm run serve -``` - -The `build` folder is now served at [http://localhost:3000/](http://localhost:3000/). - -You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). diff --git a/docs/tutorial-basics/markdown-features.mdx b/docs/tutorial-basics/markdown-features.mdx deleted file mode 100644 index 0337f34d..00000000 --- a/docs/tutorial-basics/markdown-features.mdx +++ /dev/null @@ -1,150 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Markdown Features - -Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. - -## Front Matter - -Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/): - -```text title="my-doc.md" -// highlight-start ---- -id: my-doc-id -title: My document title -description: My document description -slug: /my-custom-url ---- -// highlight-end - -## Markdown heading - -Markdown text with [links](./hello.md) -``` - -## Links - -Regular Markdown links are supported, using url paths or relative file paths. - -```md -Let's see how to [Create a page](/create-a-page). -``` - -```md -Let's see how to [Create a page](./create-a-page.md). -``` - -**Result:** Let's see how to [Create a page](./create-a-page.md). - -## Images - -Regular Markdown images are supported. - -You can use absolute paths to reference images in the static directory (`static/img/docusaurus.png`): - -```md -![Docusaurus logo](/img/docusaurus.png) -``` - -![Docusaurus logo](/img/docusaurus.png) - -You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them: - -```md -![Docusaurus logo](./img/docusaurus.png) -``` - -## Code Blocks - -Markdown code blocks are supported with Syntax highlighting. - - ```jsx title="src/components/HelloDocusaurus.js" - function HelloDocusaurus() { - return ( -

Hello, Docusaurus!

- ) - } - ``` - -```jsx title="src/components/HelloDocusaurus.js" -function HelloDocusaurus() { - return

Hello, Docusaurus!

; -} -``` - -## Admonitions - -Docusaurus has a special syntax to create admonitions and callouts: - - :::tip My tip - - Use this awesome feature option - - ::: - - :::danger Take care - - This action is dangerous - - ::: - -:::tip My tip - -Use this awesome feature option - -::: - -:::danger Take care - -This action is dangerous - -::: - -## MDX and React Components - -[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: - -```jsx -export const Highlight = ({children, color}) => ( - { - alert(`You clicked the color ${color} with label ${children}`) - }}> - {children} - -); - -This is Docusaurus green ! - -This is Facebook blue ! -``` - -export const Highlight = ({children, color}) => ( - { - alert(`You clicked the color ${color} with label ${children}`); - }}> - {children} - -); - -This is Docusaurus green ! - -This is Facebook blue ! diff --git a/docs/tutorial-extras/_category_.json b/docs/tutorial-extras/_category_.json deleted file mode 100644 index a8ffcc19..00000000 --- a/docs/tutorial-extras/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "Tutorial - Extras", - "position": 3, - "link": { - "type": "generated-index" - } -} diff --git a/docs/tutorial-extras/img/docsVersionDropdown.png b/docs/tutorial-extras/img/docsVersionDropdown.png deleted file mode 100644 index 97e41646..00000000 Binary files a/docs/tutorial-extras/img/docsVersionDropdown.png and /dev/null differ diff --git a/docs/tutorial-extras/img/localeDropdown.png b/docs/tutorial-extras/img/localeDropdown.png deleted file mode 100644 index e257edc1..00000000 Binary files a/docs/tutorial-extras/img/localeDropdown.png and /dev/null differ diff --git a/docs/tutorial-extras/manage-docs-versions.md b/docs/tutorial-extras/manage-docs-versions.md deleted file mode 100644 index e12c3f34..00000000 --- a/docs/tutorial-extras/manage-docs-versions.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Manage Docs Versions - -Docusaurus can manage multiple versions of your docs. - -## Create a docs version - -Release a version 1.0 of your project: - -```bash -npm run docusaurus docs:version 1.0 -``` - -The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. - -Your docs now have 2 versions: - -- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs -- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** - -## Add a Version Dropdown - -To navigate seamlessly across versions, add a version dropdown. - -Modify the `docusaurus.config.js` file: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - navbar: { - items: [ - // highlight-start - { - type: 'docsVersionDropdown', - }, - // highlight-end - ], - }, - }, -}; -``` - -The docs version dropdown appears in your navbar: - -![Docs Version Dropdown](./img/docsVersionDropdown.png) - -## Update an existing version - -It is possible to edit versioned docs in their respective folder: - -- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` -- `docs/hello.md` updates `http://localhost:3000/docs/next/hello` diff --git a/docs/tutorial-extras/translate-your-site.md b/docs/tutorial-extras/translate-your-site.md deleted file mode 100644 index caeaffb0..00000000 --- a/docs/tutorial-extras/translate-your-site.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -sidebar_position: 2 ---- - -# Translate your site - -Let's translate `docs/intro.md` to French. - -## Configure i18n - -Modify `docusaurus.config.js` to add support for the `fr` locale: - -```js title="docusaurus.config.js" -module.exports = { - i18n: { - defaultLocale: 'en', - locales: ['en', 'fr'], - }, -}; -``` - -## Translate a doc - -Copy the `docs/intro.md` file to the `i18n/fr` folder: - -```bash -mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ - -cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md -``` - -Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. - -## Start your localized site - -Start your site on the French locale: - -```bash -npm run start -- --locale fr -``` - -Your localized site is accessible at [http://localhost:3000/fr/](http://localhost:3000/fr/) and the `Getting Started` page is translated. - -:::caution - -In development, you can only use one locale at a same time. - -::: - -## Add a Locale Dropdown - -To navigate seamlessly across languages, add a locale dropdown. - -Modify the `docusaurus.config.js` file: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - navbar: { - items: [ - // highlight-start - { - type: 'localeDropdown', - }, - // highlight-end - ], - }, - }, -}; -``` - -The locale dropdown now appears in your navbar: - -![Locale Dropdown](./img/localeDropdown.png) - -## Build your localized site - -Build your site for a specific locale: - -```bash -npm run build -- --locale fr -``` - -Or build your site to include all the locales at once: - -```bash -npm run build -``` diff --git a/docusaurus.config.js b/docusaurus.config.js index a8561d1a..119d9a36 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,137 +1,84 @@ -// @ts-check -// Note: type annotations allow type checking and IDEs autocompletion - -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); - /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'My Site', - tagline: 'Dinosaurs are cool', - favicon: 'img/favicon.ico', - - // Set the production url of your site here - url: 'https://your-docusaurus-test-site.com', - // Set the // pathname under which your site is served - // For GitHub pages deployment, it is often '//' - baseUrl: '/', - - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: 'facebook', // Usually your GitHub org/user name. - projectName: 'docusaurus', // Usually your repo name. - - onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', - - // Even if you don't use internalization, you can use this field to set useful - // metadata like html lang. For example, if your site is Chinese, you may want - // to replace "en" with "zh-Hans". i18n: { - defaultLocale: 'en', - locales: ['en'], + defaultLocale: "en", + locales: ["en", "zh"], + localeConfigs: { + en: { + label: "English", + }, + zh: { + label: "简体中文", + }, + }, }, + title: "Chat2DB", + tagline: + "Chat2DB is a database client and BI reporting tool that integrates AI capabilities and supports management of various databases including MySQL, Oracle, etc.", + url: "https://chat2db.ai", + baseUrl: "/", + favicon: "img/favicon.ico", + organizationName: "Chat2DB", + projectName: "Chat2DB", + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + trailingSlash: true, presets: [ [ - 'classic', - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ + "@docusaurus/preset-classic", + { + // 设置谷歌数据分析 + gtag: { + trackingID: "G-HLJ1ZEFTZM", + anonymizeIP: true, + }, docs: { - sidebarPath: require.resolve('./sidebars.js'), - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', + sidebarPath: require.resolve("./sidebars.js"), + // breadcrumbs: false, }, blog: { showReadingTime: true, - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', }, theme: { - customCss: require.resolve('./src/css/custom.css'), + customCss: require.resolve("./src/css/custom.css"), }, - }), + }, ], ], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ - // Replace with your project's social card - image: 'img/docusaurus-social-card.jpg', + image: "img/docusaurus-social-card.jpg", navbar: { - title: 'My Site', + title: "Chat2DB", logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', + alt: "My Site Logo", + src: "img/logo.svg", }, items: [ + { to: "docs", label: "Documentation", position: "right" }, + // { + // type: "doc", + // docId: "contact", + // label: "Contact", + // position: "right", + // }, { - type: 'docSidebar', - sidebarId: 'tutorialSidebar', - position: 'left', - label: 'Tutorial', - }, - {to: '/blog', label: 'Blog', position: 'left'}, - { - href: 'https://github.com/facebook/docusaurus', - label: 'GitHub', - position: 'right', - }, - ], - }, - footer: { - style: 'dark', - links: [ - { - title: 'Docs', - items: [ - { - label: 'Tutorial', - to: '/docs/intro', - }, - ], - }, - { - title: 'Community', - items: [ - { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/docusaurus', - }, - { - label: 'Discord', - href: 'https://discordapp.com/invite/docusaurus', - }, - { - label: 'Twitter', - href: 'https://twitter.com/docusaurus', - }, - ], + type: "localeDropdown", + position: "right", }, { - title: 'More', - items: [ - { - label: 'Blog', - to: '/blog', - }, - { - label: 'GitHub', - href: 'https://github.com/facebook/docusaurus', - }, - ], + href: "https://github.com/chat2db/chat2db", + className: "header-github-link", + "aria-label": "GitHub", + position: "right", }, ], - copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, }, prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, + theme: require("prism-react-renderer/themes/dracula"), }, }), }; diff --git a/i18n/zh/code.json b/i18n/zh/code.json new file mode 100644 index 00000000..7645079d --- /dev/null +++ b/i18n/zh/code.json @@ -0,0 +1,273 @@ +{ + "theme.ErrorPageContent.title": { + "message": "页面已崩溃。", + "description": "The title of the fallback page when the page crashed" + }, + "theme.NotFound.title": { + "message": "找不到页面", + "description": "The title of the 404 page" + }, + "theme.NotFound.p1": { + "message": "我们找不到您要找的页面。", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.admonition.note": { + "message": "备注", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "提示", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.danger": { + "message": "危险", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "信息", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.caution": { + "message": "警告", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.blog.archive.title": { + "message": "历史博文", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "历史博文", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "回到顶部", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "博文列表分页导航", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "较新的博文", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "较旧的博文", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "博文分页导航", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "较新一篇", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "较旧一篇", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.colorToggle.ariaLabel": { + "message": "切换浅色/暗黑模式(当前为{mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "暗黑模式", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "浅色模式", + "description": "The name for the light color mode" + }, + "theme.blog.post.plurals": { + "message": "{count} 篇博文", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} 含有标签「{tagName}」", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "查看所有标签", + "description": "The label of the link targeting the tag list page" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "页面路径", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count} 个项目", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "文件选项卡", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "上一页", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "下一页", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.versionBadge.label": { + "message": "版本:{versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "最新版本", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "编辑此页", + "description": "The link label to edit the current page" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "{count} 篇文档带有标签", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged}「{tagName}」", + "description": "The title of the page for a docs tag" + }, + "theme.common.headingLinkTitle": { + "message": "{heading}的直接链接", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": "于 {date} ", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": "由 {user} ", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "最后{byUser}{atDate}更新", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "选择版本", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.tags.tagsListLabel": { + "message": "标签:", + "description": "The label alongside a tag list" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "关闭", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "最近博文导航", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.CodeBlock.copied": { + "message": "复制成功", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "复制代码到剪贴板", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copy": { + "message": "复制", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "切换自动换行", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "打开/收起侧边栏菜单「{label}」", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.NavBar.navAriaLabel": { + "message": "主导航", + "description": "The ARIA label for the main navigation" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "本页总览", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "选择语言", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.blog.post.readMore": { + "message": "阅读更多", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "阅读 {title} 的全文", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "阅读需 {readingTime} 分钟", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.breadcrumbs.home": { + "message": "主页面", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "文档侧边栏", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "关闭导航栏", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← 回到主菜单", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "切换导航栏", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "重试", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.common.skipToMainContent": { + "message": "跳到主要内容", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "标签", + "description": "The title of the tag list page" + } +} diff --git a/i18n/zh/docusaurus-plugin-content-blog/options.json b/i18n/zh/docusaurus-plugin-content-blog/options.json new file mode 100644 index 00000000..9239ff70 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Recent posts", + "description": "The label for the left sidebar" + } +} diff --git a/i18n/zh/docusaurus-plugin-content-docs/current.json b/i18n/zh/docusaurus-plugin-content-docs/current.json new file mode 100644 index 00000000..2723dc3d --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,10 @@ +{ + "version.label": { + "message": "Next", + "description": "The label for version current" + }, + "sidebar.docs.category.Guide": { + "message": "Guide", + "description": "The label for category Guide in sidebar docs" + } +} diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/guides/intro.md b/i18n/zh/docusaurus-plugin-content-docs/current/guides/intro.md new file mode 100644 index 00000000..8a2e69d9 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/guides/intro.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 1 +--- + +# Tutorial Intro + +Let's discover **Docusaurus in less than 5 minutes**. + +## Getting Started + +Get started by **creating a new site**. + +Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. + +### What you'll need + +- [Node.js](https://nodejs.org/en/download/) version 16.14 or above: + - When installing Node.js, you are recommended to check all checkboxes related to dependencies. + +## Generate a new site + +Generate a new Docusaurus site using the **classic template**. + +The classic template will automatically be added to your project after you run the command: + +```bash +npm init docusaurus@latest my-website classic +``` + +You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. + +The command also installs all necessary dependencies you need to run Docusaurus. + +## Start your site + +Run the development server: + +```bash +cd my-website +npm run start +``` + +The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. + +The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. + +Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/guides/user-guide.md b/i18n/zh/docusaurus-plugin-content-docs/current/guides/user-guide.md new file mode 100644 index 00000000..ffed7ed9 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/guides/user-guide.md @@ -0,0 +1,190 @@ +--- +title: '使用教程' +sidebar_position: 3 +description: Chat2DB一个集成了AI能力的、支持Mysql、Oracle等多种数据库管理的数据库客户端和BI报表工具 +--- + +# 使用教程 + +## 10分钟入门视频 + + +## 访问示例数据 + +打开Chat2DB,点击左侧的“连接”按钮,选择“示例数据库”,右键点击“连接”按钮或双击,即可连接到示例数据库。 + +⚠ 提示:访问示例数据需要可以连接公网,如果无法连接公网,忽略报错,删除示例数据直接连接自己内部数据库即可。 + + + +如图所示,Chat2DB已经连接到示例数据库,可以直接使用。 +2、3代表数据库schema点击可以切换database。 + +4、5代表数据库表,点击可以查看表结构。 + +6、代表SQL控制台,新建可以打开新的控制台,在控制台可以对该数据库做操作。 + + + +点击左侧仪表盘按钮,可以查看示例报表功能 + + + +## 新建数据库连接 + +点击左侧“连接”按钮,点击右侧“新建链接”按钮,选择数据库类型,输入数据库连接信息,点击“连接”按钮即可连接数据库。 + + + + +### 配置数据库信息 + +配置数据库连接信息,点击“测试连接”按钮,如果连接成功,点击“连接”按钮即可连接数据库。 + + + +### 驱动配置 + +链接数据库需要下载对应的驱动,如果驱动为空有两种方式配置驱动 + +1、如果可以链接公网,点击“下载驱动”按钮,下载驱动,然后点击选择驱动。 + +2、如果无法连接公网或者默认驱动不能适配你的数据库,可以在本地下载驱动,点击“上传驱动”按钮,选择驱动文件上传,上传成功后即可使用。 + + + + +### 配置SSH隧道 + +如果数据库需要通过SSH隧道连接,可以选择使用SSH true 配置SSH隧道信息,点击“测试SSH隧道”按钮,如果连接成功,说明SSH可以链接。 + + + +### ⚠ 错误提示 + +如果连接失败,会有错误提示,可以根据错误提示进行排查,99%以上的问题都是都是配置错误,或者驱动版本不适配你的数据库版本,网上查询大部分都能解决。 + +如果仍然无法解决,查看详情后可以复制错误信息,在 GitHub 提交 issue,所有 issue 我们都会去看,提交 issue 是最有效的解决办法。 + + + +## 数据库管理 + +点击左侧第一个“数据库管理”按钮,可以查看已经连接的数据库。 + +2、3代表数据库schema点击可以切换database。 + +4、5代表数据库表,点击可以查看表结构。 + +6、代表SQL控制台,新建可以打开新的控制台,在控制台可以对该数据库做操作。 + + + + +1、选中SQL,点击执行按钮,可以执行SQL。控制台下方会显示执行结果,可以分页查看结果,也可以导出结果。 +2、选中SQL,点击格式化按钮,可以格式化SQL。 +3、点击控制台保存按钮,可以保存SQL到本地,在左侧我的保存可以查看保存记录,下次打开可以直接打开。 + +## AI 配置 + +### 方式一 : ⚠ 通过 Open AI key使用AI能力 + +⚠ 提示:使用 OpenAI Key 是客户端直接请求 OpenAI 的接口 ,Chat2DB 没有对使用 OpenAI 做任何限制,有异议直接看代码。 +如果使用 OpenAI 遇到的错误 95% 都是 Open AI 限制导致的,Open AI 限制如下: + +1、访问 OpenAI 需要能够科学上网,并且能够开启全局代理,很多科学上网不支持全局代理导致不可用。 + +2、大部分人都是通过某宝,或者其他平台买了一个 Key 用来访问 OpenAI,这些Key都是共享的,OpenAI 对 Key 有限制,如果某个 Key 被多人使用,Open AI会限制该Key的使用,导致使用不了。 + +Open AI官方限制文档:https://platform.openai.com/docs/guides/rate-limits/overview + + + +如果以上问题你都已经解决,可以参考下面配置就可以使用 OpenAI了。 + + + + +点击左下角设置--》自定义AI-->OpenAI,输入Open AI Key,点击保存即可。Api Host 一般不需要修改,如果你有私有部署的 OpenAI 代理,可以修改 Api Host。HTTP Proxy Host、HTTP Proxy Port 一般不需要填,如果你的网络需要代理才能访问 OpenAI,可以配置代理。 + + +### 方式二: ✅ 通过 Chat2DB AI 使用 AI 能力(推荐) + +Chat2DB AI 是 Chat2DB 自己实现的 AI,不需要科学上网。 通过扫描下方二维码,关注 Chat2DB 公众号,回复“AI”获取AI Key,然后在 Chat2DB 中配置 AI Key即可使用。 + + + +点击左下角设置--》自定义AI--> Chat2DB AI,输入AI Key,点击保存即可。 + + + +### 其他方式:也支持 AzureAI 或自定义 AI + +配置方式同上,只需要修改AI类型和AI Key即可。 + +## 使用 AI + +### 1、AI 生成SQL + +在数据库管理中,选中数据库,新建SQL控制台,在控制台上方有一个输入框,输入你需要让AI帮你查询的数据回车,AI 会自动的在控制台生成你想要的SQL,点击执行按钮就可执行 SQL 控制台下方会显示你查询的结果。 + + + +### 2、SQL 解释 + +选中 SQL 右键 解释SQL,在右侧弹窗中 AI 即可对 SQL 解释生成内容。 + + + +### 3、SQL优化 + +选中 SQL 右键 优化SQL,在右侧弹窗中 AI 即可对 SQL 生成建议。 + +### 4、SQL转化 + +选中 SQL 右键 转化SQL,在右侧弹窗中 AI 即可对 当前 SQL 转换未其他数据库的 SQL 语法。 + + +## BI 报表 + +点击左侧第二个“仪表盘”按钮,可以查看已经创建的报表,单击切换即可看到相应的报表数据 。 + + + +点击"+"按钮可以新建报表,输入报表名称,点击保存,选中刚新建的仪表盘开始添加数据。 + + +- 1、当前卡片选择数据源,可以选择已经连接的数据库。 +- 2、输入该报表要查询的数据,AI 开始生成 SQL。 +- 3、点击执行按钮返回数据格式。 +- 4、选择报表格式,x坐标 y坐标。 +- 5、点击保存卡片。 +- 6、点击卡片下方"+"号,在当前报表继续添加卡片,步骤同上。 + + +## 本地调试 + +- git clone 到本地 + +```bash +$ git clone git@github.com:chat2db/Chat2DB.git +``` + +- 前端调试 + +```bash +node版本必须为16及以上 +一定要用yarn +$ cd Chat2DB/chat2db-client +$ yarn +$ yarn run start:web +``` + +- 后端调试 + +```bash +$ cd ../chat2db-server +$ mvn clean install # 需要安装maven 3.8以上版本 +$ cd chat2db-server/chat2db-server-start/target/ +$ java -jar -Dloader.path=/lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/index.md b/i18n/zh/docusaurus-plugin-content-docs/current/index.md new file mode 100644 index 00000000..05edd81e --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/index.md @@ -0,0 +1,41 @@ +--- +title: 'Chat2DB简介' +sidebar_position: 1 +description: Chat2DB一个集成了AI能力的、支持Mysql、Oracle等多种数据库管理的数据库客户端工具 +--- + +## 📖 简介 +   Chat2DB 是一款有开源免费的多数据库客户端工具,支持windows、mac本地安装,也支持服务器端部署,web网页访问。和传统的数据库客户端软件Navicat、DBeaver 相比Chat2DB集成了AIGC的能力,能够将自然语言转换为SQL,也可以将SQL转换为自然语言,可以给出研发人员SQL的优化建议,极大的提升人员的效率,是AI时代数据库研发人员的利器,未来即使不懂SQL的运营业务也可以使用快速查询业务数据、生成报表能力。 +## ✨ 特性 +* 🍎 Chat2DB整体的设计简单易用,没有任何花里胡哨的东西,符合技术人喜欢简洁的特点。 +* 👩 为了不同类型用户群里的喜爱,同时支持客户端版、web版,同时也支持客户端版连接远程服务。 前端使用 Electron 开发,提供 Windows、Mac、Linux 客户端、网页版本一体化的解决方案 +* 🔧 突出了AI 智能生成SQL、SQL解析的的能力,但在传统数据库能力方便一点都不少。 +* 🔌 强大的扩展能力,目前已经支持Mysql、PostgreSQL、Oracle、SQLServer、ClickHouse、Oceanbase、H2、SQLite等等,未来会支持更多的数据库 +* ⚙️ 强大的数据管理能力,支持数据表、视图、存储过程、函数、触发器、索引、序列、用户、角色、授权等管理 +* 👭 支持团队协作,研发无需知道线上数据库密码,解决企业数据库账号安全问题 +* 🎁 支持环境隔离、线上、日常数据权限分离 + +## 📑 Github地址 + +* WIKI +* Issue tracker + +## 🔌 支持的数据库 +* Mysql +* PostgreSQL +* Oracle +* SQLServer +* ClickHouse +* Oceanbase +* H2 +* SQLite +* 更多数据库支持中... + +## ☎️ 联系我们 + + +微信:yxccw132 + + + + diff --git a/i18n/zh/docusaurus-theme-classic/navbar.json b/i18n/zh/docusaurus-theme-classic/navbar.json new file mode 100644 index 00000000..497a7970 --- /dev/null +++ b/i18n/zh/docusaurus-theme-classic/navbar.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Chat2DB", + "description": "The title in the navbar" + }, + "logo.alt": { + "message": "My Site Logo", + "description": "The alt text of navbar logo" + }, + "item.label.Documentation": { + "message": "Documentation", + "description": "Navbar item with label Documentation" + } +} diff --git a/sidebars.js b/sidebars.js index 9ab54c24..2bc64c6b 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1,33 +1,17 @@ -/** - * Creating a sidebar enables you to: - - create an ordered group of docs - - render a sidebar for each doc of that group - - provide next/previous navigation - - The sidebars can be generated from the filesystem, or explicitly defined here. - - Create as many sidebars as you want. - */ - // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], - - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', + docs: [ + "index", { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], + type: "category", + label: "Guide", + // 默认打开 + collapsed: false, + items: ["guides/user-guide"], }, ], - */ }; module.exports = sidebars; diff --git a/src/css/custom.css b/src/css/custom.css index 2bc6a4cf..365dc973 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -28,3 +28,23 @@ --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); } + + + +.header-github-link:hover { + opacity: 0.6; +} + +.header-github-link:before { + content: ''; + width: 24px; + height: 24px; + display: flex; + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} + +html[data-theme='dark'] .header-github-link:before { + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} \ No newline at end of file