fix(gateway): show legacy season states

This commit is contained in:
2026-07-31 15:28:16 +00:00
parent 8a17412fcd
commit 809de8ace6
12 changed files with 246 additions and 43 deletions
+7 -4
View File
@@ -10,6 +10,7 @@ import { createGameTrpc, type GameRouter } from '../utils/gameTrpc';
import { trpc } from '../utils/trpc';
import { formatLog } from '../utils/formatLog';
import { sealPassword } from '../utils/passwordEnvelope';
import { resolveServerSeasonStatus } from '../utils/serverSeasonStatus';
type GatewayOutput = inferRouterOutputs<AppRouter>;
type GameOutput = inferRouterOutputs<GameRouter>;
@@ -37,6 +38,7 @@ const dateText = computed(() => {
}
return `西紀 ${info.value.year}${info.value.month}`;
});
const seasonStatus = computed(() => (info.value ? resolveServerSeasonStatus(info.value) : null));
const loadPublicStatus = async (): Promise<void> => {
statusLoading.value = true;
@@ -153,9 +155,7 @@ const handlePasswordReset = async (): Promise<void> => {
<button class="login-button" type="submit" :disabled="loginLoading">
{{ loginLoading ? '로그인 중…' : '로그인' }}
</button>
<button class="reset-button" type="button" @click="handlePasswordReset">
비밀번호 초기화
</button>
<button class="reset-button" type="button" @click="handlePasswordReset">비밀번호 초기화</button>
<RouterLink class="signup-button" to="/signup">아이디로 회원가입</RouterLink>
</form>
<p v-if="loginError" class="login-error" role="alert">{{ loginError }}</p>
@@ -174,7 +174,10 @@ const handlePasswordReset = async (): Promise<void> => {
</div>
<ul v-if="info" class="status-summary">
<li>서버: {{ profile?.korName }} / 시나리오: {{ profile?.scenario }}</li>
<li>유저 {{ info.userCnt }} · NPC {{ info.npcCnt }} · {{ info.nationCnt }} 경쟁중</li>
<li>
유저 {{ info.userCnt }} · NPC {{ info.npcCnt }} ·
<span class="season-status" :title="seasonStatus?.period">{{ seasonStatus?.label }}</span>
</li>
<li>{{ info.turnTerm }} 서버</li>
</ul>
<div v-if="mapData?.history?.length" class="status-history">
+9 -4
View File
@@ -8,6 +8,7 @@ import MapPreview from '../components/MapPreview.vue';
import { trpc } from '../utils/trpc';
import { createGameTrpc } from '../utils/gameTrpc';
import type { GameRouter } from '../utils/gameTrpc';
import { resolveServerSeasonStatus } from '../utils/serverSeasonStatus';
type GatewayRouterOutput = inferRouterOutputs<AppRouter>;
type GameRouterOutput = inferRouterOutputs<GameRouter>;
@@ -43,6 +44,7 @@ const userIconBaseUrl = import.meta.env.VITE_GATEWAY_USER_ICON_BASE_URL ?? '/gat
const formatGraceEndsAt = (value: string | null | undefined): string =>
value ? new Date(value).toLocaleString('ko-KR') : '';
const serverSeasonStatus = (info: LobbyInfo) => resolveServerSeasonStatus(info);
const encodeLegacyIconPath = (value: string): string =>
value
.split('/')
@@ -273,15 +275,18 @@ const handleEnter = async (profile: LobbyProfile, targetPath: string) => {
:style="{ color: profile.color }"
class="text-lg font-bold cursor-help"
:title="
profileDetails[profile.profileName]?.starttime
? `시작일: ${profileDetails[profile.profileName]?.starttime}`
profileDetails[profile.profileName]
? serverSeasonStatus(profileDetails[profile.profileName]!).period
: ''
"
>
{{ profile.korName }}
</div>
<div v-if="profileDetails[profile.profileName]" class="text-xs text-zinc-500 mt-1">
&lt;{{ profileDetails[profile.profileName]?.nationCnt }} 경쟁중&gt;
<div
v-if="profileDetails[profile.profileName]"
class="season-status mt-1 whitespace-nowrap text-xs text-zinc-500"
>
{{ serverSeasonStatus(profileDetails[profile.profileName]!).label }}
</div>
<div
v-if="