diff --git a/dashboard.go b/dashboard.go
index b829894..745a3cf 100644
--- a/dashboard.go
+++ b/dashboard.go
@@ -226,7 +226,7 @@ const dashboardHTML = `
-
+
@@ -300,7 +300,8 @@ var app = new Vue({
let prettyBody = JSON.stringify(JSON.parse(body), null, ' ');
this.selectedItem[key] = data.replace(body, prettyBody);
},
- copyCurl() {
+ copyCurl(event) {
+ this.changeText(event);
let e = document.createElement('textarea');
e.value = this.selectedItem.curl;
document.body.appendChild(e);
@@ -312,6 +313,12 @@ var app = new Vue({
await fetch(window.location.href + '/retry/' + this.selectedItem.id);
this.show(this.items[0]);
},
+ changeText(event) {
+ let elem = event.target;
+ let btnText = elem.getAttribute("data-text");
+ elem.innerText = "copied!";
+ setTimeout(() => elem.innerText = btnText, 400)
+ }
},
});