mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-04 14:33:41 +01:00
Add field validation for some widgets
This commit is contained in:
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…
x
Reference in New Issue
Block a user