mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-01 18:57:46 +00:00
Version 2.5.18: user fixes, blink only now, fix for connect loading
This commit is contained in:
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.7",
|
"version": "2.5.18",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.7",
|
"version": "2.5.18",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
"react-tooltip": "^4.2.21",
|
"react-tooltip": "^4.2.21",
|
||||||
"react-widgets": "^5.1.1",
|
"react-widgets": "^5.1.1",
|
||||||
"sass": "^1.35.1",
|
"sass": "^1.35.1",
|
||||||
"ucentral-libs": "^1.0.56",
|
"ucentral-libs": "^1.0.57",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -15046,9 +15046,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ucentral-libs": {
|
"node_modules/ucentral-libs": {
|
||||||
"version": "1.0.56",
|
"version": "1.0.57",
|
||||||
"resolved": "https://registry.npmjs.org/ucentral-libs/-/ucentral-libs-1.0.56.tgz",
|
"resolved": "https://registry.npmjs.org/ucentral-libs/-/ucentral-libs-1.0.57.tgz",
|
||||||
"integrity": "sha512-/j4KpsQ588nvRKu3XYLpVfS07lTx7kq3e6QVTMalG/HGA0rv0CmAbbJdv3ICyDIReGbVdUI7scBKOyK8ZUjG+w==",
|
"integrity": "sha512-3EBNHNasVRFOivvEt53cR+9nqDK6IOZ+vFS2Df+edOS2PEUq6Gg1hYTc2DrUPyRhJjHo7zTdLiDkB+QwZy+OkQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
@@ -28138,9 +28138,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ucentral-libs": {
|
"ucentral-libs": {
|
||||||
"version": "1.0.56",
|
"version": "1.0.57",
|
||||||
"resolved": "https://registry.npmjs.org/ucentral-libs/-/ucentral-libs-1.0.56.tgz",
|
"resolved": "https://registry.npmjs.org/ucentral-libs/-/ucentral-libs-1.0.57.tgz",
|
||||||
"integrity": "sha512-/j4KpsQ588nvRKu3XYLpVfS07lTx7kq3e6QVTMalG/HGA0rv0CmAbbJdv3ICyDIReGbVdUI7scBKOyK8ZUjG+w==",
|
"integrity": "sha512-3EBNHNasVRFOivvEt53cR+9nqDK6IOZ+vFS2Df+edOS2PEUq6Gg1hYTc2DrUPyRhJjHo7zTdLiDkB+QwZy+OkQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.5.17",
|
"version": "2.5.18",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^3.4.0",
|
"@coreui/coreui": "^3.4.0",
|
||||||
"@coreui/icons": "^2.0.1",
|
"@coreui/icons": "^2.0.1",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"react-tooltip": "^4.2.21",
|
"react-tooltip": "^4.2.21",
|
||||||
"react-widgets": "^5.1.1",
|
"react-widgets": "^5.1.1",
|
||||||
"sass": "^1.35.1",
|
"sass": "^1.35.1",
|
||||||
"ucentral-libs": "^1.0.56",
|
"ucentral-libs": "^1.0.57",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"blink": "LEDs Blinken",
|
"blink": "LEDs Blinken",
|
||||||
"device_leds": "LEDs",
|
"device_leds": "LEDs",
|
||||||
"execute_now": "Möchten Sie dieses Muster jetzt einstellen?",
|
"execute_now": "Möchten Sie dieses Muster jetzt einstellen?",
|
||||||
|
"explanation": "Welches Muster möchten Sie auf diesem Gerät für 30 Sekunden einstellen?",
|
||||||
"pattern": "Wählen Sie das Muster, das Sie verwenden möchten:",
|
"pattern": "Wählen Sie das Muster, das Sie verwenden möchten:",
|
||||||
"set_leds": "LEDs einstellen",
|
"set_leds": "LEDs einstellen",
|
||||||
"when_blink_leds": "Wann möchten Sie die LEDs blinken lassen?"
|
"when_blink_leds": "Wann möchten Sie die LEDs blinken lassen?"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"blink": "Blink",
|
"blink": "Blink",
|
||||||
"device_leds": "Device LEDs",
|
"device_leds": "Device LEDs",
|
||||||
"execute_now": "Would you like to set this pattern now?",
|
"execute_now": "Would you like to set this pattern now?",
|
||||||
|
"explanation": "What pattern would you like to set on this device for 30 seconds?",
|
||||||
"pattern": "LEDs pattern: ",
|
"pattern": "LEDs pattern: ",
|
||||||
"set_leds": "Set LEDs",
|
"set_leds": "Set LEDs",
|
||||||
"when_blink_leds": "When would you like to make the device LEDs blink?"
|
"when_blink_leds": "When would you like to make the device LEDs blink?"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"blink": "Parpadeo",
|
"blink": "Parpadeo",
|
||||||
"device_leds": "LED de dispositivo",
|
"device_leds": "LED de dispositivo",
|
||||||
"execute_now": "¿Le gustaría establecer este patrón ahora?",
|
"execute_now": "¿Le gustaría establecer este patrón ahora?",
|
||||||
|
"explanation": "¿Qué patrón le gustaría establecer en este dispositivo durante 30 segundos?",
|
||||||
"pattern": "Elija el patrón que le gustaría usar:",
|
"pattern": "Elija el patrón que le gustaría usar:",
|
||||||
"set_leds": "Establecer LED",
|
"set_leds": "Establecer LED",
|
||||||
"when_blink_leds": "¿Cuándo desea que los LED del dispositivo parpadeen?"
|
"when_blink_leds": "¿Cuándo desea que los LED del dispositivo parpadeen?"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"blink": "Cligner",
|
"blink": "Cligner",
|
||||||
"device_leds": "LED de l'appareil",
|
"device_leds": "LED de l'appareil",
|
||||||
"execute_now": "Souhaitez-vous définir ce modèle maintenant ?",
|
"execute_now": "Souhaitez-vous définir ce modèle maintenant ?",
|
||||||
|
"explanation": "Quel modèle souhaitez-vous définir sur cet appareil pendant 30 secondes ?",
|
||||||
"pattern": "Choisissez le modèle que vous souhaitez utiliser :",
|
"pattern": "Choisissez le modèle que vous souhaitez utiliser :",
|
||||||
"set_leds": "Définir les LED",
|
"set_leds": "Définir les LED",
|
||||||
"when_blink_leds": "Quand souhaitez-vous faire clignoter les LED de l'appareil ?"
|
"when_blink_leds": "Quand souhaitez-vous faire clignoter les LED de l'appareil ?"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"blink": "Piscar",
|
"blink": "Piscar",
|
||||||
"device_leds": "LEDs do dispositivo",
|
"device_leds": "LEDs do dispositivo",
|
||||||
"execute_now": "Você gostaria de definir este padrão agora?",
|
"execute_now": "Você gostaria de definir este padrão agora?",
|
||||||
|
"explanation": "Que padrão você gostaria de definir neste dispositivo por 30 segundos?",
|
||||||
"pattern": "Escolha o padrão que deseja usar:",
|
"pattern": "Escolha o padrão que deseja usar:",
|
||||||
"set_leds": "Definir LEDs",
|
"set_leds": "Definir LEDs",
|
||||||
"when_blink_leds": "Quando você gostaria de fazer os LEDs do dispositivo piscarem?"
|
"when_blink_leds": "Quando você gostaria de fazer os LEDs do dispositivo piscarem?"
|
||||||
|
|||||||
@@ -5,21 +5,18 @@ import {
|
|||||||
CModalTitle,
|
CModalTitle,
|
||||||
CModalBody,
|
CModalBody,
|
||||||
CModalFooter,
|
CModalFooter,
|
||||||
CSwitch,
|
|
||||||
CCol,
|
CCol,
|
||||||
CRow,
|
|
||||||
CFormGroup,
|
CFormGroup,
|
||||||
CInputRadio,
|
CInputRadio,
|
||||||
CLabel,
|
CLabel,
|
||||||
CPopover,
|
CPopover,
|
||||||
|
CRow,
|
||||||
} from '@coreui/react';
|
} from '@coreui/react';
|
||||||
import CIcon from '@coreui/icons-react';
|
import CIcon from '@coreui/icons-react';
|
||||||
import { cilX } from '@coreui/icons';
|
import { cilX } from '@coreui/icons';
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import DatePicker from 'react-widgets/DatePicker';
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { dateToUnix } from 'utils/helper';
|
|
||||||
import 'react-widgets/styles.css';
|
import 'react-widgets/styles.css';
|
||||||
import axiosInstance from 'utils/axiosInstance';
|
import axiosInstance from 'utils/axiosInstance';
|
||||||
import eventBus from 'utils/eventBus';
|
import eventBus from 'utils/eventBus';
|
||||||
@@ -31,38 +28,24 @@ const BlinkModal = ({ show, toggleModal }) => {
|
|||||||
const { currentToken, endpoints } = useAuth();
|
const { currentToken, endpoints } = useAuth();
|
||||||
const { deviceSerialNumber } = useDevice();
|
const { deviceSerialNumber } = useDevice();
|
||||||
const { addToast } = useToast();
|
const { addToast } = useToast();
|
||||||
const [isNow, setIsNow] = useState(false);
|
|
||||||
const [waiting, setWaiting] = useState(false);
|
const [waiting, setWaiting] = useState(false);
|
||||||
const [chosenDate, setChosenDate] = useState(new Date().toString());
|
const [chosenPattern, setPattern] = useState('blink');
|
||||||
const [chosenPattern, setPattern] = useState('on');
|
|
||||||
const [result, setResult] = useState(null);
|
const [result, setResult] = useState(null);
|
||||||
|
|
||||||
const toggleNow = () => {
|
|
||||||
setIsNow(!isNow);
|
|
||||||
};
|
|
||||||
|
|
||||||
const setDate = (date) => {
|
|
||||||
if (date) {
|
|
||||||
setChosenDate(date.toString());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (show) {
|
if (show) {
|
||||||
setWaiting(false);
|
setWaiting(false);
|
||||||
setChosenDate(new Date().toString());
|
setPattern('blink');
|
||||||
setPattern('on');
|
|
||||||
setResult(null);
|
setResult(null);
|
||||||
}
|
}
|
||||||
}, [show]);
|
}, [show]);
|
||||||
|
|
||||||
const doAction = () => {
|
const doAction = () => {
|
||||||
setWaiting(true);
|
setWaiting(true);
|
||||||
const utcDate = new Date(chosenDate);
|
|
||||||
|
|
||||||
const parameters = {
|
const parameters = {
|
||||||
serialNumber: deviceSerialNumber,
|
serialNumber: deviceSerialNumber,
|
||||||
when: isNow ? 0 : dateToUnix(utcDate),
|
when: 0,
|
||||||
pattern: chosenPattern,
|
pattern: chosenPattern,
|
||||||
duration: 30,
|
duration: 30,
|
||||||
};
|
};
|
||||||
@@ -113,11 +96,26 @@ const BlinkModal = ({ show, toggleModal }) => {
|
|||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<CModalBody>
|
<CModalBody>
|
||||||
<CFormGroup row>
|
<CRow className="mb-3">
|
||||||
|
<CCol>{t('blink.explanation')}</CCol>
|
||||||
|
</CRow>
|
||||||
|
<CFormGroup row className="mb-0">
|
||||||
<CCol md="3">
|
<CCol md="3">
|
||||||
<CLabel>{t('blink.pattern')}</CLabel>
|
<CLabel>{t('blink.pattern')}</CLabel>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol>
|
<CCol>
|
||||||
|
<CFormGroup variant="custom-radio" onClick={() => setPattern('blink')} inline>
|
||||||
|
<CInputRadio
|
||||||
|
custom
|
||||||
|
defaultChecked={chosenPattern === 'blink'}
|
||||||
|
id="radio3"
|
||||||
|
name="radios"
|
||||||
|
value="option3"
|
||||||
|
/>
|
||||||
|
<CLabel variant="custom-checkbox" htmlFor="radio3">
|
||||||
|
{t('blink.blink')}
|
||||||
|
</CLabel>
|
||||||
|
</CFormGroup>
|
||||||
<CFormGroup variant="custom-radio" onClick={() => setPattern('on')} inline>
|
<CFormGroup variant="custom-radio" onClick={() => setPattern('on')} inline>
|
||||||
<CInputRadio
|
<CInputRadio
|
||||||
custom
|
custom
|
||||||
@@ -142,55 +140,12 @@ const BlinkModal = ({ show, toggleModal }) => {
|
|||||||
{t('common.off')}
|
{t('common.off')}
|
||||||
</CLabel>
|
</CLabel>
|
||||||
</CFormGroup>
|
</CFormGroup>
|
||||||
<CFormGroup variant="custom-radio" onClick={() => setPattern('blink')} inline>
|
|
||||||
<CInputRadio
|
|
||||||
custom
|
|
||||||
defaultChecked={chosenPattern === 'blink'}
|
|
||||||
id="radio3"
|
|
||||||
name="radios"
|
|
||||||
value="option3"
|
|
||||||
/>
|
|
||||||
<CLabel variant="custom-checkbox" htmlFor="radio3">
|
|
||||||
{t('blink.blink')}
|
|
||||||
</CLabel>
|
|
||||||
</CFormGroup>
|
|
||||||
</CCol>
|
</CCol>
|
||||||
</CFormGroup>
|
</CFormGroup>
|
||||||
<CRow className="pt-1">
|
|
||||||
<CCol md="8">
|
|
||||||
<p>{t('blink.execute_now')}</p>
|
|
||||||
</CCol>
|
|
||||||
<CCol>
|
|
||||||
<CSwitch
|
|
||||||
disabled={waiting}
|
|
||||||
color="primary"
|
|
||||||
defaultChecked={isNow}
|
|
||||||
onClick={toggleNow}
|
|
||||||
labelOn={t('common.yes')}
|
|
||||||
labelOff={t('common.no')}
|
|
||||||
/>
|
|
||||||
</CCol>
|
|
||||||
</CRow>
|
|
||||||
<CRow hidden={isNow} className="pt-3">
|
|
||||||
<CCol md="4" className="pt-2">
|
|
||||||
<p>{t('common.custom_date')}</p>
|
|
||||||
</CCol>
|
|
||||||
<CCol xs="12" md="8">
|
|
||||||
<DatePicker
|
|
||||||
selected={new Date(chosenDate)}
|
|
||||||
includeTime
|
|
||||||
value={new Date(chosenDate)}
|
|
||||||
placeholder="Select custom date"
|
|
||||||
disabled={waiting}
|
|
||||||
onChange={(date) => setDate(date)}
|
|
||||||
min={new Date()}
|
|
||||||
/>
|
|
||||||
</CCol>
|
|
||||||
</CRow>
|
|
||||||
</CModalBody>
|
</CModalBody>
|
||||||
<CModalFooter>
|
<CModalFooter>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
label={isNow ? t('blink.set_leds') : t('common.schedule')}
|
label={t('blink.set_leds')}
|
||||||
isLoadingLabel={t('common.loading_ellipsis')}
|
isLoadingLabel={t('common.loading_ellipsis')}
|
||||||
isLoading={waiting}
|
isLoading={waiting}
|
||||||
action={doAction}
|
action={doAction}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const DeviceActions = ({ device }) => {
|
|||||||
const [upgradeStatus, setUpgradeStatus] = useState({
|
const [upgradeStatus, setUpgradeStatus] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
const [connectLoading, setConnectLoading] = useToggle(false);
|
const [connectLoading, setConnectLoading] = useState(false);
|
||||||
const [showRebootModal, toggleRebootModal] = useToggle(false);
|
const [showRebootModal, toggleRebootModal] = useToggle(false);
|
||||||
const [showBlinkModal, toggleBlinkModal] = useToggle(false);
|
const [showBlinkModal, toggleBlinkModal] = useToggle(false);
|
||||||
const [showUpgradeModal, toggleUpgradeModal, setShowUpgradeModal] = useToggle(false);
|
const [showUpgradeModal, toggleUpgradeModal, setShowUpgradeModal] = useToggle(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user