refactor: improve war module type safety and reserved turns test data handling

This commit is contained in:
2026-01-05 17:34:36 +00:00
parent 2e45a2d194
commit 44df19b079
10 changed files with 137 additions and 111 deletions
+15 -14
View File
@@ -60,6 +60,7 @@ const handleLogout = async () => {
<div class="max-w-5xl mx-auto py-8 px-4 space-y-8">
<!-- Notice -->
<div v-if="notice" class="text-center">
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="text-orange-500 text-3xl font-bold" v-html="notice"></span>
</div>
@@ -91,15 +92,15 @@ const handleLogout = async () => {
:style="{ color: profile.color }"
class="text-lg font-bold cursor-help"
:title="
profileDetails[profile.profileName]
? `시작일: ${profileDetails[profile.profileName].starttime}`
profileDetails[profile.profileName]?.starttime
? `시작일: ${profileDetails[profile.profileName]?.starttime}`
: ''
"
>
{{ profile.korName }}
</div>
<div v-if="profileDetails[profile.profileName]" class="text-xs text-zinc-500 mt-1">
&lt;{{ profileDetails[profile.profileName].nationCnt }} 경쟁중&gt;
&lt;{{ profileDetails[profile.profileName]?.nationCnt }} 경쟁중&gt;
</div>
</td>
@@ -108,25 +109,25 @@ const handleLogout = async () => {
<template v-if="profileDetails[profile.profileName]">
<div class="space-y-1">
<div>
서기 {{ profileDetails[profile.profileName].year }}
{{ profileDetails[profile.profileName].month }} (<span
서기 {{ profileDetails[profile.profileName]?.year }}
{{ profileDetails[profile.profileName]?.month }} (<span
class="text-orange-400"
>{{ profile.scenario }}</span
>)
</div>
<div class="text-zinc-400">
유저 : {{ profileDetails[profile.profileName].userCnt }} /
{{ profileDetails[profile.profileName].maxUserCnt }}
유저 : {{ profileDetails[profile.profileName]?.userCnt }} /
{{ profileDetails[profile.profileName]?.maxUserCnt }}
<span class="text-cyan-400 ml-2"
>NPC : {{ profileDetails[profile.profileName].npcCnt }}</span
>NPC : {{ profileDetails[profile.profileName]?.npcCnt }}</span
>
<span class="text-green-400 ml-2"
>({{ profileDetails[profile.profileName].turnTerm }} 서버)</span
>({{ profileDetails[profile.profileName]?.turnTerm }} 서버)</span
>
</div>
<div class="text-xs text-zinc-500">
(상성 설정:{{ profileDetails[profile.profileName].fictionMode }}), (기타
설정:{{ profileDetails[profile.profileName].otherTextInfo }})
(상성 설정:{{ profileDetails[profile.profileName]?.fictionMode }}), (기타
설정:{{ profileDetails[profile.profileName]?.otherTextInfo }})
</div>
</div>
</template>
@@ -145,14 +146,14 @@ const handleLogout = async () => {
class="w-12 h-12 mx-auto bg-zinc-800 rounded overflow-hidden border border-zinc-700"
>
<img
:src="profileDetails[profile.profileName].myGeneral.picture"
:src="profileDetails[profile.profileName]?.myGeneral?.picture ?? undefined"
class="w-full h-full object-cover"
/>
</div>
</td>
<td class="px-4 py-4 border-r border-zinc-800 text-center">
<div v-if="profileDetails[profile.profileName]?.myGeneral" class="font-medium">
{{ profileDetails[profile.profileName].myGeneral.name }}
{{ profileDetails[profile.profileName]?.myGeneral?.name }}
</div>
<div v-else class="text-zinc-600">- -</div>
</td>
@@ -161,7 +162,7 @@ const handleLogout = async () => {
<td class="px-4 py-4 text-center">
<template v-if="profileDetails[profile.profileName]">
<button
v-if="profileDetails[profile.profileName].myGeneral"
v-if="profileDetails[profile.profileName]?.myGeneral"
class="w-full bg-zinc-700 hover:bg-zinc-600 text-white py-1.5 rounded text-sm transition-colors"
>
입장