mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-19 11:09:50 +00:00
implemented fetching of minecraft server status
This commit is contained in:
parent
767fc1ec39
commit
8604418fb1
4 changed files with 50 additions and 0 deletions
21
src/widgets/minecraft/widget.js
Normal file
21
src/widgets/minecraft/widget.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
import { asJson } from "utils/proxy/api-helpers";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/{endpoint}/{domain}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
mappings: {
|
||||
status: {
|
||||
endpoint: "2",
|
||||
map: (data) => {
|
||||
const jsonData = asJson(data);
|
||||
return {
|
||||
players: jsonData.players,
|
||||
version: jsonData.version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default widget;
|
Loading…
Add table
Add a link
Reference in a new issue