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 { makeElement } from "../htmlUtils.js";
|
||||||
import { getSealStatus, lookupSelf, getMounts, renewSelf } from "../api.js";
|
import { getSealStatus, lookupSelf, getMounts, renewSelf } from "../api.js";
|
||||||
import formatDistance from 'date-fns/formatDistance';
|
import formatDistance from 'date-fns/formatDistance';
|
||||||
|
import ClipboardJS from "clipboard";
|
||||||
|
|
||||||
export class HomePage extends Page {
|
export class HomePage extends Page {
|
||||||
constructor() {
|
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({
|
makeElement({
|
||||||
tag: "li",
|
tag: "li",
|
||||||
children: makeElement({
|
children: makeElement({
|
||||||
|
|
Loading…
Reference in a new issue