feat(mqtt): 新增 MQTT 数据源连接与测试发消息支持

This commit is contained in:
Syngnat
2026-06-14 11:38:05 +08:00
parent d805f288ae
commit 0fa8afd517
31 changed files with 1896 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { Alert, Form, Input, Modal, Select, Space, Typography, message } from 'antd';
import { Alert, Checkbox, Form, Input, Modal, Select, Space, Typography, message } from 'antd';
import { DBQuery } from '../../wailsjs/go/app/App';
import type { SavedConnection } from '../types';
@@ -149,6 +149,28 @@ const MessagePublishModal: React.FC<MessagePublishModalProps> = ({
</Form.Item>
)}
{presentation.showQos && (
<Form.Item
label="QoS"
name="qos"
extra="0 为至多一次1 为至少一次2 为仅一次。"
>
<Select
options={[
{ label: '0 · At most once', value: 0 },
{ label: '1 · At least once', value: 1 },
{ label: '2 · Exactly once', value: 2 },
]}
/>
</Form.Item>
)}
{presentation.showRetain && (
<Form.Item name="retain" valuePropName="checked" style={{ marginBottom: 16 }}>
<Checkbox>Retain </Checkbox>
</Form.Item>
)}
{presentation.showKey && (
<Form.Item label="消息 Key可选">
<Space.Compact style={{ width: '100%' }}>