feat: 增加服务器信息导入、导出功能
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user