mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
fix: optimize appearing the wrong prompt by pop-up for the HTTP environments in copy function (#491)
This commit is contained in:
@@ -18,8 +18,20 @@
|
||||
import { ElNotification } from "element-plus";
|
||||
|
||||
export default (text: string): void => {
|
||||
if (location.protocol === "http:") {
|
||||
ElNotification({
|
||||
title: "Warning",
|
||||
message: "Clipboard is not supported in HTTP environments",
|
||||
type: "warning",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!navigator.clipboard) {
|
||||
console.error("Clipboard is not supported");
|
||||
ElNotification({
|
||||
title: "Warning",
|
||||
message: "Clipboard is not supported",
|
||||
type: "warning",
|
||||
});
|
||||
return;
|
||||
}
|
||||
navigator.clipboard
|
||||
@@ -33,7 +45,7 @@ export default (text: string): void => {
|
||||
})
|
||||
.catch((err) => {
|
||||
ElNotification({
|
||||
title: "Error",
|
||||
title: "Warning",
|
||||
message: err,
|
||||
type: "warning",
|
||||
});
|
||||
|
Reference in New Issue
Block a user