fix: about page

This commit is contained in:
2025-03-12 10:09:45 +00:00
parent bc1d0512f8
commit 0584089d92
4 changed files with 14 additions and 23 deletions

View File

@ -131,7 +131,7 @@
"vite": "^5.2.8",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-pwa": "^0.19.2",
"vite-plugin-version-mark": "^0.0.10",
"vite-plugin-version-mark": "^0.1.4",
"vitest": "^0.34.6"
}
}

View File

@ -1,29 +1,17 @@
import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import Changelog from "@/../CHANGELOG.md";
import Changelog from "@/../CHANGELOG.md?raw";
import { Markdown } from "@/Components/Event/Markdown";
export function AboutPage() {
const [changelog, setChangelog] = useState("");
async function getChangelog() {
const res = await fetch(Changelog);
const content = await res.text();
setChangelog(content);
}
useEffect(() => {
getChangelog().catch(console.error);
}, []);
const version = document.querySelector("meta[name='application-name']")?.getAttribute("content");
return (
<div className="main-content p">
<h1>
<FormattedMessage defaultMessage="About" />
</h1>
Version: <b>{__SNORT_VERSION__}</b>
<Markdown content={changelog} tags={[]} />
Version: <b>{version?.split(":")?.at(1) ?? "unknown version"}</b>
<Markdown content={Changelog} tags={[]} />
</div>
);
}

View File

@ -35,7 +35,7 @@ export default defineConfig({
name: "snort",
ifGitSHA: true,
command: "git describe --always --tags",
ifMeta: false,
ifMeta: true,
ifLog: false,
ifGlobal: false,
}),