发布 0.1.0:通知渠道、告警规则与多项体验修复
CI / test (push) Successful in 27s
Release / release (push) Successful in 26s

This commit is contained in:
Wang Defa
2026-07-10 17:31:19 +08:00
parent 9d0c116ce3
commit 5464d2dfea
68 changed files with 1604 additions and 359 deletions
+80 -8
View File
@@ -16,6 +16,10 @@ export interface LoginResponse {
expiresAt: string
}
/** 敏感操作成功后随响应下发的新会话(旧 token 已全部失效);
* 204 降级时为 undefined,前端按会话失效走重新登录 */
export type SessionRefresh = LoginResponse | undefined
/** 两步验证状态 */
export interface TotpStatus {
enabled: boolean
@@ -83,7 +87,7 @@ export interface OauthProviderInfo {
// ---- API Key 配置(租户)----
export type AccountType = 'paid' | 'trial' | 'free' | 'unknown'
export type AliveStatus = 'alive' | 'dead' | 'unknown'
export type AliveStatus = 'alive' | 'dead' | 'suspended' | 'unknown'
/** 列表接口(GET /oci-configs)的瘦身摘要:只含列表页与全局选择器消费的字段 */
export interface OciConfigSummary {
@@ -538,6 +542,16 @@ export interface CostItem {
unit: string
}
// ---- 身份域 ----
// 租户 ACTIVE 身份域;后端只下发元数据,SCIM 端点 URL 由后端解析
export interface IdentityDomain {
id: string
displayName: string
homeRegion: string
type: string
licenseType: string
}
// ---- 租户用户管理 ----
export interface IamUser {
id: string
@@ -579,15 +593,12 @@ export interface AuditEvent {
requestPath: string
}
// truncated 为 true 表示服务端翻页到限(10 页)被截断;nextPage 为续查游标,
// 配合 start/end 绝对时间窗可断点加载更早的事件
// 批式懒加载响应:cursor 供下一批续查原样带回;
// cursor 为空且 exhausted 为 true 表示已回溯到 365 天保留期尽头
export interface AuditEventsResult {
items: AuditEvent[]
truncated: boolean
nextPage?: string
/** 本次实际查询的绝对窗(RFC3339),续查必须原样带回 */
start: string
end: string
cursor?: string
exhausted: boolean
}
// ---- 域通知与密码策略 ----
@@ -724,6 +735,41 @@ export interface TelegramSetting {
tokenTail: string
}
/** 通知渠道类型(Telegram 沿用独立接口,不在此枚举) */
export type NotifyChannelType = 'webhook' | 'ntfy' | 'bark' | 'smtp'
/** 通知渠道脱敏视图;密文字段(ntfy token / bark key / smtp 密码)只回 set/tail */
export interface NotifyChannelItem {
type: NotifyChannelType
enabled: boolean
url?: string
bodyTemplate?: string
server?: string
topic?: string
host?: string
port?: number
username?: string
from?: string
to?: string
secretSet: boolean
secretTail?: string
}
/** 保存单渠道配置;secret 缺省沿用已存值,空串清除 */
export interface UpdateNotifyChannelBody {
enabled: boolean
url?: string
bodyTemplate?: string
server?: string
topic?: string
host?: string
port?: number
username?: string
from?: string
to?: string
secret?: string
}
/** 通知事件开关(通知管理);存量部署未保存过时后端按全开返回 */
export interface NotifyEventsSetting {
/** 任务由成功转失败时推送 */
@@ -832,6 +878,32 @@ export interface LogEventPage {
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 */
export interface LogWebhookInfo {
path: string