From 75e7e7e19cc3e01a4c2ecfb83676b4d4439440a4 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sat, 22 Nov 2025 16:27:33 +0800 Subject: [PATCH] update pay function --- build-and-check.sh | 67 ++++++++++++++++++++++++++++++++++++++++ fix-agentchat-styles.sh | 67 ++++++++++++++++++++++++++++++++++++++++ src/styles/brainwave.css | 14 +++++++-- 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 build-and-check.sh create mode 100644 fix-agentchat-styles.sh diff --git a/build-and-check.sh b/build-and-check.sh new file mode 100644 index 00000000..e5d1dc86 --- /dev/null +++ b/build-and-check.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# 构建并检查 Agent Chat + +echo "🏗️ 开始构建..." +echo "" + +# 1. 清理缓存 +echo "1️⃣ 清理缓存..." +rm -rf node_modules/.cache +rm -rf build + +# 2. 执行构建 +echo "" +echo "2️⃣ 执行构建(显示详细输出)..." +npm run build 2>&1 | tee build.log + +# 3. 检查构建结果 +echo "" +echo "3️⃣ 检查构建结果..." + +if [ -d "build" ]; then + echo "✅ build 目录已生成" + + # 检查 CSS 文件 + if [ -d "build/static/css" ]; then + echo "✅ CSS 目录存在" + echo "" + echo "📊 CSS 文件列表:" + ls -lh build/static/css/ + + echo "" + echo "📏 CSS 文件大小统计:" + for file in build/static/css/*.css; do + if [ -f "$file" ]; then + size=$(wc -c < "$file") + lines=$(wc -l < "$file") + echo " - $(basename $file): $size bytes, $lines 行" + + # 检查是否包含 Tailwind 类名 + if grep -q "bg-gray-900" "$file"; then + echo " ✅ 包含 Tailwind 类名 (bg-gray-900)" + else + echo " ❌ 不包含 Tailwind 类名 (bg-gray-900)" + fi + fi + done + else + echo "❌ CSS 目录不存在" + fi + + # 检查 index.html + if [ -f "build/index.html" ]; then + echo "" + echo "✅ index.html 已生成" + else + echo "" + echo "❌ index.html 不存在" + fi +else + echo "❌ build 目录不存在,构建失败!" + echo "" + echo "🔍 查看构建日志:" + tail -50 build.log +fi + +echo "" +echo "📝 完整构建日志已保存到: build.log" diff --git a/fix-agentchat-styles.sh b/fix-agentchat-styles.sh new file mode 100644 index 00000000..f07e353d --- /dev/null +++ b/fix-agentchat-styles.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Agent Chat 样式修复脚本 + +echo "🔧 修复 Agent Chat 样式问题..." +echo "" + +# 1. 创建 tailwind.config.js +echo "📝 创建 tailwind.config.js..." +cat > tailwind.config.js << 'EOF' +/** @type {import('tailwindcss').Config} */ +const { heroui } = require("@heroui/react"); + +module.exports = { + content: [ + "./src/views/AgentChat/**/*.{js,jsx}", + "./src/providers/AppProviders.js", + ], + darkMode: "class", + theme: { + extend: {}, + }, + plugins: [heroui()], +} +EOF +echo "✅ tailwind.config.js 已创建" + +# 2. 确保 postcss.config.js 正确 +echo "" +echo "📝 检查 postcss.config.js..." +cat > postcss.config.js << 'EOF' +module.exports = { + plugins: [ + require('tailwindcss'), + require('autoprefixer'), + ], +} +EOF +echo "✅ postcss.config.js 已更新" + +# 3. 清空 brainwave.css +echo "" +echo "📝 清空 brainwave.css..." +echo "/* 空文件 - Brainwave 样式已不再使用 */" > src/styles/brainwave.css +echo "✅ brainwave.css 已清空" + +# 4. 清理缓存 +echo "" +echo "🧹 清理缓存..." +rm -rf node_modules/.cache +rm -rf build +echo "✅ 缓存已清理" + +# 5. 重新构建 +echo "" +echo "🏗️ 重新构建..." +npm run build + +# 6. 检查结果 +echo "" +echo "📊 构建结果检查:" +echo " - CSS 文件:" +ls -lh build/static/css/ 2>/dev/null || echo " ❌ build 目录不存在" + +echo "" +echo "✅ 修复完成!" +echo "" +echo "🌐 现在访问 https://valuefrontier.cn/agent-chat 查看效果" diff --git a/src/styles/brainwave.css b/src/styles/brainwave.css index 32d06f16..4821c5d2 100644 --- a/src/styles/brainwave.css +++ b/src/styles/brainwave.css @@ -1,2 +1,12 @@ -/* 空文件 - Brainwave 样式已不再使用 */ -/* 保留此文件避免导入错误,但内容已清空 */ +/* Tailwind CSS 入口文件 */ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* 自定义工具类 */ +@layer utilities { + /* 毛玻璃效果 */ + .backdrop-blur-xl { + backdrop-filter: blur(24px); + } +}