diff --git a/web/src/components/vendor/console/components/ConsoleMenu.tsx b/web/src/components/vendor/console/components/ConsoleMenu.tsx index ae36bf08..f9979e8b 100644 --- a/web/src/components/vendor/console/components/ConsoleMenu.tsx +++ b/web/src/components/vendor/console/components/ConsoleMenu.tsx @@ -45,6 +45,7 @@ import { saveCommonCommand } from "../modules/es"; import { pushCommand } from "../modules/mappings/mappings"; import { formatMessage } from "umi/locale"; import { hasAuthority } from "@/utils/authority"; +import { CopyToClipboard } from "react-copy-to-clipboard"; interface Props { getCurl: () => Promise; @@ -177,21 +178,22 @@ export default class ConsoleMenu extends Component { {formatMessage({ id: "console.menu.save_as_command" })} ) } - if (window.navigator?.clipboard) { - items.unshift( + items.unshift( + { this.closePopover(); - this.copyAsCurl(); + notification.open({ + message: "Request copied as cURL", + placement: "bottomRight", + }); }} > {formatMessage({ id: "console.menu.copy_as_curl" })} - ); - } + + ); return (