From 91e675a129c101b1b3d8223eff9892689e5316f5 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sun, 6 Aug 2023 17:02:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E9=BB=98=E8=AE=A4=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/blocks/Setting/BaseSetting/index.tsx | 40 ++++++++++++------- chat2db-client/src/utils/localStorage.ts | 16 +++++++- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx index 3829f597b..4b0b04ba8 100644 --- a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx +++ b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx @@ -15,16 +15,16 @@ import styles from './index.less'; const { Option } = Select; const themeList = [ - { - code: ThemeType.Dark, - name: i18n('setting.text.dark'), - img: themeDarkImg, - }, { code: ThemeType.Light, name: i18n('setting.text.light'), img: themeLightImg, }, + { + code: ThemeType.Dark, + name: i18n('setting.text.dark'), + img: themeDarkImg, + }, { code: ThemeType.FollowOs, name: i18n('setting.text.followOS'), @@ -38,26 +38,26 @@ const themeList = [ ]; const colorList = [ - { - code: 'polar-blue', - name: i18n('setting.label.blue'), - color: '#1a90ff', - }, - { - code: 'polar-green', - name: i18n('setting.label.green'), - color: '#039e74', - }, { code: 'golden-purple', name: i18n('setting.label.violet'), color: '#9373ee', }, + { + code: 'polar-blue', + name: i18n('setting.label.blue'), + color: '#1a90ff', + }, { code: 'blue2', name: i18n('setting.label.violet'), color: '#00c3ee', }, + { + code: 'polar-green', + name: i18n('setting.label.green'), + color: '#039e74', + }, { code: 'gold', name: i18n('setting.label.violet'), @@ -152,6 +152,16 @@ export default function BaseSetting() { ); })} + {/* +
+
{}} + > + 自定义 +
+
+
*/} ); diff --git a/chat2db-client/src/utils/localStorage.ts b/chat2db-client/src/utils/localStorage.ts index 30aa2a211..27979e75c 100644 --- a/chat2db-client/src/utils/localStorage.ts +++ b/chat2db-client/src/utils/localStorage.ts @@ -10,7 +10,13 @@ export function setLang(lang: LangType) { } export function getTheme(): ThemeType { - return (localStorage.getItem('theme') as ThemeType) || ThemeType.Light; + const themeColor:any = localStorage.getItem('theme') as ThemeType + if(themeColor){ + return themeColor + } + localStorage.setItem('theme', ThemeType.Light) + // 默认主题色 + return ThemeType.Light } export function setTheme(theme: ThemeType) { @@ -18,7 +24,13 @@ export function setTheme(theme: ThemeType) { } export function getPrimaryColor(): PrimaryColorType { - return (localStorage.getItem('primary-color') as PrimaryColorType) || PrimaryColorType.Polar_Blue; + const primaryColor = localStorage.getItem('primary-color') as PrimaryColorType + if(primaryColor){ + return primaryColor + } + localStorage.setItem('primary-color', PrimaryColorType.Golden_Purple) + // 默认主题色 + return PrimaryColorType.Golden_Purple } export function setPrimaryColor(primaryColor: PrimaryColorType) { From 1b9c9be90ab75d0faf021fab7c7bd308c0dcfa06 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sun, 6 Aug 2023 17:15:45 +0800 Subject: [PATCH 2/3] CHANGELOG --- CHANGELOG.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba4b71b68..b0e26730a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,7 @@ ## 🐞 Bug Fixes -- Activate the console for the latest operation when you create or start a console - -- Records the last console used +- Activate the console for the latest operation when you create or start a console、Records the last console used - The replication function of the browser, such as edge, is unavailable @@ -15,9 +13,7 @@ ## 🐞 问题修复 -- 新建、开打console时激活最新操作的console - -- 记录最后一次使用的console +- 新建、开打console时激活最新操作的console、记录最后一次使用的console - edge等浏览器复制功能无法正常使用 From 5dbee472adf2049f81d37e61736a89614c9032c1 Mon Sep 17 00:00:00 2001 From: jipengfei-jpf <1558143046@qq.com> Date: Sun, 6 Aug 2023 17:25:44 +0800 Subject: [PATCH 3/3] If the database name contains the name of the current database, the current database is placed in the first place --- CHANGELOG.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0e26730a..dae6fa99f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,23 +3,18 @@ ## 🐞 Bug Fixes -- Activate the console for the latest operation when you create or start a console、Records the last console used - -- The replication function of the browser, such as edge, is unavailable - -- table Indicates an error when ddl is exported after the search - +- Activate the console for the latest operation when you create or start a console、Records the last console used +- The replication function of the browser, such as edge, is unavailable +- table Indicates an error when ddl is exported after the search - Adds table comments and column field types and comments ## 🐞 问题修复 - 新建、开打console时激活最新操作的console、记录最后一次使用的console - - edge等浏览器复制功能无法正常使用 - - table搜索后导出ddl报错 - - 增加表注释以及列字段类型和注释 +- 当数据源添加了database默认选择第一个database # 2.0.9