mirror of
https://github.com/gethomepage/homepage.git
synced 2025-07-09 03:04:18 -04:00
Enhancement: add optional token parameter for gamedig (#5245)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
7e8752243c
commit
2509d8c235
@ -14,4 +14,5 @@ widget:
|
|||||||
type: gamedig
|
type: gamedig
|
||||||
serverType: csgo # see https://github.com/gamedig/node-gamedig#games-list
|
serverType: csgo # see https://github.com/gamedig/node-gamedig#games-list
|
||||||
url: udp://server.host.or.ip:port
|
url: udp://server.host.or.ip:port
|
||||||
|
gameToken: # optional, a token used by gamedig with certain games
|
||||||
```
|
```
|
||||||
|
@ -304,6 +304,9 @@ export function cleanServiceGroups(groups) {
|
|||||||
// frigate
|
// frigate
|
||||||
enableRecentEvents,
|
enableRecentEvents,
|
||||||
|
|
||||||
|
// gamedig
|
||||||
|
gameToken,
|
||||||
|
|
||||||
// beszel, glances, immich, komga, mealie, pihole, pfsense, speedtest
|
// beszel, glances, immich, komga, mealie, pihole, pfsense, speedtest
|
||||||
version,
|
version,
|
||||||
|
|
||||||
@ -487,6 +490,9 @@ export function cleanServiceGroups(groups) {
|
|||||||
if (["diskstation", "qnap"].includes(type)) {
|
if (["diskstation", "qnap"].includes(type)) {
|
||||||
if (volume) widget.volume = volume;
|
if (volume) widget.volume = volume;
|
||||||
}
|
}
|
||||||
|
if (type === "gamedig") {
|
||||||
|
if (gameToken) widget.gameToken = gameToken;
|
||||||
|
}
|
||||||
if (type === "kopia") {
|
if (type === "kopia") {
|
||||||
if (snapshotHost) widget.snapshotHost = snapshotHost;
|
if (snapshotHost) widget.snapshotHost = snapshotHost;
|
||||||
if (snapshotPath) widget.snapshotPath = snapshotPath;
|
if (snapshotPath) widget.snapshotPath = snapshotPath;
|
||||||
|
@ -12,13 +12,19 @@ export default async function gamedigProxyHandler(req, res) {
|
|||||||
const url = new URL(serviceWidget.url);
|
const url = new URL(serviceWidget.url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const serverData = await GameDig.query({
|
const gamedigOptions = {
|
||||||
type: serviceWidget.serverType,
|
type: serviceWidget.serverType,
|
||||||
host: url.hostname,
|
host: url.hostname,
|
||||||
port: url.port,
|
port: url.port,
|
||||||
givenPortOnly: true,
|
givenPortOnly: true,
|
||||||
checkOldIDs: true,
|
checkOldIDs: true,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (serviceWidget.gameToken) {
|
||||||
|
gamedigOptions.token = serviceWidget.gameToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
const serverData = await GameDig.query(gamedigOptions);
|
||||||
|
|
||||||
res.status(200).send({
|
res.status(200).send({
|
||||||
online: true,
|
online: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user