From 3a49081a0539fe8b9cefef0382e718a7c077caf7 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 8 Feb 2025 18:51:09 +0800 Subject: [PATCH] opt some --- src/client/chat.css | 2 +- src/client/chat.js | 12 ++++++------ usr/local/export/web.chat.macos.desktop/hash.json | 8 ++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/client/chat.css b/src/client/chat.css index 6124755..b8d08c3 100644 --- a/src/client/chat.css +++ b/src/client/chat.css @@ -1,5 +1,5 @@ $content>div.message { padding:20px; overflow:auto; } -$content>div.message>div.request { background-color:#94ec69; padding:10px; float:right; } +$content>div.message>div.request { background-color:#94ec69; color:black; padding:10px; float:right; } $content>div.message>div.request>span { float:right; } $content>div.message>div.response { white-space:break-spaces; padding:0px; clear:both; } $content>div.request { padding:20px; } \ No newline at end of file diff --git a/src/client/chat.js b/src/client/chat.js index d66312b..e68d1c4 100644 --- a/src/client/chat.js +++ b/src/client/chat.js @@ -8,8 +8,8 @@ Volcanos(chat.ONIMPORT, { }, content: function(can, target) { var ui = can.page.Append(can, can.ui.content, [ - {view: chat.MESSAGE, list: [{text: "有什么问题尽管问吧!"}]}, - {view: chat.REQUEST, list: [ + {view: "message", list: [{text: "有什么问题尽管问吧!"}]}, + {view: "request", list: [ {type: html.TEXTAREA, onkeydown: function(event) { if (event.key == code.ENTER) { can.onaction.request(event, can, event.target.value), event.target.value = "", can.onkeymap.prevent(event) @@ -30,9 +30,9 @@ Volcanos(chat.ONIMPORT, { }) Volcanos(chat.ONACTION, { request: function(event, can, text) { - can.page.Append(can, can.ui.message, [{view: chat.REQUEST, list: [{text: text}]}]) - var response = can.page.Append(can, can.ui.message, [{view: chat.RESPONSE}])._target; can.ui.responseList.push(response) + can.page.Append(can, can.ui.message, [{view: "request", list: [{text: text}]}]) + var response = can.page.Append(can, can.ui.message, [{view: "response"}])._target; can.ui.responseList.push(response) can.request(event, {which: ""+can.ui.responseList.length, model: can.db.model}) - can.runAction(event, chat.REQUEST, [text], function(msg) {}) + can.runAction(event, "request", [text], function(msg) {}) }, -}) \ No newline at end of file +}) diff --git a/usr/local/export/web.chat.macos.desktop/hash.json b/usr/local/export/web.chat.macos.desktop/hash.json index 350b04c..f9c8493 100644 --- a/usr/local/export/web.chat.macos.desktop/hash.json +++ b/usr/local/export/web.chat.macos.desktop/hash.json @@ -7,6 +7,14 @@ "time": "2025-02-08 09:20:30.381" } }, + "937681425ca043f9908761fbcdf3c813": { + "meta": { + "icon": "src/main.png", + "index": "web.chat.ollama.chat", + "name": "chat", + "time": "2025-02-08 15:27:08.564" + } + }, "adf694a4d378bcc855218c464fecb7d9": { "meta": { "icon": "usr/icons/Messages.png",