update eventfetcher alert

This commit is contained in:
2023-11-23 18:49:37 +08:00
parent 979679532c
commit 4af2190e6d
6 changed files with 38 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ import { ACCOUNT_API_URL, TURNSTILE_KEY } from '@/data/constants'
import { Question24Regular } from '@vicons/fluent'
import VueTurnstile from 'vue-turnstile'
import { BiliAuthCodeStatusType } from '@/api/api-models'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
const token = ref()
const turnstile = ref()
@@ -227,6 +228,7 @@ async function ChangeBili() {
<NButton size="small" @click="bindBiliCodeModalVisiable = true" type="info"> 进行绑定 </NButton>
</template>
</NCard>
<EventFetcherStatusCard />
<NAlert title="Token" type="info">
请注意保管, 这个东西可以完全操作你的账号
<NInput type="password" :value="accountInfo?.token" show-password-on="click" status="error" />

View File

@@ -37,6 +37,7 @@ import { computed, onMounted, ref } from 'vue'
import { saveAs } from 'file-saver'
import { List } from 'linqts'
import { isDarkMode } from '@/Utils'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
enum EventType {
Guard,
@@ -174,11 +175,7 @@ onMounted(() => {
<NAlert v-if="!accountInfo?.isBiliVerified" type="warning"> 使用此功能前你需要先<NButton type="info" text @click="$router.push({ name: 'manage-biliVerify' })">认证Bilibili账号</NButton> </NAlert>
</NSpace>
<NDivider />
<NAlert title="EVENT-FETCHER 状态" :type="accountInfo?.eventFetcherOnline ? (accountInfo?.eventFetcherStatus == 'ok' ? 'success' : 'warning') : 'info'">
<NTag :type="accountInfo?.eventFetcherOnline ? (accountInfo?.eventFetcherStatus == 'ok' ? 'success' : 'warning') : 'error'">
{{ accountInfo?.eventFetcherOnline ? (accountInfo?.eventFetcherStatus == 'ok' ? '正常' : `异常: ${accountInfo.eventFetcherStatus}`) : '未连接' }}
</NTag>
</NAlert>
<EventFetcherStatusCard />
<NDivider />
<NCard size="small" style="witdh: 100%">
<template v-if="accountInfo?.eventFetcherOnline">

View File

@@ -9,7 +9,9 @@ const accountInfo = useAccount()
let client = new DanmakuClient(null)
onMounted(() => {
client.Start()
if(accountInfo.value?.eventFetcherOnline != true){
client.Start()
}
})
onUnmounted(() => {
client.Stop()

View File

@@ -825,8 +825,8 @@ onUnmounted(() => {
<NAlert type="warning" v-else title="你尚未注册并登录 VTsuru.live, 大部分规则设置将不可用 (因为我懒得在前段重写一遍逻辑">
<NButton @click="$router.push({ name: 'manage-index' })" type="primary"> 前往登录或注册 </NButton>
</NAlert>
<NAlert type="warning" closable>
<br />
<NAlert v-if="accountInfo?.eventFetcherOnline != true" type="warning" closable>
不要同时开多个页面, 会导致点歌重复! 可以考虑使用
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
, 部署后还可以记录SC和上舰历史