mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
Add LND version label to UI
This commit is contained in:
parent
9126875beb
commit
223ca0cb67
2 changed files with 22 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue