diff --git a/src/main/front/src/components/AgentConfigView.vue b/src/main/front/src/components/AgentConfigView.vue index 6e0a4f2..d0a30b1 100644 --- a/src/main/front/src/components/AgentConfigView.vue +++ b/src/main/front/src/components/AgentConfigView.vue @@ -117,7 +117,42 @@ function configReload() { } // agentConfig의 내용을 json 파일로 다운로드 -function configExport() {} +function configExport() { + const configCopy = JSON.parse(JSON.stringify(agentConfig)) + if (Array.isArray(configCopy.knownAgentList)) { + configCopy.knownAgentList.forEach((item) => { + delete item.selected + delete item.added + }) + } + if (Array.isArray(configCopy.dataSourceConfig)) { + configCopy.dataSourceConfig.forEach((item) => { + delete item.selected + delete item.added + }) + } + if (configCopy.dropBoxConfig && Array.isArray(configCopy.dropBoxConfig.dropBoxList)) { + configCopy.dropBoxConfig.dropBoxList.forEach((item) => { + delete item.selected + delete item.added + }) + } + if (configCopy.postmanConfig && Array.isArray(configCopy.postmanConfig.postmanList)) { + configCopy.postmanConfig.postmanList.forEach((item) => { + delete item.selected + delete item.added + }) + } + const configString = JSON.stringify(configCopy, null, 2) + const blob = new Blob([configString], { type: 'application/json' }) + const url = URL.createObjectURL(blob) + const a = document.createElement('a') + a.href = url + a.download = 'settings.json' + document.body.append(a) + a.click() + URL.revokeObjectURL(url) +} // agentConfig의 내용을 서버에 전송하여 저장 function configSave() {} @@ -272,6 +307,9 @@ defineExpose({