mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-01 18:57:46 +00:00
Refresh button added to commands
This commit is contained in:
@@ -85,7 +85,7 @@ const DeviceActions = () => {
|
||||
<BlinkModalWidget show={showBlinkModal} toggleModal={toggleBlinkModal}/>
|
||||
<FirmwareUpgradeModal show={showUpgradeModal} toggleModal={toggleUpgradeModal} />
|
||||
<TraceModalWidget show={showTraceModal} toggleModal={toggleTraceModal} />
|
||||
<WifiScanModalWidget show={showScanModal} toggleModal={toggleScanModal} />
|
||||
<WifiScanModalWidget show={showScanModal} toggleModal={toggleScanModal} />
|
||||
</CCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import CIcon from '@coreui/icons-react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import DatePicker from 'react-widgets/DatePicker';
|
||||
import { cilSync } from '@coreui/icons';
|
||||
import { prettyDate, addDays } from '../utils/helper';
|
||||
import axiosInstance from '../utils/axiosInstance';
|
||||
import { getToken } from '../utils/authHelper';
|
||||
@@ -87,6 +88,10 @@ const DeviceCommands = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const refreshCommands = () => {
|
||||
setEnd(new Date());
|
||||
}
|
||||
|
||||
const getDetails = (command, commandDetails) => {
|
||||
if (command === 'wifiscan') {
|
||||
return null;
|
||||
@@ -134,6 +139,21 @@ const DeviceCommands = () => {
|
||||
footerSlot={
|
||||
<div style={{ padding: '20px' }}>
|
||||
<CCollapse show={collapse}>
|
||||
<CRow>
|
||||
<CCol/>
|
||||
<CCol>
|
||||
<div style={{float: 'right'}}>
|
||||
<CButton onClick={() => refreshCommands()} size="sm">
|
||||
<CIcon
|
||||
name="cil-sync"
|
||||
content={cilSync}
|
||||
style={{ color: 'white' }}
|
||||
size="2xl"
|
||||
/>
|
||||
</CButton>
|
||||
</div>
|
||||
</CCol>
|
||||
</CRow>
|
||||
<CRow style={{ marginBottom: '10px' }}>
|
||||
<CCol>
|
||||
From:
|
||||
|
||||
@@ -14,7 +14,6 @@ const DevicePage = () => {
|
||||
// Storing the deviceId in the store
|
||||
let selectedDeviceId = useSelector((state) => state.selectedDeviceId);
|
||||
const { deviceId } = useParams();
|
||||
|
||||
if (!selectedDeviceId || selectedDeviceId !== deviceId) {
|
||||
dispatch({ type: 'set', selectedDeviceId: deviceId });
|
||||
selectedDeviceId = deviceId;
|
||||
@@ -30,7 +29,7 @@ const DevicePage = () => {
|
||||
<CRow>
|
||||
<CCol xs="12" sm="6">
|
||||
<DeviceConfiguration />
|
||||
<DeviceCommands />
|
||||
<DeviceCommands/>
|
||||
</CCol>
|
||||
<CCol xs="12" sm="6">
|
||||
<DeviceLogs />
|
||||
|
||||
@@ -28,7 +28,6 @@ import {
|
||||
const [checkingIfSure, setCheckingIfSure] = useState(false);
|
||||
const selectedDeviceId = useSelector((state) => state.selectedDeviceId);
|
||||
|
||||
|
||||
const confirmingIfSure = () => {
|
||||
setCheckingIfSure(true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user