5 Commits
Author SHA1 Message Date
wangdefa 3475ce7ce6 回传日志去高度限制与文案同步,错误 toast 可展开详情
CI / test (push) Successful in 27s
2026-07-17 16:53:03 +08:00
wangdefa c0229b60c1 实例表单:默认 2C12G、去免费文案、配额按 AD 联动 2026-07-17 16:53:03 +08:00
wangdefa fbed8d1ea4 删除未引用的 PageHeader 死组件
CI / test (push) Successful in 26s
2026-07-17 12:19:28 +08:00
wangdefa 1fc5d74d8a 发布 v0.7.2
CI / test (push) Successful in 26s
Release / release (push) Successful in 26s
2026-07-16 21:25:40 +08:00
wangdefa 4606fbfd4f 设置页上游预算项、代理状态列、调用日志 Tokens 列宽
CI / test (push) Successful in 26s
2026-07-16 21:20:14 +08:00
13 changed files with 207 additions and 80 deletions
+11
View File
@@ -2,6 +2,17 @@
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。 格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)(版本段不记日期),版本号遵循语义化版本。
## [0.7.2]
### Added
- 设置页 AI Tab「Responses 直通」面板新增「上游无响应预算」输入(30..900 秒,失焦 / 回车提交,即时生效),与流式保险丝同面板并网格对齐
- 代理列表新增「状态」列(检测中 / 正常 / 异常):与地区同源于经代理链路的出口探测,探测失败即视为异常,「重测」联动刷新;页脚说明同步
### Changed
- AI 调用日志 Tokens(入/出)列加宽并禁止换行,大用量流式行不再折行;原「流式保险丝」独立面板并入「Responses 直通」
## [0.7.1] ## [0.7.1]
### Added ### Added
+35
View File
@@ -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
View File
@@ -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 响应体,保留默认消息 */
} }
-16
View File
@@ -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>
@@ -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>
+86 -34
View File
@@ -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"
+2 -10
View File
@@ -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 shapeA1 免费额度上限 4 OCPU / 24 GB 镜像不能换到 x86 shape
</div> </div>
</FormModal> </FormModal>
</template> </template>
+2 -2
View File
@@ -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)) },
] ]
+5 -5
View File
@@ -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)' }">
+9 -1
View File
@@ -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
+36 -4
View File
@@ -21,6 +21,7 @@ const form = reactive<AiSettings>({
streamGuardKB: 60, streamGuardKB: 60,
grokWebSearch: true, grokWebSearch: true,
grokXSearch: true, grokXSearch: true,
upstreamWaitSeconds: 300,
}) })
watch( watch(
@@ -58,6 +59,12 @@ function commitGuardKB(v: number | null) {
setField('streamGuardKB', v) setField('streamGuardKB', v)
} }
/** 上游无响应预算失焦/回车提交 */
function commitUpstreamWait(v: number | null) {
if (v == null || v === form.upstreamWaitSeconds) return
setField('upstreamWaitSeconds', v)
}
const removing = ref(0) const removing = ref(0)
async function doRemove(id: number, name: string) { async function doRemove(id: number, name: string) {
removing.value = id removing.value = id
@@ -83,15 +90,15 @@ function onBlacklistChanged() {
<NSpin size="small" /> <NSpin size="small" />
</div> </div>
<div v-else class="flex max-w-[880px] flex-col gap-4"> <div v-else class="flex max-w-[880px] flex-col gap-4">
<!-- 流式保险丝 --> <!-- Responses 直通防护 -->
<div class="panel"> <div class="panel">
<div class="border-b border-line-soft px-4.5 py-3.5"> <div class="border-b border-line-soft px-4.5 py-3.5">
<div class="text-sm font-semibold">流式保险丝</div> <div class="text-sm font-semibold">Responses 直通</div>
</div> </div>
<div class="px-4.5"> <div class="px-4.5">
<div class="flex items-center justify-between gap-3 py-3.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="min-w-0">
<div class="text-[13px] font-medium">instructions + tools 阈值</div> <div class="text-[13px] font-medium">流式保险丝:instructions + tools 阈值</div>
<div class="mt-0.5 text-xs text-ink-3"> <div class="mt-0.5 text-xs text-ink-3">
系统提示与工具定义合计超过阈值的流式请求,预防性改走非流式上游并合成 系统提示与工具定义合计超过阈值的流式请求,预防性改走非流式上游并合成
SSE:丢增量输出,保会话不中断 SSE:丢增量输出,保会话不中断
@@ -119,6 +126,31 @@ function onBlacklistChanged() {
/> />
</div> </div>
</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>
<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">
修改即时生效,无需重启 · 仅作用于 Responses 直通面;Chat / Messages 已有断流自动重做兜底 修改即时生效,无需重启 · 仅作用于 Responses 直通面;Chat / Messages 已有断流自动重做兜底
+4
View File
@@ -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[]
} }
// ---- 引导卷 ---- // ---- 引导卷 ----
@@ -986,6 +988,8 @@ export interface AiSettings {
/** grok(xai. 前缀)服务端搜索工具默认注入;请求已带同名工具时不覆盖 */ /** grok(xai. 前缀)服务端搜索工具默认注入;请求已带同名工具时不覆盖 */
grokWebSearch: boolean grokWebSearch: boolean
grokXSearch: boolean grokXSearch: boolean
/** 上游无响应预算(秒):非流式为单次尝试总超时,流式为等待响应头上限;限 30..900 */
upstreamWaitSeconds: number
} }
/** 聚合模型目录条目(黑名单添加弹窗):能力为 CHAT / EMBEDDING / RERANK / TTS */ /** 聚合模型目录条目(黑名单添加弹窗):能力为 CHAT / EMBEDDING / RERANK / TTS */
+1 -1
View File
@@ -89,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)' },