Skip to content

Commit 116fc4e

Browse files
committed
hide buttons in dropdown menu
1 parent 3e0ba0e commit 116fc4e

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,10 @@ clean:
11471147
rm -rvf *.a *.dll *.so *.dot
11481148
find ggml src common tests examples pocs -type f -name "*.o" -delete
11491149
find ggml src common tests examples pocs -type f -name "*.d" -delete
1150+
find examples/server -type f -name "*.js.hpp" -delete
1151+
find examples/server -type f -name "*.mjs.hpp" -delete
1152+
find examples/server -type f -name "*.css.hpp" -delete
1153+
find examples/server -type f -name "*.html.hpp" -delete
11501154

11511155
#
11521156
# Examples

examples/server/public/index.html

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
.bg-base-200 {background-color: var(--fallback-b2,oklch(var(--b2)/1))}
2626
.bg-base-300 {background-color: var(--fallback-b3,oklch(var(--b3)/1))}
2727
.text-base-content {color: var(--fallback-bc,oklch(var(--bc)/1))}
28+
.text-error {color: var(--fallback-er,oklch(var(--er)/1))}
29+
.menu > li {
30+
border-radius: var(--rounded-btn, .5rem);
31+
@apply cursor-pointer;
32+
&:hover {background-color: var(--fallback-b3,oklch(var(--b3)/1))}
33+
}
2834
.show-on-hover {
2935
@apply opacity-0 group-hover:opacity-100;
3036
}
@@ -69,25 +75,24 @@ <h2 class="font-bold mb-4 ml-4">Conversations</h2>
6975
<!-- header -->
7076
<div class="flex flex-row items-center">
7177
<div class="grow text-2xl font-bold mt-8 mb-6">
72-
🦙 llama.cpp - chat
78+
🦙 llama.cpp
7379
</div>
7480

7581
<!-- action buttons (top right) -->
7682
<div class="flex items-center">
77-
<button v-if="messages.length > 0" class="btn mr-1" @click="deleteConv(viewingConvId)" :disabled="isGenerating">
78-
<!-- delete conversation button -->
79-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
80-
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/>
81-
<path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/>
82-
</svg>
83-
</button>
84-
<button v-if="messages.length > 0" class="btn mr-1" @click="downloadConv(viewingConvId)" :disabled="isGenerating">
85-
<!-- download conversation button -->
86-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-download" viewBox="0 0 16 16">
87-
<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5"/>
88-
<path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708z"/>
89-
</svg>
90-
</button>
83+
<div v-if="messages.length > 0" class="dropdown dropdown-end">
84+
<!-- "more" button -->
85+
<div tabindex="0" role="button" class="btn m-1">
86+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
87+
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"/>
88+
</svg>
89+
</div>
90+
<!-- "more" dropdown menu -->
91+
<ul tabindex="0" class="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow">
92+
<li @click="downloadConv(viewingConvId)" :disabled="isGenerating"><a>Download</a></li>
93+
<li class="text-error" @click="deleteConv(viewingConvId)" :disabled="isGenerating"><a>Delete</a></li>
94+
</ul>
95+
</div>
9196
<button class="btn" @click="showConfigDialog = true" :disabled="isGenerating">
9297
<!-- edit config button -->
9398
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
@@ -161,7 +166,7 @@ <h2 class="font-bold mb-4 ml-4">Conversations</h2>
161166
<!-- actions for each message -->
162167
<div :class="{'text-right': msg.role === 'user'}" class="mx-4 mt-2 mb-2">
163168
<!-- user message -->
164-
<button v-if="msg.role === 'user'" class="badge btn-minishow-on-hover " @click="editingMsg = msg" :disabled="isGenerating">
169+
<button v-if="msg.role === 'user'" class="badge btn-mini show-on-hover" @click="editingMsg = msg" :disabled="isGenerating">
165170
✍️ Edit
166171
</button>
167172
<!-- assistant message -->

0 commit comments

Comments
 (0)