\n
\n \n {(closeModal: Function) => (\n \n fetchBuildings(accessToken, setBuildings)\n }\n />\n )}\n \n\n \n {(closeModal: Function) => (\n fetchPlans(accessToken, setPlans)}\n />\n )}\n \n \n {(closeModal: Function) => (\n {\n fetchBuildings(accessToken, setBuildings)\n fetchPlans(accessToken, setPlans)\n fetchDevices(accessToken, setRowData)\n }}\n />\n )}\n \n \n {(closeModal: Function) => (\n {\n fetchBuildings(accessToken, setBuildings)\n fetchPlans(accessToken, setPlans)\n fetchDevices(accessToken, setRowData)\n }}\n />\n )}\n \n
\n
\n {\n resizeGrid()\n }}\n defaultColDef={{\n flex: 1,\n minWidth: 110,\n editable: true,\n resizable: true,\n }}\n onCellValueChanged={(param: CellValueChangedEvent) => {\n if (param.colDef.headerName === 'Plan') {\n updateIndoorDevice(accessToken, {\n devEUI: param.data.deviceId,\n planId: param.value,\n sensorType: param.data.sensorType,\n })\n } else {\n updateDevice(param.data)\n }\n }}\n >\n \n \n \n \n \n \n \n {\n if (params.value === -1) {\n return 'None'\n }\n const plan = plans.find(\n (plan) => plan.ID === params.value\n )\n return plan?.name ?? ''\n }}\n cellEditor=\"agSelectCellEditor\"\n cellEditorParams={{\n values: planOptions,\n }}\n />\n \n \n
\n )\n}\n\nexport default DeviceOverrideInfo\n\nconst AgGridWrapper = styled.div`\n width: 100vw;\n height: calc(100vh - 61px);\n transition: max-height 1s;\n`\n\nfunction getNumericCellEditor() {\n function isCharNumeric(charStr: any, value: string) {\n return /\\d/.test(charStr) || (charStr === '.' && !/\\./.test(value))\n }\n\n function isKeyPressedNumeric(event: any, value: string) {\n var charCode = getCharCodeFromEvent(event)\n var charStr = String.fromCharCode(charCode)\n return isCharNumeric(charStr, value)\n }\n\n function getCharCodeFromEvent(event: any) {\n event = event || window.event\n return typeof event.which === 'undefined' ? event.keyCode : event.which\n }\n\n function NumericCellEditor() {}\n\n NumericCellEditor.prototype.init = function (params: any) {\n this.focusAfterAttached = params.cellStartedEdit\n this.eInput = document.createElement('input')\n this.eInput.style.width = '100%'\n this.eInput.style.height = '100%'\n this.eInput.style.border = '0px'\n this.eInput.value = isCharNumeric(params.charPress, this.eInput.value)\n ? params.charPress\n : params.value\n var that = this\n this.eInput.addEventListener('keypress', function (event: any) {\n if (!isKeyPressedNumeric(event, that.eInput.value)) {\n that.eInput.focus()\n if (event.preventDefault) event.preventDefault()\n }\n })\n }\n NumericCellEditor.prototype.getGui = function () {\n return this.eInput\n }\n NumericCellEditor.prototype.afterGuiAttached = function () {\n if (this.focusAfterAttached) {\n this.eInput.focus()\n this.eInput.select()\n }\n }\n NumericCellEditor.prototype.isCancelBeforeStart = function () {\n return this.cancelBeforeStart\n }\n NumericCellEditor.prototype.isCancelAfterEnd = function () {}\n NumericCellEditor.prototype.getValue = function () {\n return parseFloat(this.eInput.value)\n }\n NumericCellEditor.prototype.focusIn = function () {\n var eInput = this.getGui()\n eInput.focus()\n eInput.select()\n }\n NumericCellEditor.prototype.focusOut = function () {}\n return NumericCellEditor\n}\n","var _excluded = [\"title\", \"titleId\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport * as React from \"react\";\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m254.618 188.692c-36.352 0-65.926 29.574-65.926 65.926s29.574 65.926 65.926 65.926 65.926-29.574 65.926-65.926-29.575-65.926-65.926-65.926zm0 101.852c-19.81 0-35.926-16.117-35.926-35.926s16.117-35.926 35.926-35.926 35.926 16.117 35.926 35.926-16.117 35.926-35.926 35.926z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m337.461 154.133c-6.39-5.274-15.845-4.368-21.117 2.021-5.273 6.39-4.368 15.844 2.021 21.117 23.184 19.133 36.48 47.325 36.48 77.347s-13.296 58.214-36.48 77.347c-6.389 5.273-7.294 14.727-2.021 21.117 2.966 3.594 7.255 5.453 11.577 5.453 3.362 0 6.744-1.125 9.54-3.432 30.114-24.852 47.385-61.478 47.385-100.485s-17.271-75.633-47.385-100.485z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m193.236 332.771c-24.688-19.156-38.847-48.038-38.847-79.242 0-30.022 13.296-58.214 36.48-77.347 6.389-5.273 7.294-14.727 2.021-21.117-5.272-6.389-14.727-7.294-21.117-2.021-30.113 24.852-47.384 61.478-47.384 100.485 0 40.542 18.391 78.063 50.457 102.944 2.735 2.122 5.972 3.149 9.185 3.149 4.477 0 8.905-1.995 11.862-5.805 5.077-6.544 3.888-15.967-2.657-21.046z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m431.837 175.578c-10.461-23.763-25.373-44.889-44.32-62.791-6.021-5.689-15.514-5.42-21.205.601-5.689 6.021-5.42 15.515.602 21.205 33.049 31.227 51.25 73.453 51.25 118.9 0 45.929-19.49 90.017-53.473 120.961-6.125 5.578-6.569 15.064-.992 21.19 2.96 3.25 7.02 4.901 11.095 4.901 3.604 0 7.22-1.292 10.095-3.909 40.212-36.616 63.274-88.79 63.274-143.143.001-27.092-5.492-53.306-16.326-77.915z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m147.534 378.073c-35.883-31.113-56.463-76.17-56.463-123.618 0-47.274 20.455-92.223 56.12-123.32 6.244-5.444 6.892-14.919 1.448-21.164-5.444-6.244-14.919-6.893-21.164-1.448-42.201 36.795-66.404 89.986-66.404 145.932 0 56.151 24.351 109.47 66.81 146.284 2.838 2.461 6.337 3.667 9.82 3.667 4.198 0 8.374-1.753 11.339-5.173 5.428-6.259 4.753-15.732-1.506-21.16z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m487.613 151.121c-13.856-31.352-33.599-59.198-58.681-82.764-6.038-5.673-15.531-5.378-21.203.661-5.673 6.037-5.377 15.53.661 21.203 22.138 20.8 39.561 45.371 51.783 73.027 12.648 28.621 19.062 59.137 19.062 90.703 0 31.888-6.541 62.691-19.44 91.553-12.466 27.893-30.213 52.598-52.75 73.43-6.083 5.623-6.456 15.113-.833 21.197 2.957 3.198 6.981 4.818 11.019 4.818 3.642 0 7.293-1.318 10.178-3.985 25.532-23.602 45.643-51.6 59.774-83.218 14.632-32.738 22.051-67.66 22.051-103.794.001-35.77-7.274-70.367-21.621-102.831z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m104.819 421.993c-47.548-42.586-74.819-103.592-74.819-167.375s27.271-124.79 74.819-167.375c6.171-5.527 6.693-15.01 1.167-21.181-5.528-6.171-15.011-6.693-21.181-1.167-53.895 48.27-84.805 117.421-84.805 189.723s30.91 141.453 84.804 189.723c2.863 2.564 6.439 3.826 10.002 3.826 4.116 0 8.216-1.685 11.179-4.993 5.527-6.17 5.005-15.653-1.166-21.181z\"\n}));\nfunction SvgSensor(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n enableBackground: \"new 0 0 509.235 509.235\",\n height: 25,\n viewBox: \"0 0 509.235 509.235\",\n width: 25,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgSensor);\nexport default __webpack_public_path__ + \"static/media/sensor.dab5e5d3.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\r\nimport { Chart, Line } from 'bizcharts'\r\nimport { IHistory } from './Interface'\r\nconst SimpleChart = ({ data }: { data: IHistory[] }) => {\r\n return (\r\n