This commit is contained in:
Your Name
2026-07-28 15:04:17 +08:00
parent ac406a5f99
commit 8f68af1c2c
27 changed files with 3442 additions and 296 deletions
+7 -2
View File
@@ -69,16 +69,21 @@ const fetchRecentLogs = async () => {
}
let statsInterval = null
const refreshVisibleStats = () => {
if (document.visibilityState === 'visible') fetchStats()
}
onMounted(() => {
fetchStats()
fetchRecentLogs()
// 统计卡片每10秒自动刷新一次
statsInterval = setInterval(fetchStats, 10000)
// 汇总统计需要扫描日志索引,分钟级刷新足够且不会持续压迫数据库。
statsInterval = setInterval(refreshVisibleStats, 60000)
document.addEventListener('visibilitychange', refreshVisibleStats)
})
onUnmounted(() => {
if (statsInterval) clearInterval(statsInterval)
document.removeEventListener('visibilitychange', refreshVisibleStats)
})
</script>
+1 -1
View File
@@ -172,7 +172,7 @@ const onConvListScroll = (e) => {
const fetchAccounts = async () => {
try {
const res = await api.get('/accounts')
const res = await api.get('/account-options')
accounts.value = Array.isArray(res.data) ? res.data : res.data?.items || []
} catch (error) {
console.error(error)
+1 -1
View File
@@ -39,7 +39,7 @@ const formatPeerId = (conv) => {
}
const fetchAccounts = async () => {
const res = await api.get(`/accounts`)
const res = await api.get(`/account-options`)
accounts.value = res.data.filter(a => a.has_cookie)
if (selectedAccount.value) {
const current = accounts.value.find(a => a.id === selectedAccount.value)
+1 -1
View File
@@ -72,7 +72,7 @@ const fetchLogs = async () => {
const fetchAccounts = async () => {
try {
const res = await api.get('/accounts')
const res = await api.get('/account-options')
accounts.value = res.data
} catch (error) {
console.error(error)
+1 -1
View File
@@ -219,7 +219,7 @@ watch(filterAccountId, () => {
const fetchAccounts = async () => {
try {
const res = await api.get('/accounts')
const res = await api.get('/account-options')
accounts.value = Array.isArray(res.data) ? res.data : res.data?.items || []
if (!cooldownAccountId.value && accounts.value.length) {
cooldownAccountId.value = filterAccountId.value
+1 -1
View File
@@ -85,7 +85,7 @@ const fetchLogs = async () => {
const fetchAccounts = async () => {
try {
const res = await api.get(`/accounts`)
const res = await api.get(`/account-options`)
accounts.value = res.data
} catch (error) {
console.error(error)