Skip to content

Commit 223ca0c

Browse files
committed
Add LND version label to UI
1 parent 9126875 commit 223ca0c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

app/src/components/layout/Layout.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,24 @@ const Styled = {
106106
Fluid: styled.div`
107107
height: 100%;
108108
`,
109+
Versions: styled.div`
110+
position: absolute;
111+
font-size: ${props => props.theme.sizes.xs};
112+
bottom: 0;
113+
padding: 15px;
114+
`,
115+
};
116+
117+
const VersionInfo = () => {
118+
const { nodeStore } = useStore();
119+
const { Versions } = Styled;
120+
const shortVersion = nodeStore.version.split(' commit=')[0];
121+
122+
return (
123+
<Versions>
124+
<div title={nodeStore.version}>{`LND: v${shortVersion}`}</div>
125+
</Versions>
126+
);
109127
};
110128

111129
export const Layout: React.FC = ({ children }) => {
@@ -123,6 +141,7 @@ export const Layout: React.FC = ({ children }) => {
123141
</Hamburger>
124142
<Aside collapsed={!settingsStore.sidebarVisible}>
125143
<Sidebar />
144+
<VersionInfo />
126145
</Aside>
127146
<Content collapsed={!settingsStore.sidebarVisible} fullWidth={appView.fullWidth}>
128147
<Fluid className="container-fluid">{children}</Fluid>

app/src/store/stores/nodeStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export default class NodeStore {
1818
*/
1919
private _knownTxns: string[] = [];
2020

21+
/** the version of the LND node */
22+
version = '';
2123
/** the pubkey of the LND node */
2224
pubkey = '';
2325
/** the alias of the LND node */
@@ -71,6 +73,7 @@ export default class NodeStore {
7173
try {
7274
const info = await this._store.api.lnd.getInfo();
7375
runInAction(() => {
76+
this.version = info.version;
7477
this.pubkey = info.identityPubkey;
7578
this.alias = info.alias;
7679
this.blockHeight = info.blockHeight;

0 commit comments

Comments
 (0)