From 16f25663a39d5e14527d28449c5a7ee3a4efc6a1 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 12 Nov 2024 14:20:49 -0600 Subject: [PATCH] move mongo to settings --- src/lib/services/agent-service.js | 4 +- src/routes/page/mongodb/+page.svelte | 2 +- src/routes/page/setting/+page.svelte | 99 +++++++++++++++++++++++----- 3 files changed, 85 insertions(+), 20 deletions(-) diff --git a/src/lib/services/agent-service.js b/src/lib/services/agent-service.js index 73193ca..bd121bb 100644 --- a/src/lib/services/agent-service.js +++ b/src/lib/services/agent-service.js @@ -63,10 +63,12 @@ export async function deleteAgent(agentId) { /** * Refresh agent data + * @returns {Promise} */ export async function refreshAgents() { const url = endpoints.agentRefreshUrl; - await axios.post(url); + const response = await axios.post(url); + return response.data; } /** diff --git a/src/routes/page/mongodb/+page.svelte b/src/routes/page/mongodb/+page.svelte index 8bfa50d..979a1d3 100644 --- a/src/routes/page/mongodb/+page.svelte +++ b/src/routes/page/mongodb/+page.svelte @@ -5,7 +5,7 @@ import { refreshAgents } from '$lib/services/agent-service'; import LoadingToComplete from '$lib/common/LoadingToComplete.svelte'; import { _ } from 'svelte-i18n'; - import Swal from 'sweetalert2' + import Swal from 'sweetalert2'; let isLoading = false; let isComplete = false; diff --git a/src/routes/page/setting/+page.svelte b/src/routes/page/setting/+page.svelte index 4dde1ba..b797bab 100644 --- a/src/routes/page/setting/+page.svelte +++ b/src/routes/page/setting/+page.svelte @@ -1,7 +1,7 @@ - + @@ -62,7 +113,7 @@ handleGetSettingDetail(tab)} - active={customActiveTab == tab} + active={selectedTab == tab} > @@ -73,14 +124,14 @@ {/each} - + {#each settings as tab} - +
- { return true;}}/> +
@@ -91,6 +142,18 @@
+ + + + {$_('Migrate agents from file repository to MongoDB')} +

+ + +
+
+