Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developing #452

Merged
merged 56 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
59b31f5
support view trigger producer function
Chat2DB-Pro Aug 12, 2023
372b21e
fix:本地存储的主题色与背景色与代码不兼容时导致页面崩溃
shanhexi Aug 12, 2023
01e4be0
style
shanhexi Aug 12, 2023
a2a582a
claude ai support
robinji0 Aug 12, 2023
9448f18
support view trigger producer function
Chat2DB-Pro Aug 12, 2023
936482a
Merge remote-tracking branch 'origin/developing' into developing
Chat2DB-Pro Aug 12, 2023
a3d2a6a
add operation type
robinji0 Aug 12, 2023
c0cc2fb
add operation type
robinji0 Aug 12, 2023
8c9f048
feat:函数触发器过程
shanhexi Aug 12, 2023
8d3fa24
support view trigger producer function
Chat2DB-Pro Aug 12, 2023
2c3600f
Merge remote-tracking branch 'origin/developing' into developing
Chat2DB-Pro Aug 12, 2023
2c8cfbe
更换图标
shanhexi Aug 12, 2023
1d3753b
触发器函数等添加loading
shanhexi Aug 12, 2023
cffcc65
fix:打开触发器时bug
shanhexi Aug 12, 2023
4563f0a
support view trigger producer function
Chat2DB-Pro Aug 12, 2023
227d106
Merge remote-tracking branch 'origin/developing' into developing
Chat2DB-Pro Aug 12, 2023
80861cf
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
7ae201e
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
cdebf4b
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
b723b0c
fix: Remove the quotation marks from the table name
JerryFan626 Aug 13, 2023
603dcfc
Merge branch 'developing' of github.com:chat2db/Chat2DB into developing
JerryFan626 Aug 13, 2023
4f73c30
feat: 添加新的主题色
shanhexi Aug 13, 2023
18fb08a
feat:新的主题色
shanhexi Aug 13, 2023
86dc991
merge
shanhexi Aug 13, 2023
0f50ce7
style:修复主题颜色问题
shanhexi Aug 13, 2023
6d9885d
fix: Optimize table styles
JerryFan626 Aug 13, 2023
663841c
Merge branch 'developing' of github.com:chat2db/Chat2DB into developing
JerryFan626 Aug 13, 2023
a0a070c
sql格式化
shanhexi Aug 13, 2023
74e3888
fix: fix dashboard bug
JerryFan626 Aug 13, 2023
60d088c
style: sql执行结果表格颜色
shanhexi Aug 13, 2023
f0c226a
merge
shanhexi Aug 13, 2023
d1639ea
fix:刷新视图bug
shanhexi Aug 13, 2023
cd5e07e
Remove redundant interceptors
chat2db-jerry Aug 13, 2023
79ffd2c
mask log
robinji0 Aug 13, 2023
b94ce9f
mask log
robinji0 Aug 13, 2023
ef40737
mask log
robinji0 Aug 13, 2023
26af227
style:console tab
shanhexi Aug 13, 2023
d745b3c
- Fix the issue of 'CLOB' not displaying specific content [Issue #44…
chat2db-jerry Aug 13, 2023
52566ac
style
shanhexi Aug 13, 2023
6e894b3
merge
shanhexi Aug 13, 2023
b0e041f
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
be91243
Merge remote-tracking branch 'origin/developing' into developing
Chat2DB-Pro Aug 13, 2023
076a7d2
去除tab 滚动条
shanhexi Aug 13, 2023
63541f2
去除tab 滚动条
shanhexi Aug 13, 2023
1fe817b
style: tab颜色
shanhexi Aug 13, 2023
de91d73
Modifying clob returns
chat2db-jerry Aug 13, 2023
e39c465
更新图标
shanhexi Aug 13, 2023
e1638fd
Merge remote-tracking branch 'origin/developing' into developing
chat2db-jerry Aug 13, 2023
5f4776c
fix:bug
shanhexi Aug 13, 2023
254733a
fix:bug
shanhexi Aug 13, 2023
b4006c8
merge
shanhexi Aug 13, 2023
e2d76e7
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
0796381
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
207c820
support view trigger producer function
Chat2DB-Pro Aug 13, 2023
bb90ceb
删除Redis
shanhexi Aug 13, 2023
c9d282f
merge
shanhexi Aug 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
{
"cSpell.words": [
"AZUREAI",
"DBAI",
"DBHUB",
"Dmaven",
"Dserver",
"Dspring",
"Mddhhmmss",
"OPENAI",
"RESTAI",
"Sercurity",
"aarch",
"ahooks",
"alicdn",
"aliyuncs",
"altool",
"antd",
"asar",
"AZUREAI",
"bgcolor",
"blockmap",
"cascader",
"chmod",
"CLOB",
"datasource",
"DBAI",
"DBHUB",
"dingtalk",
"Dmaven",
"Dserver",
"Dspring",
"echart",
"echarts",
"favicons",
"ghostoy",
"iconfont",
"jdbc",
"macos",
"Mddhhmmss",
"mkdir",
"monaco",
"msgtype",
"nsis",
"OPENAI",
"ossutil",
"pgsql",
"pnpm",
"remaininguses",
"RESTAI",
"samuelmeuli",
"Sercurity",
"sortablejs",
"temurin",
"Tigger",
"togglefullscreen",
"umijs",
"umirc",
"uuidv",
"VIEWCOLUMN",
"VIEWCOLUMNS",
"wechat",
"wireframe",
"xcrun",
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# 2.0.12

## ⭐ New Features

- 🔥Supports viewing views, functions, triggers, and procedures
- Support selected sql formatting
- Added new dark themes

## 🐞 Bug Fixes

- Fixed sql formatting failure issue
- Fixed an issue where locally stored theme colors and background colors are incompatible with the new version, causing page crashes
- Logs desensitize sensitive data
- Fix the issue of 'CLOB' not displaying specific content [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
- Fix the problem that non-Select does not display query results
- Fix the problem that Oracle cannot query without schema
- Fix the problem of special type of SQL execution error reporting
- Fix the problem that the test link is successful, but the error is reported when saving the link




## ⭐ 新特性

- 🔥支持查看视图、函数、触发器、存储过程
- 支持选中sql格式化
- 增加新的暗色主题

## 🐞 问题修复

- 修复sql格式化会失败问题
- 修复本地存储的主题色、背景色与新版本不兼容时会导致页面崩溃问题
- 日志对敏感数据进行脱敏
- 修复 `CLOB` 不展示具体内容的问题 [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
- 修复非Select不展示查询结果的问题
- 修复Oracle不带schema无法查询的问题
- 修复特殊类型的SQL执行报错的问题
- 修复测试链接成功,但保存链接报错的问题

# 2.0.11

## 🐞 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ https://github.com/chat2db/Chat2DB/assets/22975773/b58db908-5768-4a71-aa30-135d2
- 🌈 AI 智能助手,支持自然语言转 SQL、SQL 转自然语言、SQL 优化建议
- 🔥 智能报表,利用AIGC能力,一句话生成报表。
- 👭 支持个人模式、支持团队协作模式,让研发协同效率更高。
- 🔌 除支持目前主流数据库外,还支持国产数据库如:达梦、Oceanbase、北大金仓
- 🔌 除支持目前主流数据库外,还支持国产数据库如:达梦、Oceanbase、人大金仓
- ⚙️ 强大的数据管理能力,支持数据表、视图、存储过程、函数、触发器、索引、序列、用户、角色、授权等管理
- 🛡 前端使用 Electron 开发,提供 Windows、Mac、Linux 客户端、网页版本一体化的解决方案
- 🎁 支持环境隔离、线上、日常数据权限分离
Expand Down
43 changes: 28 additions & 15 deletions chat2db-client/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,53 @@
},
"git.mergeEditor": false,
"cSpell.words": [
"AZUREAI",
"Appstore",
"CLICKHOUSE",
"Cascader",
"DBAI",
"Dmaven",
"Iconfont",
"JDBC",
"KEYPAIR",
"Mddhhmmss",
"OPENAI",
"RESTAI",
"SQLSERVER",
"Sercurity",
"USERANDPASSWORD",
"ahooks",
"antd",
"Appstore",
"AZUREAI",
"bgcolor",
"Cascader",
"chatgpt",
"CLICKHOUSE",
"Consolas",
"datas",
"datasource",
"DBAI",
"dbhub",
"Dmaven",
"echarts",
"favicons",
"findstr",
"gtag",
"Iconfont",
"indexs",
"JDBC",
"KEYPAIR",
"KINGBASE",
"lsof",
"MARIADB",
"Mddhhmmss",
"Menlo",
"netstat",
"OCEANBASE",
"OPENAI",
"pgsql",
"pnpm",
"POSTGRESQL",
"remaininguses",
"RESTAI",
"scrollbar",
"Sercurity",
"sortablejs",
"SQLSERVER",
"Tigger",
"ueabe",
"ueabf",
"ueac",
"umijs",
"USERANDPASSWORD",
"uuidv",
"VIEWCOLUMN",
"wireframe"
],
"typescript.tsdk": "/Users/wangjiaqi/Desktop/Chat2DB/chat2db-client/node_modules/typescript/lib"
Expand Down
30 changes: 27 additions & 3 deletions chat2db-client/src/assets/font/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3633546 */
src: url('iconfont.woff2?t=1691316217339') format('woff2'),
url('iconfont.woff?t=1691316217339') format('woff'),
url('iconfont.ttf?t=1691316217339') format('truetype');
src: url('iconfont.woff2?t=1691924685106') format('woff2'),
url('iconfont.woff?t=1691924685106') format('woff'),
url('iconfont.ttf?t=1691924685106') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,30 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-banben:before {
content: "\e70c";
}

.icon-cheweiguanli:before {
content: "\e73c";
}

.icon-dianzhelidaochu:before {
content: "\e64a";
}

.icon-circle-f:before {
content: "\e76a";
}

.icon-tubiao-hanshu:before {
content: "\e6fd";
}

.icon-shituguanliqi:before {
content: "\e647";
}

.icon-huiche:before {
content: "\e643";
}
Expand Down
Binary file modified chat2db-client/src/assets/font/iconfont.ttf
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff2
Binary file not shown.
16 changes: 11 additions & 5 deletions chat2db-client/src/blocks/Setting/BaseSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const themeList = [
name: i18n('setting.text.dark'),
img: themeDarkImg,
},
{
code: ThemeType.DarkDimmed,
name: i18n('setting.text.dark2'),
img: themeDarkImg
},
{
code: ThemeType.FollowOs,
name: i18n('setting.text.followOS'),
Expand Down Expand Up @@ -83,9 +88,9 @@ const colorList = [
// baseBody 基础设置
export default function BaseSetting() {
const [lang, setLang] = useState(currentLang);
const [currentTheme, setCurrentTheme] = useState<ThemeType>(localStorage.getItem('theme'));
const [currentPrimaryColor, setCurrentPrimaryColor] = useState(localStorage.getItem('primary-color'));
const [appTheme, setAppTheme] = useTheme();
const [currentTheme, setCurrentTheme] = useState<ThemeType>(appTheme.backgroundColor);
const [currentPrimaryColor, setCurrentPrimaryColor] = useState(localStorage.getItem('primary-color'));

const changePrimaryColor = (item: any) => {
const html = document.documentElement;
Expand All @@ -103,12 +108,13 @@ export default function BaseSetting() {
location.reload();
}

function handleChangeTheme(theme: ThemeType) {
// TODO: 这里写 ThemeType 为什么报错呢
function handleChangeTheme(backgroundColor: any) {
setAppTheme({
...appTheme,
backgroundColor: theme,
backgroundColor,
});
setCurrentTheme(theme);
setCurrentTheme(backgroundColor);
}

return (
Expand Down
33 changes: 26 additions & 7 deletions chat2db-client/src/components/Console/MonacoEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ function MonacoEditor(props: IProps, ref: ForwardedRef<IExportRefFunction>) {
...options,
value: defaultValue || '',
language: language,
theme: appTheme.backgroundColor === ThemeType.Light ? EditorThemeType.Default : EditorThemeType.BlackTheme,
theme: appTheme.backgroundColor,
});
editorRef.current = editorIns;
didMount && didMount(editorIns);

monaco.editor.defineTheme(EditorThemeType.Default, {
monaco.editor.defineTheme(ThemeType.Light, {
base: 'vs',
inherit: true,
rules: [{ background: '#15161a' }] as any,
Expand All @@ -82,7 +82,7 @@ function MonacoEditor(props: IProps, ref: ForwardedRef<IExportRefFunction>) {
},
});

monaco.editor.defineTheme(EditorThemeType.BlackTheme, {
monaco.editor.defineTheme(ThemeType.Dark, {
base: 'vs-dark',
inherit: true,
rules: [{ background: '#15161a' }] as any,
Expand All @@ -92,6 +92,16 @@ function MonacoEditor(props: IProps, ref: ForwardedRef<IExportRefFunction>) {
'editor.background': '#0A0B0C', //背景色
},
});
monaco.editor.defineTheme(ThemeType.DarkDimmed, {
base: 'vs-dark',
inherit: true,
rules: [{ background: '#15161a' }] as any,
colors: {
// 相关颜色属性配置
'editor.foreground': '#ffffff',
'editor.background': '#1c2128', //背景色
},
});

monaco.editor.defineTheme(EditorThemeType.DashboardLightTheme, {
base: 'vs',
Expand Down Expand Up @@ -136,12 +146,11 @@ function MonacoEditor(props: IProps, ref: ForwardedRef<IExportRefFunction>) {

// 监听主题色变化切换编辑器主题色
useEffect(() => {
const isDark = appTheme.backgroundColor === ThemeType.Dark;
if (options?.theme) {
monaco.editor.setTheme(options.theme);
} else {
monaco.editor.setTheme(isDark ? 'BlackTheme' : 'Default');
return
}
monaco.editor.setTheme(appTheme.backgroundColor);
}, [appTheme.backgroundColor, options?.theme]);

// useEffect(() => {
Expand Down Expand Up @@ -206,7 +215,7 @@ function MonacoEditor(props: IProps, ref: ForwardedRef<IExportRefFunction>) {
return Object.keys(hintData).map((key) => ({
label: key,
kind: monaco.languages.CompletionItemKind.Method,
insertText: `\`${key}\``,
insertText: `${key}`,
detail: '<Database>',
}));
};
Expand Down Expand Up @@ -306,12 +315,22 @@ export const appendMonacoValue = (editor: any, text: any, range: IRangeType = 'e
return;
}
switch (range) {
// 覆盖所有内容
case 'cover':
newRange = model.getFullModelRange();
break;
// 在开头添加内容
case 'front':
newRange = new monaco.Range(1, 1, 1, 1);
break;
// 格式化选中区域的sql
case 'select':
const selection = editor.getSelection();
if (selection) {
newRange = new monaco.Range(selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn);
}
break;
// 在末尾添加内容
case 'end':
const lastLine = editor.getModel().getLineCount();
const lastLineLength = editor.getModel().getLineMaxColumn(lastLine);
Expand Down
Loading