fix: about page
This commit is contained in:
@ -131,7 +131,7 @@
|
|||||||
"vite": "^5.2.8",
|
"vite": "^5.2.8",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-pwa": "^0.19.2",
|
"vite-plugin-pwa": "^0.19.2",
|
||||||
"vite-plugin-version-mark": "^0.0.10",
|
"vite-plugin-version-mark": "^0.1.4",
|
||||||
"vitest": "^0.34.6"
|
"vitest": "^0.34.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,17 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
import Changelog from "@/../CHANGELOG.md";
|
import Changelog from "@/../CHANGELOG.md?raw";
|
||||||
import { Markdown } from "@/Components/Event/Markdown";
|
import { Markdown } from "@/Components/Event/Markdown";
|
||||||
|
|
||||||
export function AboutPage() {
|
export function AboutPage() {
|
||||||
const [changelog, setChangelog] = useState("");
|
const version = document.querySelector("meta[name='application-name']")?.getAttribute("content");
|
||||||
|
|
||||||
async function getChangelog() {
|
|
||||||
const res = await fetch(Changelog);
|
|
||||||
const content = await res.text();
|
|
||||||
setChangelog(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getChangelog().catch(console.error);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main-content p">
|
<div className="main-content p">
|
||||||
<h1>
|
<h1>
|
||||||
<FormattedMessage defaultMessage="About" />
|
<FormattedMessage defaultMessage="About" />
|
||||||
</h1>
|
</h1>
|
||||||
Version: <b>{__SNORT_VERSION__}</b>
|
Version: <b>{version?.split(":")?.at(1) ?? "unknown version"}</b>
|
||||||
<Markdown content={changelog} tags={[]} />
|
<Markdown content={Changelog} tags={[]} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ export default defineConfig({
|
|||||||
name: "snort",
|
name: "snort",
|
||||||
ifGitSHA: true,
|
ifGitSHA: true,
|
||||||
command: "git describe --always --tags",
|
command: "git describe --always --tags",
|
||||||
ifMeta: false,
|
ifMeta: true,
|
||||||
ifLog: false,
|
ifLog: false,
|
||||||
ifGlobal: false,
|
ifGlobal: false,
|
||||||
}),
|
}),
|
||||||
|
13
yarn.lock
13
yarn.lock
@ -4782,7 +4782,7 @@ __metadata:
|
|||||||
vite: "npm:^5.2.8"
|
vite: "npm:^5.2.8"
|
||||||
vite-plugin-eslint: "npm:^1.8.1"
|
vite-plugin-eslint: "npm:^1.8.1"
|
||||||
vite-plugin-pwa: "npm:^0.19.2"
|
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"
|
vitest: "npm:^0.34.6"
|
||||||
workbox-cacheable-response: "npm:^7.0.0"
|
workbox-cacheable-response: "npm:^7.0.0"
|
||||||
workbox-core: "npm:^6.4.2"
|
workbox-core: "npm:^6.4.2"
|
||||||
@ -13433,6 +13433,7 @@ __metadata:
|
|||||||
prettier: "npm:^3.0.3"
|
prettier: "npm:^3.0.3"
|
||||||
typedoc: "npm:^0.25.7"
|
typedoc: "npm:^0.25.7"
|
||||||
typescript: "npm:^5.2.2"
|
typescript: "npm:^5.2.2"
|
||||||
|
vite-plugin-version-mark: "npm:^0.1.4"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
@ -15124,10 +15125,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"vite-plugin-version-mark@npm:^0.0.10":
|
"vite-plugin-version-mark@npm:^0.1.4":
|
||||||
version: 0.0.10
|
version: 0.1.4
|
||||||
resolution: "vite-plugin-version-mark@npm:0.0.10"
|
resolution: "vite-plugin-version-mark@npm:0.1.4"
|
||||||
checksum: 10/a5120d2c09e428a0942dfbd27ad60aa6305599daf5d52ce110d50ae9da23da1591d4e78c62eae2d724919b37315ecda2a192cfa60601a4b0ad5a6b87941750f1
|
peerDependencies:
|
||||||
|
vite: "*"
|
||||||
|
checksum: 10/25f2320c02d5d885842e823c5fc239b73f67716b84ca6a12acb6a6e5511bff97ae455484b651242311645c8878c3314b79408e3827cf07ac59c1b053e62a1bf3
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user