移除告警规则界面、恢复 Chat 端点并优化列表
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
0.6.5
|
0.6.6
|
||||||
@@ -15,7 +15,7 @@ oci-portal-dash/
|
|||||||
├── App.vue NConfigProvider 注入 Naive 主题
|
├── App.vue NConfigProvider 注入 Naive 主题
|
||||||
├── assets/ main.css:Tailwind @theme 设计 token(浅色)+ html.dark 暗色变量覆盖与全局基础样式
|
├── assets/ main.css:Tailwind @theme 设计 token(浅色)+ html.dark 暗色变量覆盖与全局基础样式
|
||||||
├── theme/ tokens.ts(JS 侧 token 唯一来源,含 darkTokens 暗色板)、naive.ts(亮暗两套 themeOverrides 同一工厂生成)
|
├── theme/ tokens.ts(JS 侧 token 唯一来源,含 darkTokens 暗色板)、naive.ts(亮暗两套 themeOverrides 同一工厂生成)
|
||||||
├── types/ api.ts:与 docs/API接口文档.md 一一对应的 DTO 类型
|
├── types/ api.ts:与后端 swagger(oci-portal/docs/)一一对应的 DTO 类型
|
||||||
├── api/ request 封装(JWT 注入、401 跳登录、错误 hint 拼接)+ 按资源分模块;VITE_MOCK=1 时返回 mock.ts 数据
|
├── api/ request 封装(JWT 注入、401 跳登录、错误 hint 拼接)+ 按资源分模块;VITE_MOCK=1 时返回 mock.ts 数据
|
||||||
├── stores/ Pinia:auth(令牌持久化)、app(侧栏收缩、暗色主题:默认跟随系统 + localStorage 记忆,驱动 html.dark 与 Naive darkTheme)、scope(全局作用域:租户/区域/区间,localStorage 按租户记忆)
|
├── stores/ Pinia:auth(令牌持久化)、app(侧栏收缩、暗色主题:默认跟随系统 + localStorage 记忆,驱动 html.dark 与 Naive darkTheme)、scope(全局作用域:租户/区域/区间,localStorage 按租户记忆)
|
||||||
├── router/ 路由与登录守卫
|
├── router/ 路由与登录守卫
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Vue 3 + Vite + TypeScript + Naive UI + Tailwind CSS v4 + ECharts + Pinia。Naive
|
|||||||
|
|
||||||
- [ ] 读过 [Directory Structure](./directory-structure.md),文件放对层(views / components / composables / api / stores / types)
|
- [ ] 读过 [Directory Structure](./directory-structure.md),文件放对层(views / components / composables / api / stores / types)
|
||||||
- [ ] 涉及颜色、圆角、间距时先看 [Styling & Design Tokens](./styling-design-tokens.md),禁止硬编码 hex
|
- [ ] 涉及颜色、圆角、间距时先看 [Styling & Design Tokens](./styling-design-tokens.md),禁止硬编码 hex
|
||||||
- [ ] 新增请求走 `api/` 统一封装,DTO 类型进 `types/`(与 `docs/API接口文档.md` 一一对应)
|
- [ ] 新增请求走 `api/` 统一封装,DTO 类型进 `types/`(与后端 swagger `oci-portal/docs/` 一一对应)
|
||||||
- [ ] 出 UI 设计稿前读 `../guides/design-workflow.md`
|
- [ ] 出 UI 设计稿前读 `../guides/design-workflow.md`
|
||||||
|
|
||||||
## Quality Check
|
## Quality Check
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- 开启 `strict`;禁止 `any`,未知类型用 `unknown` 后收窄。
|
- 开启 `strict`;禁止 `any`,未知类型用 `unknown` 后收窄。
|
||||||
- 对象形状优先 `interface`,联合/工具类型用 `type`;类型导入写 `import type`。
|
- 对象形状优先 `interface`,联合/工具类型用 `type`;类型导入写 `import type`。
|
||||||
- 与后端交互的 DTO 类型集中在 `types/`,字段与 `docs/API接口文档.md` 一一对应,不在组件里手写内联响应类型。
|
- 与后端交互的 DTO 类型集中在 `types/`,字段与后端 swagger(`oci-portal/docs/`)一一对应,不在组件里手写内联响应类型。
|
||||||
- 用 `const` 对象 + `as const` 代替 `enum`。
|
- 用 `const` 对象 + `as const` 代替 `enum`。
|
||||||
|
|
||||||
## Vue 组件
|
## Vue 组件
|
||||||
|
|||||||
+13
-13
@@ -183,7 +183,7 @@ Complex task: ask the user if you can create a Trellis task and enter the planni
|
|||||||
- 1.0 Create task `[required · once]` (only after task-creation consent)
|
- 1.0 Create task `[required · once]` (only after task-creation consent)
|
||||||
- 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
|
- 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
|
||||||
- 1.2 Research `[optional · repeatable]`
|
- 1.2 Research `[optional · repeatable]`
|
||||||
- 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix (sub-agent-dispatch platforms only; inline platforms skip)
|
- 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix (sub-agent-dispatch platforms only; inline platforms skip)
|
||||||
- 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
|
- 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
|
||||||
- 1.5 Completion criteria
|
- 1.5 Completion criteria
|
||||||
|
|
||||||
@@ -272,13 +272,13 @@ Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
|
|||||||
|
|
||||||
When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
|
When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
- Planning or unclear requirements -> `trellis-brainstorm`.
|
- Planning or unclear requirements -> `trellis-brainstorm`.
|
||||||
- `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
|
- `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
|
||||||
- Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
|
- Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
[codex-inline, Kilo, Antigravity, Devin]
|
[codex-inline, Kilo, Antigravity, Devin]
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ Return to this step whenever requirements change and revise the relevant artifac
|
|||||||
|
|
||||||
Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
|
Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
Spawn the research sub-agent:
|
Spawn the research sub-agent:
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ Spawn the research sub-agent:
|
|||||||
- **Task description**: Research <specific question>
|
- **Task description**: Research <specific question>
|
||||||
- **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
|
- **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
[codex-inline, Kilo, Antigravity, Devin]
|
[codex-inline, Kilo, Antigravity, Devin]
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ Brainstorm and research can interleave freely — pause to research a technical
|
|||||||
|
|
||||||
#### 1.3 Configure context `[required · once]`
|
#### 1.3 Configure context `[required · once]`
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
|
Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
|
||||||
|
|
||||||
@@ -425,7 +425,7 @@ Ready gate: both `implement.jsonl` and `check.jsonl` must contain at least one r
|
|||||||
|
|
||||||
Skip this step only when both files already have real curated entries.
|
Skip this step only when both files already have real curated entries.
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
[codex-inline, Kilo, Antigravity, Devin]
|
[codex-inline, Kilo, Antigravity, Devin]
|
||||||
|
|
||||||
@@ -458,11 +458,11 @@ If `task.py start` errors with a session-identity message (no context key from h
|
|||||||
| `design.md` exists (complex tasks) | ✅ |
|
| `design.md` exists (complex tasks) | ✅ |
|
||||||
| `implement.md` exists (complex tasks) | ✅ |
|
| `implement.md` exists (complex tasks) | ✅ |
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
| `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | ✅ |
|
| `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | ✅ |
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ Goal: turn reviewed planning artifacts into code that passes quality checks.
|
|||||||
|
|
||||||
#### 2.1 Implement `[required · repeatable]`
|
#### 2.1 Implement `[required · repeatable]`
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
|
[Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi, Oh My Pi]
|
||||||
|
|
||||||
Spawn the implement sub-agent:
|
Spawn the implement sub-agent:
|
||||||
|
|
||||||
@@ -484,7 +484,7 @@ The platform hook/plugin auto-handles:
|
|||||||
- Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
|
- Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
|
||||||
- Injects `prd.md`, `design.md` if present, and `implement.md` if present
|
- Injects `prd.md`, `design.md` if present, and `implement.md` if present
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi]
|
[/Claude Code, Cursor, OpenCode, CodeBuddy, Droid, Pi, Oh My Pi]
|
||||||
|
|
||||||
[codex-sub-agent, Gemini, Qoder, Copilot, ZCode, Reasonix, Trae]
|
[codex-sub-agent, Gemini, Qoder, Copilot, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ The platform prelude auto-handles the context load requirement:
|
|||||||
|
|
||||||
#### 2.2 Quality check `[required · repeatable]`
|
#### 2.2 Quality check `[required · repeatable]`
|
||||||
|
|
||||||
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
Spawn the check sub-agent:
|
Spawn the check sub-agent:
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ The check agent's job:
|
|||||||
- Auto-fix issues it finds
|
- Auto-fix issues it finds
|
||||||
- Run lint and typecheck to verify
|
- Run lint and typecheck to verify
|
||||||
|
|
||||||
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, ZCode, Reasonix, Trae]
|
[/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Reasonix, Trae]
|
||||||
|
|
||||||
[codex-inline, Kilo, Antigravity, Devin]
|
[codex-inline, Kilo, Antigravity, Devin]
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,27 @@
|
|||||||
|
|
||||||
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。
|
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。
|
||||||
|
|
||||||
|
## [0.3.0] - 2026-07-13
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- AI 网关端点列表恢复展示 OpenAI Chat Completions 接口(`POST /ai/v1/chat/completions`),标明支持流式与非流式调用
|
||||||
|
- 租户列表分页支持 10 / 20 / 50 / 100 条每页切换
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 回传日志告警统一改由「通知管理 → 云端事件」分类推送,租户删除提示同步移除已废弃的告警规则清理项
|
||||||
|
- 总览页租户测活列表改为限高滚动,「查看全部租户」入口固定展示
|
||||||
|
- 系统日志、OCI 审计日志与配额表格取消固定高度,分页内容随页面完整展开
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- 移除日志页自定义审计告警规则的管理入口、条件表单及相关前端 API
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复租户列表分页状态在页面重绘时丢失,以及筛选后停留在越界页码的问题
|
||||||
|
|
||||||
## [0.2.0] - 2026-07-12
|
## [0.2.0] - 2026-07-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { mockLogEvents, mockLogRelays, mockLogWebhooks } from './mock'
|
import { mockLogEvents, mockLogRelays, mockLogWebhooks } from './mock'
|
||||||
import { mockOn, mocked, request } from './request'
|
import { mockOn, mocked, request } from './request'
|
||||||
import type {
|
import type {
|
||||||
AlertRule,
|
|
||||||
AlertRuleBody,
|
|
||||||
LogEventPage,
|
LogEventPage,
|
||||||
LogRelayView,
|
LogRelayView,
|
||||||
LogWebhookInfo,
|
LogWebhookInfo,
|
||||||
@@ -30,27 +28,6 @@ export function listLogEvents(params: LogEventParams): Promise<LogEventPage> {
|
|||||||
return request('/log-events', { query: { ...params } })
|
return request('/log-events', { query: { ...params } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 告警规则 ----
|
|
||||||
export function listAlertRules(): Promise<AlertRule[]> {
|
|
||||||
if (mockOn) return mocked([])
|
|
||||||
return request<{ items: AlertRule[] }>('/log-events/alert-rules').then((r) => r.items)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createAlertRule(body: AlertRuleBody): Promise<AlertRule> {
|
|
||||||
if (mockOn) return mocked({ ...body, id: 1, createdAt: '', updatedAt: '' }, 300)
|
|
||||||
return request('/log-events/alert-rules', { method: 'POST', body })
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updateAlertRule(id: number, body: AlertRuleBody): Promise<AlertRule> {
|
|
||||||
if (mockOn) return mocked({ ...body, id, createdAt: '', updatedAt: '' }, 300)
|
|
||||||
return request(`/log-events/alert-rules/${id}`, { method: 'PUT', body })
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteAlertRule(id: number): Promise<void> {
|
|
||||||
if (mockOn) return mocked(undefined, 300)
|
|
||||||
return request(`/log-events/alert-rules/${id}`, { method: 'DELETE' })
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getLogWebhook(cfgId: number): Promise<LogWebhookState> {
|
export function getLogWebhook(cfgId: number): Promise<LogWebhookState> {
|
||||||
if (mockOn) {
|
if (mockOn) {
|
||||||
const info = mockLogWebhooks.get(cfgId)
|
const info = mockLogWebhooks.get(cfgId)
|
||||||
|
|||||||
@@ -1,313 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import {
|
|
||||||
NButton,
|
|
||||||
NInput,
|
|
||||||
NModal,
|
|
||||||
NPopconfirm,
|
|
||||||
NSelect,
|
|
||||||
NSwitch,
|
|
||||||
type SelectOption,
|
|
||||||
} from 'naive-ui'
|
|
||||||
import { computed, reactive, ref, watch } from 'vue'
|
|
||||||
|
|
||||||
import {
|
|
||||||
createAlertRule,
|
|
||||||
deleteAlertRule,
|
|
||||||
listAlertRules,
|
|
||||||
updateAlertRule,
|
|
||||||
} from '@/api/logevents'
|
|
||||||
import { listNotifyTemplates } from '@/api/settings'
|
|
||||||
import AppInputNumber from '@/components/AppInputNumber.vue'
|
|
||||||
import FormField from '@/components/FormField.vue'
|
|
||||||
import NotifyTemplateModal from '@/components/settings/NotifyTemplateModal.vue'
|
|
||||||
import TenantPicker from '@/components/TenantPicker.vue'
|
|
||||||
import { eventLabel } from '@/composables/useEventLabel'
|
|
||||||
import { useAsync } from '@/composables/useAsync'
|
|
||||||
import { useScopeStore } from '@/stores/scope'
|
|
||||||
import type { AlertRule, AlertRuleBody, NotifyTemplateItem } from '@/types/api'
|
|
||||||
import { useToast } from '@/composables/useToast'
|
|
||||||
|
|
||||||
const show = defineModel<boolean>('show', { required: true })
|
|
||||||
|
|
||||||
const message = useToast()
|
|
||||||
const scope = useScopeStore()
|
|
||||||
|
|
||||||
/** 可选事件短名 = 回传链路的关键事件清单(Connector 侧 filter 一致) */
|
|
||||||
const RELAY_EVENTS = [
|
|
||||||
'LaunchInstance', 'TerminateInstance', 'InstanceAction',
|
|
||||||
'CreateUser', 'DeleteUser', 'UpdateUser',
|
|
||||||
'CreateApiKey', 'DeleteApiKey', 'UpdateUserCapabilities',
|
|
||||||
'CreateRegionSubscription', 'CreatePolicy', 'UpdatePolicy', 'DeletePolicy',
|
|
||||||
'InteractiveLogin',
|
|
||||||
]
|
|
||||||
const eventOptions: SelectOption[] = RELAY_EVENTS.map((e) => ({
|
|
||||||
value: e,
|
|
||||||
label: eventLabel(e) ? `${eventLabel(e)}(${e})` : e,
|
|
||||||
}))
|
|
||||||
|
|
||||||
const rules = useAsync(listAlertRules, false)
|
|
||||||
watch(show, (v) => {
|
|
||||||
if (v) void rules.run()
|
|
||||||
})
|
|
||||||
|
|
||||||
// ---- 编辑表单:editing 非 null 时进入表单视图,id=0 表示新建 ----
|
|
||||||
const editing = ref<AlertRule | null>(null)
|
|
||||||
const saving = ref(false)
|
|
||||||
const form = reactive({
|
|
||||||
name: '',
|
|
||||||
enabled: true,
|
|
||||||
cfgId: null as number | null,
|
|
||||||
eventTypes: [] as string[],
|
|
||||||
sourceIps: '',
|
|
||||||
sourceIpMode: 'in' as 'in' | 'notin',
|
|
||||||
resourceMatch: '',
|
|
||||||
threshold: 1 as number | null,
|
|
||||||
windowMinutes: 5 as number | null,
|
|
||||||
})
|
|
||||||
|
|
||||||
function openCreate() {
|
|
||||||
editing.value = {
|
|
||||||
id: 0, name: '', enabled: true, ociConfigId: 0, eventTypes: '', sourceIps: '',
|
|
||||||
sourceIpMode: 'in', resourceMatch: '', threshold: 1, windowMinutes: 5,
|
|
||||||
createdAt: '', updatedAt: '',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function openEdit(rule: AlertRule) {
|
|
||||||
editing.value = rule
|
|
||||||
}
|
|
||||||
|
|
||||||
// 进入表单时由所编辑规则回填
|
|
||||||
watch(editing, (r) => {
|
|
||||||
if (!r) return
|
|
||||||
form.name = r.name
|
|
||||||
form.enabled = r.enabled
|
|
||||||
form.cfgId = r.ociConfigId || null
|
|
||||||
form.eventTypes = r.eventTypes ? r.eventTypes.split(',') : []
|
|
||||||
form.sourceIps = r.sourceIps
|
|
||||||
form.sourceIpMode = r.sourceIpMode || 'in'
|
|
||||||
form.resourceMatch = r.resourceMatch
|
|
||||||
form.threshold = r.threshold || 1
|
|
||||||
form.windowMinutes = r.windowMinutes || 5
|
|
||||||
})
|
|
||||||
|
|
||||||
function buildBody(): AlertRuleBody {
|
|
||||||
return {
|
|
||||||
name: form.name.trim(),
|
|
||||||
enabled: form.enabled,
|
|
||||||
ociConfigId: form.cfgId ?? 0,
|
|
||||||
eventTypes: form.eventTypes.join(','),
|
|
||||||
sourceIps: form.sourceIps.trim(),
|
|
||||||
sourceIpMode: form.sourceIpMode,
|
|
||||||
resourceMatch: form.resourceMatch.trim(),
|
|
||||||
threshold: form.threshold ?? 1,
|
|
||||||
windowMinutes: form.windowMinutes ?? 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function save() {
|
|
||||||
if (!editing.value) return
|
|
||||||
saving.value = true
|
|
||||||
try {
|
|
||||||
const body = buildBody()
|
|
||||||
if (editing.value.id) await updateAlertRule(editing.value.id, body)
|
|
||||||
else await createAlertRule(body)
|
|
||||||
message.success(editing.value.id ? '规则已更新' : '规则已创建')
|
|
||||||
editing.value = null
|
|
||||||
void rules.run()
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '保存失败')
|
|
||||||
} finally {
|
|
||||||
saving.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 列表行的启停开关:就地整体覆盖保存 */
|
|
||||||
async function toggleRule(rule: AlertRule, enabled: boolean) {
|
|
||||||
try {
|
|
||||||
await updateAlertRule(rule.id, { ...rule, enabled })
|
|
||||||
rule.enabled = enabled
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '操作失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function removeRule(rule: AlertRule) {
|
|
||||||
try {
|
|
||||||
await deleteAlertRule(rule.id)
|
|
||||||
message.success(`已删除「${rule.name}」`)
|
|
||||||
void rules.run()
|
|
||||||
} catch (e) {
|
|
||||||
message.error(e instanceof Error ? e.message : '删除失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 条件摘要:留空条件不出现 */
|
|
||||||
function ruleSummary(r: AlertRule): string {
|
|
||||||
const parts: string[] = []
|
|
||||||
const alias = scope.cfgOptions.find((o) => Number(o.value) === r.ociConfigId)?.label
|
|
||||||
parts.push(r.ociConfigId ? `租户 ${alias ?? `#${r.ociConfigId}`}` : '全部租户')
|
|
||||||
parts.push(r.eventTypes ? `${r.eventTypes.split(',').length} 种事件` : '全部事件')
|
|
||||||
if (r.sourceIps) parts.push(`IP ${r.sourceIpMode === 'notin' ? '不在' : '命中'} ${r.sourceIps}`)
|
|
||||||
if (r.resourceMatch) parts.push(`资源含「${r.resourceMatch}」`)
|
|
||||||
parts.push(r.threshold > 1 ? `${r.windowMinutes} 分钟内 ${r.threshold} 次` : '即时触发')
|
|
||||||
return parts.join(' · ')
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---- 通知模板入口:复用设置页模板编辑弹窗(kind=audit_alert) ----
|
|
||||||
const templates = useAsync(listNotifyTemplates, false)
|
|
||||||
const tplShow = ref(false)
|
|
||||||
const tplItem = ref<NotifyTemplateItem | null>(null)
|
|
||||||
|
|
||||||
async function openTemplate() {
|
|
||||||
if (!templates.data.value) await templates.run()
|
|
||||||
const item = (templates.data.value ?? []).find((t) => t.kind === 'audit_alert')
|
|
||||||
if (!item) {
|
|
||||||
message.error('模板加载失败,请稍后再试')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tplItem.value = item
|
|
||||||
tplShow.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const canSave = computed(() => !!form.name.trim())
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<NModal
|
|
||||||
v-model:show="show"
|
|
||||||
preset="card"
|
|
||||||
closable
|
|
||||||
title="审计告警规则"
|
|
||||||
:style="{ width: '680px', maxWidth: 'calc(100vw - 24px)' }"
|
|
||||||
>
|
|
||||||
<!-- 表单视图 -->
|
|
||||||
<div v-if="editing" class="flex flex-col">
|
|
||||||
<FormField label="规则名称" required>
|
|
||||||
<NInput v-model:value="form.name" placeholder="如:非白名单终止实例" />
|
|
||||||
</FormField>
|
|
||||||
<div class="grid grid-cols-2 gap-3 max-md:grid-cols-1">
|
|
||||||
<FormField label="租户范围" hint="留空对全部租户生效">
|
|
||||||
<TenantPicker
|
|
||||||
v-model:value="form.cfgId"
|
|
||||||
clearable
|
|
||||||
placeholder="全部租户"
|
|
||||||
:configs="scope.configs.data ?? []"
|
|
||||||
:loading="scope.configs.loading"
|
|
||||||
/>
|
|
||||||
</FormField>
|
|
||||||
<FormField label="事件类型" hint="留空匹配全部回传事件">
|
|
||||||
<NSelect
|
|
||||||
v-model:value="form.eventTypes"
|
|
||||||
multiple
|
|
||||||
clearable
|
|
||||||
:options="eventOptions"
|
|
||||||
placeholder="全部事件"
|
|
||||||
:max-tag-count="2"
|
|
||||||
/>
|
|
||||||
</FormField>
|
|
||||||
</div>
|
|
||||||
<FormField
|
|
||||||
label="来源 IP 条件"
|
|
||||||
hint="逗号分隔 IP 或 CIDR;「不在列表才告警」适合白名单场景(非我发起的操作)"
|
|
||||||
>
|
|
||||||
<div class="mb-1.5 flex gap-1.5">
|
|
||||||
<button
|
|
||||||
v-for="m in [
|
|
||||||
{ v: 'in', t: '命中列表告警' },
|
|
||||||
{ v: 'notin', t: '不在列表才告警' },
|
|
||||||
]"
|
|
||||||
:key="m.v"
|
|
||||||
type="button"
|
|
||||||
class="cursor-pointer rounded-md border px-3 py-1 text-xs"
|
|
||||||
:class="
|
|
||||||
form.sourceIpMode === m.v
|
|
||||||
? 'border-accent bg-accent/10 font-semibold text-accent'
|
|
||||||
: 'border-line bg-white text-ink-2 hover:border-ink-3'
|
|
||||||
"
|
|
||||||
@click="form.sourceIpMode = m.v as 'in' | 'notin'"
|
|
||||||
>
|
|
||||||
{{ m.t }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<NInput v-model:value="form.sourceIps" class="mono" placeholder="203.0.113.8, 10.0.0.0/8(留空=任意)" />
|
|
||||||
</FormField>
|
|
||||||
<div class="grid grid-cols-3 gap-3 max-md:grid-cols-1">
|
|
||||||
<FormField label="资源名包含" hint="子串匹配,留空=任意">
|
|
||||||
<NInput v-model:value="form.resourceMatch" placeholder="web-" />
|
|
||||||
</FormField>
|
|
||||||
<FormField label="触发阈值(次)" hint="1=每次命中即告警">
|
|
||||||
<AppInputNumber v-model:value="form.threshold" :min="1" :max="100" class="!w-full" />
|
|
||||||
</FormField>
|
|
||||||
<FormField label="聚合窗口(分钟)" hint="阈值>1 时生效,告警后同窗冷却">
|
|
||||||
<AppInputNumber
|
|
||||||
v-model:value="form.windowMinutes"
|
|
||||||
:min="1"
|
|
||||||
:max="1440"
|
|
||||||
:disabled="(form.threshold ?? 1) <= 1"
|
|
||||||
class="!w-full"
|
|
||||||
/>
|
|
||||||
</FormField>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between rounded-lg bg-wash px-3 py-2">
|
|
||||||
<span class="text-[12.5px]">启用该规则</span>
|
|
||||||
<NSwitch v-model:value="form.enabled" size="small" />
|
|
||||||
</div>
|
|
||||||
<div class="mt-3 flex items-center gap-2">
|
|
||||||
<NButton size="small" type="primary" :loading="saving" :disabled="!canSave" @click="save">
|
|
||||||
保存
|
|
||||||
</NButton>
|
|
||||||
<NButton size="small" @click="editing = null">返回列表</NButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 列表视图 -->
|
|
||||||
<div v-else class="flex flex-col">
|
|
||||||
<div class="mb-2 flex items-center justify-between gap-2">
|
|
||||||
<div class="text-xs text-ink-3">
|
|
||||||
命中规则的回传事件经「通知方式」的启用渠道推送;仅已建回传链路的租户产生事件
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-none items-center gap-2">
|
|
||||||
<NButton size="tiny" quaternary type="primary" @click="openTemplate">通知模板</NButton>
|
|
||||||
<NButton size="small" type="primary" @click="openCreate">新建规则</NButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-for="rule in rules.data.value ?? []"
|
|
||||||
:key="rule.id"
|
|
||||||
class="flex items-center gap-3 border-b border-line-soft py-2.5 last:border-b-0"
|
|
||||||
>
|
|
||||||
<div class="min-w-0 flex-1">
|
|
||||||
<div class="text-[13px] font-medium">{{ rule.name }}</div>
|
|
||||||
<div class="mt-0.5 truncate text-xs text-ink-3" :title="ruleSummary(rule)">
|
|
||||||
{{ ruleSummary(rule) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<NSwitch
|
|
||||||
size="small"
|
|
||||||
:value="rule.enabled"
|
|
||||||
@update:value="(v: boolean) => toggleRule(rule, v)"
|
|
||||||
/>
|
|
||||||
<NButton size="tiny" quaternary type="primary" @click="openEdit(rule)">编辑</NButton>
|
|
||||||
<NPopconfirm @positive-click="removeRule(rule)">
|
|
||||||
<template #trigger>
|
|
||||||
<NButton size="tiny" quaternary type="error">删除</NButton>
|
|
||||||
</template>
|
|
||||||
删除规则「{{ rule.name }}」?
|
|
||||||
</NPopconfirm>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="!rules.loading.value && !(rules.data.value ?? []).length"
|
|
||||||
class="py-8 text-center text-[13px] text-ink-3"
|
|
||||||
>
|
|
||||||
暂无规则,点击「新建规则」创建第一条
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<NotifyTemplateModal
|
|
||||||
v-model:show="tplShow"
|
|
||||||
:item="tplItem"
|
|
||||||
hint="命中告警规则时推送;变量:rule / tenant / event / resource / ip / count"
|
|
||||||
/>
|
|
||||||
</NModal>
|
|
||||||
</template>
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NDataTable, NModal, NPopover, type DataTableColumns } from 'naive-ui'
|
import { NDataTable, NModal, NPopover, type DataTableColumns } from 'naive-ui'
|
||||||
import { computed, h, reactive, ref } from 'vue'
|
import { computed, h, reactive, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
import { listConfigs } from '@/api/configs'
|
import { listConfigs } from '@/api/configs'
|
||||||
import { listLogEvents } from '@/api/logevents'
|
import { listLogEvents } from '@/api/logevents'
|
||||||
import AlertRuleModal from '@/components/logs/AlertRuleModal.vue'
|
|
||||||
import DetailFieldList, { type DetailRow } from '@/components/DetailFieldList.vue'
|
import DetailFieldList, { type DetailRow } from '@/components/DetailFieldList.vue'
|
||||||
import DetailHero, { type HeroChip } from '@/components/DetailHero.vue'
|
import DetailHero, { type HeroChip } from '@/components/DetailHero.vue'
|
||||||
import FootNote from '@/components/FootNote.vue'
|
import FootNote from '@/components/FootNote.vue'
|
||||||
@@ -41,7 +40,6 @@ const cfgById = computed(() => {
|
|||||||
|
|
||||||
const detail = ref<LogEvent | null>(null)
|
const detail = ref<LogEvent | null>(null)
|
||||||
const showDetail = ref(false)
|
const showDetail = ref(false)
|
||||||
const showRules = ref(false)
|
|
||||||
|
|
||||||
/** 受控远程分页:字面量对象会在重渲染时被重建导致状态丢失 */
|
/** 受控远程分页:字面量对象会在重渲染时被重建导致状态丢失 */
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
@@ -223,7 +221,6 @@ useAutoRefresh(() => load(true))
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-center gap-2">
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
<NButton size="small" @click="showRules = true">告警规则</NButton>
|
|
||||||
<TenantPicker
|
<TenantPicker
|
||||||
v-model:value="cfgFilter"
|
v-model:value="cfgFilter"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -251,12 +248,9 @@ useAutoRefresh(() => load(true))
|
|||||||
在租户详情「其他」tab 一键创建链路后,实例生命周期(Launch/Terminate/InstanceAction)、
|
在租户详情「其他」tab 一键创建链路后,实例生命周期(Launch/Terminate/InstanceAction)、
|
||||||
用户与凭据(Create/Delete/UpdateUser、Create/DeleteApiKey、UpdateUserCapabilities)、
|
用户与凭据(Create/Delete/UpdateUser、Create/DeleteApiKey、UpdateUserCapabilities)、
|
||||||
区域订阅与策略变更等关键审计事件将自动回传;消息按 MessageId 幂等去重,保留 90
|
区域订阅与策略变更等关键审计事件将自动回传;消息按 MessageId 幂等去重,保留 90
|
||||||
天、总量超 2 万条时删除最旧,关键事件另经「通知管理 → 云端事件」推送告警;
|
天、总量超 2 万条时删除最旧,关键事件另经「通知管理 → 云端事件」推送告警
|
||||||
更细粒度的条件告警(事件/来源 IP/资源/频率)在「告警规则」中配置
|
|
||||||
</FootNote>
|
</FootNote>
|
||||||
|
|
||||||
<AlertRuleModal v-model:show="showRules" />
|
|
||||||
|
|
||||||
<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)' }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<DetailHero
|
<DetailHero
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ useAutoRefresh(() => load(true))
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:scroll-x="880"
|
:scroll-x="880"
|
||||||
:max-height="480"
|
|
||||||
:row-key="(r: SystemLog) => r.id"
|
:row-key="(r: SystemLog) => r.id"
|
||||||
:row-props="rowProps"
|
:row-props="rowProps"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -222,7 +222,6 @@ const columns: DataTableColumns<AuditEvent> = [
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:scroll-x="820"
|
:scroll-x="820"
|
||||||
:max-height="480"
|
|
||||||
:row-props="rowProps"
|
:row-props="rowProps"
|
||||||
/>
|
/>
|
||||||
<FootNote>
|
<FootNote>
|
||||||
|
|||||||
@@ -222,7 +222,6 @@ const columns = computed(() => (withAvail.value ? [...baseColumns, ...availColum
|
|||||||
:loading="limits.loading.value"
|
:loading="limits.loading.value"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:scroll-x="withAvail ? 660 : 380"
|
:scroll-x="withAvail ? 660 : 380"
|
||||||
:max-height="440"
|
|
||||||
:row-key="(r: LimitItem) => r.name + (r.availabilityDomain ?? '')"
|
:row-key="(r: LimitItem) => r.name + (r.availabilityDomain ?? '')"
|
||||||
/>
|
/>
|
||||||
<FootNote>
|
<FootNote>
|
||||||
|
|||||||
@@ -878,32 +878,6 @@ export interface LogEventPage {
|
|||||||
total: number
|
total: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 回传事件告警规则;条件间 AND,空条件视为任意 */
|
|
||||||
export interface AlertRule {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
enabled: boolean
|
|
||||||
/** 0=全部租户 */
|
|
||||||
ociConfigId: number
|
|
||||||
/** 逗号分隔事件短名(如 TerminateInstance),空=全部 */
|
|
||||||
eventTypes: string
|
|
||||||
/** 逗号分隔 IP/CIDR,空=任意 */
|
|
||||||
sourceIps: string
|
|
||||||
/** in:命中列表告警;notin:不在列表才告警(白名单) */
|
|
||||||
sourceIpMode: 'in' | 'notin'
|
|
||||||
/** 资源名子串,空=任意 */
|
|
||||||
resourceMatch: string
|
|
||||||
/** 触发阈值,默认 1(即时) */
|
|
||||||
threshold: number
|
|
||||||
/** 聚合窗口分钟,threshold>1 时必填 */
|
|
||||||
windowMinutes: number
|
|
||||||
createdAt: string
|
|
||||||
updatedAt: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 创建/更新告警规则请求体 */
|
|
||||||
export type AlertRuleBody = Omit<AlertRule, 'id' | 'createdAt' | 'updatedAt'>
|
|
||||||
|
|
||||||
/** 每租户回传回调地址;path 需以面板公网域名拼接完整 URL */
|
/** 每租户回传回调地址;path 需以面板公网域名拼接完整 URL */
|
||||||
export interface LogWebhookInfo {
|
export interface LogWebhookInfo {
|
||||||
path: string
|
path: string
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const blacklist = useAsync(listAiBlacklist)
|
|||||||
const baseUrl = `${window.location.origin}/ai/v1`
|
const baseUrl = `${window.location.origin}/ai/v1`
|
||||||
|
|
||||||
const endpoints = [
|
const endpoints = [
|
||||||
|
{ method: 'POST', path: '/chat/completions', note: 'OpenAI · 流式/非流式' },
|
||||||
{ method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' },
|
{ method: 'POST', path: '/responses', note: 'OpenAI Responses · 无状态子集' },
|
||||||
{ method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' },
|
{ method: 'POST', path: '/messages', note: 'Claude · 流式/非流式' },
|
||||||
{ method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' },
|
{ method: 'POST', path: '/embeddings', note: 'OpenAI Embeddings · 向量化' },
|
||||||
|
|||||||
@@ -163,7 +163,8 @@ const currencySymbol = computed(() => {
|
|||||||
{{ ov?.tenants.alive ?? 0 }}/{{ ov?.tenants.total ?? 0 }} 存活
|
{{ ov?.tenants.alive ?? 0 }}/{{ ov?.tenants.total ?? 0 }} 存活
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="px-4.5 py-1.5">
|
<!-- 限高内部滚动:租户多时不撑高整行,底部露半行暗示可滚 -->
|
||||||
|
<div class="max-h-90 overflow-y-auto px-4.5 py-1.5">
|
||||||
<div
|
<div
|
||||||
v-for="c in configs.data.value ?? []"
|
v-for="c in configs.data.value ?? []"
|
||||||
:key="c.id"
|
:key="c.id"
|
||||||
@@ -188,7 +189,8 @@ const currencySymbol = computed(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="w-18 flex-none text-right text-xs text-ink-3">{{ fmtRelative(c.lastVerifiedAt) }}</div>
|
<div class="w-18 flex-none text-right text-xs text-ink-3">{{ fmtRelative(c.lastVerifiedAt) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-2.5 text-center">
|
</div>
|
||||||
|
<div class="border-t border-line-soft py-2.5 text-center">
|
||||||
<RouterLink
|
<RouterLink
|
||||||
class="text-[13px] font-medium text-accent hover:text-accent-hover"
|
class="text-[13px] font-medium text-accent hover:text-accent-hover"
|
||||||
:to="{ name: 'tenants' }"
|
:to="{ name: 'tenants' }"
|
||||||
@@ -197,7 +199,6 @@ const currencySymbol = computed(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 最近任务执行 -->
|
<!-- 最近任务执行 -->
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ async function remove() {
|
|||||||
<div class="max-w-80 text-[13px] leading-relaxed">
|
<div class="max-w-80 text-[13px] leading-relaxed">
|
||||||
<div class="font-medium">删除「{{ config.data.value.alias }}」?</div>
|
<div class="font-medium">删除「{{ config.data.value.alias }}」?</div>
|
||||||
<div class="mt-1 text-xs text-ink-3">
|
<div class="mt-1 text-xs text-ink-3">
|
||||||
将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥、告警规则与 AI 渠道。
|
将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥与 AI 渠道。
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-0.5 text-xs text-ink-3">
|
<div class="mt-0.5 text-xs text-ink-3">
|
||||||
OCI 云端资源不受影响;云端日志回传链路请先在「其他」页销毁。
|
OCI 云端资源不受影响;云端日志回传链路请先在「其他」页销毁。
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NDataTable, NInput, NInputGroup, NInputGroupLabel, NPopconfirm, NPopover, NSelect, NTooltip, type DataTableColumns } from 'naive-ui'
|
import { NButton, NDataTable, NInput, NInputGroup, NInputGroupLabel, NPopconfirm, NPopover, NSelect, NTooltip, type DataTableColumns } from 'naive-ui'
|
||||||
import { computed, h, ref, type VNodeChild } from 'vue'
|
import { computed, h, reactive, ref, watch, type VNodeChild } from 'vue'
|
||||||
import { RouterLink, useRouter } from 'vue-router'
|
import { RouterLink, useRouter } from 'vue-router'
|
||||||
|
|
||||||
import { listAiChannels } from '@/api/aigateway'
|
import { listAiChannels } from '@/api/aigateway'
|
||||||
@@ -63,6 +63,25 @@ const filtered = computed(() => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** 客户端分页:字面量对象会在重渲染时被重建导致状态丢失,须用 reactive 受控 */
|
||||||
|
const pagination = reactive({
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
showSizePicker: true,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
|
onUpdatePage: (p: number) => {
|
||||||
|
pagination.page = p
|
||||||
|
},
|
||||||
|
onUpdatePageSize: (ps: number) => {
|
||||||
|
pagination.pageSize = ps
|
||||||
|
pagination.page = 1
|
||||||
|
},
|
||||||
|
})
|
||||||
|
/** 搜索或分组过滤变化后回第 1 页,避免停留在越界页码 */
|
||||||
|
watch([keyword, groupFilter], () => {
|
||||||
|
pagination.page = 1
|
||||||
|
})
|
||||||
|
|
||||||
/** 任务是否作用于该租户:抢机看目标租户;AI 探测看号池渠道(仅入池租户);
|
/** 任务是否作用于该租户:抢机看目标租户;AI 探测看号池渠道(仅入池租户);
|
||||||
* 测活 / 成本看范围(空 = 全部租户) */
|
* 测活 / 成本看范围(空 = 全部租户) */
|
||||||
function taskTouchesCfg(task: Task, cfgId: number): boolean {
|
function taskTouchesCfg(task: Task, cfgId: number): boolean {
|
||||||
@@ -227,7 +246,7 @@ function renderActions(row: OciConfigSummary): VNodeChild {
|
|||||||
h(
|
h(
|
||||||
'div',
|
'div',
|
||||||
{ class: 'mt-1 text-xs text-ink-3' },
|
{ class: 'mt-1 text-xs text-ink-3' },
|
||||||
'将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥、告警规则与 AI 渠道。',
|
'将清理面板内关联数据:后台任务、测活 / 成本快照、回传事件、Webhook 密钥与 AI 渠道。',
|
||||||
),
|
),
|
||||||
h(
|
h(
|
||||||
'div',
|
'div',
|
||||||
@@ -332,7 +351,7 @@ const columns = computed<DataTableColumns<OciConfigSummary>>(() => [
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="filtered"
|
:data="filtered"
|
||||||
:loading="configs.loading.value"
|
:loading="configs.loading.value"
|
||||||
:pagination="{ pageSize: 10 }"
|
:pagination="pagination"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
:row-key="(r: OciConfigSummary) => r.id"
|
:row-key="(r: OciConfigSummary) => r.id"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user