Update
This commit is contained in:
rodič
c2e1aa498e
revize
6de0b886a6
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import spec from '$lib/spec.json'
|
|
||||||
|
import { onMount } from 'svelte'
|
||||||
|
|
||||||
|
let spec = null
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
|
||||||
|
const resp = await fetch('https://sysinfo.gwei.cz/api/spec')
|
||||||
|
spec = await resp.json()
|
||||||
|
})
|
||||||
|
|
||||||
const serverCols = [
|
const serverCols = [
|
||||||
{ title: 'Name', key: 'name' },
|
{ title: 'Name', key: 'name' },
|
||||||
|
@ -22,61 +31,67 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>sysinfo.gwei.cz</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
<section class="mb-10">
|
<section class="mb-10">
|
||||||
Overview of Gwei.cz servers and services
|
Overview of Gwei.cz servers and services
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="mb-10">
|
{#if spec}
|
||||||
<h2 class="mb-4 text-xl font-bold">Servers</h2>
|
<section class="mb-10">
|
||||||
<table class="table-auto w-full text-sm">
|
<h2 class="mb-4 text-xl font-bold">Servers</h2>
|
||||||
<thead>
|
<table class="table-auto w-full text-sm">
|
||||||
<tr class="">
|
<thead>
|
||||||
{#each serverCols as col}
|
<tr class="">
|
||||||
<th class="text-left pb-2">{col.title}</th>
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{#each spec.servers as item}
|
|
||||||
<tr>
|
|
||||||
{#each serverCols as col}
|
{#each serverCols as col}
|
||||||
<td class="">{@html typeof col.key === 'string' ? item[col.key] : col.key(item)}</td>
|
<th class="text-left pb-2">{col.title}</th>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{#each spec.servers as item}
|
||||||
|
<tr>
|
||||||
</section>
|
{#each serverCols as col}
|
||||||
|
<td class="">{@html typeof col.key === 'string' ? item[col.key] : col.key(item)}</td>
|
||||||
<section>
|
{/each}
|
||||||
<h2 class="mb-4 text-xl font-bold">Services</h2>
|
</tr>
|
||||||
<table class="table-auto w-full text-sm">
|
|
||||||
<thead>
|
|
||||||
<tr class="">
|
|
||||||
{#each cols as col}
|
|
||||||
<th class="text-left pb-2">{col.title}</th>
|
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tbody>
|
||||||
</thead>
|
</table>
|
||||||
<tbody>
|
|
||||||
{#each spec.services as service}
|
</section>
|
||||||
<tr>
|
|
||||||
|
<section>
|
||||||
|
<h2 class="mb-4 text-xl font-bold">Services</h2>
|
||||||
|
<table class="table-auto w-full text-sm">
|
||||||
|
<thead>
|
||||||
|
<tr class="">
|
||||||
{#each cols as col}
|
{#each cols as col}
|
||||||
<td class="">{@html typeof col.key === 'string' ? service[col.key] : col.key(service)}</td>
|
<th class="text-left pb-2">{col.title}</th>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{#each spec.services as service}
|
||||||
</section>
|
<tr>
|
||||||
|
{#each cols as col}
|
||||||
|
<td class="">{@html typeof col.key === 'string' ? service[col.key] : col.key(service)}</td>
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="mt-16 text-base">
|
<section class="mt-16 text-base">
|
||||||
Generated {spec.time}
|
Generated {spec.time}
|
||||||
| <a href="https://sysinfo.gwei.cz/spec.json" class="underline hover:no-underline">spec.json</a>
|
| <a href="https://sysinfo.gwei.cz/api/spec" class="underline hover:no-underline">api</a>
|
||||||
| <a href="https://git.gwei.cz/gweicz/sysinfo" class="underline hover:no-underline">source code</a>
|
| <a href="https://git.gwei.cz/gweicz/sysinfo" class="underline hover:no-underline">source code</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!--section class="pt-60">
|
<!--section class="pt-60">
|
||||||
<code><pre>{JSON.stringify(spec, null, 2)}</pre></code>
|
<code><pre>{JSON.stringify(spec, null, 2)}</pre></code>
|
||||||
</section-->
|
</section-->
|
||||||
|
{/if}
|
||||||
|
|
Načítá se…
Odkázat v novém úkolu