Parcourir la source

♻️ refactor(config): remove unused openapi mcp server configuration

- 删除.mcp.json中未使用的openapi服务器配置,精简配置文件

✨ feat(admin): add JSON formatting for stock data input

- 添加getValueFromEvent处理函数,实现股票数据输入时的JSON格式化
- 移除原formatter属性,统一使用getValueFromEvent处理输入值
yourname il y a 5 mois
Parent
commit
b4c8e70883
2 fichiers modifiés avec 10 ajouts et 22 suppressions
  1. 1 13
      .roo/mcp.json
  2. 9 9
      src/client/admin/pages/StockDataPage.tsx

+ 1 - 13
.roo/mcp.json

@@ -1,15 +1,3 @@
 {
-  "mcpServers": {
-    "openapi": {
-      "command": "npx",
-      "args": [
-        "-y",
-        "mcp-openapi-schema-explorer@latest",
-        "https://pre-136-107-template-6.r.d8d.fun/doc",
-        "--output-format",
-        "json"
-      ],
-      "env": {}
-    }
-  }
+  "mcpServers": {}
 }

+ 9 - 9
src/client/admin/pages/StockDataPage.tsx

@@ -300,17 +300,17 @@ export const StockDataPage: React.FC = () => {
             rules={[
               { required: true, message: '请输入股票数据' }
             ]}
+            getValueFromEvent={(e) => {
+              try {
+                return JSON.stringify(JSON.parse(e.target.value || '{}'), null, 2);
+              } catch (err) {
+                return e.target.value;
+              }
+            }}
           >
-            <Input.TextArea 
-              placeholder='请输入JSON格式的股票数据,例如: {"date": "2025-05-21", "open": 15.68, "close": 16.25, "high": 16.50, "low": 15.50, "volume": 1250000}' 
+            <Input.TextArea
+              placeholder='请输入JSON格式的股票数据,例如: {"date": "2025-05-21", "open": 15.68, "close": 16.25, "high": 16.50, "low": 15.50, "volume": 1250000}'
               rows={8}
-              formatter={(value) => {
-                try {
-                  return JSON.stringify(JSON.parse(value || '{}'), null, 2);
-                } catch (e) {
-                  return value;
-                }
-              }}
             />
           </Form.Item>
         </Form>