A web application based on Go backend and HTML frontend for managing server directories, Docker scripts, port usage, and service control.
- Browse directory structure
- Create new directories
- Delete files and directories
- Rename files and directories
- View file size and modification time
- View Docker-related scripts
- Create new Docker startup scripts
- Delete scripts
- Execute scripts and view output results
- New: SQLite database storage for script information
- New: Execution logging and viewing
- New: Execution status tracking and performance monitoring
- View current system port usage
- Display listening port numbers, process names, and PIDs
- Real-time port information refresh
- View system service status
- Start, stop, restart services
- Display service PID, memory, and CPU usage
- New: Support for Chinese and English interface switching
- New: Dynamic language switching functionality
- New: All interface elements support multi-language display
- New: Language selector located in the top status bar
server-manage/
├── backend/
│ ├── go.mod
│ ├── main.go
│ ├── database.go
│ └── scripts.db (generated at runtime)
└── frontend/
├── static/
│ ├── css/
│ │ └── style.css
│ └── js/
│ └── app.js
└── templates/
└── index.html
- Go 1.21+
- CGO enabled (for SQLite support)
- Modern web browser (ES6+ support)
cd backend
go mod tidycd backend
go run main.go database.goOpen your browser and visit http://localhost:8080
GET /api/directory?path=<path>- Get directory listPOST /api/directory- Create directoryDELETE /api/directory- Delete directory/filePUT /api/directory/rename- Rename directory/file
GET /api/docker-scripts?path=<path>- Get Docker script listPOST /api/docker-scripts- Create Docker scriptDELETE /api/docker-scripts- Delete Docker scriptPOST /api/docker-scripts/execute- Execute Docker scriptGET /api/docker-scripts/logs?script_id=<id>&limit=<n>- Get script execution logsGET /api/docker-scripts/logs/all?limit=<n>- Get all execution logs
GET /api/database/stats- Get database statisticsPOST /api/database/cleanup- Clean up old log dataPOST /api/database/backup- Backup databasePOST /api/database/restore- Restore database
GET /api/ports- Get port usage information
GET /api/services- Get service statusPOST /api/services/start- Start servicePOST /api/services/stop- Stop servicePOST /api/services/restart- Restart service
- Find the language selector in the top status bar
- Click the dropdown menu to select "中文" or "English"
- The interface will immediately switch to the selected language
- Language selection is saved in browser local storage
- View current directory files and subdirectories in the "Directory Management" tab
- Click directory names to enter that directory
- Use the "Parent Directory" button to return to the previous directory
- Select files or directories to perform delete or rename operations
- Use the "Create Directory" button to create new directories
- View Docker-related script files in the "Docker Scripts" tab
- Use the "Create Script" button to create new Docker startup scripts
- Click the "View" button to view script content
- Click the "Execute" button to run the script and view output results
- New: Click the "Logs" button to view script execution history
- New: Execution results include status, duration, execution time and other details
- New: Support for viewing historical execution logs and output content
- View current system port usage in the "Port Usage" tab
- Display port numbers, process names, PIDs, and listening status
- Use the "Refresh" button to update port information
- View system service status in the "Service Management" tab
- Display service names, status, PID, memory, and CPU usage
- Use "Start", "Stop", "Restart" buttons to manage services
- Need to run with administrator privileges to perform certain system operations
- Delete operations are irreversible, please operate with caution
- Executing Docker scripts requires Docker to be installed on the system
- Service management features require systemctl support
- New: CGO enabled is required for SQLite database support
- New: Script information is stored in SQLite database, automatically created on first run
- New: All script executions are logged for tracking and debugging
- Recommended to use in trusted network environments
- Consider adding authentication and authorization mechanisms
- Limit accessible directory ranges
- Log important operations
- Backend: Go 1.21+, Gorilla Mux, SQLite3
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- System Commands: netstat/ss, systemctl, ps, bash
- Database: SQLite (for storing script information and execution logs)
- Internationalization: Frontend JavaScript-based multi-language support system
