|
1 | 1 | import React, { useState } from 'react'; |
2 | 2 | import { OB11Config, ConnectConfig, WsConnectConfig, WsReverseConnectConfig, HttpConnectConfig, HttpPostConnectConfig } from '../types'; |
3 | 3 | import { Radio, Wifi, Globe, Send, X, Settings, Plus, Trash2, Edit2, Eye, EyeOff } from 'lucide-react'; |
| 4 | +import Portal from './Portal'; |
4 | 5 |
|
5 | 6 | interface OneBotConfigProps { |
6 | 7 | config: OB11Config; |
@@ -251,8 +252,9 @@ const OneBotConfigNew: React.FC<OneBotConfigProps> = ({ config, onChange, onSave |
251 | 252 |
|
252 | 253 | {/* 配置弹窗 */} |
253 | 254 | {showDialog && selectedAdapter && ( |
254 | | - <div className="fixed inset-0 bg-black/30 backdrop-blur-sm z-50 flex items-center justify-center p-4"> |
255 | | - <div className="bg-white/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col"> |
| 255 | + <Portal> |
| 256 | + <div className="fixed inset-0 bg-black/30 backdrop-blur-sm z-50 flex items-center justify-center p-4"> |
| 257 | + <div className="bg-white/60 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col border border-white/50"> |
256 | 258 | {/* Header */} |
257 | 259 | <div className="flex items-center justify-between p-6 border-b border-white/20"> |
258 | 260 | <div className="flex items-center gap-3 flex-1"> |
@@ -569,13 +571,15 @@ const OneBotConfigNew: React.FC<OneBotConfigProps> = ({ config, onChange, onSave |
569 | 571 | </div> |
570 | 572 | </div> |
571 | 573 | </div> |
572 | | - </div> |
| 574 | + </div> |
| 575 | + </Portal> |
573 | 576 | )} |
574 | 577 |
|
575 | 578 | {/* 添加适配器对话框 */} |
576 | 579 | {showAddDialog && ( |
577 | | - <div className="fixed inset-0 bg-black/30 backdrop-blur-sm z-50 flex items-center justify-center p-4"> |
578 | | - <div className="bg-white/90 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md"> |
| 580 | + <Portal> |
| 581 | + <div className="fixed inset-0 bg-black/30 backdrop-blur-sm z-50 flex items-center justify-center p-4"> |
| 582 | + <div className="bg-white/60 backdrop-blur-xl rounded-3xl shadow-2xl w-full max-w-md border border-white/50"> |
579 | 583 | <div className="flex items-center justify-between p-6 border-b border-white/20"> |
580 | 584 | <h3 className="text-xl font-semibold text-gray-900">选择适配器类型</h3> |
581 | 585 | <button onClick={() => setShowAddDialog(false)} className="text-gray-400 hover:text-gray-600"> |
@@ -646,7 +650,8 @@ const OneBotConfigNew: React.FC<OneBotConfigProps> = ({ config, onChange, onSave |
646 | 650 | </button> |
647 | 651 | </div> |
648 | 652 | </div> |
649 | | - </div> |
| 653 | + </div> |
| 654 | + </Portal> |
650 | 655 | )} |
651 | 656 | </div> |
652 | 657 | ); |
|
0 commit comments