Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix h2 and checkbox info style in the admin settings #181

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(settings): fix h2 and checkbox info style
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
  • Loading branch information
julien-nc committed Jan 24, 2025
commit a9a57feef2d68d7b1b5e27b65be3863a6f0816e8
100 changes: 48 additions & 52 deletions src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,68 @@
@update:checked="onCheckboxChanged($event, 'assistant_enabled')">
<div class="checkbox-text">
{{ t('assistant', 'Top-right assistant') }}
<div v-if="!state.text_processing_available" class="checkbox-text">
<InformationOutlineIcon class="icon" />
<span>
{{ t('assistant', 'To be able to use this feature, please install at least one AI text processing provider.') }}
</span>
</div>
</div>
</NcCheckboxRadioSwitch>
<NcNoteCard v-if="!state.text_processing_available" type="info">
{{ t('assistant', 'To be able to use this feature, please install at least one AI task processing provider.') }}
</NcNoteCard>
<NcCheckboxRadioSwitch
:checked="state.free_prompt_picker_enabled"
:disabled="!state.free_prompt_task_type_available"
@update:checked="onCheckboxChanged($event, 'free_prompt_picker_enabled')">
<div class="checkbox-text">
{{ t('assistant', 'AI text generation smart picker') }}
<div v-if="!state.free_prompt_task_type_available" class="checkbox-text">
<InformationOutlineIcon class="icon" />
<span>
{{ t('assistant', 'To enable this feature, please install an AI text processing provider for the free prompt task type:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/llm2#readme">Local Large language model app</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</div>
</NcCheckboxRadioSwitch>
<NcNoteCard v-if="!state.free_prompt_task_type_available" type="info">
<div class="checkbox-text">
<span>
{{ t('assistant', 'To enable this feature, please install an AI task processing provider for the free prompt task type:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/llm2#readme">Local Large language model app</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</NcNoteCard>
<NcCheckboxRadioSwitch
:checked="state.text_to_image_picker_enabled"
:disabled="!state.text_to_image_picker_available"
@update:checked="onCheckboxChanged($event, 'text_to_image_picker_enabled')">
<div class="checkbox-text">
{{ t('assistant', 'Text-to-image smart picker') }}
<div v-if="!state.text_to_image_picker_available" class="checkbox-text">
<InformationOutlineIcon class="icon" />
<span>
{{ t('assistant', 'To enable this feature, please install a text-to-image provider:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/text2image_stablediffusion#readme">Local Text-To-Image StableDiffusion</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</div>
</NcCheckboxRadioSwitch>
<NcNoteCard v-if="!state.text_to_image_picker_available" type="info">
<div class="checkbox-text">
<span>
{{ t('assistant', 'To enable this feature, please install a text-to-image provider:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/text2image_stablediffusion#readme">Local Text-To-Image StableDiffusion</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</NcNoteCard>
<NcCheckboxRadioSwitch
:checked="state.speech_to_text_picker_enabled"
:disabled="!state.speech_to_text_picker_available"
@update:checked="onCheckboxChanged($event, 'speech_to_text_picker_enabled')">
<div class="checkbox-text">
{{ t('assistant', 'Speech-to-text smart picker') }}
<div v-if="!state.speech_to_text_picker_available" class="checkbox-text">
<InformationOutlineIcon class="icon" />
<span>
{{ t('assistant', 'To enable this feature, please install a speech-to-text provider:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/stt_whisper2#readme">Local Speech-To-Text Whisper</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</div>
</NcCheckboxRadioSwitch>
<NcNoteCard v-if="!state.speech_to_text_picker_available" type="info">
<div class="checkbox-text">
<span>
{{ t('assistant', 'To enable this feature, please install a speech-to-text provider:') }}
</span>
<ul>
<li><a href="https://github.com/nextcloud/stt_whisper2#readme">Local Speech-To-Text Whisper</a></li>
<li><a href="https://apps.nextcloud.com/apps/integration_openai">OpenAI/LocalAI Integration</a></li>
</ul>
</div>
</NcNoteCard>
</div>
<div class="chat-with-ai">
<h2>
Expand Down Expand Up @@ -145,7 +145,6 @@
</template>

<script>
import InformationOutlineIcon from 'vue-material-design-icons/InformationOutline.vue'
import AssistantIcon from './icons/AssistantIcon.vue'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
Expand All @@ -169,7 +168,6 @@ export default {
NcNoteCard,
NcRichContenteditable,
NcTextField,
InformationOutlineIcon,
},

data() {
Expand Down Expand Up @@ -224,7 +222,6 @@ export default {

<style scoped lang="scss">
#assistant_prefs {
h2,
.line,
.settings-hint {
display: flex;
Expand All @@ -237,16 +234,15 @@ export default {

.checkbox-text {
display: flex;
flex-direction: row;

.icon {
margin-right: 8px;
margin-left: 24px;
}
flex-direction: column;
}

h2 .icon {
margin-right: 8px;
h2 {
justify-content: start;
display: flex;
align-items: center;
gap: 8px;
margin-top: 8px;
}

.line {
Expand All @@ -264,6 +260,11 @@ export default {
}
}

.notecard,
.text-field {
max-width: 900px;
}

.chat-with-ai {
display: flex;
flex-direction: column;
Expand All @@ -272,11 +273,6 @@ export default {
width: 900px !important;
font-weight: bold;
}

.notecard,
.text-field {
max-width: 900px;
}
}
}
</style>
Loading