Add field validation for some widgets

pull/502/head
Michael Shamoon 2 years ago
parent 21017e4716
commit 1695fd5bee

@ -7,6 +7,11 @@ const widget = {
mappings: { mappings: {
"request/count": { "request/count": {
endpoint: "request/count", endpoint: "request/count",
validate: [
"pending",
"approved",
"available"
]
}, },
}, },
}; };

@ -7,6 +7,11 @@ const widget = {
mappings: { mappings: {
"request/count": { "request/count": {
endpoint: "request/count", endpoint: "request/count",
validate: [
"pending",
"approved",
"available",
],
}, },
}, },
}; };

@ -7,6 +7,11 @@ const widget = {
mappings: { mappings: {
"api.php": { "api.php": {
endpoint: "api.php", endpoint: "api.php",
validate: [
"dns_queries_today",
"ads_blocked_today",
"domains_being_blocked"
]
}, },
}, },
}; };

@ -16,6 +16,9 @@ const widget = {
}, },
"queue/status": { "queue/status": {
endpoint: "queue/status", endpoint: "queue/status",
validate: [
"totalCount"
]
}, },
}, },
}; };

@ -7,6 +7,9 @@ const widget = {
mappings: { mappings: {
queue: { queue: {
endpoint: "queue", endpoint: "queue",
validate: [
"queue"
]
}, },
}, },
}; };

@ -11,12 +11,21 @@ const widget = {
map: (data) => ({ map: (data) => ({
total: asJson(data).length, total: asJson(data).length,
}), }),
validate: [
"total"
]
}, },
queue: { queue: {
endpoint: "queue", endpoint: "queue",
validate: [
"totalRecords"
]
}, },
"wanted/missing": { "wanted/missing": {
endpoint: "wanted/missing", endpoint: "wanted/missing",
validate: [
"totalRecords"
]
}, },
}, },
}; };

@ -7,6 +7,9 @@ const widget = {
mappings: { mappings: {
"speedtest/latest": { "speedtest/latest": {
endpoint: "speedtest/latest", endpoint: "speedtest/latest",
validate: [
"data"
]
}, },
}, },
}; };

@ -7,6 +7,11 @@ const widget = {
mappings: { mappings: {
status: { status: {
endpoint: "status", endpoint: "status",
validate: [
"numActiveSessions",
"numConnections",
"bytesProxied"
]
}, },
}, },
}; };

@ -7,6 +7,9 @@ const widget = {
mappings: { mappings: {
overview: { overview: {
endpoint: "overview", endpoint: "overview",
validate: [
"http"
]
}, },
}, },
}; };

Loading…
Cancel
Save