fix(ui): add a warn alert variant and fit org and model forms on phones
This commit is contained in:
1 parent
951acb8088
commit
ffafc3a989
8 files changed
+22
-29
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
import { restartPendingTitles } from "./apply-status";
|
||||
|
||||
@@ -17,14 +18,8 @@ const pending = computed(() =>
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="pending.length"
|
||||
role="status"
|
||||
class="mb-6 rounded-md border border-warn/40 bg-warn-soft px-4 py-3 text-sm"
|
||||
>
|
||||
<p class="font-medium text-warn">Restart pending</p>
|
||||
<p class="mt-0.5 text-fg-muted">
|
||||
{{ pending.join(", ") }}
|
||||
</p>
|
||||
</div>
|
||||
<Alert v-if="pending.length" role="status" variant="warn" class="mb-6">
|
||||
<AlertTitle class="text-warn">Restart pending</AlertTitle>
|
||||
<AlertDescription class="text-fg-muted">{{ pending.join(", ") }}</AlertDescription>
|
||||
</Alert>
|
||||
</template>
|
||||
@@ -162,7 +162,7 @@ function setAllowed(id: string, text: string) {
|
||||
<Section title="Aliases">
|
||||
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias.</p>
|
||||
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<label :for="`alias-${alias}`" class="w-28 text-sm font-medium">{{ alias }}</label>
|
||||
<label :for="`alias-${alias}`" class="w-28 text-sm font-medium max-sm:w-full">{{ alias }}</label>
|
||||
<template v-if="alias === 'embedding'">
|
||||
<Select :model-value="embeddingProvider" @update:model-value="(v) => setEmbedding(String(v), embeddingModel)">
|
||||
<SelectTrigger class="w-44 font-mono" aria-label="Embedding provider"><SelectValue placeholder="unset" /></SelectTrigger>
|
||||
@@ -173,7 +173,7 @@ function setAllowed(id: string, text: string) {
|
||||
<Input
|
||||
:id="`alias-${alias}`"
|
||||
:model-value="embeddingModel"
|
||||
class="max-w-64 font-mono"
|
||||
class="min-w-0 max-w-64 flex-1 font-mono"
|
||||
placeholder="model"
|
||||
:disabled="!embeddingProvider"
|
||||
@update:model-value="(v) => setEmbedding(embeddingProvider, String(v))"
|
||||
@@ -185,7 +185,7 @@ function setAllowed(id: string, text: string) {
|
||||
:id="`alias-${alias}`"
|
||||
:model-value="aliases[alias] ?? ''"
|
||||
list="alias-models"
|
||||
class="max-w-md flex-1 font-mono"
|
||||
class="min-w-0 max-w-md flex-1 font-mono max-sm:max-w-none max-sm:basis-full"
|
||||
placeholder="unset"
|
||||
:aria-invalid="aliasIssue(alias) ? true : undefined"
|
||||
@update:model-value="(v) => setAlias(alias, String(v))"
|
||||
@@ -211,11 +211,11 @@ function setAllowed(id: string, text: string) {
|
||||
</datalist>
|
||||
<Section title="Org access">
|
||||
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<span class="w-28 truncate text-sm font-medium" :title="o.id">{{ o.name }}</span>
|
||||
<span class="w-28 truncate text-sm font-medium max-sm:w-full" :title="o.id">{{ o.name }}</span>
|
||||
<Input
|
||||
:model-value="allowedText(o.id)"
|
||||
list="org-allowed"
|
||||
class="max-w-md flex-1 font-mono"
|
||||
class="min-w-0 max-w-md flex-1 font-mono max-sm:max-w-none max-sm:basis-full"
|
||||
placeholder="no models"
|
||||
:aria-label="`Models ${o.name} may use`"
|
||||
@update:model-value="(v) => setAllowed(o.id, String(v))"
|
||||
|
||||
Reference in new issue
Block a user