0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-22 12:10:11 +09:00

Compare commits

...

4 Commits

3 changed files with 35 additions and 5 deletions

View File

@ -6,7 +6,7 @@ module.exports = nextTranslate({
defaultLocale: 'ja',
},
images: {
domains: ['mackerel.io'],
domains: ['mackerel.io', 'mc-heads.net'],
},
webpack: function (config) {
config.module.rules.push({

View File

@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router'
import axios from 'axios';
import Image from 'next/image'
import { list } from 'postcss';
export default function Minecraft(props) {
const router = useRouter()
@ -33,7 +35,7 @@ export default function Minecraft(props) {
const offline = t('minecraft:offline')
const loading = t('minecraft:loading')
return (
<p className="text-center">
<div className="text-center">
{(() => {
if (status == true) {
if (player == undefined || player == 0) {
@ -46,7 +48,21 @@ export default function Minecraft(props) {
return <span>{loading}</span>
}
})()}
</p>
{(() => {
if (data.players && data.players.list){
var list = [];
var url = [];
for (var i in data.players.list){
url.push('https://mc-heads.net/avatar/' + data.players.list[i])
}
for (var i in url){
list.push(<Image src={url[i]} key={i} className="inline" height="50" width="50" />)
}
return <div>{list}</div>
}
})()}
</div>
)
}
}

View File

@ -29,7 +29,7 @@ export default function About(props) {
{
// cherry Mackerel
}
<h2 className="text-2xl text-left font-bold leading-7 sm:text-3xl sm:truncate">cherry</h2>
<h2 className="text-2xl text-left font-bold leading-7 sm:text-3xl sm:truncate">yui</h2>
<div className="flex xl:w-2/3 text-center">
<div className="flex-1"><p className="font-bold">CPU </p>i7-2600</div>
<div className="flex-1"><p className="font-bold">RAM </p>DDR3 24GB</div>
@ -41,7 +41,7 @@ export default function About(props) {
{
// raspberry Mackerel
}
<h2 className="text-2xl text-left font-bold leading-7 sm:text-3xl sm:truncate">raspberry</h2>
<h2 className="text-2xl text-left font-bold leading-7 sm:text-3xl sm:truncate">yukino</h2>
<div className="flex xl:w-2/3 text-center">
<div className="flex-1"><p className="font-bold">{model} </p>Raspberry Pi 4 Model B Rev 1.2</div>
<div className="flex-1"><p className="font-bold">RAM </p>4GB</div>
@ -62,8 +62,22 @@ export default function About(props) {
<div className="flex-1"><p className="font-bold">{region} </p>Japan Central (Osaka)</div>
</div>
<iframe className="w-full h-96" src="https://mackerel.io/embed/public/embed/wgmTz7aTgvwfyU6qVHrJJmQlpOHCUJK6qw0W9sJTX68WOI8TFtc27YvJ7dwkQEGv?period=24h" height="400" frameBorder="0" scrolling="no"></iframe>
{
// iroha Mackerel
}
<h2 className="text-2xl text-left font-bold leading-7 sm:text-3xl sm:truncate">komachi</h2>
<div className="flex xl:w-2/3 text-center">
<div className="flex-1"><p className="font-bold">{service} </p>Oracle Cloud</div>
<div className="flex-1"><p className="font-bold">{shape} </p>VM.Standard.E2.1.Micro</div>
<div className="flex-1"><p className="font-bold">RAM </p>1GB</div>
<div className="flex-1"><p className="font-bold">OS </p>Ubuntu 20.04 LTS</div>
<div className="flex-1"><p className="font-bold">{region} </p>Japan Central (Osaka)</div>
</div>
<iframe className="w-full h-96" src="https://mackerel.io/embed/public/embed/vcn6LE4P2hh6GzvtMbIAWxsXpDh6eSoNyAXdhfYaj9yDN6FJwOHIiz9ktqToj1HG?period=24h" height="400" frameBorder="0" scrolling="no"></iframe>
</div>
</Layout>
)
}