From b0530be5010494f2db3deded340c16a6dc3cbe56 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 12 Nov 2022 12:51:58 +0100 Subject: collapse PlayerLog entries --- .../src/lib/components/log_viewer/LogTurn.svelte | 160 +++++++++++++++++++++ 1 file changed, 160 insertions(+) (limited to 'web/pw-server/src/lib/components/log_viewer/LogTurn.svelte') diff --git a/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte b/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte index e69de29..80367f4 100644 --- a/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte +++ b/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte @@ -0,0 +1,160 @@ + + +
+
+ + + {#if expanded} + + {:else} + + {/if} + + + Turn {turnNum} + + + {#if logTurn.action?.type === "dispatches"} + {pluralize(logTurn.action.dispatches.length, "dispatch")} + {:else if logTurn.action?.type === "timeout"} + timeout + {:else if logTurn.action?.type === "bad_command"} + invalid command + {/if} +
+ {#if expanded} +
+ {#if logTurn.action?.type === "dispatches"} +
+ {#each logTurn.action.dispatches as dispatch} +
+
+ {pluralize(dispatch.ship_count, "ship")} from {dispatch.origin} to {dispatch.destination} +
+ {#if dispatch.error} + {dispatch.error} + {/if} +
+ {/each} +
+ {:else if logTurn.action?.type === "bad_command"} +
+
{logTurn.action.command}
+
Parse error: {logTurn.action.error}
+
+ {/if} + {#if logTurn.stderr.length > 0} +
stderr
+
+ {#each logTurn.stderr as stdErrMsg} +
{stdErrMsg}
+ {/each} +
+ {/if} +
+ {/if} +
+ + -- cgit v1.2.3