v1.9.0 #437
@@ -49,12 +49,6 @@ router.post(
|
|||||||
.values(insertData)
|
.values(insertData)
|
||||||
.returning();
|
.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]);
|
res.status(201).json(result[0]);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
authLogger.error("Failed to save command to history", 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)));
|
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);
|
res.json(uniqueCommands);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
authLogger.error("Failed to fetch command history", 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 });
|
res.json({ success: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
authLogger.error("Failed to delete command from history", err);
|
authLogger.error("Failed to delete command from history", err);
|
||||||
|
|||||||
@@ -102,7 +102,10 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
|
|||||||
const [isReconnecting, setIsReconnecting] = useState<boolean>(false);
|
const [isReconnecting, setIsReconnecting] = useState<boolean>(false);
|
||||||
const [searchQuery, setSearchQuery] = useState("");
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
const [lastRefreshTime, setLastRefreshTime] = useState<number>(0);
|
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 [totpRequired, setTotpRequired] = useState(false);
|
||||||
const [totpSessionId, setTotpSessionId] = useState<string | null>(null);
|
const [totpSessionId, setTotpSessionId] = useState<string | null>(null);
|
||||||
const [totpPrompt, setTotpPrompt] = useState<string>("");
|
const [totpPrompt, setTotpPrompt] = useState<string>("");
|
||||||
@@ -1886,6 +1889,12 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
|
|||||||
}
|
}
|
||||||
}, [currentHost?.id]);
|
}, [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) =>
|
const filteredFiles = files.filter((file) =>
|
||||||
file.name.toLowerCase().includes(searchQuery.toLowerCase()),
|
file.name.toLowerCase().includes(searchQuery.toLowerCase()),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -470,6 +470,7 @@ export function TopNavbar({
|
|||||||
WebkitUserSelect: "none",
|
WebkitUserSelect: "none",
|
||||||
flex: tab.type === "home" ? "0 0 auto" : "1 1 150px",
|
flex: tab.type === "home" ? "0 0 auto" : "1 1 150px",
|
||||||
minWidth: tab.type === "home" ? "auto" : "150px",
|
minWidth: tab.type === "home" ? "auto" : "150px",
|
||||||
|
maxWidth: tab.type === "home" ? "auto" : "450px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user