Skip to content

feat: improve host log management#13345

Merged
wanghe-fit2cloud merged 1 commit into
dev-v2from
feat/log-cleanup-and-journal-cursor
Jul 23, 2026
Merged

feat: improve host log management#13345
wanghe-fit2cloud merged 1 commit into
dev-v2from
feat/log-cleanup-and-journal-cursor

Conversation

@ssongliu

Copy link
Copy Markdown
Member

Refs #13229

Copilot AI review requested due to automatic review settings July 23, 2026 06:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for clearing host SSH login logs from the UI by introducing a new /hosts/ssh/log/clean endpoint in the agent, wiring it into routing, and updating the frontend SSH log page to trigger the operation with confirmation. It also refines system log pagination for journalctl by introducing cursor-based pagination and adjusts time formatting for broader journalctl compatibility.

Changes:

  • Add “Clean logs” action to the SSH login log view with confirmation and success feedback.
  • Add agent API/route/service support to clear SSH log files and update Swagger/x-panel-log docs for the new endpoint.
  • Improve system log (journalctl) pagination using __CURSOR and adjust journal time formatting.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/views/host/ssh/log/log.vue Adds a confirmation-driven “clean logs” UI action for SSH login logs.
frontend/src/api/modules/host.ts Adds a frontend API wrapper for /hosts/ssh/log/clean.
core/cmd/server/docs/x-log.json Documents the new clean endpoint in panel log metadata.
core/cmd/server/docs/swagger.json Adds Swagger path entry for /hosts/ssh/log/clean.
core/cmd/server/docs/docs.go Updates embedded Swagger template to include the new endpoint.
agent/router/ro_host.go Registers the new agent route /hosts/ssh/log/clean.
agent/cmd/server/docs/x-log.json Documents the new clean endpoint in agent log metadata.
agent/app/service/ssh.go Implements SSH log file detection improvements and adds log-cleaning behavior.
agent/app/service/logs.go Adds cursor-based pagination support for journalctl and adjusts query time formatting.
agent/app/dto/logs.go Extends system log DTO to carry the journal cursor internally.
agent/app/api/v2/ssh.go Exposes the new CleanSSHLogs API endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/api/modules/host.ts
Comment thread frontend/src/views/host/ssh/log/log.vue
@wanghe-fit2cloud
wanghe-fit2cloud merged commit 7f45054 into dev-v2 Jul 23, 2026
4 checks passed
@wanghe-fit2cloud
wanghe-fit2cloud deleted the feat/log-cleanup-and-journal-cursor branch July 23, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants