mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-04 22:48:40 +08:00
Chore: another big deps update (#4795)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
|
||||
export default function Component({ service }) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { pingWithPromise } from "minecraft-ping-js";
|
||||
import mc from "minecraftstatuspinger";
|
||||
|
||||
import createLogger from "utils/logger";
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
@@ -11,11 +11,14 @@ export default async function minecraftProxyHandler(req, res) {
|
||||
const serviceWidget = await getServiceWidget(group, service, index);
|
||||
const url = new URL(serviceWidget.url);
|
||||
try {
|
||||
const pingResponse = await pingWithPromise(url.hostname, url.port || 25565);
|
||||
const pingResponse = await mc.lookup({
|
||||
host: url.hostname,
|
||||
port: url.port || 25565,
|
||||
});
|
||||
res.status(200).send({
|
||||
version: pingResponse.version.name,
|
||||
version: pingResponse.status.version.name,
|
||||
online: true,
|
||||
players: pingResponse.players,
|
||||
players: pingResponse.status.players.online,
|
||||
});
|
||||
} catch (e) {
|
||||
if (e) logger.error(e);
|
||||
|
||||
Reference in New Issue
Block a user