add mcp label

This commit is contained in:
2026-09-06 02:08:38 +07:00
parent 13aad8ff4c
commit 70307e905f
38 changed files with 74 additions and 36 deletions
+27 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { NButton, NConfigProvider, NFlex, NInput, NQrCode } from 'naive-ui'
import { NButton, NConfigProvider, NFlex, NInput, NQrCode, NTag } from 'naive-ui'
import { useMessage } from 'naive-ui'
import { computed, nextTick, ref } from 'vue'
import { useRoute } from 'vue-router'
@@ -10,6 +10,7 @@ import type {
Introduction,
Place,
Question,
TeamAction,
} from '@/api/generated/crabs/evening_detective_server'
import GameInputForm from '@/components/GameInputForm.vue'
import HeaderMenu from '@/components/HeaderMenu.vue'
@@ -28,6 +29,7 @@ const teamId = route.params.id
const password = route.query.password
const newPlacesCount = ref(0)
const actions = ref<TeamAction[]>([])
const scrollContainer = ref<HTMLDivElement | null>()
@@ -93,6 +95,7 @@ async function getStory() {
}) || [],
questions: res.story!.questions || [],
}
actions.value = res.actions || []
const newCount = story.value.places.length
@@ -306,6 +309,13 @@ useSimplePolling(() => {
</MessagePaper>
<div v-if="authStore.hasRole('author') && story.places.length > 0" class="edit-panel">
<div v-if="actions.length > 0" class="actions-list">
<div class="actions-title">Ходы</div>
<div v-for="(action, index) in actions" :key="index" class="action-item">
<span>{{ index + 1 }}. {{ action.code }}</span>
<n-tag v-if="action.mcp" size="small" type="success">MCP</n-tag>
</div>
</div>
<n-flex justify="end">
<n-button @click="deleteLast">Удалить последний ход</n-button>
</n-flex>
@@ -326,6 +336,22 @@ useSimplePolling(() => {
z-index: -1;
}
.actions-list {
margin-bottom: 20px;
}
.actions-title {
color: #aaa;
margin-bottom: 8px;
}
.action-item {
align-items: center;
display: flex;
gap: 8px;
margin: 4px 0;
}
.bottom-margin {
height: calc(100dvh - 70px - 76px);
}