Compare commits
5
Commits
d987400a5b
..
v0.7.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fc5d74d8a | ||
|
|
4606fbfd4f | ||
|
|
0ff0e22e56 | ||
|
|
6ea222e5ab | ||
|
|
b8c0ddda6d |
@@ -2,6 +2,50 @@
|
|||||||
|
|
||||||
格式参考 [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]
|
||||||
|
|
||||||
|
### 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]
|
## [0.6.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+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 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)) },
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 已有断流自动重做兜底
|
||||||
|
|||||||
@@ -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
|
||||||
/>
|
/>
|
||||||
|
|||||||
+5
-1
@@ -594,11 +594,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
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 域通知与密码策略 ----
|
// ---- 域通知与密码策略 ----
|
||||||
@@ -984,6 +986,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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user