From c285e37678b402f6cad9ed983e676c1ff4946d71 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 14 Oct 2024 15:39:28 +0200 Subject: [PATCH] feature completed Issue #610 --- .../resources/bundle/messages_de.properties | 3 + .../resources/bundle/messages_en.properties | 3 + .../webapp/layout/css/office-theme-ai.css | 59 +++++++++++++++ .../webapp/pages/workitems/workitem_ai.xhtml | 40 ++++++++--- .../workflow/office/forms/AIController.java | 72 +++++++++++++------ .../office/forms/ChildItemController.java | 69 ++++++++++-------- 6 files changed, 185 insertions(+), 61 deletions(-) diff --git a/imixs-office-workflow-app/src/main/resources/bundle/messages_de.properties b/imixs-office-workflow-app/src/main/resources/bundle/messages_de.properties index 0e6dbe79..3fd92f0e 100644 --- a/imixs-office-workflow-app/src/main/resources/bundle/messages_de.properties +++ b/imixs-office-workflow-app/src/main/resources/bundle/messages_de.properties @@ -150,6 +150,9 @@ type=Typ summary=Zusammenfassung ai=KI ai.prompt=Wie kann ich Ihnen helfen? +ai.question=Frage +ai.answer=Antwort +ai.ask_question=Frage stellen... #################### # Month diff --git a/imixs-office-workflow-app/src/main/resources/bundle/messages_en.properties b/imixs-office-workflow-app/src/main/resources/bundle/messages_en.properties index 36a32570..8c91437d 100644 --- a/imixs-office-workflow-app/src/main/resources/bundle/messages_en.properties +++ b/imixs-office-workflow-app/src/main/resources/bundle/messages_en.properties @@ -150,6 +150,9 @@ type=Type summary=Summary ai=AI ai.prompt=How can I help you? +ai.question=Question +ai.answer=Answer +ai.ask_question=Ask question... #################### # Month diff --git a/imixs-office-workflow-app/src/main/webapp/layout/css/office-theme-ai.css b/imixs-office-workflow-app/src/main/webapp/layout/css/office-theme-ai.css index b7507d50..2ad40293 100644 --- a/imixs-office-workflow-app/src/main/webapp/layout/css/office-theme-ai.css +++ b/imixs-office-workflow-app/src/main/webapp/layout/css/office-theme-ai.css @@ -41,7 +41,66 @@ } +.imixs-ai-chat-history { + display: flex; + flex-direction: column; + gap: 20px; + max-width: 800px; + margin: 0 auto; +} + +.imixs-ai-chat-entry { + display: flex; + flex-direction: column; + border: 1px solid #e0e0e0; + border-radius: 8px; + overflow: hidden; +} + +.imixs-ai-chat-header { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #f5f5f5; + padding: 10px 15px; + font-size: 0.9em; + color: #555; +} + +.imixs-ai-chat-content { + display: flex; + flex-direction: column; + padding: 15px; + gap: 10px; +} + +.imixs-ai-question, +.imixs-ai-answer { + display: flex; + flex-direction: column; +} + +.imixs-ai-label { + font-weight: bold; + margin-bottom: 5px; +} + +.imixs-ai-message { + background-color: #fff; + border-radius: 4px; + padding: 10px; + white-space: pre-wrap; + word-wrap: break-word; + overflow-x: auto; +} + +.user-question .imixs-ai-message { + background-color: #e6f3ff; +} +.imixs-ai-answer .message { + background-color: #f0f0f0; +} .imixs-ai-loader { border: 6px solid #f3f3f3; diff --git a/imixs-office-workflow-app/src/main/webapp/pages/workitems/workitem_ai.xhtml b/imixs-office-workflow-app/src/main/webapp/pages/workitems/workitem_ai.xhtml index b2e02d17..8405d059 100644 --- a/imixs-office-workflow-app/src/main/webapp/pages/workitems/workitem_ai.xhtml +++ b/imixs-office-workflow-app/src/main/webapp/pages/workitems/workitem_ai.xhtml @@ -6,12 +6,11 @@
-
- +
@@ -25,34 +24,53 @@ - - - #{aiResultEntry} -
+ +
+ + +
+
+ + + + #{userController.getUserName(aiChatHistoryEntry.item['user'])} +
+
+
+ #{message['ai.question']}: +
#{aiChatHistoryEntry.item['question']}
+
+
+ #{message['ai.answer']}: +
#{aiChatHistoryEntry.item['answer']}
+
+
+
- +