- Add GET /api/chat/ps and POST /api/chat/warm endpoints for hot model visibility and pre-loading - Extend PATCH /api/chat/conversations/:id to accept model in addition to title - Add ModelSelector component with hot/cold indicators from Ollama /api/ps - Add DashboardChatInput component (model selector + note picker + textarea) replacing the simple "New Chat" button on the dashboard - Add model selector dropdown to ChatView header, persisted per-conversation - Warm default model on dashboard mount via fire-and-forget background task - Configure Ollama with OLLAMA_MAX_LOADED_MODELS=2 and OLLAMA_KEEP_ALIVE=30m - Always-visible edit buttons on NoteCard/TaskCard (remove hover-only behavior) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
103 lines
2.4 KiB
Vue
103 lines
2.4 KiB
Vue
<script setup lang="ts">
|
|
import { useRouter } from "vue-router";
|
|
import type { Note } from "@/types/note";
|
|
import TagPill from "@/components/TagPill.vue";
|
|
import { relativeTime } from "@/composables/useRelativeTime";
|
|
import { renderPreview } from "@/utils/markdown";
|
|
|
|
const props = defineProps<{ note: Note }>();
|
|
const emit = defineEmits<{ "tag-click": [tag: string] }>();
|
|
const router = useRouter();
|
|
|
|
function onTagClick(tag: string) {
|
|
emit("tag-click", tag);
|
|
}
|
|
|
|
function goEdit() {
|
|
router.push(`/notes/${props.note.id}/edit`);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<router-link :to="`/notes/${note.id}`" class="note-card">
|
|
<div class="note-top">
|
|
<h3 class="note-title">{{ note.title || "Untitled" }}</h3>
|
|
<button class="btn-edit" title="Edit" @click.prevent.stop="goEdit">Edit</button>
|
|
</div>
|
|
<div v-if="note.body" class="note-preview prose" v-html="renderPreview(note.body)"></div>
|
|
<div class="note-meta">
|
|
<TagPill
|
|
v-for="tag in note.tags"
|
|
:key="tag"
|
|
:tag="tag"
|
|
@click.stop="onTagClick(tag)"
|
|
/>
|
|
<span class="timestamp">{{ relativeTime(note.updated_at) }}</span>
|
|
</div>
|
|
</router-link>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.note-card {
|
|
display: block;
|
|
padding: 1rem;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
text-decoration: none;
|
|
color: inherit;
|
|
background: var(--color-bg-card);
|
|
transition: box-shadow 0.15s;
|
|
}
|
|
.note-card:hover {
|
|
box-shadow: 0 2px 8px var(--color-shadow);
|
|
}
|
|
.note-top {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 0.5rem;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
.note-title {
|
|
margin: 0;
|
|
font-size: 1.1rem;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.btn-edit {
|
|
flex-shrink: 0;
|
|
padding: 0.25rem 0.6rem;
|
|
font-size: 0.8rem;
|
|
background: var(--color-bg-card);
|
|
color: var(--color-text-secondary);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
|
}
|
|
.btn-edit:hover {
|
|
color: var(--color-primary);
|
|
border-color: var(--color-primary);
|
|
}
|
|
.note-preview {
|
|
margin: 0 0 0.5rem;
|
|
color: var(--color-text-secondary);
|
|
font-size: 0.9rem;
|
|
max-height: 7.5em;
|
|
overflow: hidden;
|
|
}
|
|
.note-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
.timestamp {
|
|
margin-left: auto;
|
|
font-size: 0.75rem;
|
|
color: var(--color-text-muted);
|
|
}
|
|
</style>
|