feat: enhance alert log search with start and end time filters - #13489
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR primarily adds start/end time filtering to the agent-side alert log search, while also including several cross-cutting updates in the frontend auth flow, core local-agent proxy helper, and setting-related typings/validation keys.
Changes:
- Add
startTime/endTimefields to alert log search DTO and applycreated_attime-range filtering in alert log pagination. - Update frontend 403/forbidden handling to clear auth info and set login status via
globalStoreactions. - Refactor core’s local Unix-socket proxy helper to route requests through a new client wrapper; remove OpsReport-related setting fields/keys; add
CronjobIDto cronjob record DTO.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/utils/auth-response.ts | Clears auth info and sets login status via globalStore before redirecting to entrance. |
| frontend/src/api/helper/check-status.ts | Aligns 403 handling with the updated auth-clearing behavior. |
| frontend/src/api/interface/setting.ts | Removes OpsReport-related fields from the SettingInfo typing. |
| core/utils/req_helper/proxy_local/req_to_local.go | Introduces a client wrapper for Unix-socket requests and routes NewLocalClient through it. |
| core/init/validator/validator.go | Removes OpsReport-related keys from the core setting key allowlist. |
| agent/app/dto/alert.go | Extends AlertLogSearch with startTime/endTime as time.Time. |
| agent/app/service/alert.go | Applies time-range filtering to alert log pagination when start/end times are provided. |
| agent/app/dto/cronjob.go | Adds CronjobID to the Record DTO payload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
21
to
25
| export const redirectToEntrance = () => { | ||
| const { entrance, isLogin } = useGlobalStore(); | ||
| isLogin.value = false; | ||
| const { entrance, globalStore } = useGlobalStore(); | ||
| globalStore.setLogStatus(false); | ||
| globalStore.clearAuthInfo(); | ||
| router.push({ |
Comment on lines
21
to
+25
| func NewLocalClient(reqUrl, reqMethod string, body io.Reader, ctx *gin.Context) (interface{}, error) { | ||
| sockPath := "/etc/1panel/agent.sock" | ||
| if _, err := os.Stat(sockPath); err != nil { | ||
| return nil, fmt.Errorf("no such agent.sock find in localhost, err: %v", err) | ||
| } | ||
| client := NewReusableClient() | ||
| defer client.CloseIdleConnections() | ||
| return client.Request(reqUrl, reqMethod, body, ctx) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.