Bump version to 1.0.21
This commit is contained in:
@@ -25,6 +25,7 @@ import { ErrorBoundary } from './components/ErrorBoundary';
|
||||
import { Spinner } from './components/ui/Spinner';
|
||||
import { Button } from './components/ui/Button';
|
||||
import { cn } from './lib/utils';
|
||||
import { api, SettingsInfo } from './api/client';
|
||||
import Login from './pages/Login';
|
||||
import Dashboard from './pages/Dashboard';
|
||||
import Machines from './pages/Machines';
|
||||
@@ -62,8 +63,15 @@ function ProtectedRoute({ children }: { children: JSX.Element }) {
|
||||
|
||||
function NavBar() {
|
||||
const [mobileOpen, setMobileOpen] = useState(false);
|
||||
const [version, setVersion] = useState<string | null>(null);
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
api<SettingsInfo>('/api/settings/info')
|
||||
.then(info => setVersion(info.version))
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });
|
||||
@@ -86,6 +94,12 @@ function NavBar() {
|
||||
<span className="hidden sm:inline">SyncServer</span>
|
||||
</a>
|
||||
|
||||
{version && (
|
||||
<span className="hidden lg:inline-flex items-center rounded-card bg-surface-raised px-2 py-0.5 text-xs font-mono text-fg-muted border border-border">
|
||||
v{version}
|
||||
</span>
|
||||
)}
|
||||
|
||||
<nav className="hidden md:flex items-center gap-0.5 flex-1">
|
||||
{navItems.map(item => {
|
||||
const Icon = item.icon;
|
||||
|
||||
@@ -102,3 +102,9 @@ export interface SSHKey {
|
||||
has_private_key: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface SettingsInfo {
|
||||
version: string;
|
||||
data_dir: string;
|
||||
ssh_pub_key: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user