mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Previously, we opted into the X11 GTK backend when rendering the GUI Client's window. This is causing issues on newer Linux distributions such as Fedora 43 where Wayland is now the only available compositor. Removing the X11 GTK requires us to draw our own CSDs such as titlebars and a close button. This PR does exactly that by adding a minimalistic title bar. To make better use of the space, we move the section headers into there. |Before|After| |---|---| |<img width="1900" height="1174" alt="Screenshot From 2025-11-11 11-14-11" src="https://github.com/user-attachments/assets/9439a69b-65ba-41d6-b1f8-4448e0f80728" />|<img width="1800" height="1000" alt="Screenshot From 2025-11-11 11-40-55" src="https://github.com/user-attachments/assets/7884b2cc-3d9c-4b47-9a1e-c6462aef36ab" />| |<img width="1900" height="1174" alt="Screenshot From 2025-11-11 11-14-16" src="https://github.com/user-attachments/assets/2cfea825-5c08-45a5-873c-5afcbc1dbf16" />|<img width="1800" height="1000" alt="Screenshot From 2025-11-11 11-40-58" src="https://github.com/user-attachments/assets/43ddd7c9-ce65-42f7-b972-28c6b172b70d" />| |<img width="1900" height="1174" alt="Screenshot From 2025-11-11 11-14-19" src="https://github.com/user-attachments/assets/446873a7-9023-4266-9377-ea7b8b4353ee" />|<img width="1800" height="1000" alt="Screenshot From 2025-11-11 11-41-01" src="https://github.com/user-attachments/assets/64439383-f33f-461d-9b4a-6b4138bd675b" />| |<img width="1900" height="1174" alt="Screenshot From 2025-11-11 11-14-22" src="https://github.com/user-attachments/assets/6c39e06c-1d77-471f-91f1-32a78b90a21c" />|<img width="1800" height="1000" alt="Screenshot From 2025-11-11 11-41-04" src="https://github.com/user-attachments/assets/b56912cb-9c85-4b5a-9295-dae6139b25c6" />| |<img width="1900" height="1174" alt="Screenshot From 2025-11-11 11-14-26" src="https://github.com/user-attachments/assets/5a5d638c-15bf-4523-8466-2e0977a03e22" />|<img width="1800" height="1000" alt="Screenshot From 2025-11-11 11-41-06" src="https://github.com/user-attachments/assets/ed169b52-ef86-4dc4-8f25-852da622eaa1" />|
114 lines
2.8 KiB
TypeScript
114 lines
2.8 KiB
TypeScript
import React from "react";
|
|
import logo from "../logo.png";
|
|
import { Button, Spinner } from "flowbite-react";
|
|
import { SessionViewModel } from "../generated/bindings";
|
|
|
|
interface OverviewPageProps {
|
|
session: SessionViewModel | null;
|
|
signOut: () => void;
|
|
signIn: () => void;
|
|
}
|
|
|
|
export default function Overview(props: OverviewPageProps) {
|
|
return (
|
|
<div className="flex flex-col items-center justify-center gap-4">
|
|
<img src={logo} alt="Firezone Logo" className="w-40 h-40" />
|
|
|
|
<h1 className="text-6xl font-bold">Firezone</h1>
|
|
|
|
<Session {...props} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function Session(props: OverviewPageProps) {
|
|
if (!props.session) {
|
|
return <SignedOut {...props} />;
|
|
}
|
|
|
|
switch (props.session) {
|
|
case "SignedOut": {
|
|
return <SignedOut {...props} />;
|
|
}
|
|
case "Loading": {
|
|
return <Loading />;
|
|
}
|
|
default: {
|
|
const { account_slug, actor_name } = props.session.SignedIn;
|
|
|
|
return (
|
|
<SignedIn
|
|
accountSlug={account_slug}
|
|
actorName={actor_name}
|
|
signOut={props.signOut}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
interface SignedOutProps {
|
|
signIn: () => void;
|
|
}
|
|
|
|
function SignedOut({ signIn }: SignedOutProps) {
|
|
return (
|
|
<div>
|
|
<div className="flex flex-col items-center gap-4">
|
|
<p className="text-center">
|
|
You can sign in by clicking the Firezone icon in the taskbar or by
|
|
clicking "Sign in" below.
|
|
</p>
|
|
<Button onClick={signIn}>Sign in</Button>
|
|
<p className="text-xs text-center">
|
|
Firezone will continue running after this window is closed.
|
|
<br />
|
|
It is always available from the taskbar.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
interface SignedInProps {
|
|
accountSlug: string;
|
|
actorName: string;
|
|
signOut: () => void;
|
|
}
|
|
|
|
function SignedIn({ actorName, accountSlug, signOut }: SignedInProps) {
|
|
return (
|
|
<div>
|
|
<div className="flex flex-col items-center gap-4">
|
|
<p className="text-center">
|
|
You are currently signed into
|
|
<span className="font-bold">{accountSlug}</span>
|
|
as
|
|
<span className="font-bold">{actorName}</span>
|
|
.<br />
|
|
Click the Firezone icon in the taskbar to see the list of Resources.
|
|
</p>
|
|
<Button onClick={signOut}>Sign out</Button>
|
|
<p className="text-xs text-center">
|
|
Firezone will continue running in the taskbar after this window is
|
|
closed.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function Loading() {
|
|
return (
|
|
<div>
|
|
<div className="flex flex-col items-center gap-4">
|
|
<Spinner />
|
|
<p className="text-xs text-center">
|
|
Firezone will continue running in the taskbar after this window is
|
|
closed.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|