From c09ca83053c68e101650555407f5509d6b874d14 Mon Sep 17 00:00:00 2001
From: Jana Peper <jana.peper@nextcloud.com>
Date: Fri, 6 Dec 2024 11:35:54 +0100
Subject: feat: add switch in frontend

Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
---
 apps/settings/src/components/AdminAI.vue | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'apps/settings/src/components/AdminAI.vue')

diff --git a/apps/settings/src/components/AdminAI.vue b/apps/settings/src/components/AdminAI.vue
index 557b4e23067..df53d88c85e 100644
--- a/apps/settings/src/components/AdminAI.vue
+++ b/apps/settings/src/components/AdminAI.vue
@@ -10,10 +10,14 @@
 				<div :key="type">
 					<h3>{{ t('settings', 'Task:') }} {{ type.name }}</h3>
 					<p>{{ type.description }}</p>
-					<p>&nbsp;</p>
+					<NcCheckboxRadioSwitch type="switch"
+						v-model="taskEnabled" >
+						{{ t('settings', 'Enable') }}
+					</NcCheckboxRadioSwitch>
 					<NcSelect v-model="settings['ai.taskprocessing_provider_preferences'][type.id]"
 						class="provider-select"
 						:clearable="false"
+						:disabled="!taskEnabled"
 						:options="taskProcessingProviders.filter(p => p.taskType === type.id).map(p => p.id)"
 						@input="saveChanges">
 						<template #option="{label}">
@@ -142,6 +146,7 @@ export default {
 			taskProcessingProviders: loadState('settings', 'ai-task-processing-providers'),
 			taskProcessingTaskTypes: loadState('settings', 'ai-task-processing-task-types'),
 			settings: loadState('settings', 'ai-settings'),
+			taskEnabled: true,
 		}
 	},
 	computed: {
-- 
cgit v1.2.3

