|
7 | 7 | import type { PageData } from "./$types.js"; |
8 | 8 | import { getTimeBetween } from "$lib/helpers.js"; |
9 | 9 | import { browser } from "$app/environment"; |
| 10 | + import { page } from "$app/state"; |
10 | 11 |
|
11 | 12 | const { data }: { data: PageData } = $props(); |
12 | 13 |
|
|
15 | 16 | let devMode = $state(true); |
16 | 17 | let adblockEnabled = $state(SessionState.adBlockEnabled); |
17 | 18 | let adsEnabled = $state(SessionState.adsEnabled); |
| 19 | + let sResponses = $state(SessionState.serverResponses) |
18 | 20 | onMount(async () => { |
19 | 21 | await initializeTooling(); |
20 | 22 | isAHost = State.isAHost(); |
|
76 | 78 | Ads Enabled: {adsEnabled}<br /> |
77 | 79 | Current Server: {State.currentServer.name} (Loaded {State.servers |
78 | 80 | .length})<br /> |
| 81 | + <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 82 | + <thead> |
| 83 | + <tr> |
| 84 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Server</th> |
| 85 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Status</th> |
| 86 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Ping (ms)</th> |
| 87 | + </tr> |
| 88 | + </thead> |
| 89 | + <tbody> |
| 90 | + {#each sResponses as r} |
| 91 | + <tr> |
| 92 | + <td>{r.server.name}</td> |
| 93 | + <td>{r.success ? "Success" : "Failed"}</td> |
| 94 | + <td>{r.time.toFixed(2)}</td> |
| 95 | + </tr> |
| 96 | + {/each} |
| 97 | + </tbody> |
| 98 | + </table> |
79 | 99 | AHost: {State.isAHost()} (Loaded {State.aHosts.length})<br /> |
80 | | - AHosts: {State.aHosts.map(h => h.hostname).join(", ")} |
| 100 | + <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 101 | + <thead> |
| 102 | + <tr> |
| 103 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">AHost Hostname</th> |
| 104 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">ACode</th> |
| 105 | + </tr> |
| 106 | + </thead> |
| 107 | + <tbody> |
| 108 | + {#each State.aHosts as h} |
| 109 | + <tr> |
| 110 | + <td>{h.hostname}{(h.hostname && browser && h.hostname == page.url.hostname) ? " (Active)" : " (Inactive)"}</td> |
| 111 | + <td>{h.acode}</td> |
| 112 | + </tr> |
| 113 | + {/each} |
| 114 | + </tbody> |
| 115 | + </table> |
81 | 116 | <br /> |
82 | 117 | Games Loaded: {games.length} ({State.pinnedGames.length} pinned) - rendered |
83 | 118 | {State.homeView}<br /> |
84 | 119 | Version: {State.version}<br /> |
85 | 120 | Logged In: {SessionState.loggedIn}<br /> |
86 | 121 | SSR: {SessionState.ssr}<br /> |
87 | | - AWS Ready: {SessionState.awsReady}<br /> |
88 | | - AWS Acting: {SessionState.credentials?.identityId} | {SessionState |
89 | | - .credentials?.accessKeyId}<br /> |
90 | | - Credentials Expires: {SessionState.credentials?.expiration?.toLocaleTimeString()} |
91 | | - {getTimeBetween( |
92 | | - SessionState.credentials?.expiration || new Date(), |
93 | | - new Date(), |
94 | | - )} <br /> |
| 122 | + <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 123 | + <thead> |
| 124 | + <tr> |
| 125 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">AWS Ready</th> |
| 126 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Identity ID</th> |
| 127 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Access Key ID</th> |
| 128 | + <th style="border-bottom: 1px solid #ccc; text-align: left;">Credentials Expires</th> |
| 129 | + </tr> |
| 130 | + </thead> |
| 131 | + <tbody> |
| 132 | + <tr> |
| 133 | + <td>{SessionState.awsReady ? "Yes" : "No"}</td> |
| 134 | + <td title={SessionState.credentials?.identityId || "-"}>{SessionState.credentials?.identityId.slice(0, 10) + "..." || "-"}</td> |
| 135 | + <td title={SessionState.credentials?.accessKeyId || "-"}>{SessionState.credentials?.accessKeyId.slice(0, 6) + "..." || "-"}</td> |
| 136 | + <td>{SessionState.credentials?.expiration?.toLocaleTimeString() || "-"}</td> |
| 137 | + </tr> |
| 138 | + </tbody> |
| 139 | + </table> |
95 | 140 | Plays: {SessionState.plays.toLocaleString()} ({State.localPlays.toLocaleString()} |
96 | 141 | local)<br /> |
97 | 142 | </div> |
|
0 commit comments