Refactor service status response: migrate bangui_version into version field

This commit is contained in:
2026-03-22 21:42:08 +01:00
parent ed184f1c84
commit 798ed08ddd
15 changed files with 27 additions and 68 deletions

View File

@@ -352,12 +352,6 @@ export function ServerHealthSection(): React.JSX.Element {
<Text className={styles.statValue}>{status.version}</Text>
</div>
)}
{status.bangui_version && (
<div className={styles.statCard}>
<Text className={styles.statLabel}>BanGUI</Text>
<Text className={styles.statValue}>{status.bangui_version}</Text>
</div>
)}
<div className={styles.statCard}>
<Text className={styles.statLabel}>Active Jails</Text>
<Text className={styles.statValue}>{status.jail_count}</Text>

View File

@@ -15,11 +15,10 @@ describe("ServerHealthSection", () => {
vi.clearAllMocks();
});
it("shows the BanGUI version in the service health panel", async () => {
it("shows the version in the service health panel", async () => {
mockedFetchServiceStatus.mockResolvedValue({
online: true,
version: "1.2.3",
bangui_version: "1.2.3",
jail_count: 2,
total_bans: 5,
total_failures: 1,
@@ -41,11 +40,11 @@ describe("ServerHealthSection", () => {
</FluentProvider>,
);
// The service health panel should render and include the BanGUI version.
const banGuiLabel = await screen.findByText("BanGUI");
expect(banGuiLabel).toBeInTheDocument();
// The service health panel should render and include the version.
const versionLabel = await screen.findByText("Version");
expect(versionLabel).toBeInTheDocument();
const banGuiCard = banGuiLabel.closest("div");
expect(banGuiCard).toHaveTextContent("1.2.3");
const versionCard = versionLabel.closest("div");
expect(versionCard).toHaveTextContent("1.2.3");
});
});