feat(governance): add agent market automation surfaces
Some checks failed
Some checks failed
This commit is contained in:
@@ -112,7 +112,7 @@ export function FlywheelKPICard() {
|
||||
}
|
||||
}, [])
|
||||
|
||||
const fmt = (n: number | undefined, digits = 0) =>
|
||||
const fmt = (n: number | null | undefined, digits = 0) =>
|
||||
n == null ? '--' : n.toLocaleString(undefined, { maximumFractionDigits: digits })
|
||||
|
||||
const pct = (n: number | null | undefined) =>
|
||||
|
||||
@@ -81,7 +81,7 @@ function HostCard({ host }: { host: HostInfo }) {
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: accentColor, flexShrink: 0 }} />
|
||||
<span style={{ fontSize: 12, fontWeight: 700, color: '#141413', fontFamily: 'var(--font-body), monospace' }}>
|
||||
{/* 顯示末段 IP 作為簡短標識,完整名稱放 IP 欄位 */}
|
||||
{host.ip.split('.').pop() ?? host.hostname}
|
||||
{host.ip.includes('.') ? host.ip.split('.').pop() ?? host.ip : host.hostname}
|
||||
</span>
|
||||
{isK3s && (
|
||||
<span style={{
|
||||
@@ -92,8 +92,8 @@ function HostCard({ host }: { host: HostInfo }) {
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span style={{ fontSize: 10, color: '#b0ad9f', fontFamily: 'monospace' }}>{host.ip}</span>
|
||||
</div>
|
||||
<span style={{ fontSize: 10, color: '#b0ad9f', fontFamily: 'monospace' }}>{host.ip}</span>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 10, marginTop: 2 }}>
|
||||
<span style={{ fontSize: 10, color: '#b0ad9f' }}>CPU <MetricBar value={host.cpuPct} /></span>
|
||||
<span style={{ fontSize: 10, color: '#b0ad9f' }}>RAM <MetricBar value={host.ramPct} /></span>
|
||||
@@ -117,6 +117,9 @@ function HostCard({ host }: { host: HostInfo }) {
|
||||
)
|
||||
}
|
||||
|
||||
const K8S_VIP_INFO_FALLBACK =
|
||||
'K8S VIP topology (ops-only) · kubectl:6443 · web:32335 · api:32334'
|
||||
|
||||
export function HostGrid({ hosts }: HostGridProps) {
|
||||
if (hosts.length === 0) {
|
||||
return <div style={{ padding: 16, textAlign: 'center', color: '#b0ad9f', fontSize: 12 }}>--</div>
|
||||
@@ -150,7 +153,7 @@ export function HostGrid({ hosts }: HostGridProps) {
|
||||
☸ K3S CLUSTER (HA)
|
||||
</span>
|
||||
<span style={{ fontSize: 10, color: '#3b7de8' }}>
|
||||
{process.env.NEXT_PUBLIC_K8S_VIP_INFO ?? 'VIP 192.168.0.125 · kubectl :6443 · Web :32335 · API :32334'}
|
||||
{(process.env.NEXT_PUBLIC_K8S_VIP_INFO ?? '').trim() || K8S_VIP_INFO_FALLBACK}
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 6, padding: 6 }}>
|
||||
|
||||
Reference in New Issue
Block a user