summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2023-08-01 11:59:10 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-08-09 10:28:01 +0200
commit67fa798dc0541ab3f5bdfe4406c6cbe8d7b725f2 (patch)
tree0c9935117efa0224108a67f90ec1dc54bba52857 /apps
parentf95cf6389541dbd06e129df9655e0ab525940e00 (diff)
downloadnextcloud-server-67fa798dc0541ab3f5bdfe4406c6cbe8d7b725f2.tar.gz
nextcloud-server-67fa798dc0541ab3f5bdfe4406c6cbe8d7b725f2.zip
polish AI admin settings UI
Signed-off-by: Julien Veyssier <julien-nc@posteo.net> (cherry picked from commit 0ace67c762c3c7e8af792bd0635a071269faa4ad)
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/src/components/AdminAI.vue24
1 files changed, 20 insertions, 4 deletions
diff --git a/apps/settings/src/components/AdminAI.vue b/apps/settings/src/components/AdminAI.vue
index 51e5c5cede6..0e969ea58f2 100644
--- a/apps/settings/src/components/AdminAI.vue
+++ b/apps/settings/src/components/AdminAI.vue
@@ -5,8 +5,16 @@
<draggable v-model="settings['ai.translation_provider_preferences']" @change="saveChanges">
<div v-for="(providerClass, i) in settings['ai.translation_provider_preferences']" :key="providerClass" class="draggable__item">
<DragVerticalIcon /> <span class="draggable__number">{{ i + 1 }}</span> {{ translationProviders.find(p => p.class === providerClass)?.name }}
- <NcButton aria-label="Move up" type="tertiary" @click="moveUp(i)"><template #icon><ArrowUpIcon /></template></NcButton>
- <NcButton aria-label="Move down" type="tertiary" @click="moveDown(i)"><template #icon><ArrowDownIcon /></template></NcButton>
+ <NcButton aria-label="Move up" type="tertiary" @click="moveUp(i)">
+ <template #icon>
+ <ArrowUpIcon />
+ </template>
+ </NcButton>
+ <NcButton aria-label="Move down" type="tertiary" @click="moveDown(i)">
+ <template #icon>
+ <ArrowDownIcon />
+ </template>
+ </NcButton>
</div>
</draggable>
</NcSettingsSection>
@@ -22,7 +30,7 @@
{{ provider.name }}
</NcCheckboxRadioSwitch>
</template>
- <template v-if="sttProviders.length === 0">
+ <template v-if="!hasStt">
<NcCheckboxRadioSwitch disabled type="radio">
{{ t('settings', 'None of your currently installed apps provide Speech-To-Text functionality') }}
</NcCheckboxRadioSwitch>
@@ -49,7 +57,7 @@
<p>&nbsp;</p>
</div>
</template>
- <template v-if="Object.keys(settings['ai.textprocessing_provider_preferences']).length === 0 || !Array.isArray(textProcessingTaskTypes)">
+ <template v-if="!hasTextProcessing">
<p>{{ t('settings', 'None of your currently installed apps provide Text processing functionality') }}</p>
</template>
</NcSettingsSection>
@@ -95,6 +103,14 @@ export default {
settings: loadState('settings', 'ai-settings'),
}
},
+ computed: {
+ hasStt() {
+ return this.sttProviders.length > 0
+ },
+ hasTextProcessing() {
+ return Object.keys(this.settings['ai.textprocessing_provider_preferences']).length > 0 && Array.isArray(this.textProcessingTaskTypes)
+ },
+ },
methods: {
moveUp(i) {
this.settings['ai.translation_provider_preferences'].splice(