릴리스: v0.1.38 아이템 이름 수정과 티어표 썸네일 추가

This commit is contained in:
2026-03-26 18:14:54 +09:00
parent f729b6fa82
commit 5d778e9c20
14 changed files with 293 additions and 22 deletions

View File

@@ -196,7 +196,13 @@ async function loadGame() {
try {
const data = await api.getGame(selectedGameId.value)
selectedGame.value = data
selectedGame.value = {
...data,
items: (data.items || []).map((item) => ({
...item,
draftLabel: item.label,
})),
}
} catch (e) {
error.value = '게임 정보를 불러오지 못했어요.'
}
@@ -346,6 +352,24 @@ async function removeGameItem(itemId) {
}
}
async function saveGameItemLabel(item) {
resetMessages()
if (!selectedGameId.value) return
const nextLabel = (item.draftLabel || '').trim()
if (!nextLabel) {
error.value = '아이템 이름을 입력해주세요.'
return
}
try {
await api.updateAdminGameItem(selectedGameId.value, item.id, { label: nextLabel })
await loadGame()
success.value = '기본 아이템 이름을 수정했어요.'
} catch (e) {
error.value = '기본 아이템 이름 수정에 실패했어요.'
}
}
async function removeGame() {
resetMessages()
if (!selectedGameId.value || !selectedGame.value?.game) return
@@ -708,8 +732,11 @@ async function saveFeaturedOrder() {
<div v-else class="thumbGrid">
<div v-for="item in selectedGame.items" :key="item.id" class="thumbCard">
<img class="thumb thumb--game" :src="toApiUrl(item.src)" :alt="item.label" />
<div class="thumbLabel">{{ item.label }}</div>
<button class="btn btn--danger btn--small" @click="removeGameItem(item.id)">아이템 삭제</button>
<input v-model="item.draftLabel" class="input input--labelEdit" placeholder="아이템 이름" />
<div class="thumbCard__actions">
<button class="btn btn--ghost btn--small" @click="saveGameItemLabel(item)">이름 저장</button>
<button class="btn btn--danger btn--small" @click="removeGameItem(item.id)">아이템 삭제</button>
</div>
</div>
</div>
</div>
@@ -1047,6 +1074,9 @@ async function saveFeaturedOrder() {
.input--compact {
max-width: 320px;
}
.input--labelEdit {
margin-top: 10px;
}
.hint {
margin-top: 10px;
opacity: 0.78;
@@ -1251,6 +1281,11 @@ async function saveFeaturedOrder() {
opacity: 0.9;
word-break: break-word;
}
.thumbCard__actions {
margin-top: 10px;
display: grid;
gap: 8px;
}
.thumbLabel--preview {
text-align: center;
}