add shields.io 'style' parameter

pull/1119/head
Jens Neuber 3 years ago
parent 7abbf421d0
commit f455e3a454

@ -225,6 +225,7 @@ router.get("/api/badge/:id/status", cache("5 minutes"), async (request, response
downLabel = "Down", downLabel = "Down",
upColor = badgeConstants.defaultUpColor, upColor = badgeConstants.defaultUpColor,
downColor = badgeConstants.defaultDownColor, downColor = badgeConstants.defaultDownColor,
style = "flat",
value // for demo purpose only value // for demo purpose only
} = request.query; } = request.query;
@ -243,7 +244,7 @@ router.get("/api/badge/:id/status", cache("5 minutes"), async (request, response
[requestedMonitorId] [requestedMonitorId]
); );
const badgeValues = {}; const badgeValues = { style };
if (!publicMonitor) { if (!publicMonitor) {
// return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant // return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant
@ -279,6 +280,7 @@ router.get("/api/badge/:id/uptime/:duration?", cache("5 minutes"), async (reques
suffix = "%", suffix = "%",
color, color,
labelColor, labelColor,
style = "flat",
value // for demo purpose only value // for demo purpose only
} = request.query; } = request.query;
@ -299,7 +301,7 @@ router.get("/api/badge/:id/uptime/:duration?", cache("5 minutes"), async (reques
[requestedMonitorId] [requestedMonitorId]
); );
const badgeValues = {}; const badgeValues = { style };
if (!publicMonitor) { if (!publicMonitor) {
// return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant // return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant
@ -345,7 +347,8 @@ router.get("/api/badge/:id/ping/:duration?", cache("5 minutes"), async (request,
suffix = "ms", suffix = "ms",
color = badgeConstants.defaultPingColor, color = badgeConstants.defaultPingColor,
labelColor, labelColor,
value style = "flat",
value // for demo purpose only
} = request.query; } = request.query;
try { try {
@ -368,7 +371,7 @@ router.get("/api/badge/:id/ping/:duration?", cache("5 minutes"), async (request,
[-requestedDuration, requestedMonitorId] [-requestedDuration, requestedMonitorId]
)); ));
const badgeValues = {}; const badgeValues = { style };
if (!publicAvgPing) { if (!publicAvgPing) {
// return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant // return a "N/A" badge in naColor (grey), if monitor is not public / not available / non exsitant

Loading…
Cancel
Save