Skip to content

Commit

Permalink
dashboard: export package.json version
Browse files Browse the repository at this point in the history
  • Loading branch information
zeim839 committed Apr 19, 2024
1 parent 65bbd0b commit 5232605
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dashboard/components/NavHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useContext } from 'react'
import { UserAvatar, Asleep, Awake, Logout } from '@carbon/icons-react'
import { useCookies } from 'next-client-cookies'
import { useRouter } from 'next/navigation'
import { VERSION } from '@/config'

import { Header, HeaderContainer, HeaderName, HeaderGlobalBar,
HeaderGlobalAction, SkipToContent, useTheme } from '@carbon/react'
Expand Down Expand Up @@ -38,7 +39,7 @@ const NavHeader = (props : { setTheme: Function }) => {
<Header aria-label="OpenWebServices">
<SkipToContent />
<HeaderName href="/" prefix="UF">OpenWebServices</HeaderName>
<p>v0.1.4-alpha</p>
<p>{VERSION}</p>
<HeaderGlobalBar>
{ themeSelector() }
{
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
const { version } = require('./package.json');

export const API_ENDPOINT = process.env.NEXT_PUBLIC_API_ENDPOINT || "http://localhost:8080"
export const VERSION = 'v'+version
3 changes: 3 additions & 0 deletions dashboard/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const { version } = require('./package.json')

/** @type {import('next').NextConfig} */
module.exports = {
"output": 'standalone',
env: { version },
}

0 comments on commit 5232605

Please sign in to comment.