|
208 | 208 | {"key": "spark", "label": "Spark", "unit": "spark-sidecar.service"}, |
209 | 209 | {"key": "ark", "label": "Ark", "unit": "arkade-sidecar.service"}, |
210 | 210 | {"key": "caddy", "label": "Caddy", "unit": "caddy.service"}, |
211 | | - {"key": "system", "label": "System", "unit": None}, |
212 | 211 | {"key": "tunnel", "label": "Tunnel", "unit": f"{TUNNEL_SERVICE_NAME}.service"}, |
213 | 212 | {"key": "tor", "label": "Tor", "unit": "tor.service"}, |
214 | | - {"key": "admin", "label": "Admin App", "unit": "lnbitspi-admin.service"}, |
215 | 213 | ] |
216 | 214 | LOG_SERVICE_BY_KEY = {entry["key"]: entry for entry in LOG_SERVICE_OPTIONS} |
217 | 215 | FUNDING_LOG_KEYS = {"spark", "ark", "phoenixd"} |
@@ -359,11 +357,28 @@ def _funding_sources_payload() -> dict[str, Any]: |
359 | 357 | for key, value in FUNDING_SOURCES.items() |
360 | 358 | }, |
361 | 359 | "spark": { |
362 | | - "balance": get_spark_balance(), |
| 360 | + "balance": get_spark_balance() if selected == "spark" else None, |
363 | 361 | "seed_present": bool(_read_spark_mnemonic()), |
364 | 362 | }, |
365 | | - "arkade": get_arkade_status(), |
366 | | - "phoenixd": get_phoenixd_status(), |
| 363 | + "arkade": ( |
| 364 | + get_arkade_status() |
| 365 | + if selected == "ark" |
| 366 | + else { |
| 367 | + "seed_present": bool(_read_arkade_mnemonic()), |
| 368 | + "balance": None, |
| 369 | + "mnemonic_missing": False, |
| 370 | + } |
| 371 | + ), |
| 372 | + "phoenixd": ( |
| 373 | + get_phoenixd_status() |
| 374 | + if selected == "phoenixd" |
| 375 | + else { |
| 376 | + "seed_present": bool(_read_phoenixd_seed()), |
| 377 | + "balance": None, |
| 378 | + "channels": [], |
| 379 | + "channel_count": 0, |
| 380 | + } |
| 381 | + ), |
367 | 382 | } |
368 | 383 |
|
369 | 384 |
|
@@ -1471,7 +1486,7 @@ def get_spark_balance(): |
1471 | 1486 | try: |
1472 | 1487 | import requests |
1473 | 1488 | api_key = _read_sidecar_api_key(SPARK_API_KEY_FILE, "SPARK_SIDECAR_API_KEY") |
1474 | | - headers = {"X-API-KEY": api_key} if api_key else {} |
| 1489 | + headers = {"X-API-Key": api_key} if api_key else {} |
1475 | 1490 | resp = requests.post(f"{SPARK_URL}/v1/balance", headers=headers, timeout=5) |
1476 | 1491 | if resp.ok: |
1477 | 1492 | data = resp.json() |
@@ -1650,7 +1665,7 @@ def collect_stats(): |
1650 | 1665 | }, |
1651 | 1666 | "funding_sources": funding_sources, |
1652 | 1667 | "funding_source": _read_selected_funding_source(), |
1653 | | - "spark_balance": get_spark_balance(), |
| 1668 | + "spark_balance": funding_sources.get("spark", {}).get("balance"), |
1654 | 1669 | "arkade_status": funding_sources.get("arkade", {}), |
1655 | 1670 | "phoenixd_status": funding_sources.get("phoenixd", {}), |
1656 | 1671 | "tor_onion": get_onion_address(), |
|
0 commit comments