change(ui): version tag from api
This commit is contained in:
parent
6126d0dc6e
commit
decb7dd9fe
3 changed files with 24 additions and 7 deletions
|
|
@ -4,8 +4,7 @@ import ServiceCategory from 'Components/Header/HealthStatus/ServiceCategory';
|
|||
import cn from 'classnames';
|
||||
import { IServiceStats } from './HealthStatus';
|
||||
import { Divider, Space } from 'antd';
|
||||
|
||||
const Logo = require('../../../svg/logo-gray.svg').default;
|
||||
import VersionTag from "Components/Header/VersionTag";
|
||||
|
||||
function HealthWidget({
|
||||
healthResponse,
|
||||
|
|
@ -43,10 +42,7 @@ function HealthWidget({
|
|||
return (
|
||||
<div className='w-full flex flex-col gap-2 items-center' style={{ minWidth: '200px'}}>
|
||||
<div className='self-start mb-2'>
|
||||
<Space>
|
||||
<img src={Logo} width={20} />
|
||||
<div>{`v${window.env.VERSION}`}</div>
|
||||
</Space>
|
||||
<VersionTag />
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
|
|
|
|||
19
frontend/app/components/Header/VersionTag.tsx
Normal file
19
frontend/app/components/Header/VersionTag.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import React from 'react';
|
||||
import {connect} from "react-redux";
|
||||
import {updateModule} from "Duck/user";
|
||||
import {Space} from "antd";
|
||||
|
||||
const Logo = require('../../svg/logo-gray.svg').default;
|
||||
|
||||
function VersionTag({version}: { version: string }) {
|
||||
return (
|
||||
<Space>
|
||||
<img src={Logo} width={20}/>
|
||||
<div>{`v${version}`}</div>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect((state: any) => ({
|
||||
version: state.getIn(['user', 'account', 'versionNumber'])
|
||||
}), {updateModule})(VersionTag)
|
||||
|
|
@ -21,6 +21,7 @@ export interface IAccount extends IMember {
|
|||
tenantKey: string
|
||||
edition: string
|
||||
optOut: string
|
||||
versionNumber: string
|
||||
}
|
||||
|
||||
export default Member.extend({
|
||||
|
|
@ -42,10 +43,11 @@ export default Member.extend({
|
|||
tenantName: undefined,
|
||||
edition: undefined,
|
||||
optOut: false,
|
||||
versionNumber: undefined,
|
||||
}, {
|
||||
fromJS: ({ ...account})=> ({
|
||||
...account,
|
||||
id: account.id || account.userId,
|
||||
expirationDate: account.expirationDate > 0 && DateTime.fromMillis(account.expirationDate || 0),
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue