Add LND version label to UI

This commit is contained in:
Oscar Lafarga 2022-10-27 16:14:27 -04:00
parent 9126875beb
commit 223ca0cb67
No known key found for this signature in database
GPG key ID: 0ED526E2148EAFD3
2 changed files with 22 additions and 0 deletions

View file

@ -106,6 +106,24 @@ const Styled = {
Fluid: styled.div`
height: 100%;
`,
Versions: styled.div`
position: absolute;
font-size: ${props => props.theme.sizes.xs};
bottom: 0;
padding: 15px;
`,
};
const VersionInfo = () => {
const { nodeStore } = useStore();
const { Versions } = Styled;
const shortVersion = nodeStore.version.split(' commit=')[0];
return (
<Versions>
<div title={nodeStore.version}>{`LND: v${shortVersion}`}</div>
</Versions>
);
};
export const Layout: React.FC = ({ children }) => {
@ -123,6 +141,7 @@ export const Layout: React.FC = ({ children }) => {
</Hamburger>
<Aside collapsed={!settingsStore.sidebarVisible}>
<Sidebar />
<VersionInfo />
</Aside>
<Content collapsed={!settingsStore.sidebarVisible} fullWidth={appView.fullWidth}>
<Fluid className="container-fluid">{children}</Fluid>

View file

@ -18,6 +18,8 @@ export default class NodeStore {
*/
private _knownTxns: string[] = [];
/** the version of the LND node */
version = '';
/** the pubkey of the LND node */
pubkey = '';
/** the alias of the LND node */
@ -71,6 +73,7 @@ export default class NodeStore {
try {
const info = await this._store.api.lnd.getInfo();
runInAction(() => {
this.version = info.version;
this.pubkey = info.identityPubkey;
this.alias = info.alias;
this.blockHeight = info.blockHeight;