Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Display version in the UI (#1386)

Mike Fortman0bde2b87d9ec
diff --git a/frontend/components/user-nav.tsx b/frontend/components/user-nav.tsx
index 3f38b307b..aeefbd9d9 100644
--- a/frontend/components/user-nav.tsx
+++ b/frontend/components/user-nav.tsx
@@ -17,8 +17,15 @@ import ThemeButtons from "./theme-switcher-buttons";
export function UserNav() {
const isCloudBrand = useIsCloudBrand();
- const { user, isLoading, isAuthenticated, isNoAuthMode, login, logout } =
- useAuth();
+ const {
+ user,
+ isLoading,
+ isAuthenticated,
+ isNoAuthMode,
+ login,
+ logout,
+ version,
+ } = useAuth();
const { theme, setTheme } = useTheme();
if (isLoading) {
@@ -106,6 +113,17 @@ export function UserNav() {
</div>
</DropdownMenuLabel>
<DropdownMenuSeparator className="m-0" />
+ {version && (
+ <>
+ <div className="flex items-center justify-between pl-3 pr-2 h-9">
+ <span className="text-sm">Version</span>
+ <p className="text-xs leading-none text-muted-foreground">
+ v{version}
+ </p>
+ </div>
+ <DropdownMenuSeparator className="m-0" />
+ </>
+ )}
<div className="flex items-center justify-between pl-3 pr-2 h-9">
<span className="text-sm">Theme</span>
<ThemeButtons />
diff --git a/frontend/contexts/auth-context.tsx b/frontend/contexts/auth-context.tsx
index c1097a747..f45dc2f63 100644
--- a/frontend/contexts/auth-context.tsx
+++ b/frontend/contexts/auth-context.tsx
@@ -25,6 +25,7 @@ interface AuthContextType {
isAuthenticated: boolean;
isNoAuthMode: boolean;
isIbmAuthMode: boolean;
+ version: string | null;
login: () => void;
loginWithIbm: (username: string, password: string) => Promise<void>;
logout: () => Promise<void>;
@@ -50,6 +51,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
const [isLoading, setIsLoading] = useState(true);
const [isNoAuthMode, setIsNoAuthMode] = useState(false);
const [isIbmAuthMode, setIsIbmAuthMode] = useState(false);
+ const [version, setVersion] = useState<string | null>(null);
const checkAuth = useCallback(async () => {
setIsLoading(true);
@@ -65,6 +67,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
const data = await response.json();
console.log("[checkAuth] /api/auth/me response:", data);
+ if (data.version) setVersion(data.version);
// Check auth mode flags
if (data.ibm_auth_mode) {
@@ -235,6 +238,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
isAuthenticated: !!user,
isNoAuthMode,
isIbmAuthMode,
+ version,
login,
loginWithIbm,
logout,
diff --git a/src/api/auth.py b/src/api/auth.py
index 22de1f361..04f199b09 100644
--- a/src/api/auth.py
+++ b/src/api/auth.py
@@ -3,6 +3,7 @@ from typing import Optional
from fastapi import Depends, HTTPException, Request
from fastapi.responses import JSONResponse
from utils.telemetry import TelemetryClient, Category, MessageId
+from utils.version_utils import OPENRAG_VERSION
from dependencies import (
get_auth_service,
@@ -103,6 +104,7 @@ async def auth_me(
):
"""Get current user information"""
result = await auth_service.get_user_info(request)
+ result["version"] = OPENRAG_VERSION
return JSONResponse(result)