From 462a3bbc831914caa014776bf088f534c32a8938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Wed, 27 May 2026 14:09:50 +0800 Subject: [PATCH] feat: add node selection reports (#12871) * feat: add node selection reports * Merge dev-v2 and resolve PR conflicts --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- agent/app/dto/ssh.go | 6 ++-- agent/app/service/ssh.go | 33 +++++++++++++++-- core/app/dto/logs.go | 6 ++-- core/app/repo/common.go | 8 +++++ core/app/service/logs.go | 3 ++ core/app/service/setting.go | 9 ----- core/go.mod | 2 -- core/go.sum | 5 --- frontend/src/api/interface/cronjob.ts | 4 +-- frontend/src/api/interface/host.ts | 2 ++ frontend/src/api/interface/log.ts | 3 ++ frontend/src/api/modules/alert.ts | 27 ++++++++++---- frontend/src/api/modules/container.ts | 26 ++++++++++---- frontend/src/api/modules/cronjob.ts | 9 +++-- frontend/src/api/modules/dashboard.ts | 16 ++++++--- frontend/src/api/modules/files.ts | 9 +++-- frontend/src/api/modules/host.ts | 51 ++++++++++++++++++++------- frontend/src/api/modules/log.ts | 9 +++-- frontend/src/api/modules/website.ts | 9 +++-- frontend/src/lang/modules/en.ts | 5 ++- frontend/src/lang/modules/es-es.ts | 5 ++- frontend/src/lang/modules/ja.ts | 5 ++- frontend/src/lang/modules/ko.ts | 5 ++- frontend/src/lang/modules/ms.ts | 5 ++- frontend/src/lang/modules/pt-br.ts | 5 ++- frontend/src/lang/modules/ru.ts | 5 ++- frontend/src/lang/modules/tr.ts | 5 ++- frontend/src/lang/modules/zh-Hant.ts | 5 ++- frontend/src/lang/modules/zh.ts | 5 ++- frontend/src/utils/date.ts | 16 +++++++++ 30 files changed, 232 insertions(+), 71 deletions(-) diff --git a/agent/app/dto/ssh.go b/agent/app/dto/ssh.go index 8aef60814..de965539f 100644 --- a/agent/app/dto/ssh.go +++ b/agent/app/dto/ssh.go @@ -57,8 +57,10 @@ type SSHConfUpdate struct { } type SearchSSHLog struct { PageInfo - Info string `json:"info"` - Status string `json:"Status" validate:"required,oneof=Success Failed All"` + Info string `json:"info"` + Status string `json:"Status" validate:"required,oneof=Success Failed All"` + StartTime time.Time `json:"startTime"` + EndTime time.Time `json:"endTime"` } type SSHHistory struct { diff --git a/agent/app/service/ssh.go b/agent/app/service/ssh.go index 9ae10e340..ea8e78188 100644 --- a/agent/app/service/ssh.go +++ b/agent/app/service/ssh.go @@ -599,7 +599,18 @@ func (u *SSHService) LoadLog(ctx *gin.Context, req dto.SearchSSHLog) (int64, []d nyc, _ := time.LoadLocation(common.LoadTimeZoneByCmd()) itemFailed, itemTotal := 0, 0 for _, file := range fileList { - dataItem, successCount, failedCount := loadSSHData(ctx, file.Name, req.Status, filter, showCountFrom, showCountTo, file.Year, nyc) + dataItem, successCount, failedCount := loadSSHData( + ctx, + file.Name, + req.Status, + filter, + req.StartTime, + req.EndTime, + showCountFrom, + showCountTo, + file.Year, + nyc, + ) itemFailed += failedCount itemTotal += successCount + failedCount showCountFrom = showCountFrom - (successCount + failedCount) @@ -1118,7 +1129,13 @@ type sshParsedLog struct { Index int } -func loadSSHData(ctx *gin.Context, filePath, status, filter string, showCountFrom, showCountTo, currentYear int, nyc *time.Location) ([]dto.SSHHistory, int, int) { +func loadSSHData( + ctx *gin.Context, + filePath, status, filter string, + startTime, endTime time.Time, + showCountFrom, showCountTo, currentYear int, + nyc *time.Location, +) ([]dto.SSHHistory, int, int) { var ( datas []dto.SSHHistory successCount int @@ -1138,9 +1155,12 @@ func loadSSHData(ctx *gin.Context, filePath, status, filter string, showCountFro if !matchSSHLogStatus(status, itemData.Status) || !checkIsStandard(itemData) { continue } + itemData.Date = loadDate(currentYear, itemData.DateStr, nyc) + if !isSSHLogWithinTimeRange(itemData.Date, startTime, endTime) { + continue + } if successCount+failedCount >= showCountFrom && (showCountTo == -1 || successCount+failedCount < showCountTo) { itemData.Area, _ = geo.GetIPLocation(getLoc, itemData.Address, common.GetLang(ctx)) - itemData.Date = loadDate(currentYear, itemData.DateStr, nyc) datas = append(datas, itemData) } if itemData.Status == constant.StatusSuccess { @@ -1152,6 +1172,13 @@ func loadSSHData(ctx *gin.Context, filePath, status, filter string, showCountFro return datas, successCount, failedCount } +func isSSHLogWithinTimeRange(itemTime, startTime, endTime time.Time) bool { + if startTime.IsZero() || endTime.IsZero() { + return true + } + return itemTime.After(startTime) && itemTime.Before(endTime) +} + func collectSSHLogItems(lines []string, filter, status string) []sshParsedLog { var items []sshParsedLog auxiliaryIndex := make(map[string]int) diff --git a/core/app/dto/logs.go b/core/app/dto/logs.go index 16002b7b5..ecee476ca 100644 --- a/core/app/dto/logs.go +++ b/core/app/dto/logs.go @@ -33,8 +33,10 @@ type SearchOpLogWithPage struct { type SearchLgLogWithPage struct { PageInfo - Info string `json:"info"` - Status string `json:"status"` + Info string `json:"info"` + Status string `json:"status"` + StartTime time.Time `json:"startTime"` + EndTime time.Time `json:"endTime"` } type LoginLog struct { diff --git a/core/app/repo/common.go b/core/app/repo/common.go index 998f78c9e..ccf3a095d 100644 --- a/core/app/repo/common.go +++ b/core/app/repo/common.go @@ -2,6 +2,7 @@ package repo import ( "fmt" + "time" "github.com/1Panel-dev/1Panel/core/constant" "github.com/1Panel-dev/1Panel/core/global" @@ -73,6 +74,13 @@ func WithByStatus(status string) global.DBOption { return g.Where("status = ?", status) } } + +func WithByCreatedAt(startTime, endTime time.Time) global.DBOption { + return func(g *gorm.DB) *gorm.DB { + return g.Where("created_at > ? AND created_at < ?", startTime, endTime) + } +} + func WithByNode(node string) global.DBOption { return func(g *gorm.DB) *gorm.DB { return g.Where("node = ?", node) diff --git a/core/app/service/logs.go b/core/app/service/logs.go index 0c87efc74..55c5ef848 100644 --- a/core/app/service/logs.go +++ b/core/app/service/logs.go @@ -53,6 +53,9 @@ func (u *LogService) PageLoginLog(ctx *gin.Context, req dto.SearchLgLogWithPage) if len(req.Status) != 0 { options = append(options, repo.WithByStatus(req.Status)) } + if !req.StartTime.IsZero() && !req.EndTime.IsZero() { + options = append(options, repo.WithByCreatedAt(req.StartTime, req.EndTime)) + } total, ops, err := logRepo.PageLoginLog( req.Page, req.PageSize, diff --git a/core/app/service/setting.go b/core/app/service/setting.go index 790296027..cfc22c73a 100644 --- a/core/app/service/setting.go +++ b/core/app/service/setting.go @@ -113,15 +113,6 @@ func (u *SettingService) GetSettingInfo() (*dto.SettingInfo, error) { return &info, err } -func defaultOpsReportSavePath() string { - return path.Join(global.CONF.Base.InstallDir, constant.OpsReportDefaultSaveSubDir) -} - -func isValidOpsReportThreshold(value string) bool { - threshold, err := strconv.Atoi(strings.TrimSpace(value)) - return err == nil && threshold >= 1 && threshold <= 100 -} - func (u *SettingService) GetSettingBaseInfo() (*dto.SettingBaseInfo, error) { setting, err := settingRepo.List() if err != nil { diff --git a/core/go.mod b/core/go.mod index e021f5102..efa137ca4 100644 --- a/core/go.mod +++ b/core/go.mod @@ -83,12 +83,10 @@ require ( github.com/ncruces/go-strftime v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.3.0 // indirect github.com/philhofer/fwd v1.2.0 // indirect - github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect github.com/quic-go/qpack v0.6.0 // indirect github.com/quic-go/quic-go v0.59.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/sagikazarmark/locafero v0.12.0 // indirect - github.com/signintech/gopdf v0.36.1 github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect diff --git a/core/go.sum b/core/go.sum index 3bd74a1a5..2068447cf 100644 --- a/core/go.sum +++ b/core/go.sum @@ -145,9 +145,6 @@ github.com/pelletier/go-toml/v2 v2.3.0 h1:k59bC/lIZREW0/iVaQR8nDHxVq8OVlIzYCOJf4 github.com/pelletier/go-toml/v2 v2.3.0/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM= github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= -github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 h1:zyWXQ6vu27ETMpYsEMAsisQ+GqJ4e1TPvSNfdOPF0no= -github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.10 h1:+5FbKNTe5Z9aspU88DPIKJ9z2KZoaGCu6Sr6kKR/5mU= @@ -167,8 +164,6 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= -github.com/signintech/gopdf v0.36.1 h1:cGpvEKvvqCV+ZXB9R2SQoWgouW91JpwsgoQEhLxIdp0= -github.com/signintech/gopdf v0.36.1/go.mod h1:d23eO35GpEliSrF22eJ4bsM3wVeQJTjXTHq5x5qGKjA= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= diff --git a/frontend/src/api/interface/cronjob.ts b/frontend/src/api/interface/cronjob.ts index a6f5234b9..1a1de9a08 100644 --- a/frontend/src/api/interface/cronjob.ts +++ b/frontend/src/api/interface/cronjob.ts @@ -195,8 +195,8 @@ export namespace Cronjob { } export interface SearchRecord extends ReqPage { cronjobID: number; - startTime: Date; - endTime: Date; + startTime: string | Date; + endTime: string | Date; status: string; } export interface Record { diff --git a/frontend/src/api/interface/host.ts b/frontend/src/api/interface/host.ts index cb2fdcf01..405fbd143 100644 --- a/frontend/src/api/interface/host.ts +++ b/frontend/src/api/interface/host.ts @@ -201,6 +201,8 @@ export namespace Host { export interface searchSSHLog extends ReqPage { info: string; status: string; + startTime?: string | Date; + endTime?: string | Date; } export interface analysisSSHLog extends ReqPage { orderBy: string; diff --git a/frontend/src/api/interface/log.ts b/frontend/src/api/interface/log.ts index 5a9b89488..3209abe52 100644 --- a/frontend/src/api/interface/log.ts +++ b/frontend/src/api/interface/log.ts @@ -22,10 +22,13 @@ export namespace Log { source: string; status: string; operation: string; + node?: string; } export interface SearchLgLog extends ReqPage { info: string; status: string; + startTime?: string | Date; + endTime?: string | Date; } export interface LoginLogs { ip: string; diff --git a/frontend/src/api/modules/alert.ts b/frontend/src/api/modules/alert.ts index 7b26886f9..12911d023 100644 --- a/frontend/src/api/modules/alert.ts +++ b/frontend/src/api/modules/alert.ts @@ -2,8 +2,13 @@ import http from '@/api'; import { ResPage } from '@/api/interface'; import { Alert } from '../interface/alert'; import { deepCopy } from '@/utils/misc'; -export const SearchAlerts = (req: Alert.AlertSearch) => { - return http.post>(`/alert/search`, req); +export const SearchAlerts = (req: Alert.AlertSearch, currentNode?: string) => { + return http.post>( + `/alert/search`, + req, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const CreateAlert = (req: Alert.AlertCreateReq) => { @@ -27,8 +32,13 @@ export const ListDisks = () => { return http.get(`/alert/disks/list`); }; -export const SearchAlertLogs = (req: Alert.AlertLogSearch) => { - return http.post>(`/alert/logs/search`, req); +export const SearchAlertLogs = (req: Alert.AlertLogSearch, currentNode?: string) => { + return http.post>( + `/alert/logs/search`, + req, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const CleanAlertLogs = () => { @@ -43,8 +53,13 @@ export const ListCronJob = (req: Alert.CronJobReq) => { return http.post(`/alert/cronjob/list`, req); }; -export const ListAlertConfigs = () => { - return http.post(`/alert/config/info`); +export const ListAlertConfigs = (currentNode?: string) => { + return http.post( + `/alert/config/info`, + {}, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const DeleteAlertConfig = (req: Alert.DelReq) => { diff --git a/frontend/src/api/modules/container.ts b/frontend/src/api/modules/container.ts index 52e7f7fd6..90c6ec177 100644 --- a/frontend/src/api/modules/container.ts +++ b/frontend/src/api/modules/container.ts @@ -3,8 +3,13 @@ import { ResPage, SearchWithPage } from '../interface'; import { Container } from '../interface/container'; import { TimeoutEnum } from '@/enums/http-enum'; -export const searchContainer = (params: Container.ContainerSearch) => { - return http.post>(`/containers/search`, params, TimeoutEnum.T_40S); +export const searchContainer = (params: Container.ContainerSearch, currentNode?: string) => { + return http.post>( + `/containers/search`, + params, + TimeoutEnum.T_40S, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const listContainer = () => { return http.post>(`/containers/list`, {}); @@ -39,8 +44,12 @@ export const downloadContainerFile = (params: { containerID: string; path: strin timeout: TimeoutEnum.T_40S, }); }; -export const loadContainerStatus = () => { - return http.get(`/containers/status`); +export const loadContainerStatus = (currentNode?: string) => { + return http.get( + `/containers/status`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; export const loadResourceLimit = () => { return http.get(`/containers/limit`); @@ -72,8 +81,13 @@ export const cleanContainerLog = (containerName: string, operateNode?: string) = const params = operateNode ? `?operateNode=${operateNode}` : ''; return http.post(`/containers/clean/log${params}`, { name: containerName }, TimeoutEnum.T_60S); }; -export const containerItemStats = (containerID: string) => { - return http.post(`/containers/item/stats`, { name: containerID }, TimeoutEnum.T_60S); +export const containerItemStats = (containerID: string, currentNode?: string) => { + return http.post( + `/containers/item/stats`, + { name: containerID }, + TimeoutEnum.T_60S, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const containerListStats = () => { return http.get>(`/containers/list/stats`); diff --git a/frontend/src/api/modules/cronjob.ts b/frontend/src/api/modules/cronjob.ts index 5f3b3f0e7..dad957cbd 100644 --- a/frontend/src/api/modules/cronjob.ts +++ b/frontend/src/api/modules/cronjob.ts @@ -47,8 +47,13 @@ export const deleteCronjob = (params: Cronjob.CronjobDelete) => { return http.post(`/cronjobs/del`, params); }; -export const searchRecords = (params: Cronjob.SearchRecord, timeout?: TimeoutEnum) => { - return http.post>(`cronjobs/search/records`, params, timeout); +export const searchRecords = (params: Cronjob.SearchRecord, timeout?: TimeoutEnum, currentNode?: string) => { + return http.post>( + `cronjobs/search/records`, + params, + timeout, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const stopCronjob = (id: number) => { diff --git a/frontend/src/api/modules/dashboard.ts b/frontend/src/api/modules/dashboard.ts index 077140db5..9b3153675 100644 --- a/frontend/src/api/modules/dashboard.ts +++ b/frontend/src/api/modules/dashboard.ts @@ -21,12 +21,20 @@ export const changeLauncherStatus = (key: string, val: string) => { return http.post(`/dashboard/app/launcher/show`, { key: key, value: val }); }; -export const loadBaseInfo = (ioOption: string, netOption: string) => { - return http.get(`/dashboard/base/${ioOption}/${netOption}`); +export const loadBaseInfo = (ioOption: string, netOption: string, currentNode?: string) => { + return http.get( + `/dashboard/base/${ioOption}/${netOption}`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; -export const loadCurrentInfo = (ioOption: string, netOption: string) => { - return http.get(`/dashboard/current/${ioOption}/${netOption}`); +export const loadCurrentInfo = (ioOption: string, netOption: string, currentNode?: string) => { + return http.get( + `/dashboard/current/${ioOption}/${netOption}`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; export const loadTopCPU = () => { diff --git a/frontend/src/api/modules/files.ts b/frontend/src/api/modules/files.ts index 1bb8afcc3..f42b79deb 100644 --- a/frontend/src/api/modules/files.ts +++ b/frontend/src/api/modules/files.ts @@ -68,8 +68,13 @@ export const stopDeCompressFile = (taskID: string) => { return http.post('files/decompress/stop', { taskID } as File.FileDeCompressStopReq); }; -export const getFileContent = (params: File.ReqFile) => { - return http.post('files/content', params); +export const getFileContent = (params: File.ReqFile, currentNode?: string) => { + return http.post( + `files/content`, + params, + TimeoutEnum.T_3M, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const getPreviewContent = (params: File.PreviewContentReq) => { diff --git a/frontend/src/api/modules/host.ts b/frontend/src/api/modules/host.ts index ada5adad6..3d1d879f2 100644 --- a/frontend/src/api/modules/host.ts +++ b/frontend/src/api/modules/host.ts @@ -62,28 +62,50 @@ export const operateFilterChain = (name: string, op: string) => { }; // monitors -export const loadMonitor = (param: Host.MonitorSearch) => { - return http.post>(`/hosts/monitor/search`, param); +export const loadMonitor = (param: Host.MonitorSearch, currentNode?: string) => { + return http.post>( + `/hosts/monitor/search`, + param, + TimeoutEnum.T_60S, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; -export const getNetworkOptions = () => { - return http.get>(`/hosts/monitor/netoptions`); +export const getNetworkOptions = (currentNode?: string) => { + return http.get>( + `/hosts/monitor/netoptions`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; -export const getIOOptions = () => { - return http.get>(`/hosts/monitor/iooptions`); +export const getIOOptions = (currentNode?: string) => { + return http.get>( + `/hosts/monitor/iooptions`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; export const cleanMonitors = () => { return http.post(`/hosts/monitor/clean`, {}); }; -export const loadMonitorSetting = () => { - return http.get(`/hosts/monitor/setting`, {}); +export const loadMonitorSetting = (currentNode?: string) => { + return http.get( + `/hosts/monitor/setting`, + {}, + currentNode ? { headers: { CurrentNode: currentNode } } : {}, + ); }; export const updateMonitorSetting = (key: string, value: string) => { return http.post(`/hosts/monitor/setting/update`, { key: key, value: value }); }; // ssh -export const getSSHInfo = () => { - return http.post(`/hosts/ssh/search`); +export const getSSHInfo = (currentNode?: string) => { + return http.post( + `/hosts/ssh/search`, + {}, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const operateSSH = (operation: string) => { return http.post(`/hosts/ssh/operate`, { operation: operation }, TimeoutEnum.T_40S); @@ -116,8 +138,13 @@ export const deleteCert = (ids: Array, forceDelete: boolean) => { export const syncCert = () => { return http.post(`/hosts/ssh/cert/sync`); }; -export const loadSSHLogs = (params: Host.searchSSHLog) => { - return http.post>(`/hosts/ssh/log`, params); +export const loadSSHLogs = (params: Host.searchSSHLog, currentNode?: string) => { + return http.post>( + `/hosts/ssh/log`, + params, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const exportSSHLogs = (params: Host.searchSSHLog) => { return http.post(`/hosts/ssh/log/export`, params, TimeoutEnum.T_40S); diff --git a/frontend/src/api/modules/log.ts b/frontend/src/api/modules/log.ts index 2d0e10fda..4481e734f 100644 --- a/frontend/src/api/modules/log.ts +++ b/frontend/src/api/modules/log.ts @@ -7,8 +7,13 @@ export const getOperationLogs = (info: Log.SearchOpLog) => { return http.post>(`/core/logs/operation`, info); }; -export const getLoginLogs = (info: Log.SearchLgLog) => { - return http.post>(`/core/logs/login`, info); +export const getLoginLogs = (info: Log.SearchLgLog, currentNode?: string) => { + return http.post>( + `/core/logs/login`, + info, + undefined, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const getSystemFiles = (node?: string) => { diff --git a/frontend/src/api/modules/website.ts b/frontend/src/api/modules/website.ts index c42fb4930..ca65f2ff6 100644 --- a/frontend/src/api/modules/website.ts +++ b/frontend/src/api/modules/website.ts @@ -110,8 +110,13 @@ export const updateAcmeAccount = (req: Website.AcmeAccountUpdate) => { return http.post(`/websites/acme/update`, req, TimeoutEnum.T_10M); }; -export const searchSSL = (req: ReqPage) => { - return http.post>(`/websites/ssl/search`, req); +export const searchSSL = (req: ReqPage, currentNode?: string) => { + return http.post>( + `/websites/ssl/search`, + req, + TimeoutEnum.T_40S, + currentNode ? { CurrentNode: currentNode } : undefined, + ); }; export const listSSL = (req: Website.SSLReq) => { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 8fb0308bd..f3bc14dab 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -3976,6 +3976,9 @@ const message = { setting: 'Settings', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4202,7 +4205,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/es-es.ts b/frontend/src/lang/modules/es-es.ts index 832d78e0c..d1e35a3f0 100644 --- a/frontend/src/lang/modules/es-es.ts +++ b/frontend/src/lang/modules/es-es.ts @@ -4034,6 +4034,9 @@ const message = { setting: 'Configuración', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4250,7 +4253,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 3c73e5de1..94e6971a6 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -4016,6 +4016,9 @@ const message = { setting: '設定', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4232,7 +4235,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 61422914b..5c4f0dbbd 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -3928,6 +3928,9 @@ const message = { setting: '설정', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4144,7 +4147,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 6080f486d..95d2cab9e 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -4071,6 +4071,9 @@ const message = { setting: 'Tetapan', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4287,7 +4290,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 50d45b466..583bee6bb 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -4210,6 +4210,9 @@ const message = { setting: 'Configurações', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4426,7 +4429,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 47d10a204..5ae321f05 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -4062,6 +4062,9 @@ const message = { setting: 'Настройки', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4278,7 +4281,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts index 2c7b6927f..c8508face 100644 --- a/frontend/src/lang/modules/tr.ts +++ b/frontend/src/lang/modules/tr.ts @@ -4063,6 +4063,9 @@ const message = { setting: 'Ayarlar', page: { enterprise: 'Enterprise', + reportNode: 'Report Node', + selectReportNode: 'Select report node', + currentNode: 'Current', scoreMeta: '{0} points deducted · {1} risks', hostAddress: 'Host Address', panelVersion: 'Panel Version', @@ -4279,7 +4282,7 @@ const message = { alertFailedLogs: 'Failed Alert Logs', alertPendingLogs: 'Pending Sync Logs', alertPending: 'Pending Sync', - alertTaskTypeStats: 'Alert Type Statistics', + alertTaskStats: 'Alert Task Statistics', alertTaskType: 'Alert Type', alertLogStatusStats: 'Alert Execution Status', alertHealthNormal: 'Normal', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index c11c6f7a4..69000d4a4 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -3702,6 +3702,9 @@ const message = { setting: '設置', page: { enterprise: '企業版', + reportNode: '報表節點', + selectReportNode: '選擇報表節點', + currentNode: '當前節點', scoreMeta: '扣分 {0} 分 · 風險 {1} 項', hostAddress: '主機地址', panelVersion: '面板版本', @@ -3913,7 +3916,7 @@ const message = { alertFailedLogs: '失敗告警日誌', alertPendingLogs: '待同步日誌', alertPending: '待同步', - alertTaskTypeStats: '告警類型統計', + alertTaskStats: '告警任務統計', alertTaskType: '告警類型', alertLogStatusStats: '告警執行狀態', alertHealthNormal: '正常', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 05bdc94df..9eea5acd5 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -4290,6 +4290,9 @@ const message = { setting: '设置', page: { enterprise: '企业版', + reportNode: '报表节点', + selectReportNode: '选择报表节点', + currentNode: '当前节点', scoreMeta: '扣分 {0} 分 · 风险 {1} 项', hostAddress: '主机地址', panelVersion: '面板版本', @@ -4511,7 +4514,7 @@ const message = { alertFailedLogs: '失败告警日志', alertPendingLogs: '待同步日志', alertPending: '待同步', - alertTaskTypeStats: '告警类型统计', + alertTaskStats: '告警任务统计', alertTaskType: '告警类型', alertLogStatusStats: '告警执行状态', alertHealthNormal: '正常', diff --git a/frontend/src/utils/date.ts b/frontend/src/utils/date.ts index ebadd6a61..679de11e4 100644 --- a/frontend/src/utils/date.ts +++ b/frontend/src/utils/date.ts @@ -100,6 +100,22 @@ export function dateFormatSimpleWithSecond(dataStr: any) { return `${String(y)}-${String(m)}-${String(d)} ${String(h)}:${String(minute)}:${String(second)}`; } +export function dateFormatRFC3339(dataStr: any) { + const date = new Date(dataStr); + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, '0'); + const d = String(date.getDate()).padStart(2, '0'); + const h = String(date.getHours()).padStart(2, '0'); + const minute = String(date.getMinutes()).padStart(2, '0'); + const second = String(date.getSeconds()).padStart(2, '0'); + const offset = -date.getTimezoneOffset(); + const sign = offset >= 0 ? '+' : '-'; + const absOffset = Math.abs(offset); + const offsetHour = String(Math.floor(absOffset / 60)).padStart(2, '0'); + const offsetMinute = String(absOffset % 60).padStart(2, '0'); + return `${y}-${m}-${d}T${h}:${minute}:${second}${sign}${offsetHour}:${offsetMinute}`; +} + export function dateFormatForName(dataStr: any) { const date = new Date(dataStr); const y = date.getFullYear();