fix(minecraft-status): wrong api path for bedrock (#2551)
This commit is contained in:
@@ -9,7 +9,7 @@ export const minecraftServerStatusRequestHandler = createCachedWidgetRequestHand
|
|||||||
queryKey: "minecraftServerStatusApiResult",
|
queryKey: "minecraftServerStatusApiResult",
|
||||||
widgetKind: "minecraftServerStatus",
|
widgetKind: "minecraftServerStatus",
|
||||||
async requestAsync(input: { domain: string; isBedrockServer: boolean }) {
|
async requestAsync(input: { domain: string; isBedrockServer: boolean }) {
|
||||||
const path = `/3/${input.isBedrockServer ? "bedrock/" : ""}${input.domain}`;
|
const path = `${input.isBedrockServer ? "/bedrock" : ""}/3/${input.domain}`;
|
||||||
|
|
||||||
const response = await fetchWithTimeout(`https://api.mcsrvstat.us${path}`);
|
const response = await fetchWithTimeout(`https://api.mcsrvstat.us${path}`);
|
||||||
return responseSchema.parse(await response.json());
|
return responseSchema.parse(await response.json());
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default function MinecraftServerStatusWidget({ options }: WidgetComponent
|
|||||||
>
|
>
|
||||||
<Group gap="xs" wrap="nowrap" align="center">
|
<Group gap="xs" wrap="nowrap" align="center">
|
||||||
<Tooltip label={data.online ? tStatus("online") : tStatus("offline")}>
|
<Tooltip label={data.online ? tStatus("online") : tStatus("offline")}>
|
||||||
<Box w="md" h="md" bg={data.online ? "teal" : "red"} style={{ borderRadius: "100%" }}></Box>
|
<Box miw="md" h="md" bg={data.online ? "teal" : "red"} style={{ borderRadius: "100%" }}></Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Text size="md" fw="bold">
|
<Text size="md" fw="bold">
|
||||||
{title}
|
{title}
|
||||||
@@ -44,11 +44,13 @@ export default function MinecraftServerStatusWidget({ options }: WidgetComponent
|
|||||||
</Group>
|
</Group>
|
||||||
{data.online && (
|
{data.online && (
|
||||||
<>
|
<>
|
||||||
<img
|
{!options.isBedrockServer && (
|
||||||
style={{ flex: 1, transform: "scale(0.8)", objectFit: "contain" }}
|
<img
|
||||||
alt={`minecraft icon ${options.domain}`}
|
style={{ flex: 1, transform: "scale(0.8)", objectFit: "contain" }}
|
||||||
src={data.icon}
|
alt={`minecraft icon ${options.domain}`}
|
||||||
/>
|
src={data.icon}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Group gap={5} c="gray.6" align="center">
|
<Group gap={5} c="gray.6" align="center">
|
||||||
<IconUsersGroup size="1rem" />
|
<IconUsersGroup size="1rem" />
|
||||||
<Text size="md">
|
<Text size="md">
|
||||||
|
|||||||
Reference in New Issue
Block a user