feat: display current version in Header and remove version display from UserProfileMenu (#93)

This commit is contained in:
samanhappy
2025-05-14 10:19:43 +08:00
committed by GitHub
parent 94d51fa03a
commit a447fe5b41
4 changed files with 4 additions and 4 deletions

View File

@@ -30,10 +30,10 @@ const Header: React.FC<HeaderProps> = ({ onToggleSidebar }) => {
<h1 className="ml-4 text-xl font-bold text-gray-900 dark:text-white">{t('app.title')}</h1>
</div>
{/* Theme Switch */}
{/* Theme Switch and Version */}
<div className="flex items-center space-x-4">
<span className="text-sm text-gray-500 dark:text-gray-400">{import.meta.env.PACKAGE_VERSION}</span>
<ThemeSwitch />
</div>
</div>
</header>

View File

@@ -104,7 +104,6 @@ const UserProfileMenu: React.FC<UserProfileMenuProps> = ({ collapsed, version })
>
<Info className="h-4 w-4 mr-2" />
{t('about.title')}
&nbsp;({version})
{showNewVersionInfo && (
<span className="absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"></span>
)}

View File

@@ -16,6 +16,7 @@ export const checkLatestVersion = async (): Promise<string | null> => {
};
export const compareVersions = (current: string, latest: string): number => {
if (current === 'dev') return -1;
const currentParts = current.split('.').map(Number);
const latestParts = latest.split('.').map(Number);

View File

@@ -1,6 +1,6 @@
{
"name": "@samanhappy/mcphub",
"version": "0.5.4",
"version": "dev",
"description": "A hub server for mcp servers",
"main": "dist/index.js",
"type": "module",