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,
}),

View File

@ -4782,7 +4782,7 @@ __metadata:
vite: "npm:^5.2.8"
vite-plugin-eslint: "npm:^1.8.1"
vite-plugin-pwa: "npm:^0.19.2"
vite-plugin-version-mark: "npm:^0.0.10"
vite-plugin-version-mark: "npm:^0.1.4"
vitest: "npm:^0.34.6"
workbox-cacheable-response: "npm:^7.0.0"
workbox-core: "npm:^6.4.2"
@ -13433,6 +13433,7 @@ __metadata:
prettier: "npm:^3.0.3"
typedoc: "npm:^0.25.7"
typescript: "npm:^5.2.2"
vite-plugin-version-mark: "npm:^0.1.4"
languageName: unknown
linkType: soft
@ -15124,10 +15125,12 @@ __metadata:
languageName: node
linkType: hard
"vite-plugin-version-mark@npm:^0.0.10":
version: 0.0.10
resolution: "vite-plugin-version-mark@npm:0.0.10"
checksum: 10/a5120d2c09e428a0942dfbd27ad60aa6305599daf5d52ce110d50ae9da23da1591d4e78c62eae2d724919b37315ecda2a192cfa60601a4b0ad5a6b87941750f1
"vite-plugin-version-mark@npm:^0.1.4":
version: 0.1.4
resolution: "vite-plugin-version-mark@npm:0.1.4"
peerDependencies:
vite: "*"
checksum: 10/25f2320c02d5d885842e823c5fc239b73f67716b84ca6a12acb6a6e5511bff97ae455484b651242311645c8878c3314b79408e3827cf07ac59c1b053e62a1bf3
languageName: node
linkType: hard