Skip to content

Commit f8760c7

Browse files
committed
Add Traffic Gear for analysis and visualization
- Implemented Traffic gear with features for traffic source analysis, GeoIP enrichment, and network visualization. - Created settings page for configuring traffic analysis options including GeoIP and top sources count. - Added HTTP handlers for rendering the traffic analysis page and managing permissions. - Introduced SVG icon for the traffic gear in the sidebar. - Developed JavaScript functions for toggling settings and managing UI interactions for traffic and other gears. - Updated existing configuration files and added new JavaScript files for enhanced functionality across various gears.
1 parent 1831269 commit f8760c7

127 files changed

Lines changed: 2352 additions & 2314 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Project Overview
44

5-
**Gearbox** is a general-purpose monitoring and management platform with a plugin-based architecture. It consists of two Go applications:
5+
**Gearbox** is a general-purpose monitoring and management platform with a gear-based architecture. It consists of two Go applications:
66

77
1. **gearbox** - Web dashboard (port 3000)
88
2. **gearbox-agent** - Agent running on monitored servers (port 8405)
99

10-
**Key Principle**: This is a plugin-based architecture. The framework provides shared services, and plugins provide functionality.
10+
**Key Principle**: This is a gear-based architecture. The framework provides shared services, and plugins provide functionality.
1111

1212
## Architecture
1313

@@ -23,7 +23,7 @@ gearbox-agent/ - Agent binary for monitored servers
2323
Monitored Server → gearbox-agent (collects) → API/WebSocket → gearbox (displays) → Browser
2424
```
2525

26-
### Plugin Architecture
26+
### Gear Architecture
2727

2828
**Framework** (gearbox/internal/framework/):
2929
- Agent client (WebSocket/REST communication)
@@ -33,7 +33,7 @@ Monitored Server → gearbox-agent (collects) → API/WebSocket → gearbox (dis
3333
- Shared UI components (graphs, tables, panels)
3434
- Template system (Templ)
3535

36-
**Plugins** (gearbox/internal/plugins/):
36+
**Plugins** (gearbox/internal/gears/):
3737
- Self-contained feature modules
3838
- Provide pages and API handlers
3939
- Domain-specific logic
@@ -58,7 +58,7 @@ cd gearbox && make dev
5858

5959
**Key directories:**
6060
- `internal/framework/` - Core framework services
61-
- `internal/plugins/` - Feature plugins
61+
- `internal/gears/` - Feature plugins
6262
- `internal/framework/templates/` - Templ templates
6363
- `static/` - JavaScript, CSS, assets
6464

@@ -73,19 +73,19 @@ cd gearbox-agent && make deploy
7373

7474
**Key directories:**
7575
- `internal/api/` - REST API handlers
76-
- `internal/plugins/` - Agent-side plugin collectors
76+
- `internal/gears/` - Agent-side plugin collectors
7777
- `internal/framework/` - Shared agent framework
7878
- `cmd/gearbox-agent/` - Entry point
7979

8080
## Code Guidelines
8181

82-
### Adding New Plugins
82+
### Adding New Gears
8383

84-
1. Create directory in `internal/plugins/`
85-
2. Implement plugin interface
86-
3. Register in framework plugin system
84+
1. Create directory in `internal/gears/`
85+
2. Implement gear interface
86+
3. Register in framework gear system
8787
4. Add pages and templates
88-
5. Update docs/plugins.md
88+
5. Update docs/gears.md
8989

9090
### Template System (Templ)
9191

@@ -141,23 +141,23 @@ make test
141141
- Run `make dev` when user already has it running
142142
- Edit generated `*_templ.go` files directly
143143
- Skip running `make templ-generate` after template changes
144-
- Add business logic to framework (belongs in plugins)
144+
- Add business logic to framework (belongs in gears)
145145
- Hardcode server-specific values (use multi-server config)
146146

147147
### ALWAYS
148148

149149
- Run `make templ-generate && make build` after template changes
150-
- Keep plugins self-contained
150+
- Keep gears self-contained
151151
- Use framework services (don't duplicate functionality)
152-
- Follow plugin architecture patterns
153-
- Document new plugins in docs/plugins.md
152+
- Follow gear architecture patterns
153+
- Document new plugins in docs/gears.md
154154

155155
## Documentation
156156

157157
**Primary sources:**
158158
- [README.md](../README.md) - Project overview
159159
- [CLAUDE.md](../CLAUDE.md) - Development guidance
160-
- [docs/plugins.md](../docs/plugins.md) - Plugin architecture
160+
- [docs/gears.md](../docs/gears.md) - Plugin architecture
161161
- [gearbox/docs/development.md](../gearbox/docs/development.md) - Local setup
162162
- [gearbox-agent/README.md](../gearbox-agent/README.md) - Agent overview
163163

CLAUDE.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This repository contains **Gearbox**, a general-purpose monitoring and management platform with a plugin-based architecture.
7+
This repository contains **Gearbox**, a general-purpose monitoring and management platform with a gear-based architecture.
88

99
### What is Gearbox?
1010

11-
A plugin-based server monitoring and management platform designed for DevOps. Provides real-time visibility into servers, services, and infrastructure through purpose-built plugin pages.
11+
A gear-based server monitoring and management platform designed for DevOps. Provides real-time visibility into servers, services, and infrastructure through purpose-built gear pages.
1212

1313
**Architecture:**
1414

1515
- **gearbox-agent** - Go binary installed on monitored servers/workstations to gather data and expose secure API/WebSocket
1616
- **gearbox** - Web dashboard (port 3000) for monitoring multiple servers
17-
- **Plugins** - Self-contained modules providing pages, API handlers, and functionality (HAProxy, Metrics, Logs, Services, Certificates, Traffic, Alerts, OS Updates)
17+
- **Gears** - Self-contained modules providing pages, API handlers, and functionality (HAProxy, Metrics, Logs, Services, Certificates, Traffic, Alerts, OS Updates)
1818

1919
**Key Principles:**
2020

21-
- Plugin-based architecture with shared framework components
21+
- Gear-based architecture with shared framework components
2222
- gearbox-agent can run on ANY Linux system (servers, workstations, HAProxy hosts, TrueNAS, Docker hosts)
2323
- Multi-server support: gearbox talks to many different gearbox-agent instances
2424
- Configuration via web UI
25-
- HAProxy monitoring is ONE plugin, not the core purpose
25+
- HAProxy monitoring is ONE gear, not the core purpose
2626

2727
## Dual-App Architecture
2828

@@ -41,7 +41,7 @@ When troubleshooting, **ALWAYS check both codebases** and understand which serve
4141

4242
### Gearbox Dashboard (`gearbox/`)
4343

44-
Web application for monitoring multiple servers. Plugin-based architecture.
44+
Web application for monitoring multiple servers. Gear-based architecture.
4545

4646
**Post-Change Workflow:**
4747

@@ -56,13 +56,13 @@ cd gearbox && make templ-generate && make build
5656
**Key directories:**
5757

5858
- `internal/framework/` - Shared services and building blocks
59-
- `internal/plugins/` - 8 plugins
59+
- `internal/gears/` - 8 gears
6060
- `internal/framework/templates/` - Templ templates
6161
- `static/` - JavaScript, CSS, assets
6262

6363
### Gearbox Agent (`gearbox-agent/`)
6464

65-
Runs on monitored servers and workstations. Plugin-based collectors auto-discover services (HAProxy, Docker, systemd services).
65+
Runs on monitored servers and workstations. Gear-based collectors auto-discover services (HAProxy, Docker, systemd services).
6666

6767
**Building and Deploying:**
6868

@@ -75,15 +75,15 @@ cd gearbox-agent && make deploy
7575
**Key directories:**
7676

7777
- `internal/api/` - REST API handlers
78-
- `internal/plugins/` - Agent-side plugin collectors
78+
- `internal/gears/` - Agent-side gear collectors
7979
- `internal/framework/` - Shared agent framework
8080
- `cmd/gearbox-agent/` - Entry point
8181

82-
## Plugin Architecture
82+
## Gear Architecture
8383

84-
8 plugins: HAProxy, Metrics, Logs, Services, Certificates, Traffic, Alerts, OS Updates. Each plugin is self-contained in `internal/plugins/`. Framework provides shared services in `internal/framework/`.
84+
8 gears: HAProxy, Metrics, Logs, Services, Certificates, Traffic, Alerts, OS Updates. Each gear is self-contained in `internal/gears/`. Framework provides shared services in `internal/framework/`.
8585

86-
See [docs/plugins.md](docs/plugins.md) for complete plugin architecture documentation.
86+
See [docs/gears.md](docs/gears.md) for complete gear architecture documentation.
8787

8888
## GitHub-Driven Workflow
8989

@@ -166,15 +166,15 @@ TASKS.md is a **scratch pad only** — not a tracking system. The GitHub Project
166166
- Run `make dev` in gearbox (user typically has this running already)
167167
- Edit generated `*_templ.go` files directly
168168
- Skip running `make templ-generate` after template changes
169-
- Add business logic to framework (belongs in plugins)
169+
- Add business logic to framework (belongs in gears)
170170
- Hardcode server-specific values (use multi-server config)
171171

172172
### ALWAYS
173173

174174
- Run `make templ-generate && make build` after template changes in gearbox
175-
- Keep plugins self-contained
175+
- Keep gears self-contained
176176
- Use framework services (don't duplicate functionality)
177-
- Follow plugin architecture patterns
177+
- Follow gear architecture patterns
178178
- Inform user before running `make deploy` for agent
179179
- Validate HAProxy config with `haproxy -c` before reload (if applicable)
180180

@@ -201,13 +201,13 @@ Store in `docs/` directory using kebab-case naming. Include TOC after main headi
201201

202202
## Common Development Tasks
203203

204-
### Adding New Plugins
204+
### Adding New Gears
205205

206-
1. Create directory in `internal/plugins/`
207-
2. Implement plugin interface
208-
3. Register in framework plugin system
206+
1. Create directory in `internal/gears/`
207+
2. Implement gear interface
208+
3. Register in framework gear system
209209
4. Add pages and templates
210-
5. Update [docs/plugins.md](docs/plugins.md)
210+
5. Update [docs/gears.md](docs/gears.md)
211211

212212
### Modifying Templates (Templ)
213213

@@ -239,7 +239,7 @@ Store in `docs/` directory using kebab-case naming. Include TOC after main headi
239239

240240
- **[README.md](README.md)**: Project overview and quick start - SOURCE OF TRUTH
241241
- **[CLAUDE.md](CLAUDE.md)**: This file (development guidance)
242-
- **[docs/plugins.md](docs/plugins.md)**: Complete plugin architecture documentation
242+
- **[docs/gears.md](docs/gears.md)**: Complete gear architecture documentation
243243
- **[TASKS.md](TASKS.md)**: Scratch pad for describing upcoming work
244244
- **[gearbox/docs/development.md](gearbox/docs/development.md)**: Local development guide
245245

0 commit comments

Comments
 (0)