feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -17,15 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { copyText } from '../../../../helpers/clipboard';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Image,
|
||||
Button,
|
||||
Space,
|
||||
Typography,
|
||||
Tag,
|
||||
} from '@/components/ui';
|
||||
import { Modal, Image, Button, Space, Typography, Tag } from '@/components/ui';
|
||||
import { Download, Copy, ImagePlus, Sparkles } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { showSuccess, showError } from '../../../../helpers';
|
||||
@@ -83,30 +77,7 @@ const ImageDetailModal = ({
|
||||
};
|
||||
|
||||
// 复制(带 execCommand 兜底,兼容 http / 老浏览器)
|
||||
const copyToClipboard = async (text) => {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} catch (err) {
|
||||
console.warn('Clipboard API failed:', err);
|
||||
}
|
||||
}
|
||||
try {
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = text;
|
||||
textArea.style.position = 'fixed';
|
||||
textArea.style.left = '-9999px';
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
const ok = document.execCommand('copy');
|
||||
document.body.removeChild(textArea);
|
||||
return ok;
|
||||
} catch (err) {
|
||||
console.error('execCommand copy failed:', err);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const copyToClipboard = copyText;
|
||||
|
||||
const handleCopyPrompt = async () => {
|
||||
if (!task.prompt) return;
|
||||
|
||||
Reference in New Issue
Block a user