fix: Electron build problems

This commit is contained in:
LukeGus
2025-11-02 23:11:04 -06:00
parent 5dae1feca8
commit 2239a7f54a
9 changed files with 70 additions and 9 deletions

View File

@@ -190,6 +190,10 @@ jobs:
if [ -f "termix-${VERSION}-armv7l.tar.gz" ]; then if [ -f "termix-${VERSION}-armv7l.tar.gz" ]; then
mv "termix-${VERSION}-armv7l.tar.gz" "termix_linux_armv7l_portable.tar.gz" mv "termix-${VERSION}-armv7l.tar.gz" "termix_linux_armv7l_portable.tar.gz"
fi fi
# Rename Debian amd64 to x64 for consistency
if [ -f "termix_linux_amd64_deb.deb" ]; then
mv "termix_linux_amd64_deb.deb" "termix_linux_x64_deb.deb"
fi
cd .. cd ..
@@ -213,6 +217,14 @@ jobs:
path: release/termix_linux_arm64_appimage.AppImage path: release/termix_linux_arm64_appimage.AppImage
retention-days: 30 retention-days: 30
- name: Upload Linux armv7l AppImage
uses: actions/upload-artifact@v4
if: hashFiles('release/termix_linux_armv7l_appimage.AppImage') != '' && github.event.inputs.artifact_destination != 'none'
with:
name: termix_linux_armv7l_appimage
path: release/termix_linux_armv7l_appimage.AppImage
retention-days: 30
- name: Upload Linux x64 DEB - name: Upload Linux x64 DEB
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: hashFiles('release/termix_linux_x64_deb.deb') != '' && github.event.inputs.artifact_destination != 'none' if: hashFiles('release/termix_linux_x64_deb.deb') != '' && github.event.inputs.artifact_destination != 'none'
@@ -413,7 +425,7 @@ jobs:
if: steps.check_certs.outputs.has_certs == 'true' && hashFiles('release/termix_macos_universal_mas.pkg') != '' && (github.event.inputs.artifact_destination == 'file' || github.event.inputs.artifact_destination == 'release' || github.event.inputs.artifact_destination == 'submit') if: steps.check_certs.outputs.has_certs == 'true' && hashFiles('release/termix_macos_universal_mas.pkg') != '' && (github.event.inputs.artifact_destination == 'file' || github.event.inputs.artifact_destination == 'release' || github.event.inputs.artifact_destination == 'submit')
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: termix_macos_mas name: termix_macos_universal_mas
path: release/termix_macos_universal_mas.pkg path: release/termix_macos_universal_mas.pkg
retention-days: 30 retention-days: 30
if-no-files-found: warn if-no-files-found: warn

View File

@@ -106,6 +106,15 @@ http {
proxy_read_timeout 300s; proxy_read_timeout 300s;
} }
location ~ ^/snippets(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/database(/.*)?$ { location ~ ^/database(/.*)?$ {
client_max_body_size 5G; client_max_body_size 5G;
client_body_timeout 300s; client_body_timeout 300s;

View File

@@ -103,6 +103,15 @@ http {
proxy_read_timeout 300s; proxy_read_timeout 300s;
} }
location ~ ^/snippets(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/database(/.*)?$ { location ~ ^/database(/.*)?$ {
client_max_body_size 5G; client_max_body_size 5G;
client_body_timeout 300s; client_body_timeout 300s;

View File

@@ -53,7 +53,7 @@
"target": [ "target": [
{ {
"target": "AppImage", "target": "AppImage",
"arch": ["x64", "arm64"] "arch": ["x64", "arm64", "armv7l"]
}, },
{ {
"target": "deb", "target": "deb",

View File

@@ -194,7 +194,7 @@ export function Dashboard({
setServerStatsLoading(true); setServerStatsLoading(true);
const serversWithStats = await Promise.all( const serversWithStats = await Promise.all(
hosts.slice(0, 5).map(async (host: { id: number; name: string }) => { hosts.slice(0, 50).map(async (host: { id: number; name: string }) => {
try { try {
const metrics = await getServerMetricsById(host.id); const metrics = await getServerMetricsById(host.id);
return { return {
@@ -213,7 +213,10 @@ export function Dashboard({
} }
}), }),
); );
setServerStats(serversWithStats); const validServerStats = serversWithStats.filter(
(server) => server.cpu !== null && server.ram !== null,
);
setServerStats(validServerStats);
setServerStatsLoading(false); setServerStatsLoading(false);
} catch (error) { } catch (error) {
console.error("Failed to fetch dashboard data:", error); console.error("Failed to fetch dashboard data:", error);

View File

@@ -651,7 +651,12 @@ export function Auth({
); );
} }
if (isElectron() && currentServerUrl && authLoading) { if (
isElectron() &&
currentServerUrl &&
authLoading &&
!isInElectronWebView()
) {
return ( return (
<div <div
className={`w-[420px] max-w-full p-6 flex flex-col bg-dark-bg border-2 border-dark-border rounded-md overflow-y-auto my-2 ${className || ""}`} className={`w-[420px] max-w-full p-6 flex flex-col bg-dark-bg border-2 border-dark-border rounded-md overflow-y-auto my-2 ${className || ""}`}
@@ -665,7 +670,7 @@ export function Auth({
); );
} }
if (isElectron() && currentServerUrl && !loggedIn) { if (isElectron() && currentServerUrl && !loggedIn && !isInElectronWebView()) {
return ( return (
<div <div
className="w-full h-screen flex items-center justify-center p-4" className="w-full h-screen flex items-center justify-center p-4"

View File

@@ -529,7 +529,13 @@ export function LeftSidebar({
{!isSidebarOpen && ( {!isSidebarOpen && (
<div <div
onClick={() => setIsSidebarOpen(true)} onClick={() => setIsSidebarOpen(true)}
className="absolute top-0 left-0 w-[10px] h-full bg-dark-bg cursor-pointer z-20 flex items-center justify-center rounded-tr-md rounded-br-md" className="fixed top-0 left-0 w-[10px] h-full cursor-pointer flex items-center justify-center rounded-tr-md rounded-br-md"
style={{
zIndex: 9999,
backgroundColor: "#18181b",
border: "2px solid #27272a",
borderLeft: "none",
}}
> >
<ChevronRight size={10} /> <ChevronRight size={10} />
</div> </div>

View File

@@ -491,7 +491,16 @@ export function TopNavbar({
{!isTopbarOpen && ( {!isTopbarOpen && (
<div <div
onClick={() => setIsTopbarOpen(true)} onClick={() => setIsTopbarOpen(true)}
className="absolute top-0 left-0 w-full h-[10px] cursor-pointer z-20 flex items-center justify-center rounded-bl-md rounded-br-md bg-dark" className="fixed top-0 cursor-pointer flex items-center justify-center rounded-bl-md rounded-br-md"
style={{
left: leftPosition,
right: "17px",
height: "10px",
zIndex: 9999,
backgroundColor: "#18181b",
border: "2px solid #27272a",
borderTop: "none",
}}
> >
<ChevronDown size={10} /> <ChevronDown size={10} />
</div> </div>

View File

@@ -345,7 +345,15 @@ function createApiInstance(
toast.warning("Session expired. Please log in again."); toast.warning("Session expired. Please log in again.");
}); });
setTimeout(() => window.location.reload(), 1000); const currentPath = window.location.pathname;
const isOnAuthPage =
currentPath === "/" ||
currentPath === "/login" ||
currentPath === "/auth";
if (!isOnAuthPage) {
setTimeout(() => window.location.reload(), 1000);
}
} }
} }