权限监控与管理界面全面美化

重新设计权限系统所有 UI 组件的视觉风格,统一配色、圆角、阴影和交互动效:
- 实时概览:统计卡片加图标和渐变色条,健康评分改为环形进度,告警改为卡片式
- 趋势分析:图表卡片加彩色图标标识,ECharts 配色升级为渐变面积填充
- 访问日志:指标卡片带图标,日志审计改为卡片式入口,IP排行前三高亮
- IP属地:工具栏重设计,排行列表前三渐变高亮,指标卡片统一新风格
- 系统级权限:从 el-table 改为自定义卡片列表,模块块独立圆角卡片
- 项目权限配置:空状态引导优化,成员表格加头像,工具栏加背景容器
- 角色概览卡片:加进度条可视化,hover 微动效
- 接口权限矩阵:工具栏分离布局,表格圆角包裹
- 角色管理抽屉:侧边栏选中态渐变,操作行 hover 高亮

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Cheng Zhou
2026-05-20 14:36:35 +08:00
parent e95eeed90e
commit 6cefa620e4
68 changed files with 6927 additions and 984 deletions
+154 -3
View File
@@ -131,11 +131,11 @@ export interface Site {
}
// 接口级权限
export type ApiPermissionValue = boolean | { allowed: boolean };
export interface ApiEndpointPermissionsResponse {
[role: string]: {
[endpoint_key: string]: {
allowed: boolean;
};
[endpoint_key: string]: ApiPermissionValue;
};
}
@@ -204,3 +204,154 @@ export interface HealthResponse {
metrics: PermissionMetricsResponse;
cache_stats: CacheStatsResponse;
}
// 权限监控 - 访问日志
export interface AccessLogItem {
id: string;
study_id: string;
user_id: string;
user_name: string;
endpoint_key: string;
role: string;
allowed: boolean;
elapsed_ms: number;
ip_address: string | null;
ip_location: string;
ip_country: string;
ip_province: string;
ip_city: string;
ip_isp: string;
created_at: string;
}
export interface AccessLogsSummary {
total_count: number;
unique_user_count: number;
unique_ip_count: number;
denied_count: number;
avg_elapsed_ms: number;
}
export interface AccessLogUserStat {
user_id: string;
user_name: string;
role: string;
total_count: number;
denied_count: number;
unique_ip_count: number;
sample_ip_address: string | null;
last_seen_at: string | null;
primary_location: string;
}
export interface AccessLogsResponse {
total: number;
page: number;
page_size: number;
summary: AccessLogsSummary;
user_stats: AccessLogUserStat[];
items: AccessLogItem[];
}
export interface SecurityAccessLogItem {
id: string;
method: string;
path: string;
status_code: number;
elapsed_ms: number;
client_ip: string | null;
user_agent: string | null;
auth_status: "ANONYMOUS" | "INVALID_TOKEN" | "AUTHENTICATED" | string;
user_identifier: string | null;
account_label: string;
created_at: string;
}
export interface SecurityAccessLogsResponse {
total: number;
page: number;
page_size: number;
summary: {
total_count: number;
anonymous_count: number;
invalid_token_count: number;
error_count: number;
};
items: SecurityAccessLogItem[];
}
// 权限监控 - 趋势数据
export interface TrendDataPoint {
bucket_time: string;
total_checks: number;
allowed_checks: number;
denied_checks: number;
avg_elapsed_ms: number;
max_elapsed_ms: number;
cache_hits: number;
cache_misses: number;
cache_hit_rate: number;
error_count: number;
}
export interface TrendsResponse {
period: string;
data_points: TrendDataPoint[];
}
// 权限监控 - 被拒绝最多
export interface TopDeniedItem {
endpoint_key: string;
role: string;
denied_count: number;
}
export interface TopDeniedResponse {
days: number;
items: TopDeniedItem[];
}
export interface IpLocationStatItem {
country: string;
province: string;
city: string;
isp: string;
location: string;
total_count: number;
allowed_count: number;
denied_count: number;
unique_ip_count: number;
unique_user_count: number;
}
export interface IpLocationsResponse {
days: number;
summary: {
total_count: number;
allowed_count: number;
denied_count: number;
unique_ip_count: number;
unique_user_count: number;
};
items: IpLocationStatItem[];
}
// 权限监控 - 统计摘要
export interface StatsSummaryResponse {
total_logs: number;
today: {
total_checks: number;
allowed_checks: number;
denied_checks: number;
avg_elapsed_ms: number;
max_elapsed_ms: number;
allow_rate: number;
deny_rate: number;
};
last_hour: {
total_checks: number;
allowed_checks: number;
denied_checks: number;
requests_per_minute: number;
};
}