|
7 | 7 | import type { PageData } from "./$types.js"; |
8 | 8 | import { browser } from "$app/environment"; |
9 | 9 | import { page } from "$app/state"; |
| 10 | + import { loadGames } from "$lib/loadCards.js"; |
10 | 11 |
|
11 | | - const { data }: { data: PageData } = $props(); |
12 | | -
|
13 | | - const { games } = data; |
14 | 12 | let isAHost = $state(State.isAHost()); |
15 | 13 | let devMode = $state(true); |
16 | 14 | let adblockEnabled = $state(SessionState.adBlockEnabled); |
17 | 15 | let adsEnabled = $state(SessionState.adsEnabled); |
18 | | - let sResponses = $state(SessionState.serverResponses) |
| 16 | + let sResponses = $state(SessionState.serverResponses); |
| 17 | + let games = $state(State.games); |
19 | 18 | onMount(async () => { |
20 | 19 | await initializeTooling(); |
21 | 20 | isAHost = State.isAHost(); |
| 21 | +
|
| 22 | + await loadGames(); |
22 | 23 | devMode = SessionState.devMode; |
23 | 24 | adblockEnabled = SessionState.adBlockEnabled; |
24 | 25 | adsEnabled = SessionState.adsEnabled; |
|
33 | 34 | /> |
34 | 35 | </svelte:head> |
35 | 36 |
|
36 | | -{#if isAHost || devMode} |
| 37 | +{#if isAHost} |
37 | 38 | <div class="container"> |
38 | 39 | <div class="background"></div> |
39 | 40 | <Navigation /> |
|
69 | 70 | </p> |
70 | 71 | <div class="information"> |
71 | 72 | <!-- none of this information is statefull, therefore none of it will update. this is intended behavior --> |
72 | | - <b>Running Information:</b><br> |
| 73 | + <b>Running Information:</b><br /> |
73 | 74 | Browser: {browser ? navigator.userAgent : "<SSR_HOST>"}<br /> |
74 | 75 | Host: {browser ? window.location.hostname : "<SSR_HOST>"}<br /> |
75 | 76 | DevMode: {SessionState.devMode}<br /> |
76 | 77 | AdBlock Enabled: {adblockEnabled}<br /> |
77 | 78 | Ads Enabled: {adsEnabled}<br /> |
78 | 79 | Current Server: {State.currentServer.name} (Loaded {State.servers |
79 | 80 | .length})<br /> |
80 | | - <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 81 | + <table |
| 82 | + style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;" |
| 83 | + > |
81 | 84 | <thead> |
82 | | - <tr> |
83 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Server</th> |
84 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Status</th> |
85 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Ping (ms)</th> |
86 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Check</th> |
87 | | - </tr> |
88 | | - </thead> |
89 | | - <tbody> |
90 | | - {#each sResponses as r} |
91 | 85 | <tr> |
92 | | - <td>{r.server.name}</td> |
93 | | - <td>{r.success ? "Success" : "Failed"}</td> |
94 | | - <td>{r.time.toFixed(2)}</td> |
95 | | - <td>{r.reason}</td> |
| 86 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 87 | + >Server</th |
| 88 | + > |
| 89 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 90 | + >Status</th |
| 91 | + > |
| 92 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 93 | + >Ping (ms)</th |
| 94 | + > |
| 95 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 96 | + >Check</th |
| 97 | + > |
96 | 98 | </tr> |
97 | | - {/each} |
| 99 | + </thead> |
| 100 | + <tbody> |
| 101 | + {#each sResponses as r} |
| 102 | + <tr> |
| 103 | + <td>{r.server.name}</td> |
| 104 | + <td>{r.success ? "Success" : "Failed"}</td> |
| 105 | + <td>{r.time.toFixed(2)}</td> |
| 106 | + <td>{r.reason}</td> |
| 107 | + </tr> |
| 108 | + {/each} |
98 | 109 | </tbody> |
99 | 110 | </table> |
100 | 111 | AHost: {State.isAHost()} (Loaded {State.aHosts.length})<br /> |
101 | | - <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 112 | + <table |
| 113 | + style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;" |
| 114 | + > |
102 | 115 | <thead> |
103 | | - <tr> |
104 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">AHost Hostname</th> |
105 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">ACode</th> |
106 | | - </tr> |
107 | | - </thead> |
108 | | - <tbody> |
109 | | - {#each State.aHosts as h} |
110 | 116 | <tr> |
111 | | - <td>{h.hostname}{(h.hostname && browser && h.hostname == page.url.hostname) ? " (Active)" : " (Inactive)"}</td> |
112 | | - <td>{h.acode}</td> |
| 117 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 118 | + >AHost Hostname</th |
| 119 | + > |
| 120 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 121 | + >ACode</th |
| 122 | + > |
113 | 123 | </tr> |
114 | | - {/each} |
| 124 | + </thead> |
| 125 | + <tbody> |
| 126 | + {#each State.aHosts as h} |
| 127 | + <tr> |
| 128 | + <td |
| 129 | + >{h.hostname}{h.hostname && |
| 130 | + browser && |
| 131 | + h.hostname == page.url.hostname |
| 132 | + ? " (Active)" |
| 133 | + : " (Inactive)"}</td |
| 134 | + > |
| 135 | + <td>{h.acode}</td> |
| 136 | + </tr> |
| 137 | + {/each} |
115 | 138 | </tbody> |
116 | 139 | </table> |
117 | 140 | <br /> |
|
120 | 143 | Version: {State.version}<br /> |
121 | 144 | Logged In: {SessionState.loggedIn}<br /> |
122 | 145 | SSR: {SessionState.ssr}<br /> |
123 | | - <table style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;"> |
| 146 | + <table |
| 147 | + style="width:100%; margin: 10px 0; border-collapse: collapse; font-size: 12px;" |
| 148 | + > |
124 | 149 | <thead> |
125 | | - <tr> |
126 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">AWS Ready</th> |
127 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Identity ID</th> |
128 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Access Key ID</th> |
129 | | - <th style="border-bottom: 1px solid #ccc; text-align: left;">Credentials Expires</th> |
130 | | - </tr> |
| 150 | + <tr> |
| 151 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 152 | + >AWS Ready</th |
| 153 | + > |
| 154 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 155 | + >Identity ID</th |
| 156 | + > |
| 157 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 158 | + >Access Key ID</th |
| 159 | + > |
| 160 | + <th style="border-bottom: 1px solid #ccc; text-align: left;" |
| 161 | + >Credentials Expires</th |
| 162 | + > |
| 163 | + </tr> |
131 | 164 | </thead> |
132 | 165 | <tbody> |
133 | | - <tr> |
134 | | - <td>{SessionState.awsReady ? "Yes" : "No"}</td> |
135 | | - <td title={SessionState.credentials?.identityId || "-"}>{SessionState.credentials?.identityId.slice(0, 10) + "..." || "-"}</td> |
136 | | - <td title={SessionState.credentials?.accessKeyId || "-"}>{SessionState.credentials?.accessKeyId.slice(0, 6) + "..." || "-"}</td> |
137 | | - <td>{SessionState.credentials?.expiration?.toLocaleTimeString() || "-"}</td> |
138 | | - </tr> |
| 166 | + <tr> |
| 167 | + <td>{SessionState.awsReady ? "Yes" : "No"}</td> |
| 168 | + <td title={SessionState.credentials?.identityId || "-"} |
| 169 | + >{SessionState.credentials?.identityId.slice(0, 10) + |
| 170 | + "..." || "-"}</td |
| 171 | + > |
| 172 | + <td title={SessionState.credentials?.accessKeyId || "-"} |
| 173 | + >{SessionState.credentials?.accessKeyId.slice(0, 6) + |
| 174 | + "..." || "-"}</td |
| 175 | + > |
| 176 | + <td |
| 177 | + >{SessionState.credentials?.expiration?.toLocaleTimeString() || |
| 178 | + "-"}</td |
| 179 | + > |
| 180 | + </tr> |
139 | 181 | </tbody> |
140 | 182 | </table> |
141 | 183 | Plays: {SessionState.plays.toLocaleString()} ({State.localPlays.toLocaleString()} |
|
159 | 201 | text-align: left; |
160 | 202 | font-family: "Courier New", Courier, monospace; |
161 | 203 | } |
162 | | -
|
163 | 204 | </style> |
0 commit comments