Add /jobs endpoint to monitor routers and improve service status handling in dashboard
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 16s
CLI Tests / test-cli (push) Failing after 11s
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m8s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Successful in 2s
Production Tests / Production Integration Tests (push) Successful in 17s
Python Tests / test-python (push) Failing after 1m5s
Security Scanning / security-scan (push) Successful in 27s
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 16s
CLI Tests / test-cli (push) Failing after 11s
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m8s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Successful in 2s
Production Tests / Production Integration Tests (push) Successful in 17s
Python Tests / test-python (push) Failing after 1m5s
Security Scanning / security-scan (push) Successful in 27s
- Add /jobs endpoint to both agent-coordinator and coordinator-api monitor routers - Add get_jobs function returning empty list for history and metrics commands - Update dashboard command to handle both string and dict formats for service status - Initialize campaigns file when empty in addition to when missing
This commit is contained in:
@@ -46,3 +46,9 @@ async def get_miners():
|
|||||||
async def get_history_dashboard():
|
async def get_history_dashboard():
|
||||||
"""Get historical dashboard data."""
|
"""Get historical dashboard data."""
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/jobs", response_model=List[Dict])
|
||||||
|
async def get_jobs():
|
||||||
|
"""Get jobs list for history and metrics commands."""
|
||||||
|
return []
|
||||||
|
|||||||
@@ -46,3 +46,9 @@ async def get_miners():
|
|||||||
async def get_history_dashboard():
|
async def get_history_dashboard():
|
||||||
"""Get historical dashboard data."""
|
"""Get historical dashboard data."""
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/jobs", response_model=List[Dict])
|
||||||
|
async def get_jobs():
|
||||||
|
"""Get jobs list for history and metrics commands."""
|
||||||
|
return []
|
||||||
|
|||||||
@@ -64,7 +64,11 @@ def dashboard(ctx, refresh: int, duration: int):
|
|||||||
console.print(f" Services: {len(services)}")
|
console.print(f" Services: {len(services)}")
|
||||||
|
|
||||||
for service_name, service_data in services.items():
|
for service_name, service_data in services.items():
|
||||||
status = service_data.get("status", "unknown")
|
# Handle both string ("online") and dict ({"status": "online"}) formats
|
||||||
|
if isinstance(service_data, dict):
|
||||||
|
status = service_data.get("status", "unknown")
|
||||||
|
else:
|
||||||
|
status = service_data if service_data else "unknown"
|
||||||
console.print(f" {service_name}: {status}")
|
console.print(f" {service_name}: {status}")
|
||||||
|
|
||||||
# Metrics summary
|
# Metrics summary
|
||||||
@@ -374,7 +378,7 @@ CAMPAIGNS_DIR = Path.home() / ".aitbc" / "campaigns"
|
|||||||
def _ensure_campaigns():
|
def _ensure_campaigns():
|
||||||
CAMPAIGNS_DIR.mkdir(parents=True, exist_ok=True)
|
CAMPAIGNS_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
campaigns_file = CAMPAIGNS_DIR / "campaigns.json"
|
campaigns_file = CAMPAIGNS_DIR / "campaigns.json"
|
||||||
if not campaigns_file.exists():
|
if not campaigns_file.exists() or campaigns_file.stat().st_size == 0:
|
||||||
# Seed with default campaigns
|
# Seed with default campaigns
|
||||||
default = {"campaigns": [
|
default = {"campaigns": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user