mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-28 02:02:08 +03:00
fix(nodes): stop flagging a node on the other update channel as outdated
A node's "update available" tag compares its reported panel version with the master's latest, and any non-semver side fell back to string inequality. A dev build reports dev+<sha> (config.GetPanelVersion), so a node moved to the dev channel from a master on the stable channel kept the tag forever; the reverse, a stable node under a master on the dev channel, was flagged too and the tag's default stable update installed nothing new. A dev label and a release tag carry no order, so the comparison now only decides within one channel; dev-to-dev still compares commits, which keeps a node on the current dev-latest commit untagged as config.go intends.
This commit is contained in:
@@ -28,6 +28,9 @@ export function formatPanelVersion(version: string | undefined | null): string {
|
||||
|
||||
export function isPanelUpdateAvailable(latest: string, current: string): boolean {
|
||||
if (!latest || !current) return false;
|
||||
// A dev+<sha> label and a release tag sit on different channels and carry no
|
||||
// order, so a node moved to the other channel is not "behind" the master's latest.
|
||||
if (latest.trim().startsWith('dev+') !== current.trim().startsWith('dev+')) return false;
|
||||
const a = parseVersionParts(latest);
|
||||
const b = parseVersionParts(current);
|
||||
if (!a || !b) {
|
||||
|
||||
Reference in New Issue
Block a user