add admin qr

This commit is contained in:
2026-08-06 00:53:17 +07:00
parent a1c19cba3e
commit 3fc1e188ef
+11 -4
View File
@@ -28,6 +28,7 @@ const showDeleteTeamModal = ref(false)
const newTeamName = ref('') const newTeamName = ref('')
const showQR = ref(false) const showQR = ref(false)
const urlQR = ref('') const urlQR = ref('')
const titleQR = ref('')
const game = ref<Game>({ const game = ref<Game>({
id: undefined, id: undefined,
@@ -79,6 +80,7 @@ async function toTeamStory(id: number, password: string, newTab: boolean = false
const uri = '/team-story/' + id + '?password=' + password const uri = '/team-story/' + id + '?password=' + password
if (newTab) { if (newTab) {
window.open(uri, '_blank'); window.open(uri, '_blank');
return
} }
router.push(uri) router.push(uri)
} }
@@ -123,6 +125,8 @@ const giveApplicationApplication = ref<Application>({
image: '' image: ''
}) })
const url = window.location.href
function giveApplication(team: Team, application: Application) { function giveApplication(team: Team, application: Application) {
giveApplicationTeam.value = team giveApplicationTeam.value = team
giveApplicationApplication.value = application giveApplicationApplication.value = application
@@ -176,8 +180,9 @@ function getTeamStoryURL(id: number, password: string): string {
return getURL() + '/team-story/' + id + '?password=' + password return getURL() + '/team-story/' + id + '?password=' + password
} }
async function openQR(url: string) { async function openQR(url: string, text: string) {
urlQR.value = url urlQR.value = url
titleQR.value = text
showQR.value = true showQR.value = true
} }
@@ -309,6 +314,9 @@ useSimplePolling(() => {
</n-space> </n-space>
<div> <div>
<n-button quaternary class="settings-button" @click="openQR(url, 'Админка')">
QR
</n-button>
<n-button quaternary @click="showSettingsModal = true" class="settings-button"> <n-button quaternary @click="showSettingsModal = true" class="settings-button">
<Icon class="settings-icon"> <Icon class="settings-icon">
<Settings /> <Settings />
@@ -365,7 +373,7 @@ useSimplePolling(() => {
</div> </div>
<n-flex justify="end"> <n-flex justify="end">
<n-button @click="openQR(getTeamStoryURL(team.id!, team.password!))"> <n-button @click="openQR(getTeamStoryURL(team.id!, team.password!), 'Подсмотреть игру')">
QR QR
</n-button> </n-button>
<n-button @click="toTeamStory(team.id!, team.password!, true)"> <n-button @click="toTeamStory(team.id!, team.password!, true)">
@@ -479,8 +487,7 @@ useSimplePolling(() => {
<!-- Окно qr --> <!-- Окно qr -->
<n-modal v-model:show="showQR"> <n-modal v-model:show="showQR">
<n-card style="width: 600px" title="Подсмотреть игру" :bordered="false" size="huge" role="dialog" <n-card style="width: 600px" :title="titleQR" :bordered="false" size="huge" role="dialog" aria-modal="true">
aria-modal="true">
<template #header-extra> <template #header-extra>
<n-button @click="showQR = false"> x </n-button> <n-button @click="showQR = false"> x </n-button>
</template> </template>