feat: enhance server stats widgets and fix TypeScript/ESLint errors #394

Merged
ZacharyZcR merged 50 commits from feature-server-stats-customization into dev-1.8.0 2025-10-10 03:48:34 +00:00
5 changed files with 7 additions and 16 deletions
Showing only changes of commit b063a9581a - Show all commits

View File

@@ -36,7 +36,7 @@ export function TerminalWindow({
executeCommand,
}: TerminalWindowProps) {
const { t } = useTranslation();
const { closeWindow, minimizeWindow, maximizeWindow, focusWindow, windows } =
const { closeWindow, maximizeWindow, focusWindow, windows } =
useWindowManager();
const terminalRef = React.useRef<any>(null);
const resizeTimeoutRef = React.useRef<NodeJS.Timeout | null>(null);

View File

@@ -67,7 +67,7 @@ function AppContent() {
localStorage.setItem("topNavbarOpen", JSON.stringify(isTopbarOpen));
}, [isTopbarOpen]);
const handleSelectView = (_nextView: string) => {
const handleSelectView = () => {
// View switching is now handled by tabs context
};

View File

@@ -1,12 +1,7 @@
import React, { useState } from "react";
import { ChevronUp, User2, HardDrive, Menu, ChevronRight } from "lucide-react";
import { useTranslation } from "react-i18next";
import {
getCookie,
setCookie,
isElectron,
logoutUser,
} from "@/ui/main-axios.ts";
import { isElectron, logoutUser } from "@/ui/main-axios.ts";
import {
Sidebar,
@@ -63,8 +58,6 @@ interface SSHHost {
}
interface SidebarProps {
onSelectView: (view: string) => void;
getView?: () => string;
disabled?: boolean;
isAdmin?: boolean;
username?: string | null;
@@ -87,8 +80,6 @@ async function handleLogout() {
}
export function LeftSidebar({
onSelectView,
getView,
disabled,
isAdmin,
username,
@@ -149,7 +140,7 @@ export function LeftSidebar({
};
const [hosts, setHosts] = useState<SSHHost[]>([]);
const [hostsLoading, setHostsLoading] = useState(false);
const [hostsLoading] = useState(false);
const [hostsError, setHostsError] = useState<string | null>(null);
const prevHostsRef = React.useRef<SSHHost[]>([]);
const [search, setSearch] = useState("");

View File

@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { Status, StatusIndicator } from "@/components/ui/shadcn-io/status";
import { Button } from "@/components/ui/button.tsx";
import { ButtonGroup } from "@/components/ui/button-group.tsx";
import { Server, Terminal } from "lucide-react";
import { Terminal } from "lucide-react";
import { getServerStatusById } from "@/ui/main-axios.ts";
import { useTabs } from "@/ui/Mobile/Apps/Navigation/Tabs/TabContext.tsx";
import type { HostProps } from "../../../../../types/index.js";

View File

@@ -75,7 +75,7 @@ export function LeftSidebar({
}: LeftSidebarProps) {
const { t } = useTranslation();
const [hosts, setHosts] = useState<SSHHost[]>([]);
const [hostsLoading, setHostsLoading] = useState(false);
const [hostsLoading] = useState(false);
const [hostsError, setHostsError] = useState<string | null>(null);
const prevHostsRef = React.useRef<SSHHost[]>([]);
const [search, setSearch] = useState("");
@@ -90,7 +90,7 @@ export function LeftSidebar({
setHosts(newHosts);
prevHostsRef.current = newHosts;
}
} catch (err: any) {
} catch {
setHostsError(t("leftSidebar.failedToLoadHosts"));
}
}, [t]);