Skip to content

Commit eac8ed3

Browse files
committed
fix:打包白屏
1 parent 945501b commit eac8ed3

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/release_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
run: |
107107
cd chat2db-client
108108
yarn install
109-
yarn run build:web:prod --appVersion=1.0.${{ github.run_id }} --appPort=10822
109+
yarn run build:web:desktop --appVersion=1.0.${{ github.run_id }} --appPort=10822
110110
cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
111111
112112
# 编译服务端java版本

chat2db-client/.umirc.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { formatDate } from './src/utils/date';
22
import { defineConfig } from 'umi';
33
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
4-
const UMI_PublicPath = process.env.UMI_PublicPath || './static/front/';
4+
const UMI_PublicPath = process.env.UMI_PublicPath || './';
55

66
const chainWebpack = (config: any, { webpack }: any) => {
77
config.plugin('monaco-editor').use(MonacoWebpackPlugin, [

chat2db-client/src/blocks/Setting/AiSetting/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,26 @@ export default function SettingAI(props: IProps) {
5151
}}
5252
value={chatGPTConfig?.aiSqlSource}
5353
>
54+
<Radio value={AiSqlSourceType.CHAT2DB}>Chat2DB AI</Radio>
5455
<Radio value={AiSqlSourceType.OPENAI}>Open AI</Radio>
5556
<Radio value={AiSqlSourceType.AZUREAI}>Azure AI</Radio>
5657
<Radio value={AiSqlSourceType.RESTAI}>{i18n('setting.tab.custom')}</Radio>
5758
</Radio.Group>
5859
</div>
60+
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.OPENAI && (
61+
<div>
62+
<div className={styles.title}>Api Key</div>
63+
<div className={classnames(styles.content, styles.chatGPTKey)}>
64+
<Input
65+
placeholder={i18n('setting.placeholder.chat2dbApiKey')}
66+
value={chatGPTConfig.apiKey}
67+
onChange={(e) => {
68+
setChatGPTConfig({ ...chatGPTConfig, apiKey: e.target.value });
69+
}}
70+
/>
71+
</div>
72+
</div>
73+
)}
5974
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.OPENAI && (
6075
<div>
6176
<div className={styles.title}>Api Key</div>

chat2db-client/src/i18n/en-us/setting.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default {
2424
'setting.label.customAiUrl': 'User-defined interface Url',
2525
'setting.placeholder.httpsProxy': 'Not required. Set HTTP proxy {1} when requesting OPENAI interface.',
2626
'setting.placeholder.apiKey': 'OpenAI official website to view the APIKEY',
27+
'setting.placeholder.chat2dbApiKey': '使用Chat2DB提供的APIKEY',
2728
'setting.placeholder.customUrl': 'URL of the REST interface of the AI',
2829
'setting.placeholder.apiHost': 'This parameter is mandatory. The default value is https://api.openai.com/',
2930
'setting.message.urlTestError': 'The interface test failed. Procedure',

chat2db-client/src/i18n/zh-cn/setting.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default {
2424
'setting.label.customAiUrl': '自定义接口Url',
2525
'setting.placeholder.httpsProxy': '非必填,用于设置请求OPENAI接口时的HTTP代理{1}',
2626
'setting.placeholder.apiKey': '使用OpenAi接口时必填,可前往OpenAI官网查看APIKEY',
27+
'setting.placeholder.chat2dbApiKey': '使用Chat2DB提供的APIKEY',
2728
'setting.placeholder.customUrl': '选择自定义AI时必填,用于设置自定义AI的REST接口URL',
2829
'setting.placeholder.apiHost': '非必填,默认值为 https://api.openai.com/',
2930
'setting.message.urlTestError': '接口测试不通过',

0 commit comments

Comments
 (0)