feat: Max terminal tab size and save current file manager sorting type

This commit is contained in:
LukeGus
2025-11-15 02:56:21 -06:00
parent 20ef98957d
commit 4e6ddd0670
3 changed files with 11 additions and 20 deletions

View File

@@ -49,12 +49,6 @@ router.post(
.values(insertData)
.returning();
authLogger.info(`Command saved to history for host ${hostId}`, {
operation: "command_history_save_success",
userId,
hostId: parseInt(hostId, 10),
});
res.status(201).json(result[0]);
} catch (err) {
authLogger.error("Failed to save command to history", err);
@@ -99,13 +93,6 @@ router.get(
const uniqueCommands = Array.from(new Set(result.map((r) => r.command)));
authLogger.info(`Fetched command history for host ${hostId}`, {
operation: "command_history_fetch_success",
userId,
hostId: hostIdNum,
count: uniqueCommands.length,
});
res.json(uniqueCommands);
} catch (err) {
authLogger.error("Failed to fetch command history", err);
@@ -149,12 +136,6 @@ router.post(
),
);
authLogger.info(`Command deleted from history for host ${hostId}`, {
operation: "command_history_delete_success",
userId,
hostId: hostIdNum,
});
res.json({ success: true });
} catch (err) {
authLogger.error("Failed to delete command from history", err);

View File

@@ -102,7 +102,10 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
const [isReconnecting, setIsReconnecting] = useState<boolean>(false);
const [searchQuery, setSearchQuery] = useState("");
const [lastRefreshTime, setLastRefreshTime] = useState<number>(0);
const [viewMode, setViewMode] = useState<"grid" | "list">("grid");
const [viewMode, setViewMode] = useState<"grid" | "list">(() => {
const saved = localStorage.getItem("fileManagerViewMode");
return saved === "grid" || saved === "list" ? saved : "grid";
});
const [totpRequired, setTotpRequired] = useState(false);
const [totpSessionId, setTotpSessionId] = useState<string | null>(null);
const [totpPrompt, setTotpPrompt] = useState<string>("");
@@ -1886,6 +1889,12 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
}
}, [currentHost?.id]);
useEffect(() => {
console.log("Saving viewMode to localStorage:", viewMode);
localStorage.setItem("fileManagerViewMode", viewMode);
console.log("Saved value:", localStorage.getItem("fileManagerViewMode"));
}, [viewMode]);
const filteredFiles = files.filter((file) =>
file.name.toLowerCase().includes(searchQuery.toLowerCase()),
);

View File

@@ -470,6 +470,7 @@ export function TopNavbar({
WebkitUserSelect: "none",
flex: tab.type === "home" ? "0 0 auto" : "1 1 150px",
minWidth: tab.type === "home" ? "auto" : "150px",
maxWidth: tab.type === "home" ? "auto" : "450px",
display: "flex",
}}
>