39 lines
1.9 KiB
Vue
39 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
const { pageParams } = useSettings();
|
|
const { providers, unsubscribe: unsubscribeModels } = await useModels();
|
|
|
|
onUnmounted(() => {
|
|
unsubscribeModels?.();
|
|
});
|
|
|
|
defineEmits(['navigate']);
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex flex-col gap-1">
|
|
<button @click="$emit('navigate', 'general')"
|
|
class="flex items-center gap-2 p-2 rounded-lg text-sm hover:bg-[var(--color-highlight)] transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)]">
|
|
<Icon name="mynaui:chevron-left" class="text-4" /> Back to General
|
|
</button>
|
|
|
|
<button @click="$emit('navigate', 'providers')"
|
|
class="flex items-center gap-2 p-2 rounded-lg text-sm hover:bg-[var(--color-highlight)] transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)]">
|
|
<Icon name="mynaui:envelope-open" class="text-4" /> All
|
|
</button>
|
|
|
|
<div class="px-2 py-4 font-bold text-xs uppercase opacity-50">Enabled Providers</div>
|
|
|
|
<button v-for="p in providers?.filter(p => p.enabled)" :key="p.id" @click="$emit('navigate', 'providers', p.id)"
|
|
:class="['flex items-center justify-between p-2 hover:bg-[var(--color-highlight)] transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)] rounded-lg', p.id === pageParams[0] ? 'bg-[var(--color-highlight)]' : '']">
|
|
<span>{{ p.name }}</span>
|
|
</button>
|
|
|
|
<div class="px-2 py-4 font-bold text-xs uppercase opacity-50">Disabled Providers</div>
|
|
|
|
<button v-for="p in providers?.filter(p => !p.enabled)" :key="p.id"
|
|
@click="$emit('navigate', 'providers', p.id)"
|
|
:class="['flex items-center justify-between p-2 hover:bg-[var(--color-highlight)] transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)] rounded-lg', p.id === pageParams[0] ? 'bg-[var(--color-highlight)]' : '']">
|
|
<span>{{ p.name }}</span>
|
|
</button>
|
|
</div>
|
|
</template> |