feat(lite): show version in UI (#5844)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Cookies from 'js-cookie'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { IntlProvider } from 'react-intl'
|
||||
import { HashRouter as Router, Switch, Route, Link } from 'react-router-dom'
|
||||
import { Map } from 'immutable'
|
||||
@@ -14,6 +15,13 @@ import StyleGuide from './StyleGuide/index'
|
||||
import TabConsole from './TabConsole'
|
||||
import XapiConnection, { ObjectsByType, Vm } from '../libs/xapi'
|
||||
|
||||
const Version = styled.div`
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: .5;
|
||||
`
|
||||
|
||||
interface ParentState {
|
||||
objectsByType: ObjectsByType
|
||||
xapi: XapiConnection
|
||||
@@ -147,6 +155,7 @@ const App = withState<State, Props, Effects, Computed, ParentState, ParentEffect
|
||||
</Router>
|
||||
</>
|
||||
)}
|
||||
<Version>v{process.env.NPM_VERSION}</Version>
|
||||
</IntlProvider>
|
||||
)
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ module.exports = {
|
||||
template: resolveApp('public/index.html'),
|
||||
favicon: resolveApp('public/favicon.ico'),
|
||||
}),
|
||||
new webpack.EnvironmentPlugin({ XAPI_HOST: '' }),
|
||||
new webpack.EnvironmentPlugin({ XAPI_HOST: '', NPM_VERSION: require('./package.json').version }),
|
||||
new (require('node-polyfill-webpack-plugin'))(),
|
||||
].filter(Boolean),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user