File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
resource/template/dashboard-default Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 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}}
You can’t perform that action at this time.
0 commit comments