mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
feat(proxy): 实现代理节点批量升级回滚、隧道重定向跟随及远程配置管理
核心功能: - 新增代理节点批量升级回滚工作流,支持分批升级、健康探针、跳过/重试/取消等操作 - proxy 隧道流处理器支持 HTTP 重定向跟随(最多 10 跳),区分 307/308 可重播与不可重播请求体 - proxy 协议新增 follow_redirects / http1_only 字段,网关侧同步支持 - 新增代理节点远端配置变更接口(名称、允许端口、调度状态、升级目标等) - 新增代理节点注册/反注册/心跳的 Admin API,及节点过期清理维护任务 - gateway 隧道 owner-relay 支持流式代理大请求体,新增 5 MiB 默认限制 - 新增 ProxyNodeRegistrationMutation / ProxyNodeRemoteConfigMutation 数据类型 - proxy 配置新增重定向重播预算、心跳间隔等参数,TUI 安装向导同步更新 - 前端 ProxyNodes 页面新增批量升级操作面板及滚动进度展示
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import { proxyNodesApi, type ProxyNode, type ManualProxyNodeCreateRequest } from '@/api/proxy-nodes'
|
||||
import {
|
||||
proxyNodesApi,
|
||||
type ManualProxyNodeCreateRequest,
|
||||
type ProxyNode,
|
||||
type ProxyNodeUpgradeRolloutStatus,
|
||||
} from '@/api/proxy-nodes'
|
||||
import { parseApiError } from '@/utils/errorParser'
|
||||
|
||||
export const useProxyNodesStore = defineStore('proxy-nodes', () => {
|
||||
const nodes = ref<ProxyNode[]>([])
|
||||
const rollout = ref<ProxyNodeUpgradeRolloutStatus | null>(null)
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
@@ -13,7 +19,11 @@ export const useProxyNodesStore = defineStore('proxy-nodes', () => {
|
||||
|
||||
/** 在线节点(可用于代理选择) */
|
||||
const onlineNodes = computed(() =>
|
||||
nodes.value.filter(n => n.status === 'online')
|
||||
nodes.value.filter(n =>
|
||||
n.status === 'online'
|
||||
&& n.remote_config?.scheduling_state !== 'draining'
|
||||
&& n.remote_config?.scheduling_state !== 'cordoned'
|
||||
)
|
||||
)
|
||||
|
||||
async function fetchNodes(params?: { status?: string }) {
|
||||
@@ -23,9 +33,11 @@ export const useProxyNodesStore = defineStore('proxy-nodes', () => {
|
||||
try {
|
||||
const data = await proxyNodesApi.listProxyNodes({ ...params, limit: 1000 })
|
||||
nodes.value = data.items
|
||||
rollout.value = data.rollout
|
||||
total.value = data.total
|
||||
fetched.value = true
|
||||
} catch (err: unknown) {
|
||||
rollout.value = null
|
||||
error.value = parseApiError(err, '获取代理节点列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -74,6 +86,7 @@ export const useProxyNodesStore = defineStore('proxy-nodes', () => {
|
||||
|
||||
return {
|
||||
nodes,
|
||||
rollout,
|
||||
total,
|
||||
loading,
|
||||
error,
|
||||
|
||||
Reference in New Issue
Block a user