2.6.2: fixed configuration display copy to clipboard format, added copy to clipboard button to latest statistics modal

This commit is contained in:
Charles
2022-02-22 21:39:58 +02:00
parent f0fdc90226
commit 67716aedde
4 changed files with 12 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ucentral-client",
"version": "2.6.1",
"version": "2.6.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ucentral-client",
"version": "2.6.1",
"version": "2.6.2",
"dependencies": {
"@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "ucentral-client",
"version": "2.6.1",
"version": "2.6.2",
"dependencies": {
"@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1",

View File

@@ -37,7 +37,7 @@ const ConfigurationDisplay = ({ getData, deviceConfig }) => {
<CopyToClipboardButton
t={t}
size="sm"
content={JSON.stringify(deviceConfig?.configuration ?? {})}
content={JSON.stringify(deviceConfig?.configuration ?? {}, null, 4)}
/>
</h5>
<CRow>

View File

@@ -5,7 +5,7 @@ import { cilX } from '@coreui/icons';
import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import axiosInstance from 'utils/axiosInstance';
import { useAuth, useDevice } from 'ucentral-libs';
import { useAuth, useDevice, CopyToClipboardButton } from 'ucentral-libs';
const LatestStatisticsModal = ({ show, toggle }) => {
const { t } = useTranslation();
@@ -51,6 +51,13 @@ const LatestStatisticsModal = ({ show, toggle }) => {
</div>
</CModalHeader>
<CModalBody>
<div style={{ textAlign: 'right' }}>
<CopyToClipboardButton
t={t}
size="lg"
content={JSON.stringify(latestStats ?? {}, null, 4)}
/>
</div>
<pre className="ignore">{JSON.stringify(latestStats, null, 2)}</pre>
</CModalBody>
</CModal>