make linter happy
This commit is contained in:
parent
96ca59c94c
commit
b66078511d
|
@ -21,6 +21,7 @@
|
|||
"BUILD_STRING": "writable"
|
||||
},
|
||||
"rules": {
|
||||
"import/no-named-as-default-member": "off",
|
||||
"no-unused-vars": ["off"],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
|
@ -48,6 +49,7 @@
|
|||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"settings": {
|
||||
"import/ignore": ["preact"],
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".js", ".ts", ".tsx"]
|
||||
|
|
22
package.json
22
package.json
|
@ -13,38 +13,38 @@
|
|||
"@typescript-eslint/eslint-plugin": "^5.9.0",
|
||||
"@typescript-eslint/parser": "^5.9.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"clipboard": "^2.0.8",
|
||||
"codejar": "^3.5.0",
|
||||
"core-js": "^3.20.2",
|
||||
"css-loader": "^6.5.1",
|
||||
"css-minimizer-webpack-plugin": "^3.3.1",
|
||||
"date-fns": "^2.28.0",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"git-revision-webpack-plugin": "^5.0.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"i18next": "^21.6.5",
|
||||
"mini-css-extract-plugin": "^2.4.5",
|
||||
"node-sass": "^7.0.1",
|
||||
"normalize.css": "^8.0.1",
|
||||
"preact": "^10.6.4",
|
||||
"prettier": "^2.5.1",
|
||||
"prismjs": "^1.25.0",
|
||||
"qr-scanner": "^1.3.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"sass-loader": "^12.4.0",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^4.5.4",
|
||||
"uikit": "^3.9.4",
|
||||
"webpack": "^5.65.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-dev-server": "^4.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"preact-router": "^4.0.0"
|
||||
"preact-router": "^4.0.0",
|
||||
"uikit": "^3.9.4",
|
||||
"preact": "^10.6.4",
|
||||
"prismjs": "^1.25.0",
|
||||
"qr-scanner": "^1.3.0",
|
||||
"normalize.css": "^8.0.1",
|
||||
"file-saver": "^2.0.5",
|
||||
"clipboard": "^2.0.8",
|
||||
"codejar": "^3.5.0",
|
||||
"core-js": "^3.20.2",
|
||||
"date-fns": "^2.28.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
npx eslint --cache -c .eslintrc.json "$@" --ext .js,.ts,.tsx
|
|
@ -1,12 +1,6 @@
|
|||
import { Settings } from "../settings/Settings";
|
||||
import { DoesNotExistError } from "../types/internalErrors";
|
||||
import { removeDoubleSlash } from "../utils";
|
||||
import { BaseAPIResponse } from "./types/api";
|
||||
import { AuthListAPIType, AuthListType } from "./types/auth";
|
||||
import { BaseAPIResponse } from "./types/api";
|
||||
import { CapabilitiesType } from "./types/capabilities";
|
||||
import { MountsType, MountType, NewMountParams } from "./types/mount";
|
||||
import { SealStatusType } from "./types/seal";
|
||||
import { TokenInfo } from "./types/token";
|
||||
import {
|
||||
DecryptionPayload,
|
||||
DecryptionResult,
|
||||
|
@ -16,7 +10,14 @@ import {
|
|||
RewrapResult,
|
||||
TransitKeyType,
|
||||
} from "./types/transit";
|
||||
import { DoesNotExistError } from "../types/internalErrors";
|
||||
import { MountType, MountsType, NewMountParams } from "./types/mount";
|
||||
import { SealStatusType } from "./types/seal";
|
||||
import { SecretMetadataType } from "./types/secret";
|
||||
import { Settings } from "../settings/Settings";
|
||||
import { TokenInfo } from "./types/token";
|
||||
import { UserType, UserTypeAPIResp } from "./types/user";
|
||||
import { removeDoubleSlash } from "../utils";
|
||||
|
||||
async function checkResponse(resp: Response): Promise<void> {
|
||||
if (resp.ok) return;
|
||||
|
@ -352,7 +353,6 @@ export class API {
|
|||
|
||||
async deleteSecret(baseMount: string, secretPath: string[], name: string): Promise<void> {
|
||||
let secretURL = "";
|
||||
let request;
|
||||
|
||||
const mountInfo = await this.getMount(baseMount);
|
||||
if (mountInfo.options.version == "2") {
|
||||
|
@ -361,7 +361,7 @@ export class API {
|
|||
secretURL = `/v1/${baseMount}/${secretPath.join("/")}/${name}`;
|
||||
}
|
||||
secretURL = removeDoubleSlash(secretURL).replace(/\/$/, "");
|
||||
request = new Request(this.appendAPIURL(secretURL), {
|
||||
const request = new Request(this.appendAPIURL(secretURL), {
|
||||
method: "DELETE",
|
||||
headers: this.getHeaders(),
|
||||
});
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
type SecretMetadataType = {
|
||||
export type SecretMetadataType = {
|
||||
versions: Record<string, unknown>;
|
||||
};
|
||||
|
|
10
src/main.tsx
10
src/main.tsx
|
@ -24,14 +24,14 @@ import translations from "./translations/index.mjs";
|
|||
// Actual Imports
|
||||
import { formatDistance } from "./formatDistance";
|
||||
//import { pageList } from "./allPages";
|
||||
import { render } from "preact";
|
||||
import { Main } from "./pages";
|
||||
import { NavBar } from "./ui/elements/NavBar";
|
||||
import { api } from "./globalAPI";
|
||||
import { settings } from "./globalSettings";
|
||||
import { playground } from "./playground";
|
||||
import i18next from "i18next";
|
||||
import { Main } from "./pages";
|
||||
import { getCurrentUrl, route } from "preact-router";
|
||||
import { playground } from "./playground";
|
||||
import { render } from "preact";
|
||||
import { settings } from "./globalSettings";
|
||||
import i18next from "i18next";
|
||||
|
||||
async function onLoad(): Promise<void> {
|
||||
document.documentElement.dir = settings.pageDirection;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { API } from "./api/API";
|
||||
import { Settings } from "./settings/Settings";
|
||||
import { route } from "preact-router";
|
||||
import ClipboardJS from "clipboard";
|
||||
import UIkit from "uikit";
|
||||
import i18next from "i18next";
|
||||
import { API } from "./api/API";
|
||||
|
||||
async function prePageChecksReal(api: API, settings: Settings) {
|
||||
if (settings.language.length == 0) {
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
import Router from "preact-router";
|
||||
import { settings } from "./globalSettings";
|
||||
import { api } from "./globalAPI";
|
||||
import { settings } from "./globalSettings";
|
||||
import Router from "preact-router";
|
||||
|
||||
import { AccessHomePage } from "./ui/pages/Access/AccessHome";
|
||||
import { AuthHome } from "./ui/pages/Access/Auth/AuthHome";
|
||||
import { AuthViewConfig } from "./ui/pages/Access/Auth/AuthViewConfig";
|
||||
import { DeleteSecretsEngine } from "./ui/pages/Secrets/DeleteSecretsEngine";
|
||||
import { Home } from "./ui/pages/Home";
|
||||
import { KeyValueDelete } from "./ui/pages/Secrets/KeyValue/KeyValueDelete";
|
||||
import { KeyValueView } from "./ui/pages/Secrets/KeyValue/KeyValueView";
|
||||
import { KeyValueEdit } from "./ui/pages/Secrets/KeyValue/KeyValueEdit";
|
||||
import { KeyValueList } from "./ui/pages/Secrets/KeyValue/KeyValueList";
|
||||
import { KeyValueNew } from "./ui/pages/Secrets/KeyValue/KeyValueNew";
|
||||
import { KeyValueView } from "./ui/pages/Secrets/KeyValue/KeyValueView";
|
||||
import { Login } from "./ui/pages/Login";
|
||||
import { Me } from "./ui/pages/Me";
|
||||
import { NewKVEngine } from "./ui/pages/Secrets/NewEngines/NewKVEngine";
|
||||
import { NewSecretsEngine } from "./ui/pages/Secrets/NewSecretsEngine";
|
||||
import { NewTOTPEngine } from "./ui/pages/Secrets/NewEngines/NewTOTPEngine";
|
||||
import { NewTransitEngine } from "./ui/pages/Secrets/NewEngines/NewTransitEngine";
|
||||
import { TransitNew } from "./ui/pages/Secrets/Transit/TransitNew";
|
||||
import { PasswordGenerator } from "./ui/pages/PwGen";
|
||||
import { PoliciesHome } from "./ui/pages/Policies/PoliciesHome";
|
||||
import { PolicyDelete } from "./ui/pages/Policies/PolicyDelete";
|
||||
import { PolicyEdit } from "./ui/pages/Policies/PolicyEdit";
|
||||
import { PolicyNew } from "./ui/pages/Policies/PolicyNew";
|
||||
import { PolicyView } from "./ui/pages/Policies/PolicyView";
|
||||
import { Secrets } from "./ui/pages/Secrets/SecretsHome";
|
||||
import { SetLanguage } from "./ui/pages/SetLanguage";
|
||||
import { SetVaultURL } from "./ui/pages/SetVaultURL";
|
||||
import { TOTPDelete } from "./ui/pages/Secrets/TOTP/TOTPDelete";
|
||||
import { TOTPNew } from "./ui/pages/Secrets/TOTP/TOTPNew";
|
||||
import { TOTPList } from "./ui/pages/Secrets/TOTP/TOTPList";
|
||||
import { TransitList } from "./ui/pages/Secrets/Transit/TransitList";
|
||||
import { TransitView } from "./ui/pages/Secrets/Transit/TransitView";
|
||||
import { Unseal } from "./ui/pages/Unseal";
|
||||
import { KeyValueNew } from "./ui/pages/Secrets/KeyValue/KeyValueNew";
|
||||
import { TOTPNew } from "./ui/pages/Secrets/TOTP/TOTPNew";
|
||||
import { TransitDecrypt } from "./ui/pages/Secrets/Transit/TransitDecrypt";
|
||||
import { TransitEncrypt } from "./ui/pages/Secrets/Transit/TransitEncrypt";
|
||||
import { TransitList } from "./ui/pages/Secrets/Transit/TransitList";
|
||||
import { TransitNew } from "./ui/pages/Secrets/Transit/TransitNew";
|
||||
import { TransitRewrap } from "./ui/pages/Secrets/Transit/TransitRewrap";
|
||||
import { PoliciesHome } from "./ui/pages/Policies/PoliciesHome";
|
||||
import { PolicyView } from "./ui/pages/Policies/PolicyView";
|
||||
import { PolicyNew } from "./ui/pages/Policies/PolicyNew";
|
||||
import { PolicyDelete } from "./ui/pages/Policies/PolicyDelete";
|
||||
import { PolicyEdit } from "./ui/pages/Policies/PolicyEdit";
|
||||
import { AuthHome } from "./ui/pages/Access/Auth/AuthHome";
|
||||
import { AccessHomePage } from "./ui/pages/Access/AccessHome";
|
||||
import { AuthViewConfig } from "./ui/pages/Access/Auth/AuthViewConfig";
|
||||
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
|
||||
import { TransitView } from "./ui/pages/Secrets/Transit/TransitView";
|
||||
import { Unseal } from "./ui/pages/Unseal";
|
||||
import { UserPassUserDelete } from "./ui/pages/Access/Auth/userpass/UserPassUserDelete";
|
||||
import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
|
||||
import { UserPassUserNew } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
|
||||
import { UserPassUserEdit } from "./ui/pages/Access/Auth/userpass/UserPassUserEdit";
|
||||
import { UserPassUserNew } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
|
||||
import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
|
||||
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
|
||||
|
||||
export const Main = () => (
|
||||
<Router>
|
||||
|
|
|
@ -10,8 +10,7 @@ export type CopyableInputBoxProps = {
|
|||
};
|
||||
|
||||
export class CopyableInputBox extends Component<CopyableInputBoxProps, unknown> {
|
||||
copyIconRef = createRef();
|
||||
inputBoxRef = createRef();
|
||||
copyIconRef = createRef<HTMLAnchorElement>();
|
||||
|
||||
componentDidMount(): void {
|
||||
const clipboard = new ClipboardJS(this.copyIconRef.current);
|
||||
|
@ -32,13 +31,7 @@ export class CopyableInputBox extends Component<CopyableInputBoxProps, unknown>
|
|||
aria-label={i18next.t("copy_input_box_copy_icon_text")}
|
||||
/>
|
||||
)}
|
||||
<input
|
||||
ref={this.inputBoxRef}
|
||||
class="uk-input uk-input-copyable"
|
||||
type="text"
|
||||
value={this.props.text}
|
||||
readonly
|
||||
/>
|
||||
<input class="uk-input uk-input-copyable" type="text" value={this.props.text} readonly />
|
||||
</MarginInline>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -12,7 +12,7 @@ export type CopyableModalProps = {
|
|||
|
||||
export class CopyableModal extends Component<CopyableModalProps, unknown> {
|
||||
ref = createRef();
|
||||
copyButtonRef = createRef();
|
||||
copyButtonRef = createRef<HTMLButtonElement>();
|
||||
|
||||
saveAsFile(): void {
|
||||
const blob = new Blob([this.props.contentString], {
|
||||
|
|
|
@ -6,7 +6,7 @@ export type FormProps = {
|
|||
};
|
||||
|
||||
export class Form extends Component<FormProps, unknown> {
|
||||
ref = createRef();
|
||||
ref = createRef<HTMLFormElement>();
|
||||
|
||||
render(): JSX.Element {
|
||||
return (
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/* eslint-disable import/no-unresolved */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
// @ts-ignore
|
||||
import qrScannerWorkerSource from "!!raw-loader!qr-scanner/qr-scanner-worker.min.js";
|
||||
QrScanner.WORKER_PATH = URL.createObjectURL(new Blob([qrScannerWorkerSource]));
|
||||
// end ignore
|
||||
/* eslint-enable */
|
||||
|
||||
import { Component, JSX, createRef } from "preact";
|
||||
import { Margin } from "./Margin";
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Grid, GridSizes } from "../../elements/Grid";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { Tile } from "../../elements/Tile";
|
||||
import { notImplemented, prePageChecks } from "../../../pageUtils";
|
||||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { route } from "preact-router";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class AccessHomePage extends Component<DefaultPageProps> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { AuthMethod } from "../../../../api/types/auth";
|
||||
import { Component, JSX } from "preact";
|
||||
import { notImplemented } from "../../../../pageUtils";
|
||||
import { objectToMap } from "../../../../utils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { authViewConfigURL, userPassUserListURL } from "../../pageLinks";
|
||||
import { notImplemented } from "../../../../pageUtils";
|
||||
import { objectToMap } from "../../../../utils";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
|
||||
export type AuthListElementProps = {
|
||||
path: string;
|
||||
|
@ -49,7 +49,7 @@ export function AuthListElement(props: AuthListElementProps): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
export class AuthHome extends Component<DefaultPageProps, { authList: Map<String, AuthMethod> }> {
|
||||
export class AuthHome extends Component<DefaultPageProps, { authList: Map<string, AuthMethod> }> {
|
||||
async componentDidMount() {
|
||||
const authList = objectToMap(await this.props.api.listAuth()) as Map<string, AuthMethod>;
|
||||
this.setState({ authList });
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { AuthMethod } from "../../../../api/types/auth";
|
||||
import { HeaderAndContent } from "../../../elements/HeaderAndContent";
|
||||
import { objectToMap, toStr } from "../../../../utils";
|
||||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { HeaderAndContent } from "../../../elements/HeaderAndContent";
|
||||
import { PageTitle } from "../../../elements/PageTitle";
|
||||
import { objectToMap, toStr } from "../../../../utils";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class AuthViewConfig extends Component<DefaultPageProps, { authMethod: AuthMethod }> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { userPassUserListURL } from "../../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class UserPassUserDelete extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../../elements/Form";
|
||||
import { InputWithTitle } from "../../../../elements/InputWithTitle";
|
||||
import { Margin } from "../../../../elements/Margin";
|
||||
import { MarginInline } from "../../../../elements/MarginInline";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { UserType } from "../../../../../api/types/user";
|
||||
import { Component } from "preact";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../../../pageUtils";
|
||||
import { toStr } from "../../../../../utils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { userPassUserViewURL } from "../../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
|
||||
const removeEmptyStrings = (arr: string[]) => arr.filter((e) => e.length > 0);
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../../elements/Form";
|
||||
import { Margin } from "../../../../elements/Margin";
|
||||
import { MarginInline } from "../../../../elements/MarginInline";
|
||||
import { UserType } from "../../../../../api/types/user";
|
||||
import { Component } from "preact";
|
||||
import { setErrorText } from "../../../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { UserType } from "../../../../../api/types/user";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../../../pageUtils";
|
||||
import { userPassUserViewURL } from "../../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class UserPassUserNew extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { HeaderAndContent } from "../../../../elements/HeaderAndContent";
|
||||
import { Margin } from "../../../../elements/Margin";
|
||||
import { Component } from "preact";
|
||||
import { toStr } from "../../../../../utils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { UserType } from "../../../../../api/types/user";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { UserType } from "../../../../../api/types/user";
|
||||
import { route } from "preact-router";
|
||||
import { toStr } from "../../../../../utils";
|
||||
import { userPassUserDeleteURL, userPassUserEditURL } from "../../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class UserPassUserView extends Component<DefaultPageProps, { user_data: UserType }> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { userPassUserNewURL, userPassUserViewURL } from "../../../pageLinks";
|
||||
import { PageTitle } from "../../../../elements/PageTitle";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class UserPassUsersList extends Component<DefaultPageProps, { users: string[] }> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { Grid, GridSizes } from "../elements/Grid";
|
||||
import { Margin } from "../elements/Margin";
|
||||
import { PageTitle } from "../elements/PageTitle";
|
||||
|
@ -7,7 +8,6 @@ import { TokenInfo } from "../../api/types/token";
|
|||
import { prePageChecks, setErrorText } from "../../pageUtils";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
|
||||
type HomeState = {
|
||||
selfTokenInfo: TokenInfo;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { Form } from "../elements/Form";
|
||||
import { Margin } from "../elements/Margin";
|
||||
|
|
|
@ -7,7 +7,7 @@ import ClipboardJS from "clipboard";
|
|||
import i18next from "i18next";
|
||||
|
||||
export class CopyLink extends Component<{ text: string; data: string }, unknown> {
|
||||
linkRef = createRef();
|
||||
linkRef = createRef<HTMLAnchorElement>();
|
||||
|
||||
componentDidMount(): void {
|
||||
const clipboard = new ClipboardJS(this.linkRef.current);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Margin } from "../../elements/Margin";
|
||||
import { prePageChecks } from "../../../pageUtils";
|
||||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Margin } from "../../elements/Margin";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { policyNewURL, policyViewURL } from "../pageLinks";
|
||||
import { prePageChecks } from "../../../pageUtils";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class PoliciesHome extends Component<DefaultPageProps, { policies: string[] }> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Component } from "preact";
|
||||
import { setErrorText } from "../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class PolicyDelete extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { CodeEditor } from "../../elements/CodeEditor";
|
||||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Margin } from "../../elements/Margin";
|
||||
import { MarginInline } from "../../elements/MarginInline";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { policyViewURL } from "../pageLinks";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { policyViewURL } from "../pageLinks";
|
||||
|
||||
type PolicyEditorProps = DefaultPageProps & {
|
||||
policyName: string;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Form } from "../../elements/Form";
|
||||
import { Margin } from "../../elements/Margin";
|
||||
import { Component } from "preact";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { policyViewURL } from "../pageLinks";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { policyViewURL } from "../pageLinks";
|
||||
|
||||
export class PolicyNew extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { CodeBlock } from "../../elements/CodeBlock";
|
||||
import { Margin } from "../../elements/Margin";
|
||||
import { prePageChecks } from "../../../pageUtils";
|
||||
import { Component } from "preact";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Margin } from "../../elements/Margin";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { route } from "preact-router";
|
||||
import { policyDeleteURL, policyEditURL } from "../pageLinks";
|
||||
import { prePageChecks } from "../../../pageUtils";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class PolicyView extends Component<
|
||||
DefaultPageProps,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Component, JSX, createRef, render } from "preact";
|
||||
import { Component, JSX, createRef } from "preact";
|
||||
import { CopyableInputBox } from "../elements/CopyableInputBox";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { Form } from "../elements/Form";
|
||||
import { Margin } from "../elements/Margin";
|
||||
import { PageTitle } from "../elements/PageTitle";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
|
||||
const passwordLengthMin = 1;
|
||||
const passwordLengthMax = 64;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Form } from "../../elements/Form";
|
||||
import { MarginInline } from "../../elements/MarginInline";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import i18next from "i18next";
|
||||
|
|
|
@ -43,7 +43,7 @@ export class KVEditor extends Component<KVEditProps, KVEditState> {
|
|||
this.props.baseMount,
|
||||
this.props.secretPath.map((e) => e + "/"),
|
||||
this.props.secretItem,
|
||||
JSON.parse(editorContent),
|
||||
JSON.parse(editorContent) as unknown as Record<string, unknown>,
|
||||
);
|
||||
window.history.back();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, JSX, createRef, render } from "preact";
|
||||
import { Component, JSX, createRef } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { DoesNotExistError } from "../../../../types/internalErrors";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CodeBlock } from "../../../elements/CodeBlock";
|
||||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { CopyableInputBox } from "../../../elements/CopyableInputBox";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Grid, GridSizes } from "../../../elements/Grid";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { MarginInline } from "../../../elements/MarginInline";
|
||||
|
@ -7,7 +8,6 @@ import { kvListURL } from "../../pageLinks";
|
|||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
||||
export class NewKVEngine extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { MarginInline } from "../../../elements/MarginInline";
|
||||
|
@ -7,7 +8,6 @@ import { route } from "preact-router";
|
|||
import { setErrorText } from "../../../../pageUtils";
|
||||
import { totpListURL } from "../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
||||
export class NewTOTPEngine extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { MarginInline } from "../../../elements/MarginInline";
|
||||
|
@ -6,7 +7,6 @@ import { PageTitle } from "../../../elements/PageTitle";
|
|||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
||||
export class NewTransitEngine extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { Grid, GridSizes } from "../../elements/Grid";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { Tile } from "../../elements/Tile";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
|
||||
export class NewSecretsEngine extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../../types/DefaultPageProps";
|
||||
import { MountType } from "../../../api/types/mount";
|
||||
import { PageTitle } from "../../elements/PageTitle";
|
||||
import { prePageChecks } from "../../../pageUtils";
|
||||
import { route } from "preact-router";
|
||||
import { sortedObjectMap } from "../../../utils";
|
||||
import i18next from "i18next";
|
||||
import { MountType } from "../../../api/types/mount";
|
||||
|
||||
const supportedMountTypes = ["kv", "totp", "transit", "cubbyhole"];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { route } from "preact-router";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { CapabilitiesType } from "../../../../api/types/capabilities";
|
||||
import { Component, JSX } from "preact";
|
||||
import { CopyableInputBox } from "../../../elements/CopyableInputBox";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
@ -10,7 +11,6 @@ import { removeDoubleSlash } from "../../../../utils";
|
|||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import i18next from "i18next";
|
||||
import { CapabilitiesType } from "../../../../api/types/capabilities";
|
||||
|
||||
type TOTPGridItemProps = DefaultPageProps & {
|
||||
baseMount: string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, JSX, createRef, render } from "preact";
|
||||
import { Component, JSX, createRef } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { Component, render } from "preact";
|
||||
import { CopyableModal } from "../../../elements/CopyableModal";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { FileUploadInput } from "../../../elements/FileUploadInput";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { InputWithTitle } from "../../../elements/InputWithTitle";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { fileToBase64 } from "../../../../htmlUtils";
|
||||
import { Component, render } from "preact";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import UIkit from "uikit";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
||||
export class TransitDecrypt extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { Component, render } from "preact";
|
||||
import { CopyableModal } from "../../../elements/CopyableModal";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { FileUploadInput } from "../../../elements/FileUploadInput";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { InputWithTitle } from "../../../elements/InputWithTitle";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { fileToBase64 } from "../../../../htmlUtils";
|
||||
import { Component, render } from "preact";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import UIkit from "uikit";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
|
||||
export class TransitEncrypt extends Component<DefaultPageProps> {
|
||||
render() {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { CapabilitiesType } from "../../../../api/types/capabilities";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { delSecretsEngineURL, transitNewSecretURL, transitViewSecretURL } from "../../pageLinks";
|
||||
import { route } from "preact-router";
|
||||
import i18next from "i18next";
|
||||
import { CapabilitiesType } from "../../../../api/types/capabilities";
|
||||
|
||||
type TransitViewListState = {
|
||||
contentLoaded: boolean;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { Component, render } from "preact";
|
||||
import { CopyableModal } from "../../../elements/CopyableModal";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Form } from "../../../elements/Form";
|
||||
import { Margin } from "../../../elements/Margin";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { TransitKeyType } from "../../../../api/types/transit";
|
||||
import { objectToMap } from "../../../../utils";
|
||||
import { Component, render } from "preact";
|
||||
import { setErrorText } from "../../../../pageUtils";
|
||||
import UIkit from "uikit";
|
||||
import i18next from "i18next";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { TransitKeyType } from "../../../../api/types/transit";
|
||||
|
||||
type versionOption = { version: string; label: string };
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Component, render } from "preact";
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
|
||||
import { Grid, GridSizes } from "../../../elements/Grid";
|
||||
import { SecretTitleElement } from "../SecretTitleElement";
|
||||
import { Tile } from "../../../elements/Tile";
|
||||
import { TransitKeyType } from "../../../../api/types/transit";
|
||||
import i18next from "i18next";
|
||||
import { route } from "preact-router";
|
||||
import {
|
||||
transitDecryptSecretURL,
|
||||
transitEncryptSecretURL,
|
||||
transitRewrapSecretURL,
|
||||
} from "../../pageLinks";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class TransitView extends Component<DefaultPageProps, { transitKey: TransitKeyType }> {
|
||||
async componentDidMount() {
|
||||
|
|
|
@ -3,7 +3,7 @@ import translations from "../../translations/index.mjs";
|
|||
// ts-unignore
|
||||
|
||||
import { Component } from "preact";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps.js";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { Form } from "../elements/Form";
|
||||
import { Margin } from "../elements/Margin";
|
||||
import { MarginInline } from "../elements/MarginInline";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Component, JSX, render } from "preact";
|
||||
import { Component, JSX } from "preact";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { Form } from "../elements/Form";
|
||||
import { MarginInline } from "../elements/MarginInline";
|
||||
import { QRScanner } from "../elements/QRScanner";
|
||||
import { DefaultPageProps } from "../../types/DefaultPageProps";
|
||||
import { PageTitle } from "../elements/PageTitle";
|
||||
import { QRScanner } from "../elements/QRScanner";
|
||||
import { route } from "preact-router";
|
||||
import { setErrorText } from "../../pageUtils";
|
||||
import { toStr } from "../../utils";
|
||||
|
|
|
@ -12,4 +12,4 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "preact",
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue