aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2023-08-01 11:59:10 +0200
committerJulien Veyssier <julien-nc@posteo.net>2023-08-02 12:37:36 +0200
commit0ace67c762c3c7e8af792bd0635a071269faa4ad (patch)
tree56d48659d513e2fc8774546feb81f933bb62652e /apps/settings
parent601679bd25d409ae9303fc1fe2f477f3667545f3 (diff)
downloadnextcloud-server-0ace67c762c3c7e8af792bd0635a071269faa4ad.tar.gz
nextcloud-server-0ace67c762c3c7e8af792bd0635a071269faa4ad.zip
polish AI admin settings UI
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'apps/settings')
-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(