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