Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d813225ac4 | ||
|
|
3475ce7ce6 | ||
|
|
c0229b60c1 | ||
|
|
fbed8d1ea4 | ||
|
|
1fc5d74d8a | ||
|
|
4606fbfd4f | ||
|
|
0ff0e22e56 | ||
|
|
6ea222e5ab | ||
|
|
b8c0ddda6d | ||
|
|
d987400a5b | ||
|
|
6a7757ae2f | ||
|
|
78cc2aab56 |
@@ -2,6 +2,75 @@
|
|||||||
|
|
||||||
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
|
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
|
||||||
|
|
||||||
|
## [0.7.3]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 实例规格表单配额判定改为数据驱动(shape `quotaNames` × compute limits,按行 scope 区分 AD / 区域限额),删除硬编码映射,覆盖全部带配额名的 shape;选定可用域后 Shape 选项按该 AD 配额禁用并标注「该 AD 无配额」,选定 Shape 后可用域选项禁用 / 标注无配额 AD
|
||||||
|
- 创建实例可用域留空且默认 AD-1 对所选 shape 无配额时,自动落位首个有配额的可用域(字段可见可改;抢机表单保持留空 = 轮询语义)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 创建实例默认规格 4 OCPU / 24 GB → 2 OCPU / 12 GB(创建与抢机共用表单)
|
||||||
|
- 实例表单(创建 / 调整规格 / 抢机)去除「免费额度」「永久免费」标注与「容量不足可改用抢机任务」「A1 免费额度上限」等提示;免费 shape 仍置顶排序
|
||||||
|
- 回传日志表格移除最大高度限制,行为与系统日志 / AI 调用一致;页脚与通知设置说明同步「创建不回传,避免抢机噪声」
|
||||||
|
- 创建实例失败 / 部分成功提示改为「短标题 + 展开详情」形态,逐台错误进详情块、可复制
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复批量接口全部失败(HTTP 500 + `errors` 数组)时提示只显示「请求失败(500)」:统一请求层现解析 `errors` 数组,展示具体失败原因
|
||||||
|
|
||||||
|
## [0.7.2]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 设置页 AI Tab「Responses 直通」面板新增「上游无响应预算」输入(30..900 秒,失焦 / 回车提交,即时生效),与流式保险丝同面板并网格对齐
|
||||||
|
- 代理列表新增「状态」列(检测中 / 正常 / 异常):与地区同源于经代理链路的出口探测,探测失败即视为异常,「重测」联动刷新;页脚说明同步
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- AI 调用日志 Tokens(入/出)列加宽并禁止换行,大用量流式行不再折行;原「流式保险丝」独立面板并入「Responses 直通」
|
||||||
|
|
||||||
|
## [0.7.1]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 租户详情 · 审计日志新增搜索框(标签式查询框,样式对齐配额页):500ms 防抖,回车 / 清空即时生效且关键字未变不发起重复请求;匹配事件 / 资源 / 操作者等可见字段,不区分大小写、支持 `*` 通配
|
||||||
|
- 审计分页状态行新增「已回溯至 …」进度提示;搜索命中稀疏时自动补批封顶(2 次)后停驻,由「加载更早」按钮显式继续,不再无人值守回溯整个保留期
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 审计页脚说明同步数据源变更:每批约 200 条、搜索匹配可见字段;详情弹窗原始 JSON 来源标注改为「来自 OCI 审计日志」
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复审计列表加载中刷新 / 更换关键字时,在途旧响应混入新信息流的竞态(代次校验丢弃过期响应)
|
||||||
|
|
||||||
|
## [0.7.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 设置页新增「AI」Tab,集中承载 AI 网关运行时设置:
|
||||||
|
- 流式保险丝:开关 + 阈值输入(KB),关闭时输入框禁用;修改即时生效
|
||||||
|
- grok 服务端搜索工具:`web_search` / `x_search` 默认注入双开关(仅 `xai.` 前缀模型生效,请求已带同名工具不覆盖)
|
||||||
|
- 模型治理:过滤弃用开关与模型黑名单管理(列表 / 移出 / 添加)
|
||||||
|
- 黑名单「添加模型」弹窗:聚合全部渠道的可用模型,按能力分组(对话 / 向量 / 重排 / 语音)、关键字过滤、行内拉黑、已拉黑置灰;目录口径随「过滤弃用」开关
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 「过滤弃用」开关与模型黑名单管理自 AI 网关页迁入设置 · AI;AI 网关「可用模型」列表移除 ✕ 拉黑入口(添加统一走设置页弹窗),渠道「模型列表」弹窗内的拉黑保留
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 实例详情网卡(VNIC):附加成功后按「期望卡数 +1」限时轮询(≤90s),新卡自动出现无需手动刷新页面;IPv6 添加 / 删除仅在网卡 ATTACHED 状态提供,修复 DETACHED 网卡仍可点「+ IPv6」;脚注移除误导的 dhclient / netplan 说明(OCI DHCPv4 只服务主网卡)
|
||||||
|
|
||||||
|
## [0.6.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- AI 网关渠道表格新增「模型数量」列(与模型列表同口径:排除黑名单、随「过滤弃用」开关)
|
||||||
|
- 渠道「模型列表」弹窗(替代原「同步模型」按钮,同步入口迁入弹窗):模型按能力分组展示(对话 / 向量 / 重排 / 语音),支持关键字过滤;每行可「测试」(通过即标记「验证模型」徽章并置渠道可用,后续探测优先使用)与「拉黑」(全局黑名单);弃用模型降灰标注,非对话模型不提供测试;操作按钮悬停行时着色,保持列表安静
|
||||||
|
|
||||||
## [0.5.1]
|
## [0.5.1]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { request } from './request'
|
import { request } from './request'
|
||||||
import type {
|
import type {
|
||||||
AiCallLog,
|
AiCallLog,
|
||||||
|
AiCatalogModel,
|
||||||
AiChannel,
|
AiChannel,
|
||||||
AiContentLog,
|
AiContentLog,
|
||||||
AiKey,
|
AiKey,
|
||||||
@@ -83,12 +84,26 @@ export function syncAiChannelModels(id: number): Promise<AiModelCacheItem[]> {
|
|||||||
}).then((r) => r.items)
|
}).then((r) => r.items)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function listAiChannelModels(id: number): Promise<AiModelCacheItem[]> {
|
||||||
|
return request<{ items: AiModelCacheItem[] }>(`/ai-channels/${id}/models`).then((r) => r.items)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 单模型 max_tokens=16 试调;通过即设为该渠道探测验证模型并按需置渠道可用 */
|
||||||
|
export function testAiChannelModel(id: number, model: string): Promise<AiChannel> {
|
||||||
|
return request(`/ai-channels/${id}/test-model`, { method: 'POST', body: { model } })
|
||||||
|
}
|
||||||
|
|
||||||
// ---- 聚合模型与调用日志 ----
|
// ---- 聚合模型与调用日志 ----
|
||||||
|
|
||||||
export function listAiModels(): Promise<AiModel[]> {
|
export function listAiModels(): Promise<AiModel[]> {
|
||||||
return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items)
|
return request<{ items: AiModel[] }>('/ai-models').then((r) => r.items)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 聚合模型目录(含能力,启用渠道去重;不受「过滤弃用」影响),黑名单添加弹窗用 */
|
||||||
|
export function listAiModelCatalog(): Promise<AiCatalogModel[]> {
|
||||||
|
return request<{ items: AiCatalogModel[] }>('/ai-model-catalog').then((r) => r.items)
|
||||||
|
}
|
||||||
|
|
||||||
// ---- 网关全局设置 ----
|
// ---- 网关全局设置 ----
|
||||||
|
|
||||||
export function getAiSettings(): Promise<AiSettings> {
|
export function getAiSettings(): Promise<AiSettings> {
|
||||||
|
|||||||
@@ -509,6 +509,7 @@ export const mockRegionSubs: RegionSubscription[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const mockLimits: LimitItem[] = [
|
export const mockLimits: LimitItem[] = [
|
||||||
|
// A1:三个 AD 均有配额 + 区域总额(镜像真实免费租户形态)
|
||||||
{
|
{
|
||||||
name: 'standard-a1-core-count',
|
name: 'standard-a1-core-count',
|
||||||
scopeType: 'AD',
|
scopeType: 'AD',
|
||||||
@@ -517,6 +518,19 @@ export const mockLimits: LimitItem[] = [
|
|||||||
used: 4,
|
used: 4,
|
||||||
available: 0,
|
available: 0,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'standard-a1-core-count',
|
||||||
|
scopeType: 'AD',
|
||||||
|
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-2',
|
||||||
|
value: 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'standard-a1-core-count',
|
||||||
|
scopeType: 'AD',
|
||||||
|
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-3',
|
||||||
|
value: 4,
|
||||||
|
},
|
||||||
|
{ name: 'standard-a1-core-regional-count', scopeType: 'REGION', value: 4 },
|
||||||
{
|
{
|
||||||
name: 'standard-a1-memory-count',
|
name: 'standard-a1-memory-count',
|
||||||
scopeType: 'AD',
|
scopeType: 'AD',
|
||||||
@@ -525,14 +539,27 @@ export const mockLimits: LimitItem[] = [
|
|||||||
used: 24,
|
used: 24,
|
||||||
available: 0,
|
available: 0,
|
||||||
},
|
},
|
||||||
|
// Micro:仅 AD-2 有配额(AD 受限 shape,驱动创建表单自动落位)
|
||||||
{
|
{
|
||||||
name: 'standard-e2-micro-core-count',
|
name: 'standard-e2-micro-core-count',
|
||||||
scopeType: 'AD',
|
scopeType: 'AD',
|
||||||
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-1',
|
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-1',
|
||||||
|
value: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'standard-e2-micro-core-count',
|
||||||
|
scopeType: 'AD',
|
||||||
|
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-2',
|
||||||
value: 2,
|
value: 2,
|
||||||
used: 1,
|
used: 1,
|
||||||
available: 1,
|
available: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'standard-e2-micro-core-count',
|
||||||
|
scopeType: 'AD',
|
||||||
|
availabilityDomain: 'RssO:EU-FRANKFURT-1-AD-3',
|
||||||
|
value: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'standard-e4-core-count',
|
name: 'standard-e4-core-count',
|
||||||
scopeType: 'AD',
|
scopeType: 'AD',
|
||||||
@@ -1374,6 +1401,12 @@ export const mockShapes: ComputeShape[] = [
|
|||||||
memoryMinGBs: 1,
|
memoryMinGBs: 1,
|
||||||
memoryMaxGBs: 512,
|
memoryMaxGBs: 512,
|
||||||
processorDescription: '3.0 GHz Ampere® Altra™',
|
processorDescription: '3.0 GHz Ampere® Altra™',
|
||||||
|
quotaNames: [
|
||||||
|
'standard-a1-memory-count',
|
||||||
|
'standard-a1-memory-regional-count',
|
||||||
|
'standard-a1-core-count',
|
||||||
|
'standard-a1-core-regional-count',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'VM.Standard.E2.1.Micro',
|
name: 'VM.Standard.E2.1.Micro',
|
||||||
@@ -1382,6 +1415,7 @@ export const mockShapes: ComputeShape[] = [
|
|||||||
ocpus: 1,
|
ocpus: 1,
|
||||||
memoryInGBs: 1,
|
memoryInGBs: 1,
|
||||||
processorDescription: '2.0 GHz AMD EPYC™ 7551',
|
processorDescription: '2.0 GHz AMD EPYC™ 7551',
|
||||||
|
quotaNames: ['standard-e2-micro-core-count'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'VM.Standard.E4.Flex',
|
name: 'VM.Standard.E4.Flex',
|
||||||
@@ -1392,6 +1426,7 @@ export const mockShapes: ComputeShape[] = [
|
|||||||
memoryMinGBs: 1,
|
memoryMinGBs: 1,
|
||||||
memoryMaxGBs: 1024,
|
memoryMaxGBs: 1024,
|
||||||
processorDescription: '2.55 GHz AMD EPYC™ 7J13',
|
processorDescription: '2.55 GHz AMD EPYC™ 7J13',
|
||||||
|
quotaNames: ['standard-e4-core-count', 'standard-e4-memory-count'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'VM.Standard.E5.Flex',
|
name: 'VM.Standard.E5.Flex',
|
||||||
|
|||||||
+9
-2
@@ -32,8 +32,15 @@ function buildUrl(path: string, query?: RequestOptions['query']): string {
|
|||||||
async function parseError(resp: Response): Promise<never> {
|
async function parseError(resp: Response): Promise<never> {
|
||||||
let message = `请求失败(${resp.status})`
|
let message = `请求失败(${resp.status})`
|
||||||
try {
|
try {
|
||||||
const body = (await resp.json()) as { error?: string; hint?: string }
|
const body = (await resp.json()) as { error?: string; hint?: string; errors?: unknown[] }
|
||||||
if (body.error) message = body.hint ? `${body.hint}|${body.error}` : body.error
|
if (body.error) {
|
||||||
|
message = body.hint ? `${body.hint}|${body.error}` : body.error
|
||||||
|
} else {
|
||||||
|
// 批量接口(如创建实例)全部失败时返回 errors 数组,逐行合并;
|
||||||
|
// 调用方以「短标题 + detail」经 useToast 展示,多行在详情块中逐行可读
|
||||||
|
const list = (body.errors ?? []).filter((e): e is string => typeof e === 'string')
|
||||||
|
if (list.length) message = list.join('\n')
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
/* 非 JSON 响应体,保留默认消息 */
|
/* 非 JSON 响应体,保留默认消息 */
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-8
@@ -182,17 +182,24 @@ export function deleteUserApiKeys(
|
|||||||
|
|
||||||
// ---- 审计日志 ----
|
// ---- 审计日志 ----
|
||||||
/** 批式懒加载查询审计事件:cursor 空自当前时刻首查,
|
/** 批式懒加载查询审计事件:cursor 空自当前时刻首查,
|
||||||
* 非空从上次响应游标向更早续取一批(~100 条,服务端分窗回溯) */
|
* 非空从上次响应游标向更早续取一批(~200 条,服务端分窗回溯);
|
||||||
|
* q 为服务端全文检索关键字,仅首查生效(续查沿用游标内嵌关键字) */
|
||||||
export function listAuditEvents(
|
export function listAuditEvents(
|
||||||
id: number,
|
id: number,
|
||||||
opts: { region?: string; cursor?: string; limit?: number } = {},
|
opts: { region?: string; cursor?: string; limit?: number; q?: string } = {},
|
||||||
): Promise<AuditEventsResult> {
|
): Promise<AuditEventsResult> {
|
||||||
// mock:首批带游标,续查一批后到尽头,演示懒加载链路
|
// mock:首批带游标,续查一批后到尽头,演示懒加载链路;q 演示不区分大小写的包含匹配
|
||||||
if (mockOn)
|
if (mockOn) {
|
||||||
return mocked(
|
const kw = (opts.q ?? '').replace(/\*/g, '').toLowerCase()
|
||||||
{ items: mockAuditEvents, cursor: opts.cursor ? undefined : 'mock-cursor', exhausted: !!opts.cursor },
|
const items = kw
|
||||||
300,
|
? mockAuditEvents.filter((e) =>
|
||||||
)
|
[e.eventName, e.resourceName, e.principalName, e.ipAddress, e.source].some((v) =>
|
||||||
|
(v ?? '').toLowerCase().includes(kw),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: mockAuditEvents
|
||||||
|
return mocked({ items, cursor: opts.cursor ? undefined : 'mock-cursor', exhausted: !!opts.cursor }, 300)
|
||||||
|
}
|
||||||
return request(`/oci-configs/${id}/audit-events`, { query: { ...opts } })
|
return request(`/oci-configs/${id}/audit-events`, { query: { ...opts } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
defineProps<{ title: string; sub?: string }>()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="flex flex-wrap items-baseline justify-between gap-2">
|
|
||||||
<div class="flex items-baseline gap-3">
|
|
||||||
<h1 class="page-title">{{ title }}</h1>
|
|
||||||
<slot name="title-extra" />
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-2">
|
|
||||||
<span v-if="sub" class="text-[13px] text-ink-3">{{ sub }}</span>
|
|
||||||
<slot name="actions" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { NButton, NInput, NModal, useDialog } from 'naive-ui'
|
||||||
|
import { computed, ref, watch } from 'vue'
|
||||||
|
|
||||||
|
import {
|
||||||
|
addAiBlacklist,
|
||||||
|
listAiChannelModels,
|
||||||
|
syncAiChannelModels,
|
||||||
|
testAiChannelModel,
|
||||||
|
} from '@/api/aigateway'
|
||||||
|
import { useToast } from '@/composables/useToast'
|
||||||
|
import type { AiChannel, AiModelCacheItem } from '@/types/api'
|
||||||
|
|
||||||
|
const props = defineProps<{ show: boolean; channel: AiChannel | null }>()
|
||||||
|
const emit = defineEmits<{ 'update:show': [boolean]; changed: [] }>()
|
||||||
|
|
||||||
|
const toast = useToast()
|
||||||
|
const dialog = useDialog()
|
||||||
|
|
||||||
|
const rows = ref<AiModelCacheItem[]>([])
|
||||||
|
const loading = ref(false)
|
||||||
|
const syncing = ref(false)
|
||||||
|
const testing = ref('')
|
||||||
|
const filter = ref('')
|
||||||
|
/** 本地镜像验证模型:测试通过即时高亮,不等父级刷新 */
|
||||||
|
const probeModel = ref('')
|
||||||
|
|
||||||
|
const CAP_ORDER = ['CHAT', 'EMBEDDING', 'RERANK', 'TTS']
|
||||||
|
const CAP_LABEL: Record<string, string> = { CHAT: '对话', EMBEDDING: '向量', RERANK: '重排', TTS: '语音' }
|
||||||
|
|
||||||
|
/** 按能力分组 + 关键字过滤;仅对话组提供「测试」入口 */
|
||||||
|
const groups = computed(() => {
|
||||||
|
const kw = filter.value.trim().toLowerCase()
|
||||||
|
const buckets = new Map<string, AiModelCacheItem[]>()
|
||||||
|
for (const r of rows.value) {
|
||||||
|
if (kw && !r.name.toLowerCase().includes(kw)) continue
|
||||||
|
const cap = r.capability || 'CHAT'
|
||||||
|
buckets.set(cap, [...(buckets.get(cap) ?? []), r])
|
||||||
|
}
|
||||||
|
const order = [...CAP_ORDER, ...[...buckets.keys()].filter((c) => !CAP_ORDER.includes(c))]
|
||||||
|
return order
|
||||||
|
.filter((cap) => buckets.has(cap))
|
||||||
|
.map((cap) => ({ cap, label: CAP_LABEL[cap] ?? cap, items: buckets.get(cap)! }))
|
||||||
|
})
|
||||||
|
|
||||||
|
const shownCount = computed(() => groups.value.reduce((n, g) => n + g.items.length, 0))
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.show,
|
||||||
|
(show) => {
|
||||||
|
if (show && props.channel) {
|
||||||
|
probeModel.value = props.channel.probeModel
|
||||||
|
filter.value = ''
|
||||||
|
void reload()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
async function reload() {
|
||||||
|
if (!props.channel) return
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
rows.value = await listAiChannelModels(props.channel.id)
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '加载失败')
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function doSync() {
|
||||||
|
if (!props.channel) return
|
||||||
|
syncing.value = true
|
||||||
|
try {
|
||||||
|
rows.value = await syncAiChannelModels(props.channel.id)
|
||||||
|
toast.success(`已同步 ${rows.value.length} 个模型`)
|
||||||
|
emit('changed')
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '同步失败')
|
||||||
|
} finally {
|
||||||
|
syncing.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function doTest(name: string) {
|
||||||
|
if (!props.channel || testing.value) return
|
||||||
|
testing.value = name
|
||||||
|
try {
|
||||||
|
const ch = await testAiChannelModel(props.channel.id, name)
|
||||||
|
probeModel.value = ch.probeModel
|
||||||
|
toast.success('测试通过', '已设为该渠道探测验证模型,后续探测优先使用')
|
||||||
|
emit('changed')
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '测试失败')
|
||||||
|
} finally {
|
||||||
|
testing.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmBlacklist(name: string) {
|
||||||
|
dialog.warning({
|
||||||
|
title: '拉黑模型',
|
||||||
|
content: `「${name}」将从全部渠道剔除,同步与探测不再入库;可在模型黑名单中移出后重新同步恢复。`,
|
||||||
|
positiveText: '拉黑',
|
||||||
|
negativeText: '取消',
|
||||||
|
onPositiveClick: async () => {
|
||||||
|
try {
|
||||||
|
await addAiBlacklist(name)
|
||||||
|
toast.success('已拉黑')
|
||||||
|
void reload()
|
||||||
|
emit('changed')
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '拉黑失败')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NModal
|
||||||
|
:show="show"
|
||||||
|
preset="card"
|
||||||
|
:style="{ width: '640px', maxWidth: 'calc(100vw - 24px)' }"
|
||||||
|
@update:show="emit('update:show', $event)"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<div>
|
||||||
|
<div class="text-[15px] leading-tight font-semibold">模型列表</div>
|
||||||
|
<div class="mono mt-1 text-xs font-normal text-ink-3">{{ channel?.name ?? '' }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2 pb-2">
|
||||||
|
<NInput v-model:value="filter" size="small" placeholder="过滤模型名…" clearable class="min-w-0 flex-1" />
|
||||||
|
<span class="flex-none text-xs whitespace-nowrap text-ink-3">
|
||||||
|
{{ filter ? `${shownCount} / ${rows.length}` : `${rows.length} 个模型` }}
|
||||||
|
</span>
|
||||||
|
<NButton size="small" :loading="syncing" @click="doSync">同步模型</NButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="-mx-2 max-h-[58vh] overflow-y-auto">
|
||||||
|
<div v-if="loading" class="py-10 text-center text-xs text-ink-3">加载中…</div>
|
||||||
|
<template v-else>
|
||||||
|
<template v-for="g in groups" :key="g.cap">
|
||||||
|
<div class="px-3 pt-3 pb-1 text-[11.5px] font-semibold tracking-wide text-ink-3">
|
||||||
|
{{ g.label }} <span class="font-normal">· {{ g.items.length }}</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="r in g.items"
|
||||||
|
:key="r.name"
|
||||||
|
class="group flex items-center gap-2 rounded-lg px-3 py-[5px] hover:bg-row-hover"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="mono min-w-0 truncate text-[13px]"
|
||||||
|
:class="r.deprecatedAt ? 'text-ink-3' : ''"
|
||||||
|
:title="r.modelOcid"
|
||||||
|
>
|
||||||
|
{{ r.name }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="r.name === probeModel"
|
||||||
|
class="flex flex-none items-center gap-1 rounded-[5px] bg-info/15 px-1.5 py-px text-[10.5px] font-medium text-info"
|
||||||
|
>
|
||||||
|
<span class="h-[5px] w-[5px] rounded-full bg-info" />验证模型
|
||||||
|
</span>
|
||||||
|
<span v-if="r.deprecatedAt" class="flex-none text-[11px] text-warn">弃用</span>
|
||||||
|
<span class="min-w-0 flex-1" />
|
||||||
|
<button
|
||||||
|
v-if="g.cap === 'CHAT'"
|
||||||
|
type="button"
|
||||||
|
class="flex-none cursor-pointer rounded-[5px] px-1.5 py-0.5 text-xs hover:bg-accent/10"
|
||||||
|
:class="testing === r.name ? 'text-accent' : 'text-ink-3/70 group-hover:text-accent'"
|
||||||
|
:disabled="!!testing"
|
||||||
|
@click="doTest(r.name)"
|
||||||
|
>
|
||||||
|
{{ testing === r.name ? '测试中…' : '测试' }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex-none cursor-pointer rounded-[5px] px-1.5 py-0.5 text-xs text-ink-3/70 group-hover:text-err hover:bg-err/10"
|
||||||
|
@click="confirmBlacklist(r.name)"
|
||||||
|
>
|
||||||
|
拉黑
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div v-if="!shownCount" class="py-10 text-center text-xs text-ink-3">
|
||||||
|
{{ rows.length ? '无匹配模型' : '暂无模型缓存,点击右上「同步模型」拉取' }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-1 border-t border-line-soft pt-2.5 text-[11.5px] leading-relaxed text-ink-3">
|
||||||
|
<span class="font-medium text-ink-2">测试</span>:发 max_tokens=16
|
||||||
|
试调,通过即设为该渠道探测验证模型(后续探测优先使用)并置渠道可用 ·
|
||||||
|
<span class="font-medium text-ink-2">拉黑</span>:全局生效,从全部渠道剔除 ·
|
||||||
|
非对话模型不提供测试
|
||||||
|
</div>
|
||||||
|
</NModal>
|
||||||
|
</template>
|
||||||
@@ -2,8 +2,9 @@
|
|||||||
import { NButton, NDataTable, NInput, NSelect, NTooltip, useDialog, type DataTableColumns } from 'naive-ui'
|
import { NButton, NDataTable, NInput, NSelect, NTooltip, useDialog, type DataTableColumns } from 'naive-ui'
|
||||||
import { computed, h, reactive, ref } from 'vue'
|
import { computed, h, reactive, ref } from 'vue'
|
||||||
|
|
||||||
import { createAiChannel, deleteAiChannel, probeAiChannel, syncAiChannelModels, updateAiChannel } from '@/api/aigateway'
|
import { createAiChannel, deleteAiChannel, probeAiChannel, updateAiChannel } from '@/api/aigateway'
|
||||||
import { listCachedRegions } from '@/api/configs'
|
import { listCachedRegions } from '@/api/configs'
|
||||||
|
import AiChannelModelsModal from '@/components/ai/AiChannelModelsModal.vue'
|
||||||
import GroupChips from '@/components/ai/GroupChips.vue'
|
import GroupChips from '@/components/ai/GroupChips.vue'
|
||||||
import AppInputNumber from '@/components/AppInputNumber.vue'
|
import AppInputNumber from '@/components/AppInputNumber.vue'
|
||||||
import FormField from '@/components/FormField.vue'
|
import FormField from '@/components/FormField.vue'
|
||||||
@@ -109,14 +110,13 @@ async function doProbe(id: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doSync(id: number) {
|
// ---- 模型列表弹窗 ----
|
||||||
try {
|
const showModels = ref(false)
|
||||||
const models = await syncAiChannelModels(id)
|
const modelsChannel = ref<AiChannel | null>(null)
|
||||||
toast.success(`已同步 ${models.length} 个模型`)
|
|
||||||
emit('changed')
|
function openModels(ch: AiChannel) {
|
||||||
} catch (e) {
|
modelsChannel.value = ch
|
||||||
toast.error(e instanceof Error ? e.message : '同步失败')
|
showModels.value = true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toggle(ch: AiChannel) {
|
async function toggle(ch: AiChannel) {
|
||||||
@@ -178,12 +178,16 @@ const columns = computed<DataTableColumns<AiChannel>>(() => [
|
|||||||
},
|
},
|
||||||
{ title: '优先级', key: 'priority', width: 76, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.priority)) },
|
{ title: '优先级', key: 'priority', width: 76, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.priority)) },
|
||||||
{ title: '权重', key: 'weight', width: 66, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.weight)) },
|
{ title: '权重', key: 'weight', width: 66, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.weight)) },
|
||||||
|
{
|
||||||
|
title: '模型数量', key: 'modelCount', width: 86,
|
||||||
|
render: (r) => h('span', { class: r.modelCount ? 'mono text-[13px]' : 'text-xs text-ink-3' }, String(r.modelCount ?? 0)),
|
||||||
|
},
|
||||||
{ title: '探测状态', key: 'probeStatus', width: 120, render: probeCell },
|
{ title: '探测状态', key: 'probeStatus', width: 120, render: probeCell },
|
||||||
{
|
{
|
||||||
title: '操作', key: 'actions', width: 250,
|
title: '操作', key: 'actions', width: 250,
|
||||||
render: (r) => h('div', { class: 'flex items-center gap-0.5' }, [
|
render: (r) => h('div', { class: 'flex items-center gap-0.5' }, [
|
||||||
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', loading: probing.value.has(r.id), onClick: () => doProbe(r.id) }, { default: () => '探测' }),
|
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', loading: probing.value.has(r.id), onClick: () => doProbe(r.id) }, { default: () => '探测' }),
|
||||||
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', onClick: () => doSync(r.id) }, { default: () => '同步模型' }),
|
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', onClick: () => openModels(r) }, { default: () => '模型列表' }),
|
||||||
h(NButton, { size: 'tiny', quaternary: true, onClick: () => toggle(r) }, { default: () => (r.enabled ? '停用' : '启用') }),
|
h(NButton, { size: 'tiny', quaternary: true, onClick: () => toggle(r) }, { default: () => (r.enabled ? '停用' : '启用') }),
|
||||||
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', onClick: () => openEdit(r) }, { default: () => '编辑' }),
|
h(NButton, { size: 'tiny', quaternary: true, type: 'primary', onClick: () => openEdit(r) }, { default: () => '编辑' }),
|
||||||
h(NButton, { size: 'tiny', quaternary: true, type: 'error', onClick: () => confirmRemove(r) }, { default: () => '删除' }),
|
h(NButton, { size: 'tiny', quaternary: true, type: 'error', onClick: () => confirmRemove(r) }, { default: () => '删除' }),
|
||||||
@@ -205,10 +209,16 @@ const columns = computed<DataTableColumns<AiChannel>>(() => [
|
|||||||
</div>
|
</div>
|
||||||
<NDataTable :columns="columns" :data="channels" :loading="loading" :bordered="false" size="small" />
|
<NDataTable :columns="columns" :data="channels" :loading="loading" :bordered="false" size="small" />
|
||||||
<div class="border-t border-line-soft bg-wash px-4.5 py-2.5 text-xs leading-relaxed text-ink-3">
|
<div class="border-t border-line-soft bg-wash px-4.5 py-2.5 text-xs leading-relaxed text-ink-3">
|
||||||
探测三步:列模型(服务可见性)→ 同步模型缓存 → max_tokens=1 试调(配额)· 探测成功自动复位熔断 ·
|
探测三步:列模型(服务可见性)→ 同步模型缓存 → max_tokens=16 试调(配额)· 探测成功自动复位熔断 ·
|
||||||
有渠道时系统自动维护「AI渠道探测」后台任务(每天 00:00 逐渠道探测,渠道清空自动暂停)
|
有渠道时系统自动维护「AI渠道探测」后台任务(每天 00:00 逐渠道探测,渠道清空自动暂停)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<AiChannelModelsModal
|
||||||
|
v-model:show="showModels"
|
||||||
|
:channel="modelsChannel"
|
||||||
|
@changed="emit('changed')"
|
||||||
|
/>
|
||||||
|
|
||||||
<FormModal
|
<FormModal
|
||||||
v-model:show="showForm"
|
v-model:show="showForm"
|
||||||
:title="editing ? '编辑渠道' : '添加渠道'"
|
:title="editing ? '编辑渠道' : '添加渠道'"
|
||||||
|
|||||||
@@ -56,12 +56,13 @@ async function submit() {
|
|||||||
// 后端 errors / instances 为空时序列化为 null,判空防炸
|
// 后端 errors / instances 为空时序列化为 null,判空防炸
|
||||||
const ok = result.instances?.length ?? 0
|
const ok = result.instances?.length ?? 0
|
||||||
const failed = result.errors?.length ?? 0
|
const failed = result.errors?.length ?? 0
|
||||||
if (failed) message.warning(`${ok} 台创建成功,${failed} 台失败:${result.errors![0]}`)
|
if (failed) message.warning(`${ok} 台创建成功,${failed} 台失败`, result.errors!.join('\n'))
|
||||||
else message.success(`已创建 ${ok} 台实例`)
|
else message.success(`已创建 ${ok} 台实例`)
|
||||||
emit('update:show', false)
|
emit('update:show', false)
|
||||||
emit('created')
|
emit('created')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error(e instanceof Error ? e.message : '创建失败')
|
// 逐台错误(可能多行)收进「展开详情」,标题保持简短
|
||||||
|
message.error('创建实例失败', e instanceof Error && e.message ? e.message : undefined)
|
||||||
} finally {
|
} finally {
|
||||||
submitting.value = false
|
submitting.value = false
|
||||||
}
|
}
|
||||||
@@ -90,17 +91,18 @@ async function submit() {
|
|||||||
<InstanceSpecForm
|
<InstanceSpecForm
|
||||||
ref="specForm"
|
ref="specForm"
|
||||||
sectioned
|
sectioned
|
||||||
|
auto-pick-ad
|
||||||
:cfg-id="cfgId"
|
:cfg-id="cfgId"
|
||||||
:region="region"
|
:region="region"
|
||||||
:compartment-id="compartmentId"
|
:compartment-id="compartmentId"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="mt-3 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-line-soft bg-wash px-3 py-2 text-xs leading-relaxed text-ink-3"
|
v-if="specForm?.summary"
|
||||||
|
class="mt-3 rounded-lg border border-line-soft bg-wash px-3 py-2 text-xs leading-relaxed"
|
||||||
>
|
>
|
||||||
<span v-if="specForm?.summary" class="font-medium text-ink-2">
|
<span class="font-medium text-ink-2">
|
||||||
预估规格:{{ form.count }} 台 · {{ specForm.summary }}
|
预估规格:{{ form.count }} 台 · {{ specForm.summary }}
|
||||||
</span>
|
</span>
|
||||||
<span>容量不足(Out of host capacity)时可改用抢机任务反复尝试</span>
|
|
||||||
</div>
|
</div>
|
||||||
</FormModal>
|
</FormModal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import FormField from '@/components/FormField.vue'
|
|||||||
import FormSection from '@/components/FormSection.vue'
|
import FormSection from '@/components/FormSection.vue'
|
||||||
import { shortAd } from '@/composables/useFormat'
|
import { shortAd } from '@/composables/useFormat'
|
||||||
import { useAsync } from '@/composables/useAsync'
|
import { useAsync } from '@/composables/useAsync'
|
||||||
|
import type { ComputeShape, LimitItem } from '@/types/api'
|
||||||
|
|
||||||
/** 实例规格表单(创建实例弹窗与抢机任务共用):
|
/** 实例规格表单(创建实例弹窗与抢机任务共用):
|
||||||
* Shape / 可用域 / 规格 / 镜像 / VCN 子网 / 引导卷 / 登录方式 / IP 分配。
|
* Shape / 可用域 / 规格 / 镜像 / VCN 子网 / 引导卷 / 登录方式 / IP 分配。
|
||||||
@@ -22,6 +23,9 @@ const props = defineProps<{
|
|||||||
sectioned?: boolean
|
sectioned?: boolean
|
||||||
/** 可用域字段说明;抢机任务留空为轮询语义,与手动创建(固定 AD-1)不同 */
|
/** 可用域字段说明;抢机任务留空为轮询语义,与手动创建(固定 AD-1)不同 */
|
||||||
adHint?: string
|
adHint?: string
|
||||||
|
/** 创建场景:AD 留空(默认 AD-1)而所选 shape 在 AD-1 无配额时,自动落位首个有配额 AD;
|
||||||
|
* 抢机表单留空 = 轮询语义,勿开 */
|
||||||
|
autoPickAd?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
/** VCN 选择的「自动创建」哨兵:提交时不传 subnetId,由后端建 VCN 与子网 */
|
/** VCN 选择的「自动创建」哨兵:提交时不传 subnetId,由后端建 VCN 与子网 */
|
||||||
@@ -30,8 +34,8 @@ const AUTO_VCN = '__auto__'
|
|||||||
const blank = {
|
const blank = {
|
||||||
availabilityDomain: null as string | null,
|
availabilityDomain: null as string | null,
|
||||||
shape: 'VM.Standard.A1.Flex',
|
shape: 'VM.Standard.A1.Flex',
|
||||||
ocpus: 4,
|
ocpus: 2,
|
||||||
memoryInGBs: 24,
|
memoryInGBs: 12,
|
||||||
imageId: null as string | null,
|
imageId: null as string | null,
|
||||||
vcnId: AUTO_VCN,
|
vcnId: AUTO_VCN,
|
||||||
subnetId: null as string | null,
|
subnetId: null as string | null,
|
||||||
@@ -194,51 +198,82 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
/** shape → OCI compute 配额名(官方 Limits by Service 命名);已知映射用于配额标注,
|
/** 免费类计费类型:仅用于排序置顶,不在选项文案中标注 */
|
||||||
* 清单外的 shape 不判定配额。AD 维度多行求和 > 0 才认为有配额。 */
|
const FREE_BILLING = new Set(['ALWAYS_FREE', 'LIMITED_FREE'])
|
||||||
const SHAPE_QUOTAS: Record<string, string> = {
|
|
||||||
'VM.Standard.A1.Flex': 'standard-a1-core-count',
|
/** shape 的核数配额名:quotaNames 排除 memory / reserved / reservable 变体,
|
||||||
'VM.Standard.A2.Flex': 'standard-a2-core-count',
|
* 剩余为核数(或实例数)限额名,与 compute limits 的 name 同名 */
|
||||||
'VM.Standard.A4.Flex': 'standard-a4-core-count',
|
function coreQuotaNames(s: ComputeShape): string[] {
|
||||||
'VM.Standard.E2.1.Micro': 'standard-e2-micro-core-count',
|
return (s.quotaNames ?? []).filter(
|
||||||
'VM.Standard.E3.Flex': 'standard-e3-core-ad-count',
|
(n) => !n.includes('memory') && !n.includes('reserved') && !n.includes('reservable'),
|
||||||
'VM.Standard.E4.Flex': 'standard-e4-core-count',
|
)
|
||||||
'VM.Standard.E5.Flex': 'standard-e5-core-count',
|
|
||||||
'VM.Standard.E6.Flex': 'standard-e6-core-count',
|
|
||||||
'VM.Standard3.Flex': 'standard3-core-count',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BILLING_LABEL: Record<string, string> = {
|
/** 单个 shape 的配额汇总:AD 行按 AD 求和,REGION 行累计为区域总额;无匹配行返回 null */
|
||||||
ALWAYS_FREE: '永久免费',
|
function shapeQuotaEntry(names: Set<string>, rows: LimitItem[]): ShapeQuota | null {
|
||||||
LIMITED_FREE: '免费额度',
|
const byAd = new Map<string, number>()
|
||||||
|
let regional: number | null = null
|
||||||
|
let matched = false
|
||||||
|
for (const r of rows) {
|
||||||
|
if (!names.has(r.name)) continue
|
||||||
|
matched = true
|
||||||
|
if (r.scopeType === 'AD' && r.availabilityDomain) {
|
||||||
|
byAd.set(r.availabilityDomain, (byAd.get(r.availabilityDomain) ?? 0) + Math.max(r.value, 0))
|
||||||
|
} else if (r.scopeType === 'REGION') {
|
||||||
|
regional = (regional ?? 0) + Math.max(r.value, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return matched ? { byAd, regional } : null
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 已知映射 shape 的核数配额合计;未知映射或配额未加载返回 null(不判定) */
|
interface ShapeQuota {
|
||||||
function quotaOf(shape: string): number | null {
|
byAd: Map<string, number> // AD 全名 → 核数配额
|
||||||
const quota = SHAPE_QUOTAS[shape]
|
regional: number | null // 区域级总额,null = 无区域行
|
||||||
const items = limits.data.value ?? []
|
}
|
||||||
if (!quota || !items.length) return null
|
|
||||||
return items.filter((l) => l.name === quota).reduce((sum, l) => sum + (l.value > 0 ? l.value : 0), 0)
|
/** 全部 shape 的配额汇总;quotaNames 缺失或 limits 无匹配行的 shape 无条目(不判定) */
|
||||||
|
const quotaByShape = computed(() => {
|
||||||
|
const rows = limits.data.value ?? []
|
||||||
|
const out = new Map<string, ShapeQuota>()
|
||||||
|
if (!rows.length) return out
|
||||||
|
for (const s of shapes.data.value ?? []) {
|
||||||
|
const names = new Set(coreQuotaNames(s))
|
||||||
|
if (!names.size) continue
|
||||||
|
const entry = shapeQuotaEntry(names, rows)
|
||||||
|
if (entry) out.set(s.name, entry)
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
})
|
||||||
|
|
||||||
|
/** shape 在指定 AD(null = 任一 AD)是否有配额;null = 数据不足不判定 */
|
||||||
|
function quotaInAd(name: string, ad: string | null): boolean | null {
|
||||||
|
const q = quotaByShape.value.get(name)
|
||||||
|
if (!q) return null
|
||||||
|
if (q.regional !== null && q.regional <= 0) return false
|
||||||
|
if (!q.byAd.size) return true // 仅区域级限额且 > 0
|
||||||
|
if (ad === null) return [...q.byAd.values()].some((v) => v > 0)
|
||||||
|
return (q.byAd.get(ad) ?? 0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 排序:免费 shape 优先 → VM.Standard 系列 → 其他 VM → 裸金属等 */
|
/** 排序:免费 shape 优先 → VM.Standard 系列 → 其他 VM → 裸金属等 */
|
||||||
function shapeRank(s: { billingType: string; name: string }): number {
|
function shapeRank(s: { billingType: string; name: string }): number {
|
||||||
if (BILLING_LABEL[s.billingType]) return 0
|
if (FREE_BILLING.has(s.billingType)) return 0
|
||||||
if (s.name.startsWith('VM.Standard')) return 1
|
if (s.name.startsWith('VM.Standard')) return 1
|
||||||
if (s.name.startsWith('VM.')) return 2
|
if (s.name.startsWith('VM.')) return 2
|
||||||
return 3
|
return 3
|
||||||
}
|
}
|
||||||
|
|
||||||
const shapeOptions = computed(() => {
|
const shapeOptions = computed(() => {
|
||||||
// 清单全部来自 shapes 接口,不做本地预设;接口不可用时仍可手输(tag 模式)
|
// 清单全部来自 shapes 接口,不做本地预设;接口不可用时仍可手输(tag 模式);
|
||||||
|
// 选定 AD 时按该 AD 判定配额,未选时看任一 AD
|
||||||
const list = shapes.data.value ?? []
|
const list = shapes.data.value ?? []
|
||||||
|
const ad = form.availabilityDomain
|
||||||
return [...list]
|
return [...list]
|
||||||
.sort((a, b) => shapeRank(a) - shapeRank(b) || a.name.localeCompare(b.name))
|
.sort((a, b) => shapeRank(a) - shapeRank(b) || a.name.localeCompare(b.name))
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
const free = BILLING_LABEL[s.billingType]
|
const ok = quotaInAd(s.name, ad)
|
||||||
const quota = quotaOf(s.name)
|
const suffix = ok === false ? (ad ? ' · 该 AD 无配额' : ' · 无配额') : ''
|
||||||
const suffix = (free ? `(${free})` : '') + (quota === 0 ? ' · 无配额' : '')
|
return { label: s.name + suffix, value: s.name, disabled: ok === false }
|
||||||
return { label: s.name + suffix, value: s.name, disabled: quota === 0 }
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -288,10 +323,29 @@ const imageOptions = computed(() => {
|
|||||||
.map((i) => ({ label: i.displayName, value: i.id }))
|
.map((i) => ({ label: i.displayName, value: i.id }))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** AD 选项按当前 shape 的配额标注并禁用无配额项;数据不足时不标注 */
|
||||||
const adOptions = computed(
|
const adOptions = computed(
|
||||||
() => ads.data.value?.map((ad) => ({ label: shortAd(ad), value: ad })) ?? [],
|
() =>
|
||||||
|
ads.data.value?.map((ad) => {
|
||||||
|
const ok = quotaInAd(form.shape, ad)
|
||||||
|
return {
|
||||||
|
label: shortAd(ad) + (ok === false ? '(无配额)' : ''),
|
||||||
|
value: ad,
|
||||||
|
disabled: ok === false,
|
||||||
|
}
|
||||||
|
}) ?? [],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 创建场景(autoPickAd):AD 留空将由后端取 AD-1;所选 shape 在 AD-1 无配额
|
||||||
|
// 而其他 AD 有配额时,自动落位首个有配额 AD(字段可见,用户可改)
|
||||||
|
watch([() => form.shape, quotaByShape, () => ads.data.value], () => {
|
||||||
|
if (!props.autoPickAd || form.availabilityDomain !== null) return
|
||||||
|
const list = ads.data.value ?? []
|
||||||
|
if (!list.length || quotaInAd(form.shape, list[0]) !== false) return
|
||||||
|
const target = list.find((ad) => quotaInAd(form.shape, ad) === true)
|
||||||
|
if (target) form.availabilityDomain = target
|
||||||
|
})
|
||||||
|
|
||||||
const vcnOptions = computed(() => [
|
const vcnOptions = computed(() => [
|
||||||
{ label: '自动创建(oci-portal-auto-vcn)', value: AUTO_VCN },
|
{ label: '自动创建(oci-portal-auto-vcn)', value: AUTO_VCN },
|
||||||
...(vcns.data.value ?? []).map((v) => ({ label: v.displayName, value: v.id })),
|
...(vcns.data.value ?? []).map((v) => ({ label: v.displayName, value: v.id })),
|
||||||
@@ -325,12 +379,10 @@ const valid = computed(() => {
|
|||||||
return !isFlex.value || form.ocpus > 0
|
return !isFlex.value || form.ocpus > 0
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 规格摘要(父表单底部预估条用):shape 短名 + 弹性核内存 + 免费标注 */
|
/** 规格摘要(父表单底部预估条用):shape 短名 + 弹性核内存 */
|
||||||
const summary = computed(() => {
|
const summary = computed(() => {
|
||||||
const parts = [form.shape.replace(/^VM\.Standard\.?/, '') || form.shape]
|
const parts = [form.shape.replace(/^VM\.Standard\.?/, '') || form.shape]
|
||||||
if (isFlex.value) parts.push(`${form.ocpus} OCPU · ${form.memoryInGBs} GB`)
|
if (isFlex.value) parts.push(`${form.ocpus} OCPU · ${form.memoryInGBs} GB`)
|
||||||
const free = selectedShape.value && BILLING_LABEL[selectedShape.value.billingType]
|
|
||||||
if (free) parts.push(free)
|
|
||||||
return parts.join(' · ')
|
return parts.join(' · ')
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -366,7 +418,7 @@ defineExpose({ valid, buildSpec, reset, applySpec, summary })
|
|||||||
<FormField
|
<FormField
|
||||||
label="Shape"
|
label="Shape"
|
||||||
required
|
required
|
||||||
hint="清单来自租户当前区域实际提供的 shape(免费与无配额已标注),可手输其他"
|
hint="清单来自租户当前区域实际提供的 shape(无配额已标注),可手输其他"
|
||||||
>
|
>
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="form.shape"
|
v-model:value="form.shape"
|
||||||
|
|||||||
@@ -37,18 +37,10 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const BILLING_LABEL: Record<string, string> = {
|
|
||||||
ALWAYS_FREE: '永久免费',
|
|
||||||
LIMITED_FREE: '免费额度',
|
|
||||||
}
|
|
||||||
|
|
||||||
const shapeOptions = computed(() => {
|
const shapeOptions = computed(() => {
|
||||||
const list = shapes.data.value ?? []
|
const list = shapes.data.value ?? []
|
||||||
if (!list.length) return [{ label: form.shape, value: form.shape }]
|
if (!list.length) return [{ label: form.shape, value: form.shape }]
|
||||||
return list.map((s) => {
|
return list.map((s) => ({ label: s.name, value: s.name }))
|
||||||
const free = BILLING_LABEL[s.billingType]
|
|
||||||
return { label: s.name + (free ? `(${free})` : ''), value: s.name }
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const selectedShape = computed(
|
const selectedShape = computed(
|
||||||
@@ -141,7 +133,7 @@ async function submit() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="text-xs leading-relaxed text-ink-3">
|
<div class="text-xs leading-relaxed text-ink-3">
|
||||||
运行中实例 OCI 会自动重启完成变更;更换 shape 要求镜像与目标 shape 架构兼容(如 aarch64
|
运行中实例 OCI 会自动重启完成变更;更换 shape 要求镜像与目标 shape 架构兼容(如 aarch64
|
||||||
镜像不能换到 x86 shape)。A1 免费额度上限 4 OCPU / 24 GB。
|
镜像不能换到 x86 shape)。
|
||||||
</div>
|
</div>
|
||||||
</FormModal>
|
</FormModal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -27,9 +27,15 @@ const emit = defineEmits<{ changed: [] }>()
|
|||||||
const message = useToast()
|
const message = useToast()
|
||||||
const vnics = useAsync(() => listVnics(props.cfgId, props.instanceId, props.region))
|
const vnics = useAsync(() => listVnics(props.cfgId, props.instanceId, props.region))
|
||||||
|
|
||||||
|
/** 附加已受理但 OCI 挂载列表有可见性延迟:限时轮询等新卡入列,入列后交由过渡态轮询接管 */
|
||||||
|
const expectAtLeast = ref(0)
|
||||||
|
let expectUntil = 0
|
||||||
|
|
||||||
useTransientPoll(
|
useTransientPoll(
|
||||||
() => vnics.data.value,
|
() => vnics.data.value,
|
||||||
(list) => !!list?.some((v) => ATTACHMENT_TRANSIENT_STATES.includes(v.lifecycleState)),
|
(list) =>
|
||||||
|
!!list?.some((v) => ATTACHMENT_TRANSIENT_STATES.includes(v.lifecycleState)) ||
|
||||||
|
((list?.length ?? 0) < expectAtLeast.value && Date.now() < expectUntil),
|
||||||
() => void vnics.run({ silent: true }),
|
() => void vnics.run({ silent: true }),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -44,6 +50,12 @@ function refresh() {
|
|||||||
emit('changed')
|
emit('changed')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onAttached() {
|
||||||
|
expectAtLeast.value = (vnics.data.value ?? []).length + 1
|
||||||
|
expectUntil = Date.now() + 90_000
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
async function doDetach(attachmentId: string) {
|
async function doDetach(attachmentId: string) {
|
||||||
detaching.value = attachmentId
|
detaching.value = attachmentId
|
||||||
try {
|
try {
|
||||||
@@ -174,7 +186,7 @@ defineExpose({ refresh: () => vnics.run() })
|
|||||||
<td colspan="6" class="px-4.5 pt-0 pb-2.5">
|
<td colspan="6" class="px-4.5 pt-0 pb-2.5">
|
||||||
<div class="flex flex-wrap items-center gap-1.5">
|
<div class="flex flex-wrap items-center gap-1.5">
|
||||||
<span class="text-[10.5px] font-medium tracking-wider text-ink-3">IPV6</span>
|
<span class="text-[10.5px] font-medium tracking-wider text-ink-3">IPV6</span>
|
||||||
<template v-if="v.vnicId">
|
<template v-if="v.vnicId && v.lifecycleState === 'ATTACHED'">
|
||||||
<span
|
<span
|
||||||
v-for="addr in v.ipv6Addresses ?? []"
|
v-for="addr in v.ipv6Addresses ?? []"
|
||||||
:key="addr"
|
:key="addr"
|
||||||
@@ -204,7 +216,9 @@ defineExpose({ refresh: () => vnics.run() })
|
|||||||
+ IPv6
|
+ IPv6
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
<span v-else class="text-xs text-ink-3">无 · 附加完成后可添加</span>
|
<span v-else class="text-xs text-ink-3">
|
||||||
|
{{ v.vnicId ? '网卡未在挂载状态,不可操作 IPv6' : '无 · 附加完成后可添加' }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -221,7 +235,7 @@ defineExpose({ refresh: () => vnics.run() })
|
|||||||
|
|
||||||
<FootNote>
|
<FootNote>
|
||||||
附加须实例运行中且 shape 有空余 VNIC 配额 · 主网卡不可分离 · 每卡 IPv6
|
附加须实例运行中且 shape 有空余 VNIC 配额 · 主网卡不可分离 · 每卡 IPv6
|
||||||
可多个(要求所在子网已启用 IPv6)· 次要网卡在 OS 内需自行配置 IP(dhclient / netplan)
|
可多个(要求所在子网已启用 IPv6)
|
||||||
</FootNote>
|
</FootNote>
|
||||||
|
|
||||||
<AttachVnicModal
|
<AttachVnicModal
|
||||||
@@ -230,7 +244,7 @@ defineExpose({ refresh: () => vnics.run() })
|
|||||||
:instance-id="instanceId"
|
:instance-id="instanceId"
|
||||||
:region="region"
|
:region="region"
|
||||||
:attached-count="(vnics.data.value ?? []).length"
|
:attached-count="(vnics.data.value ?? []).length"
|
||||||
@attached="refresh"
|
@attached="onAttached"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ function statusCell(row: AiCallLog) {
|
|||||||
function tokensCell(row: AiCallLog) {
|
function tokensCell(row: AiCallLog) {
|
||||||
if (row.errMsg && !row.totalTokens) return h('span', { class: 'text-[13px] text-ink-3' }, '—')
|
if (row.errMsg && !row.totalTokens) return h('span', { class: 'text-[13px] text-ink-3' }, '—')
|
||||||
const flow = row.stream ? ' · 流' : ''
|
const flow = row.stream ? ' · 流' : ''
|
||||||
return h('span', { class: 'mono text-[13px]' }, `${row.promptTokens} / ${row.completionTokens}${flow}`)
|
return h('span', { class: 'mono text-[13px] whitespace-nowrap' }, `${row.promptTokens} / ${row.completionTokens}${flow}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns: DataTableColumns<AiCallLog> = [
|
const columns: DataTableColumns<AiCallLog> = [
|
||||||
@@ -79,7 +79,7 @@ const columns: DataTableColumns<AiCallLog> = [
|
|||||||
{ title: '模型', key: 'model', minWidth: 220, ellipsis: { tooltip: true }, render: (r) => h('span', { class: 'mono text-xs' }, r.model) },
|
{ title: '模型', key: 'model', minWidth: 220, ellipsis: { tooltip: true }, render: (r) => h('span', { class: 'mono text-xs' }, r.model) },
|
||||||
{ title: '渠道', key: 'channelName', minWidth: 180, ellipsis: { tooltip: true }, render: (r) => h('span', { class: 'text-[13px]' }, r.channelName || '—') },
|
{ title: '渠道', key: 'channelName', minWidth: 180, ellipsis: { tooltip: true }, render: (r) => h('span', { class: 'text-[13px]' }, r.channelName || '—') },
|
||||||
{ title: '状态', key: 'status', width: 80, render: statusCell },
|
{ title: '状态', key: 'status', width: 80, render: statusCell },
|
||||||
{ title: 'Tokens(入/出)', key: 'tokens', width: 150, render: tokensCell },
|
{ title: 'Tokens(入/出)', key: 'tokens', width: 190, render: tokensCell },
|
||||||
{ title: '耗时', key: 'latencyMs', width: 80, render: (r) => h('span', { class: 'mono text-[13px]' }, fmtLatency(r.latencyMs)) },
|
{ title: '耗时', key: 'latencyMs', width: 80, render: (r) => h('span', { class: 'mono text-[13px]' }, fmtLatency(r.latencyMs)) },
|
||||||
{ title: '重试', key: 'retries', width: 60, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.retries)) },
|
{ title: '重试', key: 'retries', width: 60, render: (r) => h('span', { class: 'mono text-[13px]' }, String(r.retries)) },
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -240,15 +240,15 @@ useAutoRefresh(() => load(true))
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:scroll-x="880"
|
:scroll-x="880"
|
||||||
:max-height="480"
|
|
||||||
:row-key="(r: LogEvent) => r.id"
|
:row-key="(r: LogEvent) => r.id"
|
||||||
:row-props="rowProps"
|
:row-props="rowProps"
|
||||||
/>
|
/>
|
||||||
<FootNote>
|
<FootNote>
|
||||||
在租户详情「其他」tab 一键创建链路后,实例生命周期(Launch/Terminate/InstanceAction)、
|
在租户详情「其他」tab 一键创建链路后,实例终止与电源操作(Terminate/InstanceAction;
|
||||||
用户与凭据(Create/Delete/UpdateUser、Create/DeleteApiKey、UpdateUserCapabilities)、
|
创建不回传,避免面板抢机与批量创建刷屏)、用户与凭据(Create/Delete/UpdateUser、
|
||||||
区域订阅与策略变更等关键审计事件将自动回传;消息按 MessageId 幂等去重,保留 90
|
Create/DeleteApiKey、UpdateUserCapabilities)、区域订阅与策略变更等关键审计事件将自动回传;
|
||||||
天、总量超 2 万条时删除最旧,关键事件另经「通知管理 → 云端事件」推送告警
|
消息按 MessageId 幂等去重,保留 90 天、总量超 2 万条时删除最旧,关键事件另经
|
||||||
|
「通知管理 → 云端事件」推送告警
|
||||||
</FootNote>
|
</FootNote>
|
||||||
|
|
||||||
<NModal v-model:show="showDetail" preset="card" closable :style="{ width: '720px', maxWidth: 'calc(100vw - 24px)' }">
|
<NModal v-model:show="showDetail" preset="card" closable :style="{ width: '720px', maxWidth: 'calc(100vw - 24px)' }">
|
||||||
|
|||||||
@@ -190,6 +190,13 @@ function renderGeo(row: ProxyInfo) {
|
|||||||
return h('span', { class: 'text-[13px]' }, row.city ? `${row.country}·${row.city}` : row.country)
|
return h('span', { class: 'text-[13px]' }, row.city ? `${row.country}·${row.city}` : row.country)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 状态单元格:与地区探测同源 —— 探测经该代理链路发起,失败即代理不可用 */
|
||||||
|
function renderStatus(row: ProxyInfo) {
|
||||||
|
if (!row.geoAt) return h(StatusBadge, { kind: 'check', label: '检测中' })
|
||||||
|
const ok = !!row.country
|
||||||
|
return h(StatusBadge, { kind: ok ? 'run' : 'term', label: ok ? '正常' : '异常' })
|
||||||
|
}
|
||||||
|
|
||||||
// 新增 / 批量导入入口由页面标题行触发(ProxyListView),这里暴露打开方法
|
// 新增 / 批量导入入口由页面标题行触发(ProxyListView),这里暴露打开方法
|
||||||
defineExpose({ openCreate, openImport })
|
defineExpose({ openCreate, openImport })
|
||||||
|
|
||||||
@@ -215,6 +222,7 @@ const columns: DataTableColumns<ProxyInfo> = [
|
|||||||
render: (row) => h('span', { class: 'mono text-[12.5px] text-ink-2' }, `${row.host}:${row.port}`),
|
render: (row) => h('span', { class: 'mono text-[12.5px] text-ink-2' }, `${row.host}:${row.port}`),
|
||||||
},
|
},
|
||||||
{ title: '地区', key: 'geo', minWidth: 120, render: renderGeo },
|
{ title: '地区', key: 'geo', minWidth: 120, render: renderGeo },
|
||||||
|
{ title: '状态', key: 'status', width: 88, render: renderStatus },
|
||||||
{
|
{
|
||||||
title: '认证',
|
title: '认证',
|
||||||
key: 'username',
|
key: 'username',
|
||||||
@@ -272,7 +280,7 @@ const columns: DataTableColumns<ProxyInfo> = [
|
|||||||
:row-key="(r: ProxyInfo) => r.id"
|
:row-key="(r: ProxyInfo) => r.id"
|
||||||
/>
|
/>
|
||||||
<FootNote>
|
<FootNote>
|
||||||
支持 SOCKS5 / HTTP / HTTPS;密码 AES 加密存储、不回显明文;地区为经代理实测的出口位置(ip-api.com),创建后自动检测;被租户关联的代理不可删除,请先解除关联
|
支持 SOCKS5 / HTTP / HTTPS;密码 AES 加密存储、不回显明文;地区与状态为经代理实测的出口探测结果(ip-api.com),创建后自动检测,探测失败即视为异常,可点「重测」复查;被租户关联的代理不可删除,请先解除关联
|
||||||
</FootNote>
|
</FootNote>
|
||||||
|
|
||||||
<ProxyTenantsModal
|
<ProxyTenantsModal
|
||||||
|
|||||||
@@ -0,0 +1,264 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { NButton, NInputNumber, NSpin, NSwitch } from 'naive-ui'
|
||||||
|
import { reactive, ref, watch } from 'vue'
|
||||||
|
|
||||||
|
import { getAiSettings, listAiBlacklist, removeAiBlacklist, updateAiSettings } from '@/api/aigateway'
|
||||||
|
import BlacklistAddModal from '@/components/settings/BlacklistAddModal.vue'
|
||||||
|
import { useAsync } from '@/composables/useAsync'
|
||||||
|
import { fmtTime } from '@/composables/useFormat'
|
||||||
|
import { useToast } from '@/composables/useToast'
|
||||||
|
import type { AiSettings } from '@/types/api'
|
||||||
|
|
||||||
|
const toast = useToast()
|
||||||
|
|
||||||
|
const settings = useAsync(getAiSettings)
|
||||||
|
const blacklist = useAsync(listAiBlacklist)
|
||||||
|
|
||||||
|
/** 本地表单镜像:开关即时提交,数字输入失焦/回车提交 */
|
||||||
|
const form = reactive<AiSettings>({
|
||||||
|
filterDeprecated: false,
|
||||||
|
streamGuardEnabled: true,
|
||||||
|
streamGuardKB: 60,
|
||||||
|
grokWebSearch: true,
|
||||||
|
grokXSearch: true,
|
||||||
|
upstreamWaitSeconds: 300,
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => settings.data.value,
|
||||||
|
(v) => {
|
||||||
|
if (v) Object.assign(form, v)
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
const saving = ref(false)
|
||||||
|
|
||||||
|
/** 全量 PUT;失败回滚到服务端最新值 */
|
||||||
|
async function save() {
|
||||||
|
saving.value = true
|
||||||
|
try {
|
||||||
|
Object.assign(form, await updateAiSettings({ ...form }))
|
||||||
|
toast.success('已保存,即时生效')
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '保存失败')
|
||||||
|
void settings.run({ silent: true })
|
||||||
|
} finally {
|
||||||
|
saving.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setField<K extends keyof AiSettings>(key: K, value: AiSettings[K]) {
|
||||||
|
form[key] = value
|
||||||
|
void save()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 阈值失焦/回车提交;NInputNumber 已按 min/max 收敛 */
|
||||||
|
function commitGuardKB(v: number | null) {
|
||||||
|
if (v == null || v === form.streamGuardKB) return
|
||||||
|
setField('streamGuardKB', v)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 上游无响应预算失焦/回车提交 */
|
||||||
|
function commitUpstreamWait(v: number | null) {
|
||||||
|
if (v == null || v === form.upstreamWaitSeconds) return
|
||||||
|
setField('upstreamWaitSeconds', v)
|
||||||
|
}
|
||||||
|
|
||||||
|
const removing = ref(0)
|
||||||
|
async function doRemove(id: number, name: string) {
|
||||||
|
removing.value = id
|
||||||
|
try {
|
||||||
|
await removeAiBlacklist(id)
|
||||||
|
toast.success(`已移出黑名单:${name},重新同步渠道后恢复`)
|
||||||
|
void blacklist.run({ silent: true })
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '移出失败')
|
||||||
|
} finally {
|
||||||
|
removing.value = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const showAdd = ref(false)
|
||||||
|
function onBlacklistChanged() {
|
||||||
|
void blacklist.run({ silent: true })
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="settings.loading.value && !settings.data.value" class="panel flex max-w-[880px] items-center justify-center py-20">
|
||||||
|
<NSpin size="small" />
|
||||||
|
</div>
|
||||||
|
<div v-else class="flex max-w-[880px] flex-col gap-4">
|
||||||
|
<!-- Responses 直通防护 -->
|
||||||
|
<div class="panel">
|
||||||
|
<div class="border-b border-line-soft px-4.5 py-3.5">
|
||||||
|
<div class="text-sm font-semibold">Responses 直通</div>
|
||||||
|
</div>
|
||||||
|
<div class="px-4.5">
|
||||||
|
<div class="flex items-center justify-between gap-3 border-b border-line-soft py-3.5">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<div class="text-[13px] font-medium">流式保险丝:instructions + tools 阈值</div>
|
||||||
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
|
系统提示与工具定义合计超过阈值的流式请求,预防性改走非流式上游并合成
|
||||||
|
SSE:丢增量输出,保会话不中断
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-none items-center gap-3">
|
||||||
|
<NInputNumber
|
||||||
|
:value="form.streamGuardKB"
|
||||||
|
:min="1"
|
||||||
|
:max="1024"
|
||||||
|
:show-button="false"
|
||||||
|
:disabled="!form.streamGuardEnabled"
|
||||||
|
size="small"
|
||||||
|
class="w-24"
|
||||||
|
:update-value-on-input="false"
|
||||||
|
@update:value="commitGuardKB"
|
||||||
|
>
|
||||||
|
<template #suffix><span class="text-xs text-ink-3">KB</span></template>
|
||||||
|
</NInputNumber>
|
||||||
|
<NSwitch
|
||||||
|
:value="form.streamGuardEnabled"
|
||||||
|
size="small"
|
||||||
|
:loading="saving"
|
||||||
|
@update:value="(v: boolean) => setField('streamGuardEnabled', v)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-3 py-3.5">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<div class="text-[13px] font-medium">上游无响应预算</div>
|
||||||
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
|
非流式为单次尝试总超时,流式为等待响应头上限,响应头到达后不限制流时长;
|
||||||
|
multi-agent / 搜索类模型单次调用可达 3 分钟,建议 ≥300 秒
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-none items-center gap-3">
|
||||||
|
<NInputNumber
|
||||||
|
:value="form.upstreamWaitSeconds"
|
||||||
|
:min="30"
|
||||||
|
:max="900"
|
||||||
|
:show-button="false"
|
||||||
|
size="small"
|
||||||
|
class="w-24"
|
||||||
|
:update-value-on-input="false"
|
||||||
|
@update:value="commitUpstreamWait"
|
||||||
|
>
|
||||||
|
<template #suffix><span class="text-xs text-ink-3">秒</span></template>
|
||||||
|
</NInputNumber>
|
||||||
|
<!-- 隐形开关与上一行等宽占位,保证两行输入框网格对齐 -->
|
||||||
|
<NSwitch class="invisible" size="small" aria-hidden="true" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="border-t border-line-soft bg-wash px-4.5 py-2.5 text-xs leading-relaxed text-ink-3">
|
||||||
|
修改即时生效,无需重启 · 仅作用于 Responses 直通面;Chat / Messages 已有断流自动重做兜底
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- grok 服务端搜索工具 -->
|
||||||
|
<div class="panel">
|
||||||
|
<div class="border-b border-line-soft px-4.5 py-3.5">
|
||||||
|
<div class="text-sm font-semibold">grok 服务端搜索工具</div>
|
||||||
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
|
仅对 <span class="mono">xai.</span> 前缀模型的对话请求生效;请求 tools
|
||||||
|
已包含同名工具时保持原样,不覆盖参数
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="px-4.5">
|
||||||
|
<div class="flex items-center justify-between gap-3 border-b border-line-soft py-3">
|
||||||
|
<div class="text-[13px] font-medium">默认开启 web_search</div>
|
||||||
|
<NSwitch
|
||||||
|
:value="form.grokWebSearch"
|
||||||
|
size="small"
|
||||||
|
:loading="saving"
|
||||||
|
@update:value="(v: boolean) => setField('grokWebSearch', v)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-3 py-3">
|
||||||
|
<div class="text-[13px] font-medium">默认开启 x_search</div>
|
||||||
|
<NSwitch
|
||||||
|
:value="form.grokXSearch"
|
||||||
|
size="small"
|
||||||
|
:loading="saving"
|
||||||
|
@update:value="(v: boolean) => setField('grokXSearch', v)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 模型治理(自 AI 网关页迁入) -->
|
||||||
|
<div class="panel">
|
||||||
|
<div class="border-b border-line-soft px-4.5 py-3.5">
|
||||||
|
<div class="text-sm font-semibold">模型治理</div>
|
||||||
|
</div>
|
||||||
|
<div class="px-4.5 pb-4">
|
||||||
|
<div class="flex items-center justify-between gap-3 border-b border-line-soft py-3.5">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<div class="text-[13px] font-medium">过滤弃用模型</div>
|
||||||
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
|
开启后,已宣布弃用(即使未退役)的模型从模型列表与路由中排除;关闭恢复展示
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<NSwitch
|
||||||
|
:value="form.filterDeprecated"
|
||||||
|
size="small"
|
||||||
|
:loading="saving"
|
||||||
|
@update:value="(v: boolean) => setField('filterDeprecated', v)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-3 pt-3.5 pb-1">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<div class="text-[13px] font-medium">模型黑名单</div>
|
||||||
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
|
命中的模型从模型列表与路由排除,重新同步渠道后移出才恢复
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<NButton size="tiny" quaternary type="primary" @click="showAdd = true">+ 添加模型</NButton>
|
||||||
|
</div>
|
||||||
|
<table class="mt-1.5 w-full border-collapse">
|
||||||
|
<thead>
|
||||||
|
<tr class="border-y border-line-soft text-left text-xs font-medium text-ink-3">
|
||||||
|
<th class="w-[52%] px-3 py-2">模型</th>
|
||||||
|
<th class="px-3 py-2">加入时间</th>
|
||||||
|
<th class="w-22 px-3 py-2">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="b in blacklist.data.value ?? []"
|
||||||
|
:key="b.id"
|
||||||
|
class="border-b border-line-soft last:border-b-0"
|
||||||
|
>
|
||||||
|
<td class="px-3 py-2"><span class="mono text-[13px]">{{ b.name }}</span></td>
|
||||||
|
<td class="px-3 py-2 text-xs text-ink-3">{{ fmtTime(b.createdAt) }}</td>
|
||||||
|
<td class="px-3 py-2">
|
||||||
|
<NButton
|
||||||
|
size="tiny"
|
||||||
|
quaternary
|
||||||
|
type="error"
|
||||||
|
:loading="removing === b.id"
|
||||||
|
@click="doRemove(b.id, b.name)"
|
||||||
|
>
|
||||||
|
移出
|
||||||
|
</NButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="!(blacklist.data.value ?? []).length">
|
||||||
|
<td colspan="3" class="px-3 py-6 text-center text-xs text-ink-3">
|
||||||
|
黑名单为空;点右上「+ 添加模型」从聚合模型目录选择
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<BlacklistAddModal
|
||||||
|
v-model:show="showAdd"
|
||||||
|
:blacklisted="(blacklist.data.value ?? []).map((b) => b.name)"
|
||||||
|
@changed="onBlacklistChanged"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { NInput, NModal } from 'naive-ui'
|
||||||
|
import { computed, ref, watch } from 'vue'
|
||||||
|
|
||||||
|
import { addAiBlacklist, listAiModelCatalog } from '@/api/aigateway'
|
||||||
|
import { useToast } from '@/composables/useToast'
|
||||||
|
import type { AiCatalogModel } from '@/types/api'
|
||||||
|
|
||||||
|
const props = defineProps<{ show: boolean; blacklisted: string[] }>()
|
||||||
|
const emit = defineEmits<{ 'update:show': [boolean]; changed: [] }>()
|
||||||
|
|
||||||
|
const toast = useToast()
|
||||||
|
|
||||||
|
const rows = ref<AiCatalogModel[]>([])
|
||||||
|
const loading = ref(false)
|
||||||
|
const adding = ref('')
|
||||||
|
const filter = ref('')
|
||||||
|
|
||||||
|
const CAP_ORDER = ['CHAT', 'EMBEDDING', 'RERANK', 'TTS']
|
||||||
|
const CAP_LABEL: Record<string, string> = { CHAT: '对话', EMBEDDING: '向量', RERANK: '重排', TTS: '语音' }
|
||||||
|
|
||||||
|
const bannedSet = computed(() => new Set(props.blacklisted))
|
||||||
|
|
||||||
|
/** 按能力分组 + 关键字过滤,与渠道「模型列表」弹窗同构 */
|
||||||
|
const groups = computed(() => {
|
||||||
|
const kw = filter.value.trim().toLowerCase()
|
||||||
|
const buckets = new Map<string, AiCatalogModel[]>()
|
||||||
|
for (const r of rows.value) {
|
||||||
|
if (kw && !r.name.toLowerCase().includes(kw)) continue
|
||||||
|
buckets.set(r.capability, [...(buckets.get(r.capability) ?? []), r])
|
||||||
|
}
|
||||||
|
const order = [...CAP_ORDER, ...[...buckets.keys()].filter((c) => !CAP_ORDER.includes(c))]
|
||||||
|
return order
|
||||||
|
.filter((cap) => buckets.has(cap))
|
||||||
|
.map((cap) => ({ cap, label: CAP_LABEL[cap] ?? cap, items: buckets.get(cap)! }))
|
||||||
|
})
|
||||||
|
|
||||||
|
const shownCount = computed(() => groups.value.reduce((n, g) => n + g.items.length, 0))
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.show,
|
||||||
|
(show) => {
|
||||||
|
if (show) {
|
||||||
|
filter.value = ''
|
||||||
|
void reload()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
async function reload() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
rows.value = await listAiModelCatalog()
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '加载失败')
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 弹窗即添加场景,意图明确不做二次确认;可在黑名单中移出恢复 */
|
||||||
|
async function doBan(name: string) {
|
||||||
|
if (adding.value) return
|
||||||
|
adding.value = name
|
||||||
|
try {
|
||||||
|
await addAiBlacklist(name)
|
||||||
|
toast.success(`已拉黑:${name}`)
|
||||||
|
emit('changed')
|
||||||
|
} catch (e) {
|
||||||
|
toast.error(e instanceof Error ? e.message : '拉黑失败')
|
||||||
|
} finally {
|
||||||
|
adding.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NModal
|
||||||
|
:show="show"
|
||||||
|
preset="card"
|
||||||
|
:style="{ width: '640px', maxWidth: 'calc(100vw - 24px)' }"
|
||||||
|
@update:show="emit('update:show', $event)"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<div>
|
||||||
|
<div class="text-[15px] leading-tight font-semibold">添加到模型黑名单</div>
|
||||||
|
<div class="mt-1 text-xs font-normal text-ink-3">聚合全部渠道的可用模型</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2 pb-2">
|
||||||
|
<NInput v-model:value="filter" size="small" placeholder="过滤模型名…" clearable class="min-w-0 flex-1" />
|
||||||
|
<span class="flex-none text-xs whitespace-nowrap text-ink-3">
|
||||||
|
{{ filter ? `${shownCount} / ${rows.length}` : `${rows.length} 个模型` }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="-mx-2 max-h-[58vh] overflow-y-auto">
|
||||||
|
<div v-if="loading" class="py-10 text-center text-xs text-ink-3">加载中…</div>
|
||||||
|
<template v-else>
|
||||||
|
<template v-for="g in groups" :key="g.cap">
|
||||||
|
<div class="px-3 pt-3 pb-1 text-[11.5px] font-semibold tracking-wide text-ink-3">
|
||||||
|
{{ g.label }} <span class="font-normal">· {{ g.items.length }}</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="r in g.items"
|
||||||
|
:key="r.name"
|
||||||
|
class="group flex items-center gap-2 rounded-lg px-3 py-[5px] hover:bg-row-hover"
|
||||||
|
>
|
||||||
|
<span class="mono min-w-0 truncate text-[13px]" :class="bannedSet.has(r.name) ? 'text-ink-3/60' : ''">
|
||||||
|
{{ r.name }}
|
||||||
|
</span>
|
||||||
|
<span class="min-w-0 flex-1" />
|
||||||
|
<span v-if="bannedSet.has(r.name)" class="flex-none px-1.5 text-xs text-ink-3/50">已拉黑</span>
|
||||||
|
<button
|
||||||
|
v-else
|
||||||
|
type="button"
|
||||||
|
class="flex-none cursor-pointer rounded-[5px] px-1.5 py-0.5 text-xs text-ink-3/70 group-hover:text-err hover:bg-err/10"
|
||||||
|
:disabled="!!adding"
|
||||||
|
@click="doBan(r.name)"
|
||||||
|
>
|
||||||
|
{{ adding === r.name ? '拉黑中…' : '拉黑' }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div v-if="!shownCount" class="py-10 text-center text-xs text-ink-3">
|
||||||
|
{{ rows.length ? '无匹配模型' : '暂无模型缓存,先在 AI 网关同步渠道模型' }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-1 border-t border-line-soft pt-2.5 text-[11.5px] leading-relaxed text-ink-3">
|
||||||
|
<span class="font-medium text-ink-2">拉黑</span>:全局生效,从全部渠道剔除 ·
|
||||||
|
移出后重新同步渠道恢复 · 已拉黑的模型置灰
|
||||||
|
</div>
|
||||||
|
</NModal>
|
||||||
|
</template>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NDataTable, NModal, type DataTableColumns } from 'naive-ui'
|
import { NButton, NDataTable, NInput, NInputGroup, NInputGroupLabel, NModal, type DataTableColumns } from 'naive-ui'
|
||||||
import { computed, h, onMounted, reactive, ref } from 'vue'
|
import { computed, h, onMounted, reactive, ref, watch } from 'vue'
|
||||||
|
|
||||||
import { getAuditEventDetail, listAuditEvents } from '@/api/tenant'
|
import { getAuditEventDetail, listAuditEvents } from '@/api/tenant'
|
||||||
import DetailFieldList, { type DetailRow } from '@/components/DetailFieldList.vue'
|
import DetailFieldList, { type DetailRow } from '@/components/DetailFieldList.vue'
|
||||||
@@ -23,23 +23,74 @@ const rows = ref<AuditEvent[]>([])
|
|||||||
// 服务端分窗回溯游标:空且 exhausted 表示已到 365 天保留期尽头
|
// 服务端分窗回溯游标:空且 exhausted 表示已到 365 天保留期尽头
|
||||||
const cursor = ref('')
|
const cursor = ref('')
|
||||||
const exhausted = ref(false)
|
const exhausted = ref(false)
|
||||||
|
// 服务端全文检索关键字;变化即重置信息流
|
||||||
|
const q = ref('')
|
||||||
|
// 已完整回溯到的时刻(比它更新的时段已扫完),检索命中稀疏时给用户方位感
|
||||||
|
const scannedThrough = ref('')
|
||||||
|
// 信息流代次:刷新/换关键字自增,用于丢弃仍在途的过期响应
|
||||||
|
let gen = 0
|
||||||
|
let qTimer: ReturnType<typeof setTimeout> | undefined
|
||||||
|
// 当前信息流对应的关键字;回车/防抖只在关键字实际变化时才重查,避免重复请求
|
||||||
|
let loadedQ: string | null = null
|
||||||
|
// 连续自动补批计数:搜索命中稀疏时封顶,不能无人值守扫完整个保留期
|
||||||
|
let autoFills = 0
|
||||||
|
const maxAutoFills = 2
|
||||||
|
|
||||||
|
// 关键字防抖:停止输入 500ms 后按新关键字重查;回车/清空即时生效
|
||||||
|
watch(q, () => {
|
||||||
|
clearTimeout(qTimer)
|
||||||
|
if (q.value.trim() === loadedQ) return
|
||||||
|
qTimer = setTimeout(() => void load(), 500)
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 回车/清空的即时提交:关键字未变则不发起重复搜索 */
|
||||||
|
function submitSearch() {
|
||||||
|
clearTimeout(qTimer)
|
||||||
|
if (q.value.trim() !== loadedQ) void load()
|
||||||
|
}
|
||||||
|
|
||||||
const pageCount = computed(() => Math.max(1, Math.ceil(rows.value.length / pagination.pageSize)))
|
const pageCount = computed(() => Math.max(1, Math.ceil(rows.value.length / pagination.pageSize)))
|
||||||
const hasMore = computed(() => cursor.value !== '' && !exhausted.value)
|
const hasMore = computed(() => cursor.value !== '' && !exhausted.value)
|
||||||
|
|
||||||
|
/** 回溯进度 = min(游标窗上界, 已加载最旧事件):窗内续翻时游标上界还停在窗口右缘,
|
||||||
|
* 直接展示会显示成当前时刻;两者取更早才反映真实扫描位置 */
|
||||||
|
const scanProgress = computed(() => {
|
||||||
|
const oldest = rows.value.length ? (rows.value[rows.value.length - 1].eventTime ?? '') : ''
|
||||||
|
if (!scannedThrough.value || !oldest) return scannedThrough.value || oldest
|
||||||
|
return scannedThrough.value < oldest ? scannedThrough.value : oldest
|
||||||
|
})
|
||||||
|
|
||||||
/** 受控分页:字面量对象会在重渲染时被重建导致页大小切换失效 */
|
/** 受控分页:字面量对象会在重渲染时被重建导致页大小切换失效 */
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
showSizePicker: true,
|
showSizePicker: true,
|
||||||
pageSizes: [20, 50, 100],
|
pageSizes: [20, 50, 100],
|
||||||
prefix: () =>
|
/** 状态行:加载中/尽头给文案;停驻且还有更早数据时给「加载更早」按钮,
|
||||||
`已加载 ${rows.value.length} 条 · ` +
|
* 自动补批封顶后由用户显式接力,不会无人值守扫完整个保留期 */
|
||||||
(loadingMore.value ? '正在加载更早…' : exhausted.value ? '已到 365 天保留期尽头' : '翻到末页自动加载更早'),
|
prefix: () => {
|
||||||
|
const parts = [`已加载 ${rows.value.length} 条`]
|
||||||
|
if (scanProgress.value && !exhausted.value) parts.push(`已回溯至 ${fmtTime(scanProgress.value)}`)
|
||||||
|
if (exhausted.value) parts.push('已到 365 天保留期尽头')
|
||||||
|
const text = parts.join(' · ')
|
||||||
|
if (loadingMore.value) return `${text} · 正在加载更早…`
|
||||||
|
if (!hasMore.value) return text
|
||||||
|
return h('span', { class: 'inline-flex items-center gap-1.5' }, [
|
||||||
|
`${text} ·`,
|
||||||
|
h(
|
||||||
|
NButton,
|
||||||
|
{ size: 'tiny', quaternary: true, type: 'primary', onClick: () => { autoFills = 0; void fetchBatch() } },
|
||||||
|
{ default: () => '加载更早' },
|
||||||
|
),
|
||||||
|
])
|
||||||
|
},
|
||||||
onUpdatePage: (p: number) => {
|
onUpdatePage: (p: number) => {
|
||||||
pagination.page = p
|
pagination.page = p
|
||||||
// 懒加载触发点:翻到已加载数据的最后一页即向后端续取一批
|
// 懒加载触发点:翻到已加载数据的最后一页即向后端续取一批(用户动作,重置自动补批额度)
|
||||||
if (p >= pageCount.value) void fetchBatch()
|
if (p >= pageCount.value) {
|
||||||
|
autoFills = 0
|
||||||
|
void fetchBatch()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onUpdatePageSize: (ps: number) => {
|
onUpdatePageSize: (ps: number) => {
|
||||||
pagination.pageSize = ps
|
pagination.pageSize = ps
|
||||||
@@ -47,35 +98,45 @@ const pagination = reactive({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 重置信息流:回到最新一批 */
|
/** 重置信息流:回到最新一批(刷新按钮与关键字变化共用) */
|
||||||
async function load() {
|
async function load() {
|
||||||
|
clearTimeout(qTimer)
|
||||||
|
const g = ++gen
|
||||||
|
loadedQ = q.value.trim()
|
||||||
|
autoFills = 0
|
||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = ''
|
error.value = ''
|
||||||
rows.value = []
|
rows.value = []
|
||||||
cursor.value = ''
|
cursor.value = ''
|
||||||
exhausted.value = false
|
exhausted.value = false
|
||||||
|
scannedThrough.value = ''
|
||||||
pagination.page = 1
|
pagination.page = 1
|
||||||
try {
|
try {
|
||||||
await fetchBatch(true)
|
await fetchBatch(true)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
if (g === gen) loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 向更早方向续取一批(~100 条):追加去重后按时间重排;
|
/** 向更早方向续取一批(~200 条):追加去重后按时间重排;
|
||||||
* 末页不满且还有更早数据时自动补一批,避免首屏残页 */
|
* 末页不满且还有更早数据时自动补一批,避免首屏残页;
|
||||||
|
* 代次不符的在途响应直接丢弃,防止旧关键字结果混入新信息流 */
|
||||||
async function fetchBatch(first = false) {
|
async function fetchBatch(first = false) {
|
||||||
if (loadingMore.value || (!first && !hasMore.value)) return
|
if (!first && (loadingMore.value || !hasMore.value)) return
|
||||||
|
const g = gen
|
||||||
loadingMore.value = true
|
loadingMore.value = true
|
||||||
try {
|
try {
|
||||||
const r = await listAuditEvents(props.cfgId, { cursor: cursor.value || undefined })
|
const r = await listAuditEvents(props.cfgId, { cursor: cursor.value || undefined, q: q.value.trim() || undefined })
|
||||||
|
if (g !== gen) return
|
||||||
const seen = new Set(rows.value.map((e) => e.eventId))
|
const seen = new Set(rows.value.map((e) => e.eventId))
|
||||||
rows.value = [...rows.value, ...r.items.filter((e) => !seen.has(e.eventId))].sort((a, b) =>
|
rows.value = [...rows.value, ...r.items.filter((e) => !seen.has(e.eventId))].sort((a, b) =>
|
||||||
(b.eventTime ?? '').localeCompare(a.eventTime ?? ''),
|
(b.eventTime ?? '').localeCompare(a.eventTime ?? ''),
|
||||||
)
|
)
|
||||||
cursor.value = r.cursor ?? ''
|
cursor.value = r.cursor ?? ''
|
||||||
exhausted.value = r.exhausted
|
exhausted.value = r.exhausted
|
||||||
|
scannedThrough.value = r.scannedThrough ?? ''
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (g !== gen) return
|
||||||
if (first) {
|
if (first) {
|
||||||
error.value = e instanceof Error ? e.message : '查询失败'
|
error.value = e instanceof Error ? e.message : '查询失败'
|
||||||
} else {
|
} else {
|
||||||
@@ -83,9 +144,13 @@ async function fetchBatch(first = false) {
|
|||||||
message.error(e instanceof Error ? e.message : '继续加载失败,请刷新重新查询')
|
message.error(e instanceof Error ? e.message : '继续加载失败,请刷新重新查询')
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loadingMore.value = false
|
if (g === gen) loadingMore.value = false
|
||||||
|
}
|
||||||
|
// 首屏残页自动补批:封顶 maxAutoFills 次,命中稀疏时停驻等用户点「加载更早」
|
||||||
|
if (g === gen && hasMore.value && rows.value.length < pagination.pageSize && autoFills < maxAutoFills) {
|
||||||
|
autoFills++
|
||||||
|
void fetchBatch()
|
||||||
}
|
}
|
||||||
if (hasMore.value && rows.value.length < pagination.pageSize) void fetchBatch()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => void load())
|
onMounted(() => void load())
|
||||||
@@ -206,6 +271,17 @@ const columns: DataTableColumns<AuditEvent> = [
|
|||||||
<div class="text-sm font-semibold">审计日志</div>
|
<div class="text-sm font-semibold">审计日志</div>
|
||||||
<StatusBadge v-if="exhausted" kind="run" label="已加载全部保留期数据" :dot="false" />
|
<StatusBadge v-if="exhausted" kind="run" label="已加载全部保留期数据" :dot="false" />
|
||||||
<div class="flex-1" />
|
<div class="flex-1" />
|
||||||
|
<NInputGroup class="!w-76 max-lg:!w-full">
|
||||||
|
<NInputGroupLabel size="small">搜索</NInputGroupLabel>
|
||||||
|
<NInput
|
||||||
|
v-model:value="q"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="事件 / 资源 / 操作者,支持 *"
|
||||||
|
@keydown.enter="submitSearch()"
|
||||||
|
@clear="submitSearch()"
|
||||||
|
/>
|
||||||
|
</NInputGroup>
|
||||||
<NButton size="small" :loading="loading" @click="load()">刷新</NButton>
|
<NButton size="small" :loading="loading" @click="load()">刷新</NButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -228,7 +304,8 @@ const columns: DataTableColumns<AuditEvent> = [
|
|||||||
OCI Audit 免费且默认开启,事件保留 365 天,无需在云端做任何配置 ·
|
OCI Audit 免费且默认开启,事件保留 365 天,无需在云端做任何配置 ·
|
||||||
实时查询不入库,事件通常延迟数分钟可见 ·
|
实时查询不入库,事件通常延迟数分钟可见 ·
|
||||||
已默认过滤遥测噪声(SummarizeMetricsData)与内网地址发起的服务互调 ·
|
已默认过滤遥测噪声(SummarizeMetricsData)与内网地址发起的服务互调 ·
|
||||||
从最新事件起每批约 100 条,翻到末页自动向更早加载,空档期自动扩窗回溯 · 点击行查看完整详情
|
从最新事件起每批约 200 条,翻到末页自动向更早加载,空档期自动扩窗回溯 ·
|
||||||
|
搜索匹配事件 / 资源 / 操作者等可见字段(不区分大小写,支持 * 通配),命中较少时自动补两批后停驻,点「加载更早」继续回溯 · 点击行查看完整详情
|
||||||
</FootNote>
|
</FootNote>
|
||||||
|
|
||||||
<NModal v-model:show="showDetail" preset="card" closable :style="{ width: '720px', maxWidth: 'calc(100vw - 24px)' }">
|
<NModal v-model:show="showDetail" preset="card" closable :style="{ width: '720px', maxWidth: 'calc(100vw - 24px)' }">
|
||||||
@@ -254,7 +331,7 @@ const columns: DataTableColumns<AuditEvent> = [
|
|||||||
v-if="detailRaw"
|
v-if="detailRaw"
|
||||||
:value="detailRaw"
|
:value="detailRaw"
|
||||||
title="原始 JSON"
|
title="原始 JSON"
|
||||||
meta="来自 Audit SDK"
|
meta="来自 OCI 审计日志"
|
||||||
max-height="36vh"
|
max-height="36vh"
|
||||||
wide
|
wide
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ const exact: Record<string, string> = {
|
|||||||
'DELETE /api/v1/ai-channels/:id': '删除网关渠道',
|
'DELETE /api/v1/ai-channels/:id': '删除网关渠道',
|
||||||
'POST /api/v1/ai-channels/:id/probe': '探测网关渠道',
|
'POST /api/v1/ai-channels/:id/probe': '探测网关渠道',
|
||||||
'POST /api/v1/ai-channels/:id/sync-models': '同步渠道模型',
|
'POST /api/v1/ai-channels/:id/sync-models': '同步渠道模型',
|
||||||
|
'POST /api/v1/ai-channels/:id/test-model': '测试渠道模型',
|
||||||
'POST /api/v1/ai-blacklist': '拉黑模型',
|
'POST /api/v1/ai-blacklist': '拉黑模型',
|
||||||
'DELETE /api/v1/ai-blacklist/:id': '移出模型黑名单',
|
'DELETE /api/v1/ai-blacklist/:id': '移出模型黑名单',
|
||||||
'PUT /api/v1/ai-settings': '保存网关设置',
|
'PUT /api/v1/ai-settings': '保存网关设置',
|
||||||
|
|||||||
+26
-1
@@ -489,6 +489,8 @@ export interface ComputeShape {
|
|||||||
memoryMaxGBs?: number
|
memoryMaxGBs?: number
|
||||||
gpus?: number
|
gpus?: number
|
||||||
processorDescription?: string
|
processorDescription?: string
|
||||||
|
/** 该 shape 对应的配额名(与 compute limits 的 name 同名),用于配额与 AD 可用性判定 */
|
||||||
|
quotaNames?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 引导卷 ----
|
// ---- 引导卷 ----
|
||||||
@@ -594,11 +596,13 @@ export interface AuditEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 批式懒加载响应:cursor 供下一批续查原样带回;
|
// 批式懒加载响应:cursor 供下一批续查原样带回;
|
||||||
// cursor 为空且 exhausted 为 true 表示已回溯到 365 天保留期尽头
|
// cursor 为空且 exhausted 为 true 表示已回溯到 365 天保留期尽头;
|
||||||
|
// scannedThrough 为已完整回溯到的时刻(比它更新的时段已扫完),用于进度提示
|
||||||
export interface AuditEventsResult {
|
export interface AuditEventsResult {
|
||||||
items: AuditEvent[]
|
items: AuditEvent[]
|
||||||
cursor?: string
|
cursor?: string
|
||||||
exhausted: boolean
|
exhausted: boolean
|
||||||
|
scannedThrough?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 域通知与密码策略 ----
|
// ---- 域通知与密码策略 ----
|
||||||
@@ -946,8 +950,12 @@ export interface AiChannel {
|
|||||||
lastProbeAt: string | null
|
lastProbeAt: string | null
|
||||||
probeStatus: AiProbeStatus
|
probeStatus: AiProbeStatus
|
||||||
probeError: string
|
probeError: string
|
||||||
|
/** 用户测试通过后固定的探测验证模型;探测时置于候选首位 */
|
||||||
|
probeModel: string
|
||||||
createdAt: string
|
createdAt: string
|
||||||
updatedAt: string
|
updatedAt: string
|
||||||
|
/** 渠道模型缓存计数(列表查询回填) */
|
||||||
|
modelCount: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 聚合可用模型(OpenAI /models 形态) */
|
/** 聚合可用模型(OpenAI /models 形态) */
|
||||||
@@ -964,13 +972,30 @@ export interface AiModelCacheItem {
|
|||||||
modelOcid: string
|
modelOcid: string
|
||||||
name: string
|
name: string
|
||||||
vendor: string
|
vendor: string
|
||||||
|
capability: string
|
||||||
syncedAt: string
|
syncedAt: string
|
||||||
|
deprecatedAt: string | null
|
||||||
|
retiredAt: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */
|
/** 模型黑名单条目:拉黑即全渠道剔除,同步 / 探测不再入库 */
|
||||||
/** AI 网关全局设置 */
|
/** AI 网关全局设置 */
|
||||||
export interface AiSettings {
|
export interface AiSettings {
|
||||||
filterDeprecated: boolean
|
filterDeprecated: boolean
|
||||||
|
/** Responses 流式保险丝:instructions+tools 合计超阈值改非流式上游并合成 SSE */
|
||||||
|
streamGuardEnabled: boolean
|
||||||
|
streamGuardKB: number
|
||||||
|
/** grok(xai. 前缀)服务端搜索工具默认注入;请求已带同名工具时不覆盖 */
|
||||||
|
grokWebSearch: boolean
|
||||||
|
grokXSearch: boolean
|
||||||
|
/** 上游无响应预算(秒):非流式为单次尝试总超时,流式为等待响应头上限;限 30..900 */
|
||||||
|
upstreamWaitSeconds: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 聚合模型目录条目(黑名单添加弹窗):能力为 CHAT / EMBEDDING / RERANK / TTS */
|
||||||
|
export interface AiCatalogModel {
|
||||||
|
name: string
|
||||||
|
capability: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AiModelBlacklistItem {
|
export interface AiModelBlacklistItem {
|
||||||
|
|||||||
+4
-125
@@ -1,30 +1,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NSwitch, useDialog } from 'naive-ui'
|
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addAiBlacklist,
|
|
||||||
getAiSettings,
|
|
||||||
listAiBlacklist,
|
|
||||||
listAiChannels,
|
listAiChannels,
|
||||||
listAiKeys,
|
listAiKeys,
|
||||||
listAiModels,
|
listAiModels,
|
||||||
removeAiBlacklist,
|
|
||||||
updateAiSettings,
|
|
||||||
} from '@/api/aigateway'
|
} from '@/api/aigateway'
|
||||||
import AiChannelPanel from '@/components/ai/AiChannelPanel.vue'
|
import AiChannelPanel from '@/components/ai/AiChannelPanel.vue'
|
||||||
import AiKeyPanel from '@/components/ai/AiKeyPanel.vue'
|
import AiKeyPanel from '@/components/ai/AiKeyPanel.vue'
|
||||||
import { useAsync } from '@/composables/useAsync'
|
import { useAsync } from '@/composables/useAsync'
|
||||||
import { useToast } from '@/composables/useToast'
|
import { useToast } from '@/composables/useToast'
|
||||||
import type { AiModelBlacklistItem } from '@/types/api'
|
|
||||||
|
|
||||||
const message = useToast()
|
const message = useToast()
|
||||||
const dialog = useDialog()
|
|
||||||
|
|
||||||
const keys = useAsync(listAiKeys)
|
const keys = useAsync(listAiKeys)
|
||||||
const channels = useAsync(listAiChannels)
|
const channels = useAsync(listAiChannels)
|
||||||
const models = useAsync(listAiModels)
|
const models = useAsync(listAiModels)
|
||||||
const blacklist = useAsync(listAiBlacklist)
|
|
||||||
|
|
||||||
const baseUrl = `${window.location.origin}/ai/v1`
|
const baseUrl = `${window.location.origin}/ai/v1`
|
||||||
|
|
||||||
@@ -59,12 +50,9 @@ const modelGroups = computed(() => {
|
|||||||
.map(([vendor, ids]) => ({ vendor, label: VENDOR_LABEL[vendor] ?? vendor, ids: ids.sort() }))
|
.map(([vendor, ids]) => ({ vendor, label: VENDOR_LABEL[vendor] ?? vendor, ids: ids.sort() }))
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 手风琴:同时只展开一个分组(厂商或黑名单),配合展开区限高控制卡片总高度 */
|
/** 手风琴:同时只展开一个厂商,配合展开区限高控制卡片总高度 */
|
||||||
const expandedVendor = ref<string | null>(null)
|
const expandedVendor = ref<string | null>(null)
|
||||||
|
|
||||||
/** 黑名单在手风琴中的分组 key(厂商 key 取自模型名前缀,不会与此冲突) */
|
|
||||||
const BLACKLIST_KEY = '__blacklist__'
|
|
||||||
|
|
||||||
function toggleVendor(vendor: string) {
|
function toggleVendor(vendor: string) {
|
||||||
expandedVendor.value = expandedVendor.value === vendor ? null : vendor
|
expandedVendor.value = expandedVendor.value === vendor ? null : vendor
|
||||||
}
|
}
|
||||||
@@ -90,62 +78,9 @@ async function copyModel(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 「过滤弃用模型」开关:开启后已宣布弃用(即使未退役)的模型从列表与路由中排除 */
|
|
||||||
const filterDeprecated = ref(false)
|
|
||||||
void getAiSettings()
|
|
||||||
.then((s) => { filterDeprecated.value = s.filterDeprecated })
|
|
||||||
.catch(() => {})
|
|
||||||
|
|
||||||
async function toggleFilterDeprecated(v: boolean) {
|
|
||||||
filterDeprecated.value = v
|
|
||||||
try {
|
|
||||||
const s = await updateAiSettings({ filterDeprecated: v })
|
|
||||||
filterDeprecated.value = s.filterDeprecated
|
|
||||||
message.success(v ? '已过滤弃用模型(列表与路由同时排除)' : '已恢复展示弃用模型')
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '操作失败')
|
|
||||||
filterDeprecated.value = !v
|
|
||||||
}
|
|
||||||
refreshModels()
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshModels() {
|
|
||||||
void models.run({ silent: true })
|
|
||||||
void blacklist.run({ silent: true })
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshChannels() {
|
function refreshChannels() {
|
||||||
void channels.run({ silent: true })
|
void channels.run({ silent: true })
|
||||||
refreshModels()
|
void models.run({ silent: true })
|
||||||
}
|
|
||||||
|
|
||||||
/** 拉黑:删除全部渠道缓存中的该模型,后续同步 / 探测均过滤 */
|
|
||||||
function banModel(id: string) {
|
|
||||||
dialog.warning({
|
|
||||||
title: '加入模型黑名单',
|
|
||||||
content: `拉黑「${id}」?全部渠道立即剔除该模型,后续同步与探测不再收录。`,
|
|
||||||
positiveText: '拉黑',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await addAiBlacklist(id)
|
|
||||||
message.success(`已拉黑:${id}`)
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '操作失败')
|
|
||||||
}
|
|
||||||
refreshModels()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function unbanModel(b: AiModelBlacklistItem) {
|
|
||||||
try {
|
|
||||||
await removeAiBlacklist(b.id)
|
|
||||||
message.success(`已移出黑名单:${b.name},重新同步渠道后恢复`)
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '操作失败')
|
|
||||||
}
|
|
||||||
refreshModels()
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -186,18 +121,9 @@ async function unbanModel(b: AiModelBlacklistItem) {
|
|||||||
<div class="flex items-center justify-between border-b border-line-soft px-4.5 py-3">
|
<div class="flex items-center justify-between border-b border-line-soft px-4.5 py-3">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-sm font-semibold">可用模型</div>
|
<div class="text-sm font-semibold">可用模型</div>
|
||||||
<div class="mt-0.5 text-xs text-ink-3">按厂商分组;点击厂商展开,点击模型名复制,✕ 加入黑名单</div>
|
<div class="mt-0.5 text-xs text-ink-3">按厂商分组;点击厂商展开,点击模型名复制</div>
|
||||||
</div>
|
|
||||||
<div class="flex flex-none items-center gap-3">
|
|
||||||
<label
|
|
||||||
class="flex cursor-pointer items-center gap-1.5 text-xs text-ink-3"
|
|
||||||
title="开启后,已宣布弃用(即使未退役)的模型从模型列表与路由中排除;关闭恢复"
|
|
||||||
>
|
|
||||||
过滤弃用
|
|
||||||
<NSwitch size="small" :value="filterDeprecated" @update:value="toggleFilterDeprecated" />
|
|
||||||
</label>
|
|
||||||
<span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} 个</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
<span class="text-xs text-ink-3">{{ models.data.value?.length ?? '…' }} 个</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="px-4.5 py-1.5">
|
<div class="px-4.5 py-1.5">
|
||||||
<div
|
<div
|
||||||
@@ -238,56 +164,9 @@ async function unbanModel(b: AiModelBlacklistItem) {
|
|||||||
>
|
>
|
||||||
{{ id }}
|
{{ id }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="cursor-pointer self-stretch pr-1.5 pl-0.5 text-ink-3 hover:text-err"
|
|
||||||
:title="`加入黑名单:${id}`"
|
|
||||||
@click="banModel(id)"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
class="h-2.5 w-2.5"
|
|
||||||
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4"
|
|
||||||
stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M18 6 6 18M6 6l12 12" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="blacklist.data.value?.length" class="border-b border-line-soft py-1 last:border-b-0">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="flex w-full cursor-pointer items-center gap-2 py-1.5 text-left"
|
|
||||||
@click="toggleVendor(BLACKLIST_KEY)"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
class="h-3 w-3 flex-none text-ink-3 transition-transform"
|
|
||||||
:class="expandedVendor === BLACKLIST_KEY ? 'rotate-90' : ''"
|
|
||||||
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"
|
|
||||||
stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<path d="m9 18 6-6-6-6" />
|
|
||||||
</svg>
|
|
||||||
<span class="text-[13px] font-medium">模型黑名单</span>
|
|
||||||
<span class="text-xs text-ink-3">{{ blacklist.data.value.length }} 个</span>
|
|
||||||
</button>
|
|
||||||
<div v-if="expandedVendor === BLACKLIST_KEY" class="pb-2 pl-5">
|
|
||||||
<div class="mb-1.5 text-xs text-ink-3">同步与探测均过滤;点击移出,重新同步渠道后恢复入池</div>
|
|
||||||
<div class="flex max-h-36 flex-wrap content-start gap-1.5 overflow-y-auto">
|
|
||||||
<button
|
|
||||||
v-for="b in blacklist.data.value"
|
|
||||||
:key="b.id"
|
|
||||||
type="button"
|
|
||||||
class="mono cursor-pointer rounded-[5px] border border-err/30 bg-err/5 px-2 py-0.5 text-[11.5px] text-ink-3 line-through hover:border-err hover:text-err"
|
|
||||||
:title="`移出黑名单:${b.name}`"
|
|
||||||
@click="unbanModel(b)"
|
|
||||||
>
|
|
||||||
{{ b.name }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="models.data.value && !models.data.value.length" class="py-2 text-xs text-ink-3">
|
<div v-if="models.data.value && !models.data.value.length" class="py-2 text-xs text-ink-3">
|
||||||
暂无可用模型:请先添加渠道并探测(需租户订阅 GenAI 提供区域)
|
暂无可用模型:请先添加渠道并探测(需租户订阅 GenAI 提供区域)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import AppInputNumber from '@/components/AppInputNumber.vue'
|
|||||||
import FootNote from '@/components/FootNote.vue'
|
import FootNote from '@/components/FootNote.vue'
|
||||||
import FormField from '@/components/FormField.vue'
|
import FormField from '@/components/FormField.vue'
|
||||||
import AboutTab from '@/components/settings/AboutTab.vue'
|
import AboutTab from '@/components/settings/AboutTab.vue'
|
||||||
|
import AiSettingsTab from '@/components/settings/AiSettingsTab.vue'
|
||||||
import AccountSecurityCard from '@/components/settings/AccountSecurityCard.vue'
|
import AccountSecurityCard from '@/components/settings/AccountSecurityCard.vue'
|
||||||
import NotifyChannelCard from '@/components/settings/NotifyChannelCard.vue'
|
import NotifyChannelCard from '@/components/settings/NotifyChannelCard.vue'
|
||||||
import NotifyTemplateModal from '@/components/settings/NotifyTemplateModal.vue'
|
import NotifyTemplateModal from '@/components/settings/NotifyTemplateModal.vue'
|
||||||
@@ -88,7 +89,7 @@ const eventRows: { key: keyof NotifyEventsSetting; label: string; hint: string }
|
|||||||
{ key: 'taskStop', label: '任务停止', hint: '抢机连续鉴权失败熔断停止时推送' },
|
{ key: 'taskStop', label: '任务停止', hint: '抢机连续鉴权失败熔断停止时推送' },
|
||||||
{ key: 'loginLock', label: '登录锁定', hint: '同一 IP+用户名连续失败达阈值时推送' },
|
{ key: 'loginLock', label: '登录锁定', hint: '同一 IP+用户名连续失败达阈值时推送' },
|
||||||
{ key: 'modelDeprecated', label: '模型弃用预警', hint: 'AI 网关在池模型 30 天内被 OCI 弃用时随每日探测推送' },
|
{ key: 'modelDeprecated', label: '模型弃用预警', hint: 'AI 网关在池模型 30 天内被 OCI 弃用时随每日探测推送' },
|
||||||
{ key: 'logEventInstance', label: '实例生命周期', hint: '创建 / 终止 / 电源操作(Launch、Terminate、InstanceAction)' },
|
{ key: 'logEventInstance', label: '实例生命周期', hint: '终止 / 电源操作(Terminate、InstanceAction);创建不回传,避免抢机噪声' },
|
||||||
{ key: 'logEventIdentity', label: '用户与凭据', hint: '用户增删改、API Key 增删、能力变更' },
|
{ key: 'logEventIdentity', label: '用户与凭据', hint: '用户增删改、API Key 增删、能力变更' },
|
||||||
{ key: 'logEventPolicy', label: '策略变更', hint: 'IAM Policy 创建 / 修改 / 删除' },
|
{ key: 'logEventPolicy', label: '策略变更', hint: 'IAM Policy 创建 / 修改 / 删除' },
|
||||||
{ key: 'logEventRegion', label: '区域订阅', hint: '订阅新区域(CreateRegionSubscription)' },
|
{ key: 'logEventRegion', label: '区域订阅', hint: '订阅新区域(CreateRegionSubscription)' },
|
||||||
@@ -339,6 +340,7 @@ async function sendTest() {
|
|||||||
<NTabPane name="notify" tab="通知" />
|
<NTabPane name="notify" tab="通知" />
|
||||||
<NTabPane name="task" tab="任务" />
|
<NTabPane name="task" tab="任务" />
|
||||||
<NTabPane name="security" tab="安全" />
|
<NTabPane name="security" tab="安全" />
|
||||||
|
<NTabPane name="ai" tab="AI" />
|
||||||
<NTabPane name="about" tab="关于" />
|
<NTabPane name="about" tab="关于" />
|
||||||
</NTabs>
|
</NTabs>
|
||||||
|
|
||||||
@@ -658,6 +660,9 @@ async function sendTest() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- AI:网关运行时设置(保险丝 / grok 工具默认 / 模型治理) -->
|
||||||
|
<AiSettingsTab v-else-if="tab === 'ai'" />
|
||||||
|
|
||||||
<!-- 关于:构建信息与项目主页(v-else-if 挂载时才启动粒子动画) -->
|
<!-- 关于:构建信息与项目主页(v-else-if 挂载时才启动粒子动画) -->
|
||||||
<AboutTab v-else-if="tab === 'about'" />
|
<AboutTab v-else-if="tab === 'about'" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user