Fix critical UI and data export issues #327
Reference in New Issue
Block a user
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Details
Disk Space Display (#313)
Availcolumn from df outputEmoji Rendering (#266)
Host Export (#254)
/db/host/:id/exportAPI endpoint with decryptionTest Plan
🤖 Generated with Claude Code
Summary of Changes
Hello @ZacharyZcR, I'm Gemini Code Assist1 ! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request delivers crucial fixes and enhancements across the application's UI and backend data handling. It corrects the display of available disk space in server monitoring, resolves visual glitches with emoji rendering in terminal sessions, and significantly upgrades the host export feature to include sensitive credentials, thereby improving data portability while clearly communicating security implications to the user.
Highlights
dfcommand output, resolving a bug where it previously showed total disk space.Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either
/gemini <command>or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page./gemini review/gemini summary/gemini helpCustomization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a
.gemini/folder in the base of the repository. Detailed instructions can be found here.Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩︎
Code Review
This pull request introduces several important fixes, including a new backend endpoint to export host configurations with sensitive credentials, which resolves an incomplete data export issue. The UI is updated to use this new endpoint and to correctly display available disk space instead of total space. Additionally, emoji rendering in the terminal is fixed by enabling Unicode 11 support. My review focuses on improving the security and robustness of the new export endpoint and some minor code cleanup in the frontend. Overall, the changes are well-implemented and address critical issues.
@@ -672,1 +672,4 @@// Route: Export SSH host with decrypted credentials (requires data access)// GET /ssh/db/host/:id/exportrouter.get(Using a
GETrequest to export sensitive data can be a security risk. GET requests, including their paths, are often logged by servers, proxies, and in browser history. It's a best practice to usePOSTfor actions that involve sensitive data to avoid leaking identifiers likehostIdin logs.You'll also need to update the corresponding frontend client in
src/ui/main-axios.tsto usesshHostApi.post.@@ -673,0 +682,4 @@if (!isNonEmptyString(userId) || !hostId) {return res.status(400).json({ error: "Invalid userId or hostId" });}The
hostIdfromreq.params.idis used as a string and converted to a number in multiple places. This can lead to inconsistencies and potential issues if the parameter is not a valid number. It's more robust to parse and validate it once at the beginning of the handler. After this change, you can use thehostIdvariable directly as a number throughout the function, removing the need forNumber(hostId)andparseInt(hostId).@@ -181,0 +188,4 @@`Exported host configuration for ${host.name || host.username}@${host.ip}`,);} catch (error) {toast.error(t("hosts.failedToExportHost"));The
actualAuthTypeparameter is passed to theperformExportfunction but is no longer used within its body. Removing it will clean up the code. You will also need to update the call sites for this function inhandleExport.