diff --git a/CHANGELOG.md b/CHANGELOG.md index ba4b71b6..dae6fa99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,27 +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 - +- 新建、开打console时激活最新操作的console、记录最后一次使用的console - edge等浏览器复制功能无法正常使用 - - table搜索后导出ddl报错 - - 增加表注释以及列字段类型和注释 +- 当数据源添加了database默认选择第一个database # 2.0.9 diff --git a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx index 3829f597..4b0b04ba 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 30aa2a21..27979e75 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) {