fix(report): SMS 신뢰성 게이지 색을 지표 자체 기준으로(종합 판정과 분리)
경영 요약의 SMS 신뢰성 게이지가 종합 판정 색($verdict_color)을 그대로 써서, 누수 등으로 판정이 '경보'면 SMS 전달 100%여도 적색 링으로 표시되던 문제 수정. rc_reliability_color(pct, fail) 도입 — 실패 0=네이비(완전) / 경미=황(주의) / 저하=적(경보). 게이지·카드 액센트를 이 색으로. 판정 씰은 종합 판정 색 유지.
This commit is contained in:
parent
06f96a8d09
commit
01ed3164a6
2 changed files with 19 additions and 2 deletions
|
|
@ -151,9 +151,17 @@ $rh_low_txt = (METRIC_RH_LOW >= 0) ? (rc_fmt((float)METRIC_RH_LOW) . '%') : '비
|
|||
<div class="section-title"><span class="no">01</span> 경영 요약 <span class="en">EXECUTIVE SUMMARY</span></div>
|
||||
|
||||
<div class="kpi-row">
|
||||
<div class="kpi-card is-ok">
|
||||
<?php
|
||||
// SMS 신뢰성 게이지·카드는 종합 판정과 독립적으로 지표 자체 기준 색을 쓴다
|
||||
// (누수 등으로 판정이 경보여도 SMS 전달이 100%면 네이비로 정확히 표현).
|
||||
$rel_pct = (int)$summary['sms_reliability_pct'];
|
||||
$rel_fail = (int)$summary['sms_fail'];
|
||||
$rel_color = rc_reliability_color($rel_pct, $rel_fail);
|
||||
$rel_class = $rel_fail <= 0 ? 'is-ok' : 'is-warn';
|
||||
?>
|
||||
<div class="kpi-card <?= $rel_class ?>">
|
||||
<div class="kpi-gauge-wrap">
|
||||
<?= render_uptime_gauge($summary['sms_reliability_pct'], $verdict_color, $summary['sms_reliability_pct'] . '%', 'SMS 신뢰성') ?>
|
||||
<?= render_uptime_gauge($rel_pct, $rel_color, $rel_pct . '%', 'SMS 신뢰성') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card <?= $total_alerts > 0 ? 'is-warn' : 'is-ok' ?>">
|
||||
|
|
|
|||
|
|
@ -37,6 +37,15 @@ function rc_verdict_color(string $verdict): string {
|
|||
};
|
||||
}
|
||||
|
||||
// '높을수록 좋은' 지표(SMS 신뢰성 등) 자체 기준 색 — 종합 판정과 독립.
|
||||
// 실패 0 = 완전(네이비) / 경미한 실패 = 주의(황) / 저하 = 경보(적).
|
||||
// 종합 판정이 경보여도 SMS 전달이 100%면 이 게이지는 네이비로 정확히 표현한다.
|
||||
function rc_reliability_color(int $pct, int $fail_count): string {
|
||||
if ($fail_count <= 0) { return RC_NAVY; } // 실패 0 → 완전 신뢰
|
||||
if ($pct >= 95) { return RC_WARN; } // 경미
|
||||
return RC_ALERT; // 저하
|
||||
}
|
||||
|
||||
// 짧은 수치 포맷(소수 1자리, 불필요한 0 제거)
|
||||
function rc_fmt(float $v): string {
|
||||
return rtrim(rtrim(number_format($v, 1, '.', ''), '0'), '.');
|
||||
|
|
|
|||
Loading…
Reference in a new issue