mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-31 23:39:35 +08:00
feat: add community enhancements — password reset, audit logs, multi-source backup
Three community-requested features: 1. CLI password reset: `backupx reset-password --username admin --password xxx` Docker users can run via `docker exec`. No full app init needed. 2. Audit logging: async fire-and-forget audit trail for all key operations (login, CRUD on tasks/targets/records, settings changes). New UI page at /audit with category filter and pagination. 3. Multi-source path backup: file backup tasks now support multiple source directories packed into a single tar archive. Backward compatible with existing single sourcePath field.
This commit is contained in:
18
web/src/types/audit.ts
Normal file
18
web/src/types/audit.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export interface AuditLog {
|
||||
id: number
|
||||
userId: number
|
||||
username: string
|
||||
category: string
|
||||
action: string
|
||||
targetType: string
|
||||
targetId: string
|
||||
targetName: string
|
||||
detail: string
|
||||
clientIp: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface AuditLogListResult {
|
||||
items: AuditLog[]
|
||||
total: number
|
||||
}
|
||||
@@ -26,9 +26,19 @@ export interface BackupRecordSummary {
|
||||
completedAt?: string
|
||||
}
|
||||
|
||||
export interface StorageUploadResultItem {
|
||||
storageTargetId: number
|
||||
storageTargetName: string
|
||||
status: 'success' | 'failed'
|
||||
storagePath?: string
|
||||
fileSize?: number
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface BackupRecordDetail extends BackupRecordSummary {
|
||||
logContent: string
|
||||
logEvents?: BackupLogEvent[]
|
||||
storageUploadResults?: StorageUploadResultItem[]
|
||||
}
|
||||
|
||||
export interface BackupRecordListFilter {
|
||||
|
||||
@@ -10,6 +10,8 @@ export interface BackupTaskSummary {
|
||||
cronExpr: string
|
||||
storageTargetId: number
|
||||
storageTargetName: string
|
||||
storageTargetIds: number[]
|
||||
storageTargetNames: string[]
|
||||
nodeId: number
|
||||
nodeName?: string
|
||||
tags: string
|
||||
@@ -24,6 +26,7 @@ export interface BackupTaskSummary {
|
||||
|
||||
export interface BackupTaskDetail extends BackupTaskSummary {
|
||||
sourcePath: string
|
||||
sourcePaths: string[]
|
||||
excludePatterns: string[]
|
||||
dbHost: string
|
||||
dbPort: number
|
||||
@@ -40,6 +43,7 @@ export interface BackupTaskPayload {
|
||||
enabled: boolean
|
||||
cronExpr: string
|
||||
sourcePath: string
|
||||
sourcePaths: string[]
|
||||
excludePatterns: string[]
|
||||
dbHost: string
|
||||
dbPort: number
|
||||
@@ -48,6 +52,7 @@ export interface BackupTaskPayload {
|
||||
dbName: string
|
||||
dbPath: string
|
||||
storageTargetId: number
|
||||
storageTargetIds: number[]
|
||||
nodeId: number
|
||||
tags: string
|
||||
retentionDays: number
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface StorageTargetSummary {
|
||||
type: StorageTargetType
|
||||
description: string
|
||||
enabled: boolean
|
||||
starred: boolean
|
||||
updatedAt: string
|
||||
lastTestedAt?: string
|
||||
lastTestStatus: StorageTestStatus
|
||||
|
||||
Reference in New Issue
Block a user