当前位置: 首页 > news >正文

chili3d调试6 添加左侧面板

注释前

一个一个注释看对应哪个窗口

无事发生     子方法不是显示的窗口

注释掉看看

没了

注释这个看看

零件页面没了

这个浏览器居然完全不用关的,刷新就重载了

注释看看

无工具栏版本

sidebar:

往框框里面加入 div({ className: style.input }, user_say_input), div( { className: style.buttons }, button({ textContent: I18n.translate("common.confirm"), onclick: async () => { try { // 动态获取输入框的值 let response: string = await send_to_llm(user_say_input.value); // 将 response 解析为 JSON 对象 const jsonResponse = JSON.parse(response); let content_response: string = jsonResponse.choices[0].message.content; Logger.info(content_response); // 将 content_response 赋值给 label resultLabel.textContent = content_response; } catch (error) { Logger.error("Failed to parse response as JSON:", error); } }, }), ), // 添加结果显示区域 div({ className: style.result }, resultLabel),

我这些文本框不在他原来的白色框框里面

改了这个框框都没了

 

// Part of the Chili3d Project, under the AGPL-3.0 License.
// See LICENSE file in the project root for full license information.import { IDocument, Logger } from "chili-core";
import { button, div, input, span } from "../components";
import style from "./projectView.module.css";
import { send_to_llm } from "./send_to_llm";
export class njsgcs_ProjectView extends HTMLElement {private _activeDocument: IDocument | undefined;get activeDocument() {return this._activeDocument;}private readonly panel: HTMLDivElement;constructor(props: { className: string }) {super();this.classList.add(style.root, props.className);this.panel = div({className: style.itemsPanel,});this.render();}private render() {const user_say_input = input({type: "text",id: "njsgcs_test_input",onkeydown: (e: KeyboardEvent) => {e.stopPropagation();},});const resultLabel = document.createElement("label");resultLabel.className = style.resultLabel;this.panel.append(div({ className: style.headerPanel },span({className: style.header,textContent: "njsgcs sidebar",}),),div({ className: style.input }, user_say_input),div({ className: style.buttons },button({textContent: "发送",onclick: async () => {try {// 动态获取输入框的值let response: string = await send_to_llm(user_say_input.value);// 将 response 解析为 JSON 对象const jsonResponse = JSON.parse(response);let content_response: string = jsonResponse.choices[0].message.content;Logger.info(content_response);// 将 content_response 赋值给 labelresultLabel.textContent = content_response;} catch (error) {Logger.error("Failed to parse response as JSON:", error);}},}),),// 添加结果显示区域div({ className: style.result }, resultLabel),);// 确保 this.panel 被添加到当前的 HTMLElement 中this.appendChild(this.panel);}
}customElements.define("chili-project-njsgcs_view", njsgcs_ProjectView);

https://github.com/ticket180/chili3d/tree/njsgcs

相关文章:

  • 【第四十一周】文献阅读:HippoRAG:受神经生物学启发的大型语言模型长期记忆机制
  • OSPF特殊区域
  • 金融图QCPFinancial
  • mac监控linux上mysql性能(Grafana+Prometheus+mysqld_exporter)
  • VSCode PIO使用Jlink SWD烧录Stm32
  • 【C++初阶】第15课—模版进阶
  • 进程与线程:01 CPU管理的直观想法
  • 股票分析技术指标【RSV、KDJ】
  • 【Ollama:本地LLM工具】
  • windows服务器及网络:论如何安装(虚拟机)
  • 驱动开发硬核特训 · Day 15:电源管理核心知识与实战解析
  • 基于javaweb的SpringBoot儿童爱心管理系统设计与实现(源码+文档+部署讲解)
  • go语言对http协议的支持
  • 神经网络与模型训练过程笔记
  • PyTorch 深度学习实战(39):归一化技术对比(BN/LN/IN/GN)
  • 提示词设计:动态提示词 标准提示词
  • Android Studio 中 Drawable 详细全解
  • 计算机视觉cv入门之答题卡自动批阅
  • linux 搭建 dvwa 渗透测试环境
  • mysql的5.7版本与8.0版本的差异与兼容性
  • 全球前瞻|中国印尼举行首次“2+2”部长级会议,美乌将签署矿产协议
  • 寻女19年的“棉花糖爸爸”明将办团圆宴,大女儿:妹妹是片区销售主管
  • 城事|2小时40分42秒,天工夺冠!全球首个人形机器人半马开跑
  • 上海奉贤这所九年一贯制学校将迎首批新生,有何特色?
  • 亚洲大厦和一个被音乐剧改变的街区
  • 杨小伟被查,国家广播电视总局党组:坚决拥护党中央决定