Version 1.0.39

This commit is contained in:
Charles
2021-11-22 16:58:55 -05:00
parent c13ca4bd6e
commit 495a124884
5 changed files with 106 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ucentral-libs", "name": "ucentral-libs",
"version": "1.0.37", "version": "1.0.39",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-libs", "name": "ucentral-libs",
"version": "1.0.37", "version": "1.0.39",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "ucentral-libs", "name": "ucentral-libs",
"version": "1.0.37", "version": "1.0.39",
"main": "dist/index.js", "main": "dist/index.js",
"source": "src/index.js", "source": "src/index.js",
"engines": { "engines": {

View File

@@ -21,6 +21,7 @@ const DeviceBadge = ({ t, device, deviceIcons }) => {
setSrc(deviceIcons.iotIcon); setSrc(deviceIcons.iotIcon);
break; break;
default: default:
setSrc(deviceIcons.apIcon);
break; break;
} }
}; };
@@ -49,7 +50,7 @@ const DeviceBadge = ({ t, device, deviceIcons }) => {
style={{ height: '35px', width: '35px' }} style={{ height: '35px', width: '35px' }}
className={`c-avatar c-avatar-lg ${getCertColor()}`} className={`c-avatar c-avatar-lg ${getCertColor()}`}
> >
<img src={src} className={styles.icon} alt={device.deviceType} /> <img src={src} className={styles.icon} alt="" />
<CPopover content={device.connected ? t('common.connected') : t('common.not_connected')}> <CPopover content={device.connected ? t('common.connected') : t('common.not_connected')}>
<span <span
className={ className={

View File

@@ -0,0 +1,100 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
CForm,
CInput,
CLabel,
CCol,
CFormGroup,
CInvalidFeedback,
CFormText,
CRow,
CSelect,
} from '@coreui/react';
const DuplicateEntityMapForm = ({ t, disable, fields, updateField }) => (
<CForm>
<CFormGroup row className="pb-3">
<CLabel col htmlFor="name">
{t('user.name')}
</CLabel>
<CCol sm="7">
<CInput
id="name"
type="text"
required
value={fields.name.value}
onChange={updateField}
invalid={fields.name.error}
disabled={disable}
maxLength="50"
/>
<CFormText color={fields.name.error ? 'danger' : ''}>{t('common.required')}</CFormText>
</CCol>
</CFormGroup>
<CFormGroup row className="pb-3">
<CLabel col htmlFor="description">
{t('user.description')}
</CLabel>
<CCol sm="7">
<CInput
id="description"
type="text"
required
value={fields.description.value}
onChange={updateField}
invalid={fields.description.error}
disabled={disable}
maxLength="50"
/>
<CInvalidFeedback>{t('common.required')}</CInvalidFeedback>
</CCol>
</CFormGroup>
<CRow className="pb-3">
<CLabel col htmlFor="visibility">
<div>{t('common.visibility')}:</div>
</CLabel>
<CCol sm="7">
<CSelect
custom
id="visibility"
type="text"
required
value={fields.visibility.value}
onChange={updateField}
invalid={fields.visibility.error}
disabled={disable}
maxLength="50"
>
<option value="public">public</option>
<option value="private">private</option>
</CSelect>
</CCol>
</CRow>
<CFormGroup row className="pb-3">
<CLabel col htmlFor="note">
{t('user.note')}
</CLabel>
<CCol sm="7">
<CInput
id="note"
type="text"
required
value={fields.note.value}
onChange={updateField}
invalid={fields.note.error}
disabled={disable}
/>
</CCol>
</CFormGroup>
</CForm>
);
DuplicateEntityMapForm.propTypes = {
t: PropTypes.func.isRequired,
disable: PropTypes.bool.isRequired,
fields: PropTypes.instanceOf(Object).isRequired,
updateField: PropTypes.func.isRequired,
};
export default DuplicateEntityMapForm;

View File

@@ -44,6 +44,7 @@ export { default as DeviceFirmwareModal } from './components/DeviceFirmwareModal
export { default as DeviceListTable } from './components/DeviceListTable'; export { default as DeviceListTable } from './components/DeviceListTable';
export { default as DeviceStatusCard } from './components/DeviceStatusCard'; export { default as DeviceStatusCard } from './components/DeviceStatusCard';
export { default as DeviceSearchBar } from './components/DeviceSearchBar'; export { default as DeviceSearchBar } from './components/DeviceSearchBar';
export { default as DuplicateEntityMapForm } from './components/DuplicateEntityMapForm';
export { default as EditConfigurationForm } from './components/EditConfigurationForm'; export { default as EditConfigurationForm } from './components/EditConfigurationForm';
export { default as EditContactForm } from './components/EditContactForm'; export { default as EditContactForm } from './components/EditContactForm';
export { default as EditDefaultConfigurationForm } from './components/EditDefaultConfigurationForm'; export { default as EditDefaultConfigurationForm } from './components/EditDefaultConfigurationForm';