Compare commits

...
12 Commits
Author SHA1 Message Date
bot_dev1 01f4e4b55b chore: #188 修复版产物重打包(推理路径规范化) 2026-08-06 17:27:10 +08:00
bot_dev1 b80fe6ab0f fix(#188): 推理 API 路径规范化,消除双 /v1 前缀对 nginx rewrite 的隐式依赖 (#192)
bot_qa 复审通过(bot_dev3 代发)。PR #192 引用未同步(head 滞留 5667fad),
按 feature/issue-188 分支最新 9994fb7 手工合并。
包含:nginx 无 URI 透传 + location = /health、infer.ts 路径口径统一、
latencyMs 实测、cockpit 健康检查走封装。

⚠️ 部署:UI 产物与 nginx 配置必须同批上线(新旧路径口径互不兼容)。
2026-08-06 17:26:05 +08:00
bot_dev1 9994fb75e7 fix(#188): bot_qa 审核修正——nginx 改无 URI proxy_pass 真透传 + 健康探针 /health 无前缀
打回问题 1:proxy_pass 带末尾 / 是去前缀语义(与声称相反),/v1/models
会被转发成 /models 导致 404。改为不带 URI 的 proxy_pass(无末尾 /),
请求 URI 原样透传;另新增 location = /health 精确透传健康探针。
打回问题 2:serve.py 健康路由是 GET /health(无 /v1 前缀),fetchHealth
由 /v1/health 改回 /health;同步修正 chat/NlQuery/cockpit 三处文案注释。
构建验证:pnpm --filter @vben/web-antdv-next build 通过(10.3s)。
2026-08-06 16:48:14 +08:00
bot_dev1 be2730fe13 fix(#189): 驾驶舱主题 token 卸载时清理,修复全局 CSS 变量污染 (#193)
bot_qa 审核通过(issue #189 已关闭),补合并到 main——此前仅审核通过未合并,修复一度丢失。
2026-08-06 16:45:15 +08:00
bot_dev1 282c46afd9 fix(#187): 修复模板配置台两处交互失效 (#194)
bot_dev1 复核通过(与 bot_qa 审核结论一致);rebase 到最新 main 解决 version.vue 冲突后合并。

fixes #187
2026-08-06 08:38:00 +00:00
bot_dev1 018bcdbf1a fix(#187): 修复模板配置台两处交互失效
1. studio/import.vue CSV 上传失效:onFile 原按 DOM Event 取 e.target.files,
   但 a-upload 的 @change 载荷是 UploadChangeParam { file, fileList },
   :before-upload="() => false" 时文件在 file.originFileObj 上,导致必抛
   TypeError 无响应。改为从 info.file.originFileObj 取文件对象。
2. studio/layout.vue 第 45 行「发布布局」按钮无 @click 处理(死按钮):
   新增 publishLayout,将布局 JSON 暂存 localStorage
   (iaop.studio.layout.v1),与 version.vue 版本发布联动;
   version.vue 发布时读取并打包该布局。
   layoutJson 改为 computed,模板同步更新。

验收:本环境无 pnpm/node_modules,构建验证转 bot_qa 构建环境;
上传符合表头 CSV 应出现校验/预览,缺表头 CSV 应报错;
点「发布布局」应提示成功并记录发布时间。
2026-08-06 16:34:24 +08:00
bot_dev1 5667fad3e1 fix(#188): 推理 API 路径规范化,消除双 /v1 前缀对 nginx rewrite 的隐式依赖
问题:infer.ts BASE_URL=/v1,fetchModels/chatCompletion 再拼 /v1/* 导致
/v1/v1 双前缀,当前仅靠 nginx 对 /v1/ rewrite 去前缀巧合耦合才通。

修复(前后端+部署一起改):
1. nginx-fba.conf:新增 location /v1/,proxy_pass http://127.0.0.1:30800/
   (带末尾 /,不去前缀直接透传),消除对 rewrite 的隐式依赖。
2. infer.ts:BASE_URL 改为空串,调用方统一写 /v1/models、
   /v1/chat/completions、/v1/health(fetchHealth 原误用 /health 已修正)。
3. cockpit/index.vue:健康检查改走 infer.ts 的 fetchHealth 封装,
   不再裸 fetch('/v1/health'),路径口径统一。
4. ask() latencyMs 由硬编码 0 改为 performance.now() 实测耗时。
5. README 补充推理通道路径约定说明。

验收:浏览器 Network 确认 /v1/models、/v1/chat/completions、
/v1/health 均 200 且无 /v1/v1 请求。(本环境无 pnpm,构建验证转 bot_qa)
2026-08-06 16:11:37 +08:00
bot_dev2 787a83c550 fix: version 页改 antd a-table + 初始服务端探测(发布=注册到服务端) 2026-08-06 16:11:16 +08:00
bot_dev2 2c7ebf4efc fix: models 页改 antd a-table(响应式 :data-source,规避 vben Grid proxy 异步时序导致 0 条) 2026-08-06 16:09:00 +08:00
bot_dev2 03dbd04452 fix: models 页改 :data 响应式绑定(异步 fetch 数据 + proxy 分页时序导致 0 条,vxe-grid data 直绑最稳) 2026-08-06 16:06:53 +08:00
bot_dev2 d843dc46bf fix: ?? 与 || 混用加括号(193d561 同款语法,C2 构建修复) 2026-08-06 16:01:30 +08:00
bot_dev2 b93830c835 fix: vxe-grid proxy.query 分页兜底(page 缺省时返回全量,E2 重写覆盖了 QA cd7d4fd 修复导致 models/version 0 条) 2026-08-06 16:00:29 +08:00
11 changed files with 153 additions and 101 deletions
+7 -1
View File
@@ -138,9 +138,15 @@ docker exec -it fba_postgres psql -U postgres -d fba # 进数据库
│ · 6 模块 → views/iaop/*(cockpit/chat/studio/admin)
│ · 推理通道 /v1/ → 127.0.0.1:30800(推理服务,独立于 /fba)
├── /fba/ → 127.0.0.1:8001 fba_server(认证/RBAC/系统管理)
└── /v1/ → 127.0.0.1:30800 推理服务(iAOP LLM 网关)
└── /v1/ → 127.0.0.1:30800 推理服务(iAOP LLM 网关,**不去前缀直接透传**)
```
### 推理通道路径约定(issue #188)
- 推理服务真实路径即 `:30800/v1/*`(`/v1/models`、`/v1/chat/completions`、`/v1/health`)。
- nginx 反代 `/v1/` 用 `proxy_pass http://127.0.0.1:30800/`(带末尾 `/`,**不去前缀**,直接透传到后端的 `/v1/...`)。
- 前端 `api/iaop/infer.ts` 的 `BASE_URL` 为空串,调用方统一写 `/v1/models`、`/v1/chat/completions`、`/v1/health`,**不再出现 `/v1/v1` 双前缀**,也不依赖 nginx rewrite 去前缀的巧合耦合。
- nginx location 片段见 `deploy/fba/nginx-fba.conf`。
### 组件落点
- 受控源码:`fba-ui-src/`(fastapi-best-architecture-ui 工程,apps/web-antdv-next)
- 构建流水线:`build-ui.sh`(pnpm install → build → artifacts/fba-ui-dist.tar.gz)
Binary file not shown.
@@ -1,15 +1,20 @@
/**
* iAOP LLM 网关客户端(Epic #163 / issue #166 [A3])
*
* 对齐旧 `web/` 各模块的 INFER_BASE(nginx 反代 /v1/ → 推理服务 :30800):
* GET /v1/health —— 健康巡检
* 对齐旧 `web/` 各模块的 INFER_BASE(nginx 反代 → 推理服务 :30800):
* GET /health —— 健康巡检(serve.py 探针路由无前缀)
* GET /v1/models —— 模型列表
* POST /v1/chat/completions —— OpenAI 兼容对话(dry-run 占位 / 真实推理)
*
* 推理服务为 iAOP 独立通道(不要求 FBA JWT),故用原生 fetch 封装,
* 统一超时 / 错误信息 / 结果结构;FBA requestClient 仅用于 /fba/* 接口。
*
* issue #188(bot_qa 审核修正):nginx 反代使用不带 URI 的 proxy_pass
* 原样透传,故 BASE_URL 为空串,调用方按后端真实路由写
* /v1/models、/v1/chat/completions、/health(健康探针无 /v1 前缀),
* 避免出现 /v1/v1 双前缀对 nginx rewrite 的隐式耦合。
*/
const BASE_URL = '/v1';
const BASE_URL = '';
const TIMEOUT_MS = 15000;
export interface InferResult {
@@ -92,12 +97,14 @@ export async function chatCompletion(
/** 便捷:返回纯文本(B 系列页面统一使用) */
export async function ask(prompt: string, opts?: Parameters<typeof chatCompletion>[1]): Promise<InferResult> {
// issue #188:用 performance.now() 实测耗时,替代原先 latencyMs: 0 硬编码
const startedAt = performance.now();
const resp = await chatCompletion(prompt, opts);
const msg = resp.choices?.[0]?.message?.content || '';
return {
text: msg,
meta: (resp.meta as Record<string, unknown>) || {},
backend: String((resp.meta as Record<string, unknown>)?.backend || 'gpu'),
latencyMs: 0,
latencyMs: Math.round(performance.now() - startedAt),
};
}
@@ -2,16 +2,15 @@
/**
* 模型管理(issue #183 [E2] 前端接入注册表 API)
* - 数据源:服务端注册表 API(list/promote/rollback 全走服务端,多用户共享);
* - 降级:API 不可达时回退 localStorage(iaop.admin.models.v1,旧版 key),UI 标注「离线演示模式」;
* - 降级:API 不可达时回退 localStorage(iaop.admin.models.v1),UI 标注「离线演示模式」;
* - 迁移:检测 localStorage 有数据且服务端在线时提示导入。
* - 表格:antd a-table(响应式 :data-source 直绑,规避 vxe-grid proxy 异步时序问题)。
*/
import { computed, onMounted, ref } from 'vue';
import { Page, VbenButton } from '@vben/common-ui';
import { message } from 'antdv-next';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import {
fetchRegistryModels,
promoteModel,
@@ -45,39 +44,25 @@ function saveLocal(list: LocalModel[]) {
}
}
const online = ref(false); // 注册表服务在线?
const online = ref(false);
const loading = ref(true);
const models = ref<RegistryModel[]>([]);
const migrateVisible = ref(false);
const gridOptions: VxeTableGridOptions = {
rowConfig: { keyField: 'name' },
height: 'auto',
stripe: true,
columns: [
{ title: '模型', field: 'name', minWidth: 180 },
{ title: '版本', field: 'version', width: 120 },
{ title: '阶段', field: 'stage', width: 110, slots: { default: 'stage' } },
{ title: '说明', field: 'description', minWidth: 220 },
{ title: '操作', field: 'action', width: 170, slots: { default: 'action' } },
],
proxy: {
query: async ({ page }) => ({
items: models.value.slice((page.currentPage - 1) * page.pageSize, page.currentPage * page.pageSize),
total: models.value.length,
}),
},
};
const columns = [
{ title: '模型', dataIndex: 'name', key: 'name', width: 200 },
{ title: '版本', dataIndex: 'version', key: 'version', width: 120 },
{ title: '阶段', dataIndex: 'stage', key: 'stage', width: 110 },
{ title: '说明', dataIndex: 'description', key: 'description' },
{ title: '操作', key: 'action', width: 180 },
];
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
async function refresh() {
gridApi.query();
}
const tagColor = (stage: string) =>
stage === 'prod' ? 'green' : stage === 'staging' ? 'orange' : 'blue';
async function loadFromServer() {
const resp = await fetchRegistryModels();
models.value = resp.models;
models.value = resp.models || [];
}
async function init() {
@@ -85,7 +70,7 @@ async function init() {
try {
await loadFromServer();
online.value = true;
// 迁移提示:本地有数据且服务端在线(且本地有服务端没有的模型)
// 迁移提示:本地有服务端没有的模型
const local = loadLocal();
const serverNames = new Set(models.value.map((m) => `${m.name}@${m.version}`));
const localExtra = local.filter((m) => !serverNames.has(`${m.name}@${m.version}`));
@@ -101,7 +86,6 @@ async function init() {
}));
} finally {
loading.value = false;
refresh();
}
}
@@ -110,17 +94,14 @@ async function promote(m: RegistryModel) {
try {
await promoteModel(m.name, m.version);
await loadFromServer();
refresh();
return;
} catch (e) {
message.error(`提升失败:${(e as Error).message}`);
return;
}
}
// 离线降级
m.stage = m.stage === 'staging' ? 'prod' : m.stage === 'dev' ? 'staging' : m.stage;
saveLocal(models.value.map((x) => ({ name: x.name, version: x.version, stage: x.stage, desc: x.description })));
refresh();
}
async function rollback(m: RegistryModel) {
@@ -128,7 +109,6 @@ async function rollback(m: RegistryModel) {
try {
await rollbackModel(m.name, 'prod', m.version);
await loadFromServer();
refresh();
return;
} catch (e) {
message.error(`回滚失败:${(e as Error).message}`);
@@ -137,7 +117,6 @@ async function rollback(m: RegistryModel) {
}
m.stage = 'staging';
saveLocal(models.value.map((x) => ({ name: x.name, version: x.version, stage: x.stage, desc: x.description })));
refresh();
}
async function migrateLocal() {
@@ -153,7 +132,6 @@ async function migrateLocal() {
}
}
await loadFromServer();
refresh();
migrateVisible.value = false;
if (fail === 0) {
localStorage.removeItem(MODELS_KEY);
@@ -163,9 +141,6 @@ async function migrateLocal() {
}
}
const tagColor = (stage: string) =>
stage === 'prod' ? 'green' : stage === 'staging' ? 'orange' : 'blue';
onMounted(init);
</script>
@@ -175,15 +150,17 @@ onMounted(init);
<a-tag :color="online ? 'green' : 'orange'">{{ online ? '● 服务端在线' : '● 离线演示模式' }}</a-tag>
</template>
<a-spin :spinning="loading">
<Grid>
<template #stage="{ row }">
<a-tag :color="tagColor(row.stage)">{{ row.stage }}</a-tag>
<a-table :data-source="models" :columns="columns" row-key="name" size="small" :pagination="{ pageSize: 10 }">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'stage'">
<a-tag :color="tagColor(record.stage)">{{ record.stage }}</a-tag>
</template>
<template v-else-if="column.key === 'action'">
<VbenButton size="small" :disabled="record.stage === 'prod'" @click="promote(record)">提升</VbenButton>
<VbenButton size="small" variant="outline" :disabled="record.stage !== 'prod'" @click="rollback(record)">回滚</VbenButton>
</template>
</template>
<template #action="{ row }">
<VbenButton size="small" :disabled="row.stage === 'prod'" @click="promote(row)">提升</VbenButton>
<VbenButton size="small" variant="outline" :disabled="row.stage !== 'prod'" @click="rollback(row)">回滚</VbenButton>
</template>
</Grid>
</a-table>
</a-spin>
<a-modal v-model:open="migrateVisible" title="本地模型导入注册表"
:on-ok="migrateLocal" ok-text="导入服务端" cancel-text="暂不">
@@ -68,7 +68,7 @@ async function send() {
messages.value.push({ role: 'assistant', content: r.text, meta, citations: hits });
} catch {
offline.value = true;
messages.value.push({ role: 'assistant', content: '推理服务请求失败,请检查网关(/v1/health)。' });
messages.value.push({ role: 'assistant', content: '推理服务请求失败,请检查网关(/health)。' });
} finally {
loading.value = false;
scrollBottom();
@@ -45,7 +45,7 @@ async function submit() {
<a-button type="primary" :loading="loading" @click="submit">查询</a-button>
</div>
<a-alert v-if="offline" type="warning" show-icon style="margin-top: 8px">
<template #message>推理服务离线 / dry-run 占位:请检查后端推理服务(/v1/health)</template>
<template #message>推理服务离线 / dry-run 占位:请检查后端推理服务(/health)</template>
</a-alert>
<div v-if="answer" class="nl-answer">{{ answer }}</div>
</div>
@@ -8,6 +8,7 @@ import { onMounted, onUnmounted, ref } from 'vue';
import { Page } from '@vben/common-ui';
import { fetchHealth } from '#/api/iaop/infer';
import { loadCockpitPlan } from '#/api/iaop/templates';
import AlarmPanel from './components/AlarmPanel.vue';
@@ -71,13 +72,10 @@ onUnmounted(() => {
const inferOnline = ref(false);
async function refreshHealth() {
try {
const resp = await fetch('/v1/health', { signal: AbortSignal.timeout(3000) });
const d = await resp.json();
inferOnline.value = d.status === 'ok' || d.status === 'dry-run';
} catch {
inferOnline.value = false;
}
// issue #188:健康检查改走 infer.ts 的 fetchHealth 封装,路径口径统一(/health,无前缀)
const d = await fetchHealth();
const status = d?.status;
inferOnline.value = status === 'ok' || status === 'dry-run';
}
</script>
@@ -4,6 +4,7 @@ import { ref } from 'vue';
import { Page, VbenButton } from '@vben/common-ui';
import { BxsFile } from '@vben/icons';
import type { UploadChangeParam } from 'antdv-next';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
@@ -33,14 +34,19 @@ const gridOptions: VxeTableGridOptions<Record<string, string>> = {
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
function onFile(e: Event) {
const el = e.target as HTMLInputElement;
const file = el.files?.[0];
if (!file) return;
function onFile(info: UploadChangeParam) {
// a-upload 的 @change 载荷是 UploadChangeParam { file, fileList },
// 在 :before-upload="() => false"(禁止自动上传)时文件对象在 file.originFileObj 上,
// 不是 DOM Event,不能用 e.target.files(会抛 TypeError 导致无响应)。
const { file } = info;
// 仅在选中文件后处理一次(removed 状态时跳过,避免清空预览)
if (file.status === 'removed') return;
const raw = file.originFileObj ?? file;
if (!raw) return;
fileName.value = file.name;
const reader = new FileReader();
reader.onload = () => parseCsv(String(reader.result || ''));
reader.readAsText(file);
reader.readAsText(raw as Blob);
}
function parseCsv(text: string) {
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { Page, VbenButton } from '@vben/common-ui';
import { MaterialSymbolsEdit } from '@vben/icons';
import { message } from 'antdv-next';
const components = ref([
{ type: 'process_view', title: '四状态工艺流程', enabled: true },
@@ -24,7 +25,25 @@ const move = (i: number, dir: number) => {
components.value[j] = t;
};
const layoutJson = () => JSON.stringify({ widgets: components.value.filter((c) => c.enabled) }, null, 2);
const layoutJson = computed(() =>
JSON.stringify({ widgets: components.value.filter((c) => c.enabled) }, null, 2),
);
// 发布布局:将布局 JSON 暂存到 localStorage(与版本发布页联动——
// version.vue 发布时一并打包该布局),注册表服务落地后可改为注册到服务端。
const LAYOUT_STORAGE_KEY = 'iaop.studio.layout.v1';
const lastPublishedAt = ref('');
async function publishLayout() {
const payload = layoutJson.value;
try {
localStorage.setItem(LAYOUT_STORAGE_KEY, payload);
lastPublishedAt.value = new Date().toISOString().slice(0, 19).replace('T', ' ');
message.success('布局已发布(暂存本地,将在「版本发布」时一并打包)');
} catch {
message.error('布局发布失败:本地存储不可用');
}
}
</script>
<template>
@@ -41,8 +60,9 @@ const layoutJson = () => JSON.stringify({ widgets: components.value.filter((c) =
</a-list>
</a-card>
<a-card title="导出布局 JSON(由驾驶舱渲染)" :bordered="false" class="col">
<pre class="json-body">{{ layoutJson() }}</pre>
<VbenButton variant="solid"><MaterialSymbolsEdit class="size-4" />发布布局(版本发布见「版本发布」页)</VbenButton>
<pre class="json-body">{{ layoutJson }}</pre>
<a-tag v-if="lastPublishedAt" color="green">最近发布:{{ lastPublishedAt }}</a-tag>
<VbenButton variant="solid" @click="publishLayout"><MaterialSymbolsEdit class="size-4" />发布布局(版本发布见「版本发布」页)</VbenButton>
</a-card>
</div>
</Page>
@@ -2,16 +2,15 @@
/**
* 模板版本发布(issue #183 [E2]):发布 = 注册新版本到服务端注册表;
* 注册表离线时降级本地记录并标注。
* 表格:antd a-table(响应式直绑,规避 vxe-grid proxy 时序)。
*/
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import { Page, VbenButton } from '@vben/common-ui';
import { MaterialSymbolsAdd } from '@vben/icons';
import { message } from 'antdv-next';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { registerModel } from '#/api/iaop/registry';
import { fetchRegistryModels, registerModel } from '#/api/iaop/registry';
interface VersionRow {
version: string;
@@ -28,38 +27,41 @@ const rows = ref<VersionRow[]>([
{ version: 'v0.8.0', stage: 'dev', time: '2026-08-03 09:00', author: 'bot_dev1', note: '布局资产初版' },
]);
const gridOptions: VxeTableGridOptions = {
rowConfig: { keyField: 'version' },
height: 'auto',
stripe: true,
columns: [
{ title: '版本', field: 'version', width: 110 },
{ title: '阶段', field: 'stage', width: 100, slots: { default: 'stage' } },
{ title: '时间', field: 'time', width: 170 },
{ title: '作者', field: 'author', width: 110 },
{ title: '说明', field: 'note', minWidth: 200 },
],
proxy: {
query: async ({ page }) => ({
items: rows.value.slice((page.currentPage - 1) * page.pageSize, page.currentPage * page.pageSize),
total: rows.value.length,
}),
},
};
const columns = [
{ title: '版本', dataIndex: 'version', key: 'version', width: 120 },
{ title: '阶段', dataIndex: 'stage', key: 'stage', width: 110 },
{ title: '时间', dataIndex: 'time', key: 'time', width: 180 },
{ title: '作者', dataIndex: 'author', key: 'author', width: 120 },
{ title: '说明', dataIndex: 'note', key: 'note' },
];
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
const tagColor = (stage: string) =>
stage === 'prod' ? 'green' : stage === 'staging' ? 'orange' : 'blue';
onMounted(async () => {
// 初始探测服务端在线状态(注册表可达 → 在线)
try {
await fetchRegistryModels();
online.value = true;
} catch {
online.value = false;
}
});
async function publish() {
const version = `v${Date.now() % 100000}`;
const name = 'iaop-template';
// 一并打包「驾驶舱布局编排」页发布的布局(issue #187:发布布局与版本发布联动)
const layoutJson = localStorage.getItem('iaop.studio.layout.v1') || '';
const description = layoutJson ? '手动发布(前端,含布局)' : '手动发布(前端)';
try {
// 发布 = 注册新版本到服务端注册表(staging)
await registerModel({ name, version, stage: 'staging', description: '手动发布(前端)' });
// 发布 = 注册新版本到服务端注册表(staging);description 含布局标记(issue #187 联动)
await registerModel({ name, version, stage: 'staging', description });
online.value = true;
rows.value.unshift({
version, stage: 'staging',
time: new Date().toISOString().slice(0, 16).replace('T', ' '),
author: 'admin', note: '已发布到服务端注册表',
author: 'admin', note: layoutJson ? '已发布到服务端注册表(含布局)' : '已发布到服务端注册表',
});
message.success(`已注册 ${name}@${version}(staging)`);
} catch {
@@ -71,7 +73,6 @@ async function publish() {
});
message.warning('注册表服务不可达:本次发布仅本地记录');
}
gridApi.query();
}
</script>
@@ -80,10 +81,12 @@ async function publish() {
<template #extra>
<VbenButton variant="solid" @click="publish"><MaterialSymbolsAdd class="size-4" />发布新版本</VbenButton>
</template>
<Grid>
<template #stage="{ row }">
<a-tag :color="row.stage === 'prod' ? 'green' : row.stage === 'staging' ? 'orange' : 'blue'">{{ row.stage }}</a-tag>
<a-table :data-source="rows" :columns="columns" row-key="version" size="small" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'stage'">
<a-tag :color="tagColor(record.stage)">{{ record.stage }}</a-tag>
</template>
</template>
</Grid>
</a-table>
</Page>
</template>
+35
View File
@@ -64,3 +64,38 @@ location /fba-admin/ {
add_header Cache-Control "no-cache";
}
}
# =============================================================================
# 推理通道(iAOP LLM 网关)
#
# issue #188(bot_qa 审核修正):推理服务真实路径为
# POST /v1/chat/completions、GET /v1/models(带 /v1 前缀)
# GET /health(健康探针,**无 /v1 前缀**,见 deploy/k8s/docker/serve.py)
#
# 注意 nginx 语义:proxy_pass 带 URI 部分(含末尾 /)时会把 location 匹配
# 前缀**替换**掉(即"去前缀",同上方 /fba/ 块用法);要"原样透传"必须
# 使用不带 URI 的 proxy_pass(无末尾 /),请求 URI 完整转发给后端。
# 前端 infer.ts BASE_URL 为空串,统一写 /v1/models、/v1/chat/completions、/health。
# =============================================================================
location /v1/ {
# 不带 URI(无末尾 /):/v1/models → :30800/v1/models 原样透传
proxy_pass http://127.0.0.1:30800;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 20m;
proxy_read_timeout 120s;
}
# 健康探针无前缀,单独精确透传:/health → :30800/health
location = /health {
proxy_pass http://127.0.0.1:30800;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}