Skip to content

feat: add network diagnostic tools (Ping, Traceroute, DNS, HTTP) to toolbox#12279

Open
jakub961241 wants to merge 1 commit into1Panel-dev:dev-v2from
jakub961241:feat/network-tools-7085
Open

feat: add network diagnostic tools (Ping, Traceroute, DNS, HTTP) to toolbox#12279
jakub961241 wants to merge 1 commit into1Panel-dev:dev-v2from
jakub961241:feat/network-tools-7085

Conversation

@jakub961241
Copy link

Summary

Closes #7085 - Add Ping, Traceroute, DNS Lookup, and HTTP Check tools to the Toolbox.

Tools

Tool Description Implementation
Ping ICMP ping with configurable packet count (1-20) exec ping -c N -W 5 host
Traceroute Route tracing (falls back to tracepath) exec traceroute/tracepath
DNS Lookup A, CNAME, MX, NS, TXT records Go net.Lookup* (no shell)
HTTP Check Status, response time, headers Go http.Client (no shell)

Security

  • Host input validated: blocks ;|&$\(){}` and other shell metacharacters
  • All exec commands have timeouts (30-60s)
  • DNS and HTTP tools use Go stdlib (no shell execution)
  • Ping count capped at 20

New files

  • agent/app/dto/toolbox.go - Request/response DTOs
  • agent/app/service/toolbox_net.go - Service with all 4 tools
  • agent/app/api/v2/toolbox_net.go - Single API handler dispatching by tool type
  • frontend/src/api/modules/toolbox-net.ts - API module
  • frontend/src/views/toolbox/net/index.vue - UI with tool selector and output display

Modified files

  • agent/app/api/v2/entry.go - Register service
  • agent/router/ro_toolbox.go - Add POST /toolbox/net route
  • frontend/src/routers/modules/toolbox.ts - Add route
  • frontend/src/views/toolbox/index.vue - Add tab button
  • frontend/src/lang/modules/en.ts - English translations
  • frontend/src/lang/modules/zh.ts - Chinese translations
feat: Add network diagnostic tools (Ping, Traceroute, DNS Lookup, HTTP Check) to the Toolbox (#7085)

Add Ping, Traceroute, DNS Lookup, and HTTP Check tools to the Toolbox
section, allowing users to run network diagnostics directly from the
panel UI without using the terminal.

Backend:
- New service: agent/app/service/toolbox_net.go
  - Ping: exec ping with count limit and timeout
  - Traceroute: traceroute/tracepath with fallback
  - DNS Lookup: A, CNAME, MX, NS, TXT records via Go net package
  - HTTP Check: status, response time, headers
- Input validation: blocks shell injection characters
- All operations have timeouts (30-60s)
- Single endpoint: POST /api/v2/toolbox/net

Frontend:
- New page under Toolbox > Network Tools
- Tool selector, host input, run button
- Monospace output display with auto-scroll
- English and Chinese translations

Closes 1Panel-dev#7085
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 22, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wanghe-fit2cloud for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]增加 Ping、Tracert、HTTP 请求等常用网络检测工具

1 participant