feat: 增加服务器信息导入、导出功能

This commit is contained in:
2026-07-19 20:00:33 +08:00
parent 2682c0a1d6
commit 21683cb790
5 changed files with 182 additions and 29 deletions
+16
View File
@@ -161,6 +161,20 @@ export function useMqttStore() {
}
async function exportServers() {
return await window.api.exportServers();
}
async function importServers(serverList) {
let data = await window.api.importServers(serverList);
servers.value = data;
sortServers();
if (servers.value.length > 0 && !activeServerId.value) {
activeServerId.value = servers.value[0].id;
}
return data;
}
async function connectServer(id) {
return await window.api.connect(id);
}
@@ -273,6 +287,8 @@ export function useMqttStore() {
addServer,
updateServer,
deleteServer,
exportServers,
importServers,
connectServer,
disconnectServer,
addTopic,