import React from 'react'; const Settings = () => { const handleExport = async () => { if (window.electronAPI) { const servers = await window.electronAPI.loadServers(); const passwords = await window.electronAPI.loadPasswords(); const templates = await window.electronAPI.loadCommandTemplates(); const data = { servers: servers.success ? servers.servers : [], passwords: passwords.success ? passwords.passwords : [], templates: templates.success ? templates.templates : [], exportDate: new Date().toISOString() }; const result = await window.electronAPI.exportData(data); if (result.success) { alert('Данные успешно экспортированы!'); } else { alert(`Ошибка экспорта: ${result.error}`); } } }; const handleImport = async () => { if (window.electronAPI) { const result = await window.electronAPI.importData(); if (result.success) { const data = result.data; if (data.servers) { await window.electronAPI.saveServers(data.servers); } if (data.passwords) { await window.electronAPI.savePasswords(data.passwords); } if (data.templates) { await window.electronAPI.saveCommandTemplates(data.templates); } alert('Данные успешно импортированы! Перезагрузите приложение.'); } else { alert(`Ошибка импорта: ${result.error}`); } } }; return (
Управление данными приложения
Сохраните все данные в файл для резервного копирования
Восстановите данные из ранее созданного файла