Skip to content

Commit

Permalink
feat: vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
dolphin0618 committed Jun 28, 2024
1 parent 9aa1bda commit 10a9d8f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function SkillSheet({ select, children, onSelect }) {
};

const toCreateFlow = () => {
window.open("/build/skills");
window.open(__APP_ENV__.BASE_URL + "/build/skills");
};

const { t } = useTranslation()
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ToolsSheet({ select, onSelect, children }) {
<SearchInput placeholder={t('build.search')} className="mt-6" onChange={(e) => setKeyword(e.target.value)} />
<Button
className="mt-4 w-full"
onClick={() => window.open("/build/tools")}
onClick={() => window.open(__APP_ENV__.BASE_URL + "/build/tools")}
>
{t('create')}{t("tools.createCustomTool")}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/ModelPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function ConfigModal({ data, readonly, open, setOpen, onSave }) {
</div>
</div>
<div className="flex justify-start">
<Button variant='link' onClick={() => window.open('/model/doc')} className="link col-span-8 pl-0">{t('model.modelConfigExplanationLink')}</Button>
<Button variant='link' onClick={() => window.open(__APP_ENV__.BASE_URL + '/model/doc')} className="link col-span-8 pl-0">{t('model.modelConfigExplanationLink')}</Button>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
import svgr from "vite-plugin-svgr";

// Use environment variable to determine the target.
const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002";
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7861";
const apiRoutes = ["^/api/", "/health"];

const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
Expand Down Expand Up @@ -46,7 +46,7 @@ proxyTargets['/custom_base/api'] = {
* 开启后一般外层网管匹配【custom】时直接透传转到内层网关
* 内层网关访问 api或者前端静态资源需要去掉【custom】前缀
*/
// const app_env = { BASE_URL: '/custom' }
// const app_env = { BASE_URL: '/custom_base' }
const app_env = { BASE_URL: '' }

export default defineConfig(() => {
Expand Down

0 comments on commit 10a9d8f

Please sign in to comment.