feat: Add Tauri support and enhance client functionality

- Introduced Tauri as a new EventFetcherType in api-models.
- Enhanced ClientFetcher.vue to support forced mode switching for Danmaku client.
- Updated ClientLayout.vue to restrict usage outside Tauri environment with appropriate alerts.
- Improved ClientSettings.vue to fetch and display the current version of the application.
- Modified initialization logic in initialize.ts to handle minimized startup for Tauri.
- Updated QueryBiliAPI function to conditionally use cookies based on a new parameter.
- Added bootAsMinimized setting to useSettings store for better user experience.
- Refactored logging in useWebFetcher to use console instead of logError/logInfo for clarity.
- Created a new LabelItem component for better label handling in forms.
- Enhanced EventFetcherStatusCard.vue to display version information based on EventFetcherType.
This commit is contained in:
2025-04-07 19:14:39 +08:00
parent 277497420c
commit 0195e7b01a
14 changed files with 536 additions and 328 deletions

View File

@@ -6,7 +6,21 @@ import { NAlert, NButton, NDivider, NIcon, NTag, NText, NTooltip } from 'naive-u
import { computed } from 'vue'
const accountInfo = useAccount()
const state = accountInfo.value?.eventFetcherState
const state = accountInfo.value?.eventFetcherState
const eventFetcherVersionName = computed(() => {
if (state?.type == EventFetcherType.OBS) {
return 'OBS/网页端'
} else if (state?.type == EventFetcherType.Application) {
return '控制台应用'
} else if (state?.type == EventFetcherType.Server) {
return '本站监听 (已删除)'
} else if (state?.type == EventFetcherType.Tauri) {
return 'Tauri 应用'
} else {
return state?.version ?? '未知'
}
})
const status = computed(() => {
if (state.online == true) {
@@ -57,7 +71,7 @@ const status = computed(() => {
:color="{ borderColor: 'white', textColor: 'white', color: '#4b6159' }"
>
<NIcon :component="FlashCheckmark16Filled" />
{{ state.type == EventFetcherType.OBS ? 'OBS/网页端' : state.version ?? '未知' }}
{{ eventFetcherVersionName }}
</NTag>
</template>
你所使用的版本

View File

@@ -0,0 +1,24 @@
<template>
<span class="label-item">
<p>
{{ label }}
</p>
<slot />
</span>
</template>
<script lang="ts" setup>
defineProps<{
label: string;
}>();
</script>
<style scoped>
.label-item {
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
gap: 0.5rem;
}
</style>