From 9901068ac78838745e604fffb4601d315a610456 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Fri, 15 Nov 2024 05:48:49 -0400 Subject: [PATCH] server : (web UI) add copy button for code block, fix api key (#10242) * server : (web ui) add copy btn for code blocks * fix problem with api key * use settings-modal-short-input component * always show copy btn for code snippet --- examples/server/public/index.html | 62 +++++++++++++++++++++---------- examples/server/server.cpp | 42 +++++++++++++-------- 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 55639a944..65a915d59 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -12,7 +12,7 @@ .markdown { h1, h2, h3, h4, h5, h6, ul, ol, li { all: revert; } pre { - @apply whitespace-pre-wrap my-4 rounded-lg p-2; + @apply whitespace-pre-wrap rounded-lg p-2; border: 1px solid currentColor; } /* TODO: fix markdown table */ @@ -25,8 +25,11 @@ .bg-base-200 {background-color: var(--fallback-b2,oklch(var(--b2)/1))} .bg-base-300 {background-color: var(--fallback-b3,oklch(var(--b3)/1))} .text-base-content {color: var(--fallback-bc,oklch(var(--bc)/1))} + .show-on-hover { + @apply opacity-0 group-hover:opacity-100; + } .btn-mini { - @apply cursor-pointer opacity-0 group-hover:opacity-100 hover:shadow-md; + @apply cursor-pointer hover:shadow-md; } .chat-screen { max-width: 900px; } /* because the default bubble color is quite dark, we will make a custom one using bg-base-300 */ @@ -152,14 +155,14 @@
- - -
@@ -196,12 +199,13 @@

Settings

Settings below are saved in browser's localStorage

+ @@ -209,7 +213,7 @@ Other sampler settings
@@ -218,7 +222,7 @@ Penalties settings
@@ -245,7 +249,7 @@
-