Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version labels to the UI #440

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand All @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions app/src/store/stores/nodeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down