From 4f822878f747168b025f5fff6621a689e278bbc8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 13 Dec 2021 22:50:16 +0000 Subject: [PATCH] sorting fixes #857 --- web/src/composables/checks.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/composables/checks.js b/web/src/composables/checks.js index fda1c7eb..5bbc68b4 100644 --- a/web/src/composables/checks.js +++ b/web/src/composables/checks.js @@ -65,7 +65,9 @@ export function useCheckModal({ editCheck, initialState }) { async function getAgentServiceOptions() { const { services } = await fetchAgent(check.value.agent) - serviceOptions.value = Object.freeze(services.map(service => ({ label: service.display_name, value: service.name }))) + + const tmp = services.map(service => ({ label: service.display_name, value: service.name })) + serviceOptions.value = Object.freeze(tmp.sort((a, b) => a.label.localeCompare(b.label))) check.value.svc_name = serviceOptions.value[0].value check.value.svc_display_name = serviceOptions.value[0].label } @@ -1194,4 +1196,4 @@ export const defaultServiceOptions = [ value: "tacticalagent", label: "Tactical RMM Agent" } -] \ No newline at end of file +].sort((a, b) => a.label.localeCompare(b.label)) \ No newline at end of file