|
|
|
@ -94,6 +94,8 @@ const AdvancedSettings = ({ onLogout, locationConfig }) => { |
|
|
|
const mqttClientId = settings.mqttConfig?.mqtt?.client_id ?? ''; |
|
|
|
const mqttUsername = settings.mqttConfig?.mqtt?.username ?? ''; |
|
|
|
const mqttPassword = settings.mqttConfig?.mqtt?.password ?? ''; |
|
|
|
const enableBatch = settings.mqttConfig?.batch ?? false; |
|
|
|
const batchInterpolation = settings.mqttConfig?.interpolation ?? 'copy'; |
|
|
|
|
|
|
|
// 更新本地状态的辅助函数 |
|
|
|
const setDeviceId = (value) => updateLocalSettings({ deviceId: value }); |
|
|
|
@ -207,6 +209,20 @@ const AdvancedSettings = ({ onLogout, locationConfig }) => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const setEnableBatch = (value) => |
|
|
|
updateLocalSettings({ |
|
|
|
mqttConfig: { |
|
|
|
...settings.mqttConfig, |
|
|
|
batch: value |
|
|
|
}, |
|
|
|
}); |
|
|
|
const setBatchInterpolation = (value) => |
|
|
|
updateLocalSettings({ |
|
|
|
mqttConfig: { |
|
|
|
...settings.mqttConfig, |
|
|
|
interpolation: value |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
const [saving, setSaving] = React.useState(false); |
|
|
|
const [captureEditable, setCaptureEditable] = React.useState(false); |
|
|
|
@ -497,16 +513,16 @@ const AdvancedSettings = ({ onLogout, locationConfig }) => { |
|
|
|
<Col span={18}> |
|
|
|
<Slider |
|
|
|
min={1} |
|
|
|
max={30} |
|
|
|
max={50} |
|
|
|
value={fps} |
|
|
|
onChange={setFps} |
|
|
|
marks={{ 1: "1 Hz", 30: "30 Hz" }} |
|
|
|
marks={{ 1: "1 Hz", 50: "50 Hz" }} |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
<Col span={6}> |
|
|
|
<InputNumber |
|
|
|
min={1} |
|
|
|
max={30} |
|
|
|
max={50} |
|
|
|
value={fps} |
|
|
|
onChange={setFps} |
|
|
|
style={{ width: "100%", borderRadius: 8 }} |
|
|
|
@ -515,7 +531,7 @@ const AdvancedSettings = ({ onLogout, locationConfig }) => { |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}> |
|
|
|
有效范围 1~30 Hz |
|
|
|
有效范围 1~50 Hz |
|
|
|
</Text> |
|
|
|
</Card> |
|
|
|
|
|
|
|
@ -807,6 +823,53 @@ const AdvancedSettings = ({ onLogout, locationConfig }) => { |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
|
|
|
|
{/* 每秒批量上报 */} |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
background: |
|
|
|
"linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%)", |
|
|
|
padding: 20, |
|
|
|
borderRadius: 12, |
|
|
|
marginTop: 16, |
|
|
|
}} |
|
|
|
> |
|
|
|
<Row justify="space-between" align="middle"> |
|
|
|
<Col> |
|
|
|
<Text strong>每秒批量上报</Text> |
|
|
|
<br /> |
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}> |
|
|
|
开启后,每秒将多条数据合并为一个数组发送。 |
|
|
|
</Text> |
|
|
|
</Col> |
|
|
|
<Col> |
|
|
|
<Switch |
|
|
|
checked={enableBatch} |
|
|
|
onChange={setEnableBatch} |
|
|
|
checkedChildren="开启" |
|
|
|
unCheckedChildren="关闭" |
|
|
|
disabled={!enableMqtt} |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</div> |
|
|
|
|
|
|
|
{/* 批量补全算法 */} |
|
|
|
<div style={{ marginTop: 16 }}> |
|
|
|
<div style={{ marginBottom: 4, fontWeight: 500 }}> |
|
|
|
批量补全算法 |
|
|
|
</div> |
|
|
|
<Select |
|
|
|
value={batchInterpolation} |
|
|
|
onChange={setBatchInterpolation} |
|
|
|
size="large" |
|
|
|
disabled={!enableMqtt || !enableBatch} |
|
|
|
style={{ width: "50%", borderRadius: 8 }} |
|
|
|
> |
|
|
|
<Option value="copy">分段复制</Option> |
|
|
|
<Option value="lowpass">低通滤波</Option> |
|
|
|
</Select> |
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
|