From 8e4c368200ca7e3e923162a868a9e79f4c661580 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 26 Jun 2026 18:01:51 +0200 Subject: [PATCH] feat(update): allow opting into the dev channel from a stable build The panel version button opened the GitHub releases page on a stable, up-to-date build, and the dev-channel toggle only rendered on dev builds, so there was no in-panel path from stable to dev. Drop the IsDevBuild() guard in devChannelActive (the toggle alone drives the channel now), always open the update modal instead of releases, and always render the Dev channel switch. --- frontend/src/pages/index/IndexPage.tsx | 11 ++-------- frontend/src/pages/index/PanelUpdateModal.tsx | 22 ++++++++----------- internal/web/service/panel/panel.go | 9 ++++---- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/frontend/src/pages/index/IndexPage.tsx b/frontend/src/pages/index/IndexPage.tsx index 1a22a321a..6e49b5a60 100644 --- a/frontend/src/pages/index/IndexPage.tsx +++ b/frontend/src/pages/index/IndexPage.tsx @@ -66,7 +66,6 @@ export default function IndexPage() { useEffect(() => { setMessageInstance(messageApi); }, [messageApi]); const [accessLogEnable, setAccessLogEnable] = useState(false); - const [isDevBuild, setIsDevBuild] = useState(false); const [devChannelEnable, setDevChannelEnable] = useState(false); const [panelUpdateInfo, setPanelUpdateInfo] = useState({ currentVersion: '', @@ -90,12 +89,11 @@ export default function IndexPage() { const [loadingTip, setLoadingTip] = useState(t('loading')); useEffect(() => { - HttpUtil.post<{ accessLogEnable?: boolean; isDevBuild?: boolean; devChannelEnable?: boolean }>( + HttpUtil.post<{ accessLogEnable?: boolean; devChannelEnable?: boolean }>( '/panel/api/setting/defaultSettings', ).then((msg) => { if (msg?.success && msg.obj) { setAccessLogEnable(!!msg.obj.accessLogEnable); - setIsDevBuild(!!msg.obj.isDevBuild); setDevChannelEnable(!!msg.obj.devChannelEnable); } }); @@ -128,11 +126,7 @@ export default function IndexPage() { }, [refresh]); function openPanelVersion() { - if (panelUpdateInfo.updateAvailable || isDevBuild) { - setPanelUpdateOpen(true); - } else { - window.open('https://github.com/MHSanaei/3x-ui/releases', '_blank', 'noopener,noreferrer'); - } + setPanelUpdateOpen(true); } async function handleChannelChange(dev: boolean) { @@ -463,7 +457,6 @@ export default function IndexPage() { setPanelUpdateOpen(false)} diff --git a/frontend/src/pages/index/PanelUpdateModal.tsx b/frontend/src/pages/index/PanelUpdateModal.tsx index a6000b0f5..0e8bb788b 100644 --- a/frontend/src/pages/index/PanelUpdateModal.tsx +++ b/frontend/src/pages/index/PanelUpdateModal.tsx @@ -25,7 +25,6 @@ interface BusyEvent { interface PanelUpdateModalProps { open: boolean; info: PanelUpdateInfo; - isDevBuild?: boolean; devChannelEnable?: boolean; onChannelChange?: (dev: boolean) => void | Promise; onClose: () => void; @@ -35,7 +34,6 @@ interface PanelUpdateModalProps { export default function PanelUpdateModal({ open, info, - isDevBuild, devChannelEnable, onChannelChange, onClose, @@ -113,18 +111,16 @@ export default function PanelUpdateModal({ /> )} - {isDevBuild && ( -
-
- {t('pages.index.devChannel')} - -
+
+
+ {t('pages.index.devChannel')} +
- )} +
{devChannelEnable && (