diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-10-26 15:53:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 15:53:30 +0200 |
commit | 2b7f78fc2e9a5a031ffc04ba7f08885fb8a73cc9 (patch) | |
tree | ea9e8d782c4844f33e977e84b9a1ad6eba27db3d /apps/settings/src | |
parent | e98be0a14753d6ddcc1f6123feb4c425549de41f (diff) | |
parent | cef069e8f28f5703688103a13f3d523dc1bb5756 (diff) | |
download | nextcloud-server-2b7f78fc2e9a5a031ffc04ba7f08885fb8a73cc9.tar.gz nextcloud-server-2b7f78fc2e9a5a031ffc04ba7f08885fb8a73cc9.zip |
Merge pull request #40326 from nextcloud/enh/text-to-image-api
Implement TextToImage OCP API
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/AdminAI.vue | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/apps/settings/src/components/AdminAI.vue b/apps/settings/src/components/AdminAI.vue index 6a8b73d81f3..6a3f30451e9 100644 --- a/apps/settings/src/components/AdminAI.vue +++ b/apps/settings/src/components/AdminAI.vue @@ -36,6 +36,24 @@ </NcCheckboxRadioSwitch> </template> </NcSettingsSection> + <NcSettingsSection :name="t('settings', 'Image generation')" + :description="t('settings', 'Image generation can be implemented by different apps. Here you can set which app should be used.')"> + <template v-for="provider in text2imageProviders"> + <NcCheckboxRadioSwitch :key="provider.id" + :checked.sync="settings['ai.text2image_provider']" + :value="provider.id" + name="text2image_provider" + type="radio" + @update:checked="saveChanges"> + {{ provider.name }} + </NcCheckboxRadioSwitch> + </template> + <template v-if="!hasText2ImageProviders"> + <NcCheckboxRadioSwitch disabled type="radio"> + {{ t('settings', 'None of your currently installed apps provide image generation functionality') }} + </NcCheckboxRadioSwitch> + </template> + </NcSettingsSection> <NcSettingsSection :name="t('settings', 'Text processing')" :description="t('settings', 'Text processing tasks can be implemented by different apps. Here you can set which app should be used for which task.')"> <template v-for="type in tpTaskTypes"> @@ -88,7 +106,7 @@ export default { DragVerticalIcon, ArrowDownIcon, ArrowUpIcon, - NcButton + NcButton, }, data() { return { @@ -100,6 +118,7 @@ export default { translationProviders: loadState('settings', 'ai-translation-providers'), textProcessingProviders: loadState('settings', 'ai-text-processing-providers'), textProcessingTaskTypes: loadState('settings', 'ai-text-processing-task-types'), + text2imageProviders: loadState('settings', 'ai-text2image-providers'), settings: loadState('settings', 'ai-settings'), } }, @@ -113,13 +132,16 @@ export default { tpTaskTypes() { return Object.keys(this.settings['ai.textprocessing_provider_preferences']).filter(type => !!this.getTaskType(type)) }, + hasText2ImageProviders() { + return this.text2imageProviders.length > 0 + }, }, methods: { moveUp(i) { this.settings['ai.translation_provider_preferences'].splice( Math.min(i - 1, 0), 0, - ...this.settings['ai.translation_provider_preferences'].splice(i, 1) + ...this.settings['ai.translation_provider_preferences'].splice(i, 1), ) this.saveChanges() }, @@ -127,7 +149,7 @@ export default { this.settings['ai.translation_provider_preferences'].splice( i + 1, 0, - ...this.settings['ai.translation_provider_preferences'].splice(i, 1) + ...this.settings['ai.translation_provider_preferences'].splice(i, 1), ) this.saveChanges() }, |