diff --git a/.vscode/settings.json b/.vscode/settings.json index e73292f..89c7c47 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,6 +53,7 @@ "multiline", "optimisation", "personalise", + "pkgbuild", "pnpm", "precaching", "privatekeys", diff --git a/craco.config.js b/craco.config.js index 16d66cf..5a008c9 100644 --- a/craco.config.js +++ b/craco.config.js @@ -84,7 +84,8 @@ "__GIT_VERSION__": DefinePlugin.runtimeValue(() => JSON.stringify(gitRevisionPlugin.version()), []), "__GIT_COMMIT_HASH__": DefinePlugin.runtimeValue(() => JSON.stringify(gitRevisionPlugin.commithash()), []), "__BUILD_TIME__": DefinePlugin.runtimeValue(Date.now), - "__GIT_COMMITS__": JSON.stringify(commits) + "__GIT_COMMITS__": JSON.stringify(commits), + "__PKGBUILD__": DefinePlugin.runtimeValue(() => JSON.stringify(require("crypto").createHash("sha256").update(require("fs").readFileSync("package.json")).digest("hex").substr(0, 7)), ["package.json"]) }) ], diff --git a/public/locales/en.json b/public/locales/en.json index fd493b8..b93f258 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -385,7 +385,9 @@ "versionInfo": { "version": "Version", "commitHash": "Commit", - "buildTime": "Build time" + "buildTime": "Build time", + "variant": "Build variant", + "license": "License" } }, diff --git a/src/layout/nav/CymbalIndicator.tsx b/src/layout/nav/CymbalIndicator.tsx index d4e0483..4b47590 100644 --- a/src/layout/nav/CymbalIndicator.tsx +++ b/src/layout/nav/CymbalIndicator.tsx @@ -1,9 +1,12 @@ // Copyright (c) 2020-2021 Drew Lemmy // This file is part of KristWeb 2 under AGPL-3.0. // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt +import { useMemo } from "react"; import { Typography } from "antd"; import Icon from "@ant-design/icons"; +import packageJson from "../../../package.json"; + import { useSelector, shallowEqual } from "react-redux"; import { RootState } from "@store"; import { SettingsState } from "@utils/settings"; @@ -23,12 +26,14 @@ export function CymbalIndicator(): JSX.Element | null { const allSettings: SettingsState = useSelector((s: RootState) => s.settings, shallowEqual); const { addressList } = useWallets(); + const serverChanged = useMemo(() => localStorage.getItem("syncNode") !== packageJson.defaultSyncNode, []); const on = allSettings.walletFormats - || addressList.length > ADDRESS_LIST_LIMIT; + || addressList.length > ADDRESS_LIST_LIMIT + || serverChanged; return on ?
- + {addressList.length > ADDRESS_LIST_LIMIT && ( {addressList.length.toLocaleString()} diff --git a/src/layout/sidebar/SidebarFooter.tsx b/src/layout/sidebar/SidebarFooter.tsx index c189bb9..91aab52 100644 --- a/src/layout/sidebar/SidebarFooter.tsx +++ b/src/layout/sidebar/SidebarFooter.tsx @@ -8,6 +8,7 @@ import { ConditionalLink } from "@comp/ConditionalLink"; declare const __GIT_VERSION__: string; +declare const __PKGBUILD__: string; export function SidebarFooter(): JSX.Element { const { t } = useTranslation(); @@ -17,6 +18,7 @@ // Replaced by webpack DefinePlugin and git-revision-webpack-plugin const gitVersion: string = __GIT_VERSION__; + const pkgbuild = __PKGBUILD__; return (
@@ -42,7 +44,7 @@ {/* Git describe version */}
- {gitVersion} + {gitVersion}-{pkgbuild}
); diff --git a/src/pages/credits/CreditsPage.less b/src/pages/credits/CreditsPage.less index 9bb43ea..c3e248b 100644 --- a/src/pages/credits/CreditsPage.less +++ b/src/pages/credits/CreditsPage.less @@ -15,7 +15,7 @@ } .credits-version-info { - max-width: 640px; + max-width: 840px; margin: @margin-md auto 0 auto; text-align: left; diff --git a/src/pages/credits/CreditsPage.tsx b/src/pages/credits/CreditsPage.tsx index cb60e46..0d9eef8 100644 --- a/src/pages/credits/CreditsPage.tsx +++ b/src/pages/credits/CreditsPage.tsx @@ -18,6 +18,7 @@ declare const __GIT_VERSION__: string; declare const __GIT_COMMIT_HASH__: string; declare const __BUILD_TIME__: string; +declare const __PKGBUILD__: string; export function CreditsPage(): JSX.Element { const { t } = useTranslation(); @@ -29,6 +30,7 @@ const gitVersion: string = __GIT_VERSION__; const gitCommitHash: string = __GIT_COMMIT_HASH__; const buildTime: string = __BUILD_TIME__; + const pkgbuild: string = __PKGBUILD__; return KristWeb v2 @@ -72,6 +74,16 @@ {gitCommitHash} + + {/* Variant */} + + {pkgbuild} + + + {/* License */} + + AGPL 3.0 + {/* Supporters */}