Files
embedd-hub/resources/views/pages/embeddings/partials/navigation.blade.php

44 lines
2.1 KiB
PHP

<header class="flex flex-col gap-4">
<div class="flex flex-col justify-between gap-3 sm:flex-row sm:items-end">
<div>
<flux:heading>{{ $heading }}</flux:heading>
</div>
<div class="flex flex-wrap gap-2">
<flux:badge :color="$ollamaAvailable ? 'emerald' : 'red'" :icon="$ollamaAvailable ? 'check-circle' : 'x-circle'">
{{ $ollamaAvailable ? __('Ollama online') : __('Ollama offline') }}
</flux:badge>
<flux:badge icon="cpu-chip">{{ $providerSummary }}</flux:badge>
<flux:badge icon="circle-stack">{{ __(':count stored', ['count' => $storedCount]) }}</flux:badge>
</div>
</div>
<div class="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-end">
<div class="w-full max-w-sm">
<flux:select wire:model="embeddingModel" :label="__('Ollama model')" :disabled="! $ollamaAvailable">
@forelse ($modelOptions as $option)
<flux:select.option value="{{ $option['name'] }}">
{{ $option['name'] }} ({{ $option['dimensions'] }}d)
</flux:select.option>
@empty
<flux:select.option value="" disabled>{{ __('No models returned') }}</flux:select.option>
@endforelse
</flux:select>
<flux:error name="embeddingModel" />
</div>
<flux:button type="button" variant="filled" icon="arrow-path" wire:click="refreshOllama" class="w-full lg:w-auto data-loading:opacity-60">
<span wire:loading.remove wire:target="refreshOllama">{{ __('Refresh') }}</span>
<span wire:loading wire:target="refreshOllama">{{ __('Checking') }}</span>
</flux:button>
</div>
@if (! $ollamaAvailable)
<flux:callout variant="danger" icon="x-circle" :heading="__('Ollama is unavailable')" :text="$ollamaStatusMessage" />
@endif
@if (! $databaseReady)
<flux:callout variant="warning" icon="exclamation-circle" :heading="__('Embedding storage is unavailable')" :text="__('Embedding storage is waiting for the pgvector migration.')" />
@endif
</header>