The Petal App Manager Service
Admin Dashboard Interface
Petal App Manager includes a comprehensive web-based admin dashboard for managing petals, proxies, and monitoring system logs in real-time.
Accessing the Admin Dashboard
Primary Admin Dashboard:
http://localhost:9000/admin-dashboard
or via the controller dashboard at
http://localhost:80/home/petals-proxies-control
Note
change the localhost:80 to your drone’s IP or domain if accessing remotely.
This provides a complete graphical interface with the following features:
1. System Status Overview
Current configuration display
Enabled petals and proxies
Dependency relationships
Restart status monitoring
2. Real-time Component Management
Proxy Controls: Enable/disable proxies with visual status indicators
Petal Controls: Enable/disable petals with dependency validation
All Components View: Complete overview of all available components (enabled/disabled)
Automatic Dependency Validation: Prevents invalid configurations
3. Real-time Log Streaming
Live application logs with WebSocket connection
Log level filtering (Debug, Info, Warning, Error, Critical)
Recent log loading
Connection status indicator
Auto-scrolling log display
4. Quick Actions
Refresh status and component lists
Apply configuration changes
Clear logs
Load recent historical logs
Dashboard Features
Visual Status Indicators:
✅ Green: Component enabled and healthy
❌ Red: Component disabled or unhealthy
🔄 Refresh buttons: Update component status
📋 All Components: View complete system inventory
Proxy Management:
Each proxy shows:
Current status (enabled/disabled)
Dependencies and dependents
Toggle controls with dependency validation
Real-time status updates
Petal Management:
Each petal displays:
Current enabled/disabled state
Required proxy dependencies
Toggle controls with automatic validation
Dependency conflict prevention
Live Log Monitoring:
Connection Status: Visual indicator (Connected/Disconnected)
Log Filtering: Filter by log level in real-time
Auto-scroll: Automatically scroll to newest entries
Historical Logs: Load recent log entries on demand
Clear Function: Clear log display when needed
Using the Admin Dashboard
1. Monitor System Status:
Visit http://localhost:9000/admin-dashboard or http://localhost:80/home/petals-proxies-control
Click “Refresh Status” to load current configuration
View enabled petals and proxies in the status section
Note
change the localhost:80 to your drone’s IP or domain if accessing remotely.
2. Enable/Disable Components:
Use the Proxy Controls section to manage backend services
Use the Petal Controls section to manage application modules
Click individual toggle buttons to enable/disable components
Changes are applied automatically with dependency validation
3. View All Components:
Click “All Components” to see complete system inventory
View both enabled and disabled components
Understand dependency relationships
See component usage statistics
4. Monitor Logs in Real-time:
Use the Real-time Application Logs section
Click “Connect” to start live log streaming
Filter logs by level using the dropdown
Click “Load Recent” for historical log entries
Use “Clear” to reset the log display
5. Handle Configuration Changes:
The dashboard shows if restart is required
Apply changes are handled automatically
Monitor restart status through the interface
Alternative Access Methods
Interactive API Documentation:
Swagger UI: http://localhost:9000/docs
ReDoc: http://localhost:9000/redoc
These provide form-based API interaction for:
Testing endpoints manually
Understanding API request/response formats
Experimenting with configurations
API documentation reference
Managing Petals and Proxies via API
For programmatic access or scripting, you can use the REST API directly:
Checking What’s Running
To see which petals and proxies are currently enabled and their status:
API Endpoint:
curl http://localhost:9000/api/petal-proxies-control/status
Response:
{
"enabled_proxies": ["redis", "ext_mavlink", "db", "cloud"],
"enabled_petals": ["petal_warehouse", "mission_planner", "flight_records"],
"petal_dependencies": {
"petal_warehouse": ["redis", "ext_mavlink"],
"mission_planner": ["redis", "ext_mavlink"],
"flight_records": ["redis", "cloud"]
},
"restart_required": false
}
Health Check:
curl http://localhost:9000/health/detailed
This shows the operational status of all enabled components.
Viewing All Available Components
To see all petals and proxies (enabled and disabled):
curl http://localhost:9000/api/petal-proxies-control/components/list
Response:
{
"petals": [
{
"name": "flight_records",
"enabled": true,
"dependencies": ["redis", "cloud"]
},
{
"name": "petal_warehouse",
"enabled": true,
"dependencies": ["redis", "ext_mavlink"]
}
],
"proxies": [
{
"name": "redis",
"enabled": true,
"dependencies": [],
"dependents": ["petal:flight_records", "petal:petal_warehouse"]
},
{
"name": "cloud",
"enabled": false,
"dependencies": [],
"dependents": ["petal:flight_records"]
}
]
}
Petal Control via API
Enabling Petals
curl -X POST "http://localhost:9000/api/petal-proxies-control/petals/control" \
-H "Content-Type: application/json" \
-d '{
"petals": ["flight_records"],
"action": "ON"
}'
Disabling Petals
curl -X POST "http://localhost:9000/api/petal-proxies-control/petals/control" \
-H "Content-Type: application/json" \
-d '{
"petals": ["petal_warehouse"],
"action": "OFF"
}'
Proxy Control via API
Enabling Proxies
curl -X POST "http://localhost:9000/api/petal-proxies-control/proxies/control" \
-H "Content-Type: application/json" \
-d '{
"petals": ["cloud", "ext_mavlink"],
"action": "ON"
}'
Disabling Proxies
curl -X POST "http://localhost:9000/api/petal-proxies-control/proxies/control" \
-H "Content-Type: application/json" \
-d '{
"petals": ["cloud"],
"action": "OFF"
}'
Note
The API validates dependencies automatically. You cannot enable a petal without its required proxies, or disable a proxy that other components depend on.
Common Use Cases
Lightweight Setup (Redis only):
Via Admin Dashboard:
Go to http://localhost:9000/admin-dashboard or http://localhost:80/home/petals-proxies-control
Use Proxy Controls to disable unnecessary proxies
Use Petal Controls to disable dependent petals
Monitor changes in the System Status section
Note
change the localhost:80 to your drone’s IP or domain if accessing remotely.
Via API:
Go to Swagger UI: http://localhost:9000/docs
Disable unnecessary proxies via
/proxies/controlDisable dependent petals via
/petals/controlRestart if needed via
/restart
MAVLink Development:
Via Admin Dashboard:
Enable
ext_mavlinkproxy using toggle controlsEnable MAVLink-dependent petals (
petal_warehouse,mission_planner)Monitor system status and logs for connectivity
Via API:
Enable
ext_mavlinkproxyEnable MAVLink-dependent petals (
petal_warehouse,mission_planner)Monitor health via
/health/detailed
Cloud Integration:
Via Admin Dashboard:
Enable
cloudproxy using the dashboard controlsEnable cloud-dependent petals (
flight_records)Monitor real-time logs for cloud connectivity status
Via API:
Enable
cloudproxyEnable cloud-dependent petals (
flight_records)Verify connectivity through health endpoints
Restart Management
Configuration changes require a restart to take effect on actual petal/proxy loading.
Check Restart Status:
curl http://localhost:9000/api/petal-proxies-control/restart-status
Trigger Restart:
curl -X POST "http://localhost:9000/api/petal-proxies-control/restart"
Tip
Development Mode: If running with uvicorn --reload, the server restarts automatically.
Production Mode: Manual restart may be required depending on your deployment setup.
Service Files and Locations
Development Setup:
Configuration:
~/petal-app-manager-dev/petal-app-manager/proxies.yamlLogs:
~/petal-app-manager-dev/petal-app-manager/app.logAdmin Dashboard: http://localhost:9000/admin-dashboard
Admin Dashboard via Controller Dashboard: http://localhost:80/home/petals-proxies-control
Production Setup:
Installation:
~/.droneleaf/petal-app-manager/Configuration:
~/.droneleaf/petal-app-manager/proxies.yamlLogs:
~/.droneleaf/petal-app-manager/app.logService:
systemctl status petal-app-managerAdmin Dashboard: http://localhost:9000/admin-dashboard
Admin Dashboard via Controller Dashboard: http://localhost:80/home/petals-proxies-control
Note
change the localhost:80 to your drone’s IP or domain if accessing remotely.
Service Management (Production):
# Check service status
sudo systemctl status petal-app-manager
# Start/stop service
sudo systemctl start petal-app-manager
sudo systemctl stop petal-app-manager
# View service logs
sudo journalctl -u petal-app-manager -f