2018-08-30 14:25:33 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2020-05-22 14:06:05 +00:00
|
|
|
import { Trans, withTranslation } from 'react-i18next';
|
2018-08-30 14:25:33 +00:00
|
|
|
|
2019-09-05 16:07:14 +00:00
|
|
|
import './Version.css';
|
|
|
|
|
|
2019-06-25 14:56:50 +00:00
|
|
|
const Version = (props) => {
|
|
|
|
|
const {
|
2020-06-02 10:46:35 +00:00
|
|
|
dnsVersion, processingVersion, t, checkUpdateFlag,
|
2019-06-25 14:56:50 +00:00
|
|
|
} = props;
|
|
|
|
|
|
2018-08-30 14:25:33 +00:00
|
|
|
return (
|
2019-09-05 16:07:14 +00:00
|
|
|
<div className="version">
|
|
|
|
|
<div className="version__text">
|
2020-06-02 10:46:35 +00:00
|
|
|
{dnsVersion
|
|
|
|
|
&& <>
|
|
|
|
|
<Trans>version</Trans>:
|
|
|
|
|
<span className="version__value" title={dnsVersion}>{dnsVersion}</span>
|
|
|
|
|
</>}
|
2020-05-27 11:25:27 +00:00
|
|
|
{checkUpdateFlag && <button
|
2019-06-25 14:56:50 +00:00
|
|
|
type="button"
|
|
|
|
|
className="btn btn-icon btn-icon-sm btn-outline-primary btn-sm ml-2"
|
|
|
|
|
onClick={() => props.getVersion(true)}
|
|
|
|
|
disabled={processingVersion}
|
|
|
|
|
title={t('check_updates_now')}
|
|
|
|
|
>
|
|
|
|
|
<svg className="icons">
|
|
|
|
|
<use xlinkHref="#refresh" />
|
|
|
|
|
</svg>
|
2020-05-27 11:25:27 +00:00
|
|
|
</button>}
|
2018-09-21 12:20:41 +00:00
|
|
|
</div>
|
2018-08-30 14:25:33 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
2019-06-25 14:56:50 +00:00
|
|
|
};
|
2018-08-30 14:25:33 +00:00
|
|
|
|
|
|
|
|
Version.propTypes = {
|
2020-06-02 10:46:35 +00:00
|
|
|
dnsVersion: PropTypes.string,
|
|
|
|
|
getVersion: PropTypes.func,
|
|
|
|
|
processingVersion: PropTypes.bool,
|
|
|
|
|
checkUpdateFlag: PropTypes.bool,
|
2019-06-25 14:56:50 +00:00
|
|
|
t: PropTypes.func.isRequired,
|
2018-08-30 14:25:33 +00:00
|
|
|
};
|
2018-10-29 03:26:19 +00:00
|
|
|
|
2020-05-22 14:06:05 +00:00
|
|
|
export default withTranslation()(Version);
|