fix(gateway): show legacy season states
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
<{{ profileDetails[profile.profileName]?.nationCnt }}국 경쟁중>
|
||||
<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="
|
||||
|
||||
Reference in New Issue
Block a user