|
| 1 | +# WeGuardian Web Dashboard |
| 2 | + |
| 3 | +## Overview |
| 4 | +The WeGuardian Web Dashboard provides a modern web interface for managing punishments, viewing statistics, and monitoring server activity. |
| 5 | + |
| 6 | +## Features |
| 7 | +- **Authentication**: Secure login system with session management |
| 8 | +- **Dashboard**: Real-time statistics and server overview |
| 9 | +- **Punishment Management**: Apply and revoke punishments through web interface |
| 10 | +- **Player Management**: Search players and view punishment history |
| 11 | +- **Live Updates**: WebSocket-based real-time updates |
| 12 | +- **Responsive Design**: Works on desktop and mobile devices |
| 13 | + |
| 14 | +## Configuration |
| 15 | + |
| 16 | +### Enable the Dashboard |
| 17 | +Edit your `config.yml` file: |
| 18 | + |
| 19 | +```yaml |
| 20 | +web-dashboard: |
| 21 | + enabled: true |
| 22 | + host: "127.0.0.1" |
| 23 | + port: 8080 |
| 24 | + credentials: |
| 25 | + username: "admin" |
| 26 | + password: "supersecret" |
| 27 | + session-timeout: 3600 |
| 28 | + ssl: |
| 29 | + enabled: false |
| 30 | + keystore-path: "" |
| 31 | + keystore-password: "" |
| 32 | + security: |
| 33 | + require-https: false |
| 34 | + max-login-attempts: 5 |
| 35 | + lockout-duration: 300 |
| 36 | +``` |
| 37 | +
|
| 38 | +### Configuration Options |
| 39 | +- `enabled`: Enable/disable the web dashboard |
| 40 | +- `host`: IP address to bind the server to |
| 41 | +- `port`: Port number for the web server |
| 42 | +- `credentials`: Login credentials for the dashboard |
| 43 | +- `session-timeout`: Session timeout in seconds (default: 3600) |
| 44 | +- `ssl`: SSL/TLS configuration (optional) |
| 45 | +- `security`: Security settings for login protection |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### Accessing the Dashboard |
| 50 | +1. Start your WeGuardian server |
| 51 | +2. Open your web browser |
| 52 | +3. Navigate to `http://localhost:8080` (or your configured host:port) |
| 53 | +4. Login with the credentials from your config |
| 54 | + |
| 55 | +### Dashboard Pages |
| 56 | + |
| 57 | +#### Main Dashboard |
| 58 | +- View server statistics |
| 59 | +- Monitor active punishments |
| 60 | +- See online player count |
| 61 | +- Real-time updates via WebSocket |
| 62 | + |
| 63 | +#### Active Punishments |
| 64 | +- View all active punishments |
| 65 | +- Revoke punishments with one click |
| 66 | +- Filter by punishment type |
| 67 | +- Auto-refresh for real-time updates |
| 68 | + |
| 69 | +#### Player Management |
| 70 | +- Search for players by name |
| 71 | +- Apply new punishments |
| 72 | +- View punishment history |
| 73 | +- Support for all punishment types (ban, tempban, mute, tempmute, kick, warn) |
| 74 | + |
| 75 | +#### Settings |
| 76 | +- Configure dashboard settings |
| 77 | +- Change login credentials |
| 78 | +- Enable/disable features |
| 79 | + |
| 80 | +## API Endpoints |
| 81 | + |
| 82 | +### Authentication |
| 83 | +- `POST /api/login` - Authenticate user |
| 84 | +- `POST /api/logout` - Logout user |
| 85 | + |
| 86 | +### Punishments |
| 87 | +- `GET /api/punishments/active` - Get active punishments |
| 88 | +- `POST /api/punishments/apply` - Apply new punishment |
| 89 | +- `POST /api/punishments/revoke/:id` - Revoke punishment |
| 90 | + |
| 91 | +### Statistics |
| 92 | +- `GET /api/stats` - Get server statistics |
| 93 | + |
| 94 | +### WebSocket |
| 95 | +- `ws://localhost:8080/ws` - Real-time updates |
| 96 | + |
| 97 | +## Security Features |
| 98 | + |
| 99 | +### Session Management |
| 100 | +- HttpOnly cookies for session storage |
| 101 | +- Configurable session timeouts |
| 102 | +- Automatic session cleanup |
| 103 | + |
| 104 | +### Login Protection |
| 105 | +- Account lockout after failed attempts |
| 106 | +- Configurable lockout duration |
| 107 | +- Secure credential validation |
| 108 | + |
| 109 | +### CSRF Protection |
| 110 | +- Session-based validation |
| 111 | +- Secure token handling |
| 112 | + |
| 113 | +## Troubleshooting |
| 114 | + |
| 115 | +### Common Issues |
| 116 | + |
| 117 | +#### Dashboard Won't Start |
| 118 | +- Check if the port is already in use |
| 119 | +- Verify the host configuration |
| 120 | +- Ensure the dashboard is enabled in config |
| 121 | + |
| 122 | +#### Login Issues |
| 123 | +- Verify credentials in config.yml |
| 124 | +- Check for account lockout |
| 125 | +- Clear browser cookies if needed |
| 126 | + |
| 127 | +#### WebSocket Connection Issues |
| 128 | +- Ensure firewall allows WebSocket connections |
| 129 | +- Check browser console for errors |
| 130 | +- Verify WebSocket endpoint is accessible |
| 131 | + |
| 132 | +### Dependencies |
| 133 | +The web dashboard requires the following dependencies: |
| 134 | +- Jetty Server 11.0.18 |
| 135 | +- Jakarta Servlet API 6.0.0 |
| 136 | +- Gson 2.10.1 |
| 137 | + |
| 138 | +These are automatically included when building the plugin. |
| 139 | + |
| 140 | +## Development |
| 141 | + |
| 142 | +### Building |
| 143 | +The web dashboard is included in the main WeGuardian plugin. No separate build process is required. |
| 144 | + |
| 145 | +### Customization |
| 146 | +The web interface can be customized by modifying the HTML/CSS/JavaScript in the servlet classes. The design uses modern CSS with a responsive layout. |
| 147 | + |
| 148 | +### Adding New Features |
| 149 | +To add new features: |
| 150 | +1. Create new servlet classes extending `HttpServlet` |
| 151 | +2. Add API endpoints as needed |
| 152 | +3. Update the navigation and routing |
| 153 | +4. Add WebSocket support for real-time updates |
| 154 | + |
| 155 | +## Support |
| 156 | +For issues or questions about the web dashboard, please check the main WeGuardian documentation or contact the development team. |
0 commit comments