Add typing to SetVaultURL.ts.
This commit is contained in:
parent
a9d3e8d1e7
commit
ab3cc5fa70
|
@ -11,7 +11,7 @@ import { NewTOTPPage } from "./pages/TOTP/NewTOTP.js";
|
||||||
import { Page } from "./types/Page";
|
import { Page } from "./types/Page";
|
||||||
import { PwGenPage } from "./pages/PwGen";
|
import { PwGenPage } from "./pages/PwGen";
|
||||||
import { SetLanguagePage } from "./pages/SetLanguage";
|
import { SetLanguagePage } from "./pages/SetLanguage";
|
||||||
import { SetVaultURLPage } from "./pages/SetVaultURL.js";
|
import { SetVaultURLPage } from "./pages/SetVaultURL";
|
||||||
import { TOTPViewPage } from "./pages/TOTP/TOTPView.js";
|
import { TOTPViewPage } from "./pages/TOTP/TOTPView.js";
|
||||||
import { TransitDecryptPage } from "./pages/Transit/TransitDecrypt.js";
|
import { TransitDecryptPage } from "./pages/Transit/TransitDecrypt.js";
|
||||||
import { TransitEncryptPage } from "./pages/Transit/TransitEncrypt.js";
|
import { TransitEncryptPage } from "./pages/Transit/TransitEncrypt.js";
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { Page } from "../types/Page";
|
import { Page } from "../types/Page";
|
||||||
import { changePage, setPageContent } from "../pageUtils";
|
import { changePage, setPageContent } from "../pageUtils";
|
||||||
import { makeElement } from "../htmlUtils";
|
import { makeElement } from "../htmlUtils";
|
||||||
import { pageState } from "../globalPageState.ts";
|
import { pageState } from "../globalPageState";
|
||||||
|
|
||||||
export class SetVaultURLPage extends Page {
|
export class SetVaultURLPage extends Page {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
render() {
|
render(): void {
|
||||||
setPageContent(makeElement({
|
setPageContent(makeElement({
|
||||||
tag: "form",
|
tag: "form",
|
||||||
id: "setVaultURLForm",
|
id: "setVaultURLForm",
|
||||||
|
@ -43,12 +43,12 @@ export class SetVaultURLPage extends Page {
|
||||||
}));
|
}));
|
||||||
document.getElementById("setVaultURLForm").addEventListener("submit", function (e) {
|
document.getElementById("setVaultURLForm").addEventListener("submit", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let formData = new FormData(document.querySelector('#setVaultURLForm'));
|
const formData = new FormData(document.querySelector('#setVaultURLForm'));
|
||||||
pageState.apiURL = formData.get("vaultURL");
|
pageState.apiURL = formData.get("vaultURL") as string;
|
||||||
changePage("HOME");
|
changePage("HOME");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
get name() {
|
get name(): string {
|
||||||
return "Set Vault URL";
|
return "Set Vault URL";
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue