MCPcopy Create free account
hub / github.com/cppla/ServerStatus / alertStats

Function alertStats

web/js/app.js:233–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231function card(label, value, hint, cls){ return `<div class="overview-card ${cls}"><span class="label">${esc(label)}</span><span class="value">${esc(value)}</span><span class="hint">${esc(hint)}</span></div>`; }
232
233function alertStats(){
234 const stats = { offline: 0, abnormal: 0, blocked: 0, total: 0 };
235 S.servers.forEach(s => {
236 const m = metrics(s);
237 if(!m.online) stats.offline++;
238 else if(m.blocked) stats.blocked++;
239 else if(m.alert) stats.abnormal++;
240 });
241 stats.total = stats.offline + stats.abnormal + stats.blocked;
242 return stats;
243}
244
245function renderOsOptions(){
246 const select = $('osFilter');

Callers 1

renderOverviewFunction · 0.85

Calls 1

metricsFunction · 0.85

Tested by

no test coverage detected