mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 20:20:09 +09:00
Add "Retrieving server status..." text
This commit is contained in:
parent
d7099acd8b
commit
62925709f8
@ -4,5 +4,6 @@
|
||||
"no_one": "No one is playing.",
|
||||
"offline": "Server is down.",
|
||||
"address": "Server address",
|
||||
"fail": "Failed to retrieve server status."
|
||||
"fail": "Failed to retrieve server status.",
|
||||
"loading": "Retrieving server status..."
|
||||
}
|
@ -4,5 +4,6 @@
|
||||
"no_one": "現在、誰もログインしていません。",
|
||||
"offline": "サーバーがオフラインのようです。",
|
||||
"address": "サーバー アドレス",
|
||||
"fail": "サーバーの状態を取得できませんでした。"
|
||||
"fail": "サーバーの状態を取得できませんでした。",
|
||||
"loading": "サーバーの状態を取得しています..."
|
||||
}
|
@ -13,7 +13,7 @@ export default function Minecraft(props) {
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const result = await axios(
|
||||
'https://api.mcsrvstat.us/2/yude.jp',
|
||||
'https://mcstatus.snowdev.com.br/api/query/v3/yude.jp',
|
||||
);
|
||||
setData(result.data);
|
||||
};
|
||||
@ -31,16 +31,19 @@ export default function Minecraft(props) {
|
||||
const playing = t('minecraft:playing', {count: player})
|
||||
const no_one = t('minecraft:no_one')
|
||||
const offline = t('minecraft:offline')
|
||||
const loading = t('minecraft:loading')
|
||||
return (
|
||||
<p className="text-center">
|
||||
{(() => {
|
||||
if (status) {
|
||||
if (status == true) {
|
||||
if (player == undefined || player == 0) {
|
||||
return <span>{no_one}</span>
|
||||
} else {
|
||||
return <span>{playing}</span>
|
||||
}}else{
|
||||
}}else if (status == false) {
|
||||
return <span>{offline}</span>
|
||||
}else {
|
||||
return <span>{loading}</span>
|
||||
}
|
||||
})()}
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user