Add copy token button, closes #9.
This commit is contained in:
parent
2c223dc1aa
commit
5be2bf0779
|
@ -4,7 +4,7 @@ import { getAPIURL, getToken } from "../utils.js";
|
|||
import { makeElement } from "../htmlUtils.js";
|
||||
import { getSealStatus, lookupSelf, getMounts, renewSelf } from "../api.js";
|
||||
import formatDistance from 'date-fns/formatDistance';
|
||||
|
||||
import ClipboardJS from "clipboard";
|
||||
|
||||
export class HomePage extends Page {
|
||||
constructor() {
|
||||
|
@ -50,6 +50,19 @@ export class HomePage extends Page {
|
|||
}
|
||||
})
|
||||
}),
|
||||
makeElement({
|
||||
tag: "li",
|
||||
children: makeElement({
|
||||
tag: "a",
|
||||
text: "Copy Token",
|
||||
attributes: {
|
||||
"data-clipboard-text": getToken(),
|
||||
},
|
||||
thenRun: (e) => {
|
||||
new ClipboardJS(e);
|
||||
}
|
||||
})
|
||||
}),
|
||||
makeElement({
|
||||
tag: "li",
|
||||
children: makeElement({
|
||||
|
|
Loading…
Reference in a new issue