fix telemetryView

This commit is contained in:
Фролов 2021-07-27 12:08:11 +05:00
parent f50855d179
commit 0aec1b7379
2 changed files with 32 additions and 21327 deletions

21347
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -202,17 +202,17 @@ const timePeriodCollection = [
{value: '86400', label: '24 часа'}
]
const defaultChartInterval = '600'
export default function TelemetryView(props) {
let {id} = useParams()
const [saubData, setSaubData] = useState([])
const [chartInterval, setChartInterval] = useState(defaultInterval)
const [chartInterval, setChartInterval] = useState(defaultChartInterval)
const [messages, setMessages] = useState([])
const [loader, setLoader] = useState(false)
const periods = intervalSteps.map((line) => <Option key={line.value} value={line.value}>{line.label}</Option>)
const children = timePeriodCollection.map((line) => <Option key={line.value}>{line.label}</Option>)
const options = timePeriodCollection.map((line) => <Option key={line.value}>{line.label}</Option>)
const handleReceiveDataSaub = (data) => {
if (data) {
@ -270,8 +270,8 @@ export default function TelemetryView(props) {
<span style={{flexGrow: 0.1}}>&nbsp;</span>
<Col>
Интервал:&nbsp;
<Select defaultValue="600" onChange={setChartInterval}>
{children}
<Select defaultValue={defaultChartInterval} onChange={setChartInterval}>
{options}
</Select>
</Col>
<span style={{flexGrow: 1}}>&nbsp;</span>