1
0
Fork 0
VaultUI/src/pages/TransitViewSecret.js

65 lines
1.7 KiB
JavaScript
Raw Normal View History

2021-04-15 15:09:43 +01:00
import { Page } from "../types/Page.js";
import { setPageContent, setTitleElement } from "../pageUtils.js";
import { makeElement } from "../htmlUtils.js";
export class TransitViewSecretPage extends Page {
constructor() {
super();
}
2021-04-15 15:28:00 +01:00
makeTile(title, description, icon = "code", onclick = _ => {}) {
2021-04-15 15:09:43 +01:00
return makeElement({
tag: "div",
class: ["uk-tile", "uk-tile-default", "uk-tile-primary", "uk-padding-small"],
children: makeElement({
tag: "a",
class: "uk-link-heading",
2021-04-15 15:16:37 +01:00
onclick: onclick,
2021-04-15 15:09:43 +01:00
children: [
makeElement({
tag: "p",
class: "uk-h4",
2021-04-15 15:28:00 +01:00
text: title,
children: makeElement({
tag: "span",
class: ["uk-icon", "uk-margin-small-left"],
attributes: {
"uk-icon": `icon: ${icon}`,
"role": "img",
"aria-label": `${title} icon`
}
})
2021-04-15 15:09:43 +01:00
}),
makeElement({
tag: "span",
class: "uk-text-muted",
text: description
})
]
})
});
}
async render() {
setTitleElement(pageState);
setPageContent(makeElement({
tag: "div",
class: ["uk-child-width-1-2", "uk-grid-collapse", "uk-grid-small"],
attributes: { "uk-grid": "" },
children: [
makeElement({
tag: "div",
children: [
2021-04-15 15:28:00 +01:00
this.makeTile("Encrypt", "Encrypt some plaintext or base64 encoded binary.", "lock"),
this.makeTile("Decrypt", "Decrypt some cyphertext.", "mail"),
2021-04-15 15:09:43 +01:00
]
}),
]
}));
}
get name() {
2021-04-15 15:16:37 +01:00
return "Transit Secret View";
2021-04-15 15:09:43 +01:00
}
}