Skip to content

Commit

Permalink
feat: improve ui and style
Browse files Browse the repository at this point in the history
  • Loading branch information
catpaladin committed Jul 10, 2024
1 parent 1c3e365 commit 731f929
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func getMessagesFromDB(c *gin.Context) {
return
}

parsed = strings.ReplaceAll(parsed, "<pre>", "<div class='card bg-base-100 shadow-xl'><div class='card-body overflow-x-auto'><pre>")
parsed = strings.ReplaceAll(parsed, "<pre>", "<div class='card bg-base-100 shadow-xl'><div class='card-body text-white'><pre>")
parsed = strings.ReplaceAll(parsed, "</pre>", "</pre></div></div>")

chatMessages = append(chatMessages, ChatMessage{
Expand Down
2 changes: 1 addition & 1 deletion app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (mc *ModelConfig) runModel(ctx context.Context) gin.HandlerFunc {
for _, msg := range messages {
parsedHuman, _ := parser.ParseMD(msg.Human)
parsedResponse, _ := parser.ParseMD(msg.Response)
parsedResponse = strings.ReplaceAll(parsedResponse, "<pre>", "<div class='card bg-base-100 shadow-xl'><div class='card-body overflow-x-auto'><pre>")
parsedResponse = strings.ReplaceAll(parsedResponse, "<pre>", "<div class='card bg-base-100 shadow-xl'><div class='card-body text-white'><pre>")
parsedResponse = strings.ReplaceAll(parsedResponse, "</pre>", "</pre></div></div>")
chatMessages = append(chatMessages, ChatMessage{
Human: template.HTML(parsedHuman),
Expand Down
4 changes: 2 additions & 2 deletions templates/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
</div>
<div class="chat-header">You</div>
<div class="chat-bubble" style="max-width: 100%; word-break: break-word;">{{.Human}}</div>
<div class="chat-bubble chat-bubble-accent" style="max-width: 100%; word-break: break-word;">{{.Human}}</div>
</div>
{{end}}
{{if .Response}}
Expand All @@ -19,7 +19,7 @@
</div>
</div>
<div class="chat-header">JennAI</div>
<div class="chat-bubble" style="max-width: 100%; word-break: break-word;">{{.Response}}</div>
<div class="chat-bubble chat-bubble-secondary" style="max-width: 100%; word-break: break-word;">{{.Response}}</div>
<div class="chat-footer opacity-50">{{.Platform}} - {{.Model}}</div>
</div>
{{end}}
Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
</div>

<!-- Messages -->
<div id="htmlOutput" class="flex flex-col flex-grow pl-40 pr-40 mb-20">
<div id="htmlOutput" class="flex flex-col flex-grow justify-center pl-40 pr-40">
<div
id="messages"
class="flex flex-col flex-grow overflow-y-auto border-0 text-gray-100 mb-20"
class="overflow-y-auto border-0 text-gray-100 mb-20"
style="max-height: calc(100vh - 200px);"
>
{{template "chat.html" .}}
Expand Down

0 comments on commit 731f929

Please sign in to comment.