Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/panel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

// version is the panel build version. It defaults to the contents of the VERSION
// file and is overridden at build time via -ldflags "-X main.version=...".
var version = "1.4.0"
var version = "1.4.1"

func main() {
logBuf := logbuf.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo}), 2000)
Expand Down
47 changes: 4 additions & 43 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vortexui-web",
"private": true,
"version": "1.4.0",
"version": "1.4.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
12 changes: 11 additions & 1 deletion web/src/api/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ import type { CoreType, CreateUserInput, EnrollmentBundle, ListUsersResponse, No

// --- panel version ---

// PANEL_VERSION is the web bundle's own build version (injected by Vite at
// build time from ../VERSION). It doubles as the fallback whenever
// GET /api/version is unreachable or errors.
export const PANEL_VERSION = __PANEL_VERSION__;

// useVersion fetches the actually running panel build version from the backend
// (GET /api/version). The value only changes when the binary changes, so it is
// cached for the whole session.
// cached for the whole session. initialData is the build-time bundle version
// and flows through `select`, so consumers always get a string from the very
// first render — even when the request fails (e.g. a reseller without
// system:read gets 403) or while it is still in flight.
export function useVersion() {
return useQuery({
queryKey: ["version"],
Expand All @@ -17,6 +25,8 @@ export function useVersion() {
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
retry: false,
initialData: { version: __PANEL_VERSION__ },
select: (d) => d.version,
});
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function AppHeader() {
const { resolved, toggle: toggleTheme } = useTheme();
const { t, lang, setLang } = useI18n();
const navigate = useNavigate();
const panelVersion = useVersion().data;
const panelVersion = useVersion().data ?? __PANEL_VERSION__;
const [searchFocused, setSearchFocused] = useState(false);
const [langOpen, setLangOpen] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function Overview() {
const { data, isLoading: overviewLoading } = useOverview();
const sys = useSystem();
const nodesQ = useNodes();
const panelVersion = useVersion().data;
const panelVersion = useVersion().data ?? __PANEL_VERSION__;
const { t } = useI18n();
const [trafficRange, setTrafficRange] = useState<TrafficRange>("24h");
const trafficSeries = useTrafficSeries(trafficRange);
Expand Down