Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
018bcdbf1a | ||
|
|
787a83c550 | ||
|
|
2c7ebf4efc | ||
|
|
03dbd04452 | ||
|
|
d843dc46bf | ||
|
|
b93830c835 |
@@ -138,15 +138,9 @@ 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)
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
/**
|
||||
* iAOP LLM 网关客户端(Epic #163 / issue #166 [A3])
|
||||
*
|
||||
* 对齐旧 `web/` 各模块的 INFER_BASE(nginx 反代 → 推理服务 :30800):
|
||||
* GET /health —— 健康巡检(serve.py 探针路由无前缀)
|
||||
* 对齐旧 `web/` 各模块的 INFER_BASE(nginx 反代 /v1/ → 推理服务 :30800):
|
||||
* GET /v1/health —— 健康巡检
|
||||
* 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 = '';
|
||||
const BASE_URL = '/v1';
|
||||
const TIMEOUT_MS = 15000;
|
||||
|
||||
export interface InferResult {
|
||||
@@ -97,14 +92,12 @@ 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: Math.round(performance.now() - startedAt),
|
||||
latencyMs: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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: '推理服务请求失败,请检查网关(/health)。' });
|
||||
messages.value.push({ role: 'assistant', content: '推理服务请求失败,请检查网关(/v1/health)。' });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
scrollBottom();
|
||||
|
||||
+1
-1
@@ -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 占位:请检查后端推理服务(/health)</template>
|
||||
<template #message>推理服务离线 / dry-run 占位:请检查后端推理服务(/v1/health)</template>
|
||||
</a-alert>
|
||||
<div v-if="answer" class="nl-answer">{{ answer }}</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,6 @@ 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';
|
||||
@@ -54,10 +53,13 @@ onUnmounted(() => window.clearInterval(timer));
|
||||
|
||||
const inferOnline = ref(false);
|
||||
async function refreshHealth() {
|
||||
// issue #188:健康检查改走 infer.ts 的 fetchHealth 封装,路径口径统一(/health,无前缀)
|
||||
const d = await fetchHealth();
|
||||
const status = d?.status;
|
||||
inferOnline.value = status === 'ok' || status === 'dry-run';
|
||||
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;
|
||||
}
|
||||
}
|
||||
</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>
|
||||
|
||||
@@ -64,38 +64,3 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user