The per-cluster dot now reflects how the workload ended up after the cluster's events, not the worst thing that happened inside it: if the most recent state transition in the cluster was "-> healthy", the dot turns green even when the cluster contains earlier degraded/warning events. Falls back to the existing dominantSev logic for clusters without any state transition (e.g. rollout-only clusters). Matches the reality that a rollout which briefly degrades and then recovers is a normal, healthy outcome — not a "warning" forever. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
1.5 KiB
PHP
29 lines
1.5 KiB
PHP
<?php
|
|
|
|
define('APP_NAME', 'hyprcrd');
|
|
define('APP_VERSION', '2.0.15');
|
|
|
|
// APP_DEBUG: gates verbose error responses (curl traces, upstream bodies).
|
|
// Off by default; enable via env for local troubleshooting only.
|
|
define('APP_DEBUG', getenv('APP_DEBUG') === '1' || getenv('APP_DEBUG') === 'true');
|
|
|
|
// Database path — writable directory, outside webroot
|
|
// DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation
|
|
if (!defined('DB_PATH')) define('DB_PATH', __DIR__ . '/data/hyprcrd.db');
|
|
if (!defined('UPLOAD_DIR')) define('UPLOAD_DIR', __DIR__ . '/public/uploads');
|
|
|
|
// Base URL auto-detection (works in Docker and hosted environments)
|
|
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
|
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
|
|
$scriptDir = dirname($_SERVER['SCRIPT_NAME']);
|
|
$basePath = ($scriptDir === '/' || $scriptDir === '\\') ? '' : $scriptDir;
|
|
define('BASE_URL', $protocol . '://' . $host . $basePath);
|
|
|
|
// Oumta dashboard upstream. The browser only talks to /api/dashboard/*
|
|
// same-origin; the PHP proxy below forwards to this URL. Override via env
|
|
// for remote deployments. Inside Docker on Linux, localhost points at the
|
|
// container itself — use http://host.docker.internal:8085 (needs
|
|
// extra_hosts) or a routable URL to reach a host-side dashboard.
|
|
define('OUMTA_DASHBOARD_URL', getenv('OUMTA_DASHBOARD_URL') ?: 'http://localhost:8085');
|
|
define('OUMTA_DASHBOARD_TOKEN', getenv('OUMTA_DASHBOARD_TOKEN') ?: '');
|