Skip to content

Commit bf6ee10

Browse files
committed
Update.
1 parent b9250bc commit bf6ee10

File tree

1 file changed

+27
-0
lines changed
  • resource/template/dashboard-default

1 file changed

+27
-0
lines changed

resource/template/dashboard-default/api.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,31 @@
4949
{{template "component/api"}}
5050
{{template "common/footer" .}}
5151
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/clipboard.js/2.0.10/clipboard.min.js"></script>
52+
<script>
53+
// 初始化clipboard.js
54+
var clipboard = new ClipboardJS('.ui.icon.mini.button');
55+
56+
// 添加复制成功提示
57+
clipboard.on('success', function(e) {
58+
$.suiAlert({
59+
title: "复制成功",
60+
type: "success",
61+
description: "API Token已复制到剪贴板",
62+
time: "2",
63+
position: "top-center",
64+
});
65+
e.clearSelection();
66+
});
67+
68+
// 添加复制失败提示
69+
clipboard.on('error', function(e) {
70+
$.suiAlert({
71+
title: "复制失败",
72+
type: "error",
73+
description: "请手动复制API Token",
74+
time: "3",
75+
position: "top-center",
76+
});
77+
});
78+
</script>
5279
{{end}}

0 commit comments

Comments
 (0)