Skip to content

Commit

Permalink
fix:打包白屏
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Jul 1, 2023
1 parent 945501b commit eac8ed3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
run: |
cd chat2db-client
yarn install
yarn run build:web:prod --appVersion=1.0.${{ github.run_id }} --appPort=10822
yarn run build:web:desktop --appVersion=1.0.${{ github.run_id }} --appPort=10822
cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
# 编译服务端java版本
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/.umirc.prod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { formatDate } from './src/utils/date';
import { defineConfig } from 'umi';
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const UMI_PublicPath = process.env.UMI_PublicPath || './static/front/';
const UMI_PublicPath = process.env.UMI_PublicPath || './';

const chainWebpack = (config: any, { webpack }: any) => {
config.plugin('monaco-editor').use(MonacoWebpackPlugin, [
Expand Down
15 changes: 15 additions & 0 deletions chat2db-client/src/blocks/Setting/AiSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,26 @@ export default function SettingAI(props: IProps) {
}}
value={chatGPTConfig?.aiSqlSource}
>
<Radio value={AiSqlSourceType.CHAT2DB}>Chat2DB AI</Radio>
<Radio value={AiSqlSourceType.OPENAI}>Open AI</Radio>
<Radio value={AiSqlSourceType.AZUREAI}>Azure AI</Radio>
<Radio value={AiSqlSourceType.RESTAI}>{i18n('setting.tab.custom')}</Radio>
</Radio.Group>
</div>
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.OPENAI && (
<div>
<div className={styles.title}>Api Key</div>
<div className={classnames(styles.content, styles.chatGPTKey)}>
<Input
placeholder={i18n('setting.placeholder.chat2dbApiKey')}
value={chatGPTConfig.apiKey}
onChange={(e) => {
setChatGPTConfig({ ...chatGPTConfig, apiKey: e.target.value });
}}
/>
</div>
</div>
)}
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.OPENAI && (
<div>
<div className={styles.title}>Api Key</div>
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/src/i18n/en-us/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
'setting.label.customAiUrl': 'User-defined interface Url',
'setting.placeholder.httpsProxy': 'Not required. Set HTTP proxy {1} when requesting OPENAI interface.',
'setting.placeholder.apiKey': 'OpenAI official website to view the APIKEY',
'setting.placeholder.chat2dbApiKey': '使用Chat2DB提供的APIKEY',
'setting.placeholder.customUrl': 'URL of the REST interface of the AI',
'setting.placeholder.apiHost': 'This parameter is mandatory. The default value is https://api.openai.com/',
'setting.message.urlTestError': 'The interface test failed. Procedure',
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/src/i18n/zh-cn/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
'setting.label.customAiUrl': '自定义接口Url',
'setting.placeholder.httpsProxy': '非必填,用于设置请求OPENAI接口时的HTTP代理{1}',
'setting.placeholder.apiKey': '使用OpenAi接口时必填,可前往OpenAI官网查看APIKEY',
'setting.placeholder.chat2dbApiKey': '使用Chat2DB提供的APIKEY',
'setting.placeholder.customUrl': '选择自定义AI时必填,用于设置自定义AI的REST接口URL',
'setting.placeholder.apiHost': '非必填,默认值为 https://api.openai.com/',
'setting.message.urlTestError': '接口测试不通过',
Expand Down

0 comments on commit eac8ed3

Please sign in to comment.