add alert

This commit is contained in:
2023-11-20 18:18:05 +08:00
parent 15c3de24b3
commit 849d1594a5

View File

@@ -791,8 +791,10 @@ onMounted(() => {
if (accountInfo.value) {
settings.value = accountInfo.value.settings.songRequest
}
props.client.on('danmaku', onGetDanmaku)
props.client.on('sc', onGetSC)
if (accountInfo.value?.eventFetcherOnline != true) {
props.client.on('danmaku', onGetDanmaku)
props.client.on('sc', onGetSC)
}
timer = setInterval(() => {
updateKey.value++
}, 1000)
@@ -809,18 +811,35 @@ onUnmounted(() => {
</script>
<template>
<NAlert type="info" v-if="accountInfo"> 启用点歌功能 <NSwitch :value="accountInfo?.settings.enableFunctions.includes(FunctionTypes.SongRequest)" @update:value="onUpdateFunctionEnable" /> </NAlert>
<NAlert type="info" v-if="accountInfo">
启用点歌功能
<NSwitch :value="accountInfo?.settings.enableFunctions.includes(FunctionTypes.SongRequest)" @update:value="onUpdateFunctionEnable" />
<br />
<NText depth="3">
如果没有部署
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
则其需要保持此页面开启才能点歌
</NText>
</NAlert>
<NAlert type="warning" v-else title="你尚未注册并登录 VTsuru.live, 大部分规则设置将不可用 (因为我懒得在前段重写一遍逻辑">
<NButton @click="$router.push({ name: 'manage-index' })" type="primary"> 前往登录或注册 </NButton>
</NAlert>
<br />
<NCard size="small">
<NTooltip>
<template #trigger>
<NButton @click="showOBSModal = true" type="primary" :disabled="!accountInfo"> OBS 组件 </NButton>
</template>
{{ configCanEdit ? '' : '登陆后才可以使用此功能' }}
</NTooltip>
<NSpace align="center">
<NTooltip>
<template #trigger>
<NButton @click="showOBSModal = true" type="primary" :disabled="!accountInfo"> OBS 组件 </NButton>
</template>
{{ configCanEdit ? '' : '登陆后才可以使用此功能' }}
</NTooltip>
<NAlert type="warning">
不要同时开多个页面, 会导致点歌重复! 可以考虑使用
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
, 部署后还可以记录SC和上舰历史
</NAlert>
</NSpace>
</NCard>
<br />
<NCard>
@@ -918,9 +937,9 @@ onUnmounted(() => {
</NTooltip>
</NSpace>
<NSpace justify="end" align="center">
<NTooltip>
<NTooltip v-if="song.song">
<template #trigger>
<NButton circle type="success" style="height: 30px; width: 30px" :loading="isLrcLoading == song?.song?.key" :disabled="!song.song" @click="playMusic(song)">
<NButton circle type="success" style="height: 30px; width: 30px" :loading="isLrcLoading == song?.song?.key" @click="playMusic(song)">
<template #icon>
<NIcon :component="Play24Filled" />
</template>