mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-10 20:36:55 +08:00
优化 JWT 令牌的存储和使用逻辑;调整布局样式和组件属性
This commit is contained in:
@@ -219,7 +219,7 @@
|
||||
data: [{ value: eventsPerSecond.value, name: '事件/秒' }]
|
||||
}]
|
||||
};
|
||||
gaugeOption.value = option; // 保留原始option用于初始化
|
||||
gaugeOption.value ??= option; // 保留原始option用于初始化
|
||||
if (gaugeChart.value) {
|
||||
gaugeChart.value.setOption(option, false);
|
||||
}
|
||||
@@ -239,7 +239,7 @@
|
||||
markLine: { data: [{ type: 'average', name: '平均值' }] }
|
||||
}]
|
||||
};
|
||||
//historyOption.value = option; // 保留原始option用于初始化
|
||||
historyOption.value ??= option; // 保留原始option用于初始化
|
||||
if (historyChart.value) {
|
||||
historyChart.value.setOption(option, false);
|
||||
}
|
||||
@@ -259,7 +259,7 @@
|
||||
labelLine: { show: false }, data: typeData
|
||||
}]
|
||||
};
|
||||
typeDistributionOption.value = option; // 保留原始option用于初始化
|
||||
typeDistributionOption.value ??= option; // 保留原始option用于初始化
|
||||
if (typeDistributionChart.value) {
|
||||
typeDistributionChart.value.setOption(option, false);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { useAccount } from '@/api/account';
|
||||
import { useWebFetcher } from '@/store/useWebFetcher';
|
||||
import { openUrl } from '@tauri-apps/plugin-opener';
|
||||
import { cookie, useAccount } from '@/api/account';
|
||||
import { useWebFetcher } from '@/store/useWebFetcher';
|
||||
import { openUrl } from '@tauri-apps/plugin-opener';
|
||||
import { useElementSize } from '@vueuse/core';
|
||||
import { roomInfo, streamingInfo } from './data/info';
|
||||
import { roomInfo, streamingInfo } from './data/info';
|
||||
|
||||
const accountInfo = useAccount();
|
||||
const cookie = useLocalStorage('JWT_Token', '')
|
||||
|
||||
const webfetcher = useWebFetcher();
|
||||
|
||||
@@ -91,9 +90,7 @@ import { roomInfo, streamingInfo } from './data/info';
|
||||
<template #header>
|
||||
<NSpace align="center">
|
||||
直播状态
|
||||
<NTag
|
||||
:type="!accountInfo.streamerInfo?.isStreaming ? 'error' : 'success'"
|
||||
>
|
||||
<NTag :type="!accountInfo.streamerInfo?.isStreaming ? 'error' : 'success'">
|
||||
{{ !accountInfo.streamerInfo?.isStreaming ? '未直播' : '直播中' }}
|
||||
</NTag>
|
||||
</NSpace>
|
||||
@@ -108,15 +105,13 @@ import { roomInfo, streamingInfo } from './data/info';
|
||||
v-if="roomInfo?.user_cover"
|
||||
style="position: relative"
|
||||
>
|
||||
<div
|
||||
style="position: relative; width: 100%; max-width: 500px;"
|
||||
>
|
||||
<div style="position: relative; width: 100%; max-width: 500px;">
|
||||
<NImage
|
||||
ref="coverRef"
|
||||
:src="roomInfo?.user_cover"
|
||||
style="width: 100%; opacity: 0.5; border-radius: 8px;"
|
||||
referrerpolicy="no-referrer"
|
||||
:img-props="{ referrerpolicy: 'no-referrer', style: { width: '100%'} }"
|
||||
:img-props="{ referrerpolicy: 'no-referrer', style: { width: '100%' } }"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -244,6 +244,9 @@ import { CloudArchive24Filled, Settings24Filled } from '@vicons/fluent';
|
||||
<NLayoutContent
|
||||
class="main-layout-content"
|
||||
:native-scrollbar="false"
|
||||
:scrollbar-props="{
|
||||
trigger: 'none'
|
||||
}"
|
||||
>
|
||||
<div style="padding: 12px; padding-right: 15px;">
|
||||
<RouterView v-slot="{ Component }">
|
||||
@@ -278,7 +281,7 @@ import { CloudArchive24Filled, Settings24Filled } from '@vicons/fluent';
|
||||
justify-content: center;
|
||||
/* 计算高度,减去 WindowBar 的高度 (假设为 30px) */
|
||||
height: calc(100vh - 30px);
|
||||
background-color: #f8f8fa;
|
||||
background-color: var(--n-color);
|
||||
/* 可选:添加背景色 */
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ export async function initAll() {
|
||||
return;
|
||||
}
|
||||
let permissionGranted = await isPermissionGranted();
|
||||
checkUpdate();
|
||||
|
||||
// If not we need to request it
|
||||
if (!permissionGranted) {
|
||||
@@ -117,6 +118,7 @@ export function OnClientUnmounted() {
|
||||
|
||||
async function checkUpdate() {
|
||||
const update = await check();
|
||||
console.log(update);
|
||||
if (update) {
|
||||
console.log(
|
||||
`found update ${update.version} from ${update.date} with notes ${update.body}`
|
||||
|
||||
Reference in New Issue
Block a user