From 08d4f3a854672afe4ac5d27c8aee77688c3e24c4 Mon Sep 17 00:00:00 2001 From: Lu Ken Date: Sun, 29 Dec 2024 11:00:11 +0800 Subject: [PATCH] Agent UI: add the button for copy and delete for agent message Signed-off-by: Lu Ken --- .../src/components/TradingChatAgent.vue | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/GenTradeAgent/src/renderer/src/components/TradingChatAgent.vue b/src/GenTradeAgent/src/renderer/src/components/TradingChatAgent.vue index d3f5b3b..2700ca1 100644 --- a/src/GenTradeAgent/src/renderer/src/components/TradingChatAgent.vue +++ b/src/GenTradeAgent/src/renderer/src/components/TradingChatAgent.vue @@ -2,7 +2,17 @@
- From Agentic Server: +
+ GenAI Output: +
+ + + + + + + +
import { onMounted, ref } from 'vue' -import { NInput, NLog } from 'naive-ui' +import { NInput, NLog, NButton, NSpace, NIcon } from 'naive-ui' +import { Delete20Filled, Copy20Filled } from '@vicons/fluent' const placeholder_output = ref(`Bitcoin, introduced in 2009 by an anonymous entity known as Satoshi Nakamoto, is a decentralized \ @@ -47,15 +58,44 @@ const handleInput = (v: string) => { } + +const onClickCopy = () => { + navigator.clipboard.writeText(placeholder_output.value) +} +const onClickDelete = () => { + placeholder_output.value = '' +} + +const onRemoteSay = (message) => { + placeholder_output.value += '\nGenAI: ' + message +} + +const onUserSay = (message) => { + placeholder_output.value += '\nUser: ' + message +} + +const onTimerOutput = () => { + onRemoteSay('hello') + onUserSay('how are you') + setTimeout(onTimerOutput, 1000) +} +onTimerOutput()