Add tsx syntax to NewSecretsEngine.
This commit is contained in:
parent
9648d6027f
commit
d351e29220
|
@ -1,47 +0,0 @@
|
|||
import { Page } from "../../types/Page";
|
||||
import { Tile } from "../../elements/Tile";
|
||||
import { makeElement } from "z-makeelement";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class NewSecretsEnginePage extends Page {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
async render(): Promise<void> {
|
||||
await this.router.setPageContent(
|
||||
makeElement({
|
||||
tag: "div",
|
||||
class: "uk-child-width-1-1@s uk-child-width-1-2@m uk-grid-small uk-grid-match",
|
||||
attributes: { "uk-grid": "" },
|
||||
children: [
|
||||
Tile({
|
||||
title: i18next.t("new_secrets_engine_kv_title"),
|
||||
description: i18next.t("new_secrets_engine_kv_description"),
|
||||
onclick: async () => {
|
||||
await this.router.changePage("NEW_KV_ENGINE");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("new_secrets_engine_totp_title"),
|
||||
description: i18next.t("new_secrets_engine_totp_description"),
|
||||
onclick: async () => {
|
||||
await this.router.changePage("NEW_TOTP_ENGINE");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("new_secrets_engine_transit_title"),
|
||||
description: i18next.t("new_secrets_engine_transit_description"),
|
||||
onclick: async () => {
|
||||
await this.router.changePage("NEW_TRANSIT_ENGINE");
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
return i18next.t("new_secrets_engine_title");
|
||||
}
|
||||
}
|
43
src/pages/Secrets/NewSecretsEngine.tsx
Normal file
43
src/pages/Secrets/NewSecretsEngine.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { Page } from "../../types/Page";
|
||||
import { Tile } from "../../elements/ReactTile";
|
||||
import { render } from "preact";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class NewSecretsEnginePage extends Page {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
async render(): Promise<void> {
|
||||
render(
|
||||
<div class="uk-child-width-1-1@s uk-child-width-1-2@m uk-grid-small uk-grid-match" uk-grid>
|
||||
<Tile
|
||||
title={i18next.t("new_secrets_engine_kv_title")}
|
||||
description={i18next.t("new_secrets_engine_kv_description")}
|
||||
onclick={async () => {
|
||||
await this.router.changePage("NEW_KV_ENGINE");
|
||||
}}
|
||||
/>
|
||||
<Tile
|
||||
title={i18next.t("new_secrets_engine_totp_title")}
|
||||
description={i18next.t("new_secrets_engine_totp_description")}
|
||||
onclick={async () => {
|
||||
await this.router.changePage("NEW_TOTP_ENGINE");
|
||||
}}
|
||||
/>
|
||||
<Tile
|
||||
title={i18next.t("new_secrets_engine_transit_title")}
|
||||
description={i18next.t("new_secrets_engine_transit_description")}
|
||||
onclick={async () => {
|
||||
await this.router.changePage("NEW_TRANSIT_ENGINE");
|
||||
}}
|
||||
/>
|
||||
</div>,
|
||||
this.router.pageContentElement,
|
||||
);
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
return i18next.t("new_secrets_engine_title");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue