feat: 优化代理准备并完善远端部署
- 增加严格代理、两分钟预取、白名单去重与分组状态展示\n- 增加远端注册令牌和安全地址校验\n- 增加 Docker Compose、Caddy 示例与控制中心部署文档
This commit is contained in:
@@ -5,12 +5,14 @@ import { useScheduler } from '@/composables/useScheduler'
|
||||
import { useSettings } from '@/composables/useSettings'
|
||||
import StatusGrid from '@/components/console/StatusGrid.vue'
|
||||
import ControlStrip from '@/components/console/ControlStrip.vue'
|
||||
import ProxyGroupPanel from '@/components/console/ProxyGroupPanel.vue'
|
||||
import AccountTable from '@/components/account/AccountTable.vue'
|
||||
import LogPanel from '@/components/log/LogPanel.vue'
|
||||
import SettingsModal from '@/components/modal/SettingsModal.vue'
|
||||
import CKManager from '@/components/ck/CKManager.vue'
|
||||
import ExchangeRecords from '@/components/exchange/ExchangeRecords.vue'
|
||||
import { GetRemoteStatus } from '@wails/go/app/App'
|
||||
import { useProxyStatus } from '@/composables/useProxyStatus'
|
||||
|
||||
defineProps<{
|
||||
serverTime: string
|
||||
@@ -19,6 +21,7 @@ defineProps<{
|
||||
const { theme, toggleTheme } = useTheme()
|
||||
const { runState, countdownSeconds, formatRemain } = useScheduler()
|
||||
const { settings, loadSettings } = useSettings()
|
||||
const { loadProxyStatus } = useProxyStatus()
|
||||
|
||||
const settingsModalRef = ref<InstanceType<typeof SettingsModal> | null>(null)
|
||||
const currentPage = ref<'console' | 'ck' | 'exchange'>('console')
|
||||
@@ -28,6 +31,7 @@ const remoteStatus = ref<{
|
||||
message?: string
|
||||
}>({ enabled: false, connected: false })
|
||||
let remoteStatusTimer: number | null = null
|
||||
let proxyStatusTimer: number | null = null
|
||||
|
||||
const proxyAutoFetchReady = computed(() => (
|
||||
settings.value.proxyEnabled
|
||||
@@ -44,7 +48,7 @@ const proxyNeedsApi = computed(() => (
|
||||
const proxySummary = computed(() => {
|
||||
if (!settings.value.proxyEnabled) return '代理未启用'
|
||||
const size = settings.value.accountsPerProxy || 5
|
||||
const spare = settings.value.proxySparePercent || 25
|
||||
const spare = settings.value.proxySparePercent || 50
|
||||
if (!settings.value.autoFetchProxyOnSchedule) return `代理 · ${size}号/组 · 备用${spare}%`
|
||||
if (!settings.value.proxyApi.trim()) return `代理 · ${size}号/组 · 缺少 API`
|
||||
return `代理 · ${size}号/组 · 备用${spare}% · 预取`
|
||||
@@ -53,7 +57,7 @@ const proxySummary = computed(() => {
|
||||
const proxyTitle = computed(() => {
|
||||
if (!settings.value.proxyEnabled) return '代理尚未启用,点击配置'
|
||||
if (proxyNeedsApi.value) return '已开启定时预取,但缺少代理提取 API;点击配置'
|
||||
if (proxyAutoFetchReady.value) return '定时抢购触发前 30 秒自动提取并校验代理;点击查看设置'
|
||||
if (proxyAutoFetchReady.value) return '定时抢购触发前 2 分钟自动提取并校验代理;点击查看设置'
|
||||
return '代理已启用,点击打开代理设置'
|
||||
})
|
||||
|
||||
@@ -86,11 +90,14 @@ const refreshRemoteStatus = async () => {
|
||||
onMounted(async () => {
|
||||
await loadSettings()
|
||||
await refreshRemoteStatus()
|
||||
await loadProxyStatus()
|
||||
remoteStatusTimer = window.setInterval(refreshRemoteStatus, 3000)
|
||||
proxyStatusTimer = window.setInterval(loadProxyStatus, 2000)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (remoteStatusTimer) clearInterval(remoteStatusTimer)
|
||||
if (proxyStatusTimer) clearInterval(proxyStatusTimer)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -141,6 +148,7 @@ onUnmounted(() => {
|
||||
<template v-if="currentPage === 'console'">
|
||||
<StatusGrid :server-time="serverTime" />
|
||||
<ControlStrip />
|
||||
<ProxyGroupPanel />
|
||||
<section class="console-workspace">
|
||||
<AccountTable />
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user