feat(version): 第18条 显示版本与内部版本解耦(V/A 双系)

- config 新增 displayVersion 注入变量(默认 1.0.0):GetDisplayVersion/
  GetMasterDisplayVersion(V)/GetAgentDisplayVersion(A),以后升版只改注入值
- ParseDisplayVersion/CompareDisplayVersion:三段数值比较,个位进位规则
  (1.0.9<1.1.0) 天然成立;不可解析(dev 标签/3.7.0-agent.1)返回 ok=false
- 显示位切换:dist 注入 X_UI_CUR_VER、-v、TG 报告 → V 系;
  agent 遥测 agentVersion → A 系;节点行 A 系原样显示、老 agent 沿用
  "agent " 前缀兼容
- 内部流不动:GetBaseVersion/GetPanelVersion 及其比较/订阅/远端状态
  消费方保持原样,传统节点更新判定与徽标行为不变
This commit is contained in:
Muse
2026-10-22 13:01:50 +00:00
parent e5f39ed20b
commit 1edb8f71da
7 changed files with 186 additions and 5 deletions
+9 -1
View File
@@ -3,6 +3,7 @@ package service
import (
"strings"
"github.com/mhsanaei/3x-ui/v3/internal/config"
"github.com/mhsanaei/3x-ui/v3/internal/database"
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
"github.com/mhsanaei/3x-ui/v3/internal/util/common"
@@ -199,7 +200,14 @@ func annotateAgentTelemetry(views []*NodeView) {
v.XrayVersion = ag.XrayVersion
}
if ag.AgentVersion != "" {
v.PanelVersion = "agent " + ag.AgentVersion
// New agents report the A-series display version, shown
// verbatim; older agents report the internal build version
// and keep the historical "agent " prefix.
if _, ok := config.ParseDisplayVersion(ag.AgentVersion); ok && strings.HasPrefix(ag.AgentVersion, "A") {
v.PanelVersion = ag.AgentVersion
} else {
v.PanelVersion = "agent " + ag.AgentVersion
}
}
v.UptimeSecs = ag.UptimeSecs
v.LatencyMs = ag.LatencyMs
+1 -1
View File
@@ -112,7 +112,7 @@ func (t *Tgbot) prepareServerUsageInfo() string {
onlines := t.inboundService.GetOnlineClients()
info += t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname)
info += t.I18nBot("tgbot.messages.version", "Version=="+config.GetPanelVersion())
info += t.I18nBot("tgbot.messages.version", "Version=="+config.GetMasterDisplayVersion())
info += t.I18nBot("tgbot.messages.xrayVersion", "XrayVersion=="+fmt.Sprint(t.lastStatus.Xray.Version))
// get ip address