From 5d98b6473013ccf8fcecb8bb0d341f089f0b508c Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz - Date: Sun, 21 Nov 2021 11:06:10 +0000 Subject: [PATCH] Move some files around. --- src/allPages.ts | 82 +++++++++---------- src/main.tsx | 2 +- src/state/PageState.ts | 36 ++++---- src/{ => ui}/elements/CodeBlock.tsx | 0 src/{ => ui}/elements/CodeEditor.tsx | 0 src/{ => ui}/elements/CopyableInputBox.tsx | 2 +- src/{ => ui}/elements/CopyableModal.tsx | 2 +- src/{ => ui}/elements/FileUploadInput.tsx | 0 src/{ => ui}/elements/Form.tsx | 0 src/{ => ui}/elements/Grid.tsx | 0 src/{ => ui}/elements/HeaderAndContent.tsx | 0 src/{ => ui}/elements/InputWithTitle.tsx | 0 src/{ => ui}/elements/Margin.tsx | 0 src/{ => ui}/elements/MarginInline.tsx | 0 src/{ => ui}/elements/NavBar.tsx | 2 +- src/{ => ui}/elements/QRScanner.tsx | 0 src/{ => ui}/elements/Tile.tsx | 0 src/{ => ui}/pages/Access/AccessHome.tsx | 4 +- src/{ => ui}/pages/Access/Auth/AuthHome.tsx | 10 +-- .../pages/Access/Auth/AuthViewConfig.tsx | 8 +- .../Auth/userpass/UserPassUserDelete.tsx | 4 +- .../Access/Auth/userpass/UserPassUserEdit.tsx | 12 +-- .../Access/Auth/userpass/UserPassUserNew.tsx | 8 +- .../Access/Auth/userpass/UserPassUserView.tsx | 6 +- .../Auth/userpass/UserPassUsersList.tsx | 4 +- src/{ => ui}/pages/Home.tsx | 10 +-- src/{ => ui}/pages/Login.tsx | 8 +- src/{ => ui}/pages/Me.tsx | 10 +-- src/{ => ui}/pages/Policies/PoliciesHome.tsx | 6 +- src/{ => ui}/pages/Policies/PolicyDelete.tsx | 6 +- src/{ => ui}/pages/Policies/PolicyEdit.tsx | 8 +- src/{ => ui}/pages/Policies/PolicyNew.tsx | 8 +- src/{ => ui}/pages/Policies/PolicyView.tsx | 6 +- src/{ => ui}/pages/PwGen.tsx | 2 +- .../pages/Secrets/DeleteSecretsEngine.tsx | 6 +- .../pages/Secrets/KeyValue/KeyValueDelete.tsx | 4 +- .../pages/Secrets/KeyValue/KeyValueNew.tsx | 6 +- .../pages/Secrets/KeyValue/KeyValueSecret.tsx | 10 +-- .../Secrets/KeyValue/KeyValueSecretsEdit.tsx | 10 +-- .../Secrets/KeyValue/KeyValueVersions.tsx | 6 +- .../pages/Secrets/KeyValue/KeyValueView.tsx | 10 +-- .../pages/Secrets/NewEngines/NewKVEngine.tsx | 6 +- .../Secrets/NewEngines/NewTOTPEngine.tsx | 6 +- .../Secrets/NewEngines/NewTransitEngine.tsx | 6 +- .../pages/Secrets/NewSecretsEngine.tsx | 2 +- .../pages/Secrets/SecretTitleElement.tsx | 2 +- src/{ => ui}/pages/Secrets/SecretsHome.tsx | 10 +-- .../pages/Secrets/TOTP/TOTPDelete.tsx | 4 +- src/{ => ui}/pages/Secrets/TOTP/TOTPNew.tsx | 6 +- src/{ => ui}/pages/Secrets/TOTP/TOTPView.tsx | 14 ++-- .../pages/Secrets/Transit/NewTransitKey.tsx | 6 +- .../pages/Secrets/Transit/TransitDecrypt.tsx | 8 +- .../pages/Secrets/Transit/TransitEncrypt.tsx | 8 +- .../pages/Secrets/Transit/TransitRewrap.tsx | 10 +-- .../pages/Secrets/Transit/TransitView.tsx | 6 +- .../Secrets/Transit/TransitViewSecret.tsx | 4 +- src/{ => ui}/pages/SetLanguage.tsx | 4 +- src/{ => ui}/pages/SetVaultURL.tsx | 2 +- src/{ => ui}/pages/Unseal.tsx | 10 +-- 59 files changed, 206 insertions(+), 206 deletions(-) rename src/{ => ui}/elements/CodeBlock.tsx (100%) rename src/{ => ui}/elements/CodeEditor.tsx (100%) rename src/{ => ui}/elements/CopyableInputBox.tsx (95%) rename src/{ => ui}/elements/CopyableModal.tsx (97%) rename src/{ => ui}/elements/FileUploadInput.tsx (100%) rename src/{ => ui}/elements/Form.tsx (100%) rename src/{ => ui}/elements/Grid.tsx (100%) rename src/{ => ui}/elements/HeaderAndContent.tsx (100%) rename src/{ => ui}/elements/InputWithTitle.tsx (100%) rename src/{ => ui}/elements/Margin.tsx (100%) rename src/{ => ui}/elements/MarginInline.tsx (100%) rename src/{ => ui}/elements/NavBar.tsx (96%) rename src/{ => ui}/elements/QRScanner.tsx (100%) rename src/{ => ui}/elements/Tile.tsx (100%) rename src/{ => ui}/pages/Access/AccessHome.tsx (93%) rename src/{ => ui}/pages/Access/Auth/AuthHome.tsx (88%) rename src/{ => ui}/pages/Access/Auth/AuthViewConfig.tsx (90%) rename src/{ => ui}/pages/Access/Auth/userpass/UserPassUserDelete.tsx (85%) rename src/{ => ui}/pages/Access/Auth/userpass/UserPassUserEdit.tsx (92%) rename src/{ => ui}/pages/Access/Auth/userpass/UserPassUserNew.tsx (86%) rename src/{ => ui}/pages/Access/Auth/userpass/UserPassUserView.tsx (94%) rename src/{ => ui}/pages/Access/Auth/userpass/UserPassUsersList.tsx (89%) rename src/{ => ui}/pages/Home.tsx (91%) rename src/{ => ui}/pages/Login.tsx (94%) rename src/{ => ui}/pages/Me.tsx (91%) rename src/{ => ui}/pages/Policies/PoliciesHome.tsx (89%) rename src/{ => ui}/pages/Policies/PolicyDelete.tsx (85%) rename src/{ => ui}/pages/Policies/PolicyEdit.tsx (91%) rename src/{ => ui}/pages/Policies/PolicyNew.tsx (86%) rename src/{ => ui}/pages/Policies/PolicyView.tsx (89%) rename src/{ => ui}/pages/PwGen.tsx (98%) rename src/{ => ui}/pages/Secrets/DeleteSecretsEngine.tsx (88%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueDelete.tsx (92%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueNew.tsx (91%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueSecret.tsx (94%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx (90%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueVersions.tsx (88%) rename src/{ => ui}/pages/Secrets/KeyValue/KeyValueView.tsx (93%) rename src/{ => ui}/pages/Secrets/NewEngines/NewKVEngine.tsx (92%) rename src/{ => ui}/pages/Secrets/NewEngines/NewTOTPEngine.tsx (90%) rename src/{ => ui}/pages/Secrets/NewEngines/NewTransitEngine.tsx (90%) rename src/{ => ui}/pages/Secrets/NewSecretsEngine.tsx (96%) rename src/{ => ui}/pages/Secrets/SecretTitleElement.tsx (97%) rename src/{ => ui}/pages/Secrets/SecretsHome.tsx (92%) rename src/{ => ui}/pages/Secrets/TOTP/TOTPDelete.tsx (91%) rename src/{ => ui}/pages/Secrets/TOTP/TOTPNew.tsx (95%) rename src/{ => ui}/pages/Secrets/TOTP/TOTPView.tsx (90%) rename src/{ => ui}/pages/Secrets/Transit/NewTransitKey.tsx (93%) rename src/{ => ui}/pages/Secrets/Transit/TransitDecrypt.tsx (92%) rename src/{ => ui}/pages/Secrets/Transit/TransitEncrypt.tsx (92%) rename src/{ => ui}/pages/Secrets/Transit/TransitRewrap.tsx (91%) rename src/{ => ui}/pages/Secrets/Transit/TransitView.tsx (93%) rename src/{ => ui}/pages/Secrets/Transit/TransitViewSecret.tsx (94%) rename src/{ => ui}/pages/SetLanguage.tsx (94%) rename src/{ => ui}/pages/SetVaultURL.tsx (96%) rename src/{ => ui}/pages/Unseal.tsx (93%) diff --git a/src/allPages.ts b/src/allPages.ts index d639c82..c404558 100644 --- a/src/allPages.ts +++ b/src/allPages.ts @@ -1,47 +1,47 @@ import { PageType } from "./pagerouter/PageType"; -import { AccessHomePage } from "./pages/Access/AccessHome"; -import { AuthHomePage } from "./pages/Access/Auth/AuthHome"; -import { AuthViewConfigPage } from "./pages/Access/Auth/AuthViewConfig"; -import { DeleteSecretsEnginePage } from "./pages/Secrets/DeleteSecretsEngine"; -import { HomePage } from "./pages/Home"; -import { KeyValueDeletePage } from "./pages/Secrets/KeyValue/KeyValueDelete"; -import { KeyValueNewPage } from "./pages/Secrets/KeyValue/KeyValueNew"; -import { KeyValueSecretEditPage } from "./pages/Secrets/KeyValue/KeyValueSecretsEdit"; -import { KeyValueSecretPage } from "./pages/Secrets/KeyValue/KeyValueSecret"; -import { KeyValueVersionsPage } from "./pages/Secrets/KeyValue/KeyValueVersions"; -import { KeyValueViewPage } from "./pages/Secrets/KeyValue/KeyValueView"; -import { LoginPage } from "./pages/Login"; -import { MePage } from "./pages/Me"; -import { NewKVEnginePage } from "./pages/Secrets/NewEngines/NewKVEngine"; -import { NewSecretsEnginePage } from "./pages/Secrets/NewSecretsEngine"; -import { NewTOTPEnginePage } from "./pages/Secrets/NewEngines/NewTOTPEngine"; -import { NewTransitEnginePage } from "./pages/Secrets/NewEngines/NewTransitEngine"; -import { NewTransitKeyPage } from "./pages/Secrets/Transit/NewTransitKey"; +import { AccessHomePage } from "./ui/pages/Access/AccessHome"; +import { AuthHomePage } from "./ui/pages/Access/Auth/AuthHome"; +import { AuthViewConfigPage } from "./ui/pages/Access/Auth/AuthViewConfig"; +import { DeleteSecretsEnginePage } from "./ui/pages/Secrets/DeleteSecretsEngine"; +import { HomePage } from "./ui/pages/Home"; +import { KeyValueDeletePage } from "./ui/pages/Secrets/KeyValue/KeyValueDelete"; +import { KeyValueNewPage } from "./ui/pages/Secrets/KeyValue/KeyValueNew"; +import { KeyValueSecretEditPage } from "./ui/pages/Secrets/KeyValue/KeyValueSecretsEdit"; +import { KeyValueSecretPage } from "./ui/pages/Secrets/KeyValue/KeyValueSecret"; +import { KeyValueVersionsPage } from "./ui/pages/Secrets/KeyValue/KeyValueVersions"; +import { KeyValueViewPage } from "./ui/pages/Secrets/KeyValue/KeyValueView"; +import { LoginPage } from "./ui/pages/Login"; +import { MePage } from "./ui/pages/Me"; +import { NewKVEnginePage } from "./ui/pages/Secrets/NewEngines/NewKVEngine"; +import { NewSecretsEnginePage } from "./ui/pages/Secrets/NewSecretsEngine"; +import { NewTOTPEnginePage } from "./ui/pages/Secrets/NewEngines/NewTOTPEngine"; +import { NewTransitEnginePage } from "./ui/pages/Secrets/NewEngines/NewTransitEngine"; +import { NewTransitKeyPage } from "./ui/pages/Secrets/Transit/NewTransitKey"; import { Page } from "./types/Page"; -import { PoliciesHomePage } from "./pages/Policies/PoliciesHome"; -import { PolicyDeletePage } from "./pages/Policies/PolicyDelete"; -import { PolicyEditPage } from "./pages/Policies/PolicyEdit"; -import { PolicyNewPage } from "./pages/Policies/PolicyNew"; -import { PolicyViewPage } from "./pages/Policies/PolicyView"; -import { PwGenPage } from "./pages/PwGen"; -import { SecretsHomePage } from "./pages/Secrets/SecretsHome"; -import { SetLanguagePage } from "./pages/SetLanguage"; -import { SetVaultURLPage } from "./pages/SetVaultURL"; -import { TOTPDeletePage } from "./pages/Secrets/TOTP/TOTPDelete"; -import { TOTPNewPage } from "./pages/Secrets/TOTP/TOTPNew"; -import { TOTPViewPage } from "./pages/Secrets/TOTP/TOTPView"; -import { TransitDecryptPage } from "./pages/Secrets/Transit/TransitDecrypt"; -import { TransitEncryptPage } from "./pages/Secrets/Transit/TransitEncrypt"; -import { TransitRewrapPage } from "./pages/Secrets/Transit/TransitRewrap"; -import { TransitViewPage } from "./pages/Secrets/Transit/TransitView"; -import { TransitViewSecretPage } from "./pages/Secrets/Transit/TransitViewSecret"; -import { UnsealPage } from "./pages/Unseal"; -import { UserPassUserDeletePage } from "./pages/Access/Auth/userpass/UserPassUserDelete"; -import { UserPassUserEditPage } from "./pages/Access/Auth/userpass/UserPassUserEdit"; -import { UserPassUserNewPage } from "./pages/Access/Auth/userpass/UserPassUserNew"; -import { UserPassUserViewPage } from "./pages/Access/Auth/userpass/UserPassUserView"; -import { UserPassUsersListPage } from "./pages/Access/Auth/userpass/UserPassUsersList"; +import { PoliciesHomePage } from "./ui/pages/Policies/PoliciesHome"; +import { PolicyDeletePage } from "./ui/pages/Policies/PolicyDelete"; +import { PolicyEditPage } from "./ui/pages/Policies/PolicyEdit"; +import { PolicyNewPage } from "./ui/pages/Policies/PolicyNew"; +import { PolicyViewPage } from "./ui/pages/Policies/PolicyView"; +import { PwGenPage } from "./ui/pages/PwGen"; +import { SecretsHomePage } from "./ui/pages/Secrets/SecretsHome"; +import { SetLanguagePage } from "./ui/pages/SetLanguage"; +import { SetVaultURLPage } from "./ui/pages/SetVaultURL"; +import { TOTPDeletePage } from "./ui/pages/Secrets/TOTP/TOTPDelete"; +import { TOTPNewPage } from "./ui/pages/Secrets/TOTP/TOTPNew"; +import { TOTPViewPage } from "./ui/pages/Secrets/TOTP/TOTPView"; +import { TransitDecryptPage } from "./ui/pages/Secrets/Transit/TransitDecrypt"; +import { TransitEncryptPage } from "./ui/pages/Secrets/Transit/TransitEncrypt"; +import { TransitRewrapPage } from "./ui/pages/Secrets/Transit/TransitRewrap"; +import { TransitViewPage } from "./ui/pages/Secrets/Transit/TransitView"; +import { TransitViewSecretPage } from "./ui/pages/Secrets/Transit/TransitViewSecret"; +import { UnsealPage } from "./ui/pages/Unseal"; +import { UserPassUserDeletePage } from "./ui/pages/Access/Auth/userpass/UserPassUserDelete"; +import { UserPassUserEditPage } from "./ui/pages/Access/Auth/userpass/UserPassUserEdit"; +import { UserPassUserNewPage } from "./ui/pages/Access/Auth/userpass/UserPassUserNew"; +import { UserPassUserViewPage } from "./ui/pages/Access/Auth/userpass/UserPassUserView"; +import { UserPassUsersListPage } from "./ui/pages/Access/Auth/userpass/UserPassUsersList"; import { getObjectKeys } from "./utils"; type pagesList = { diff --git a/src/main.tsx b/src/main.tsx index cd7a7fd..b8e5145 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -28,7 +28,7 @@ import { getSealStatus } from "./api/sys/getSealStatus"; import { pageList } from "./allPages"; import { pageState } from "./globalPageState"; import { playground } from "./playground"; -import { reloadNavBar } from "./elements/NavBar"; +import { reloadNavBar } from "./ui/elements/NavBar"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/state/PageState.ts b/src/state/PageState.ts index d94b256..c88a8ee 100644 --- a/src/state/PageState.ts +++ b/src/state/PageState.ts @@ -53,10 +53,10 @@ export class PageState { } get baseMount(): string { - return this.storage.getItem("baseMount") || ""; + return sessionStorage.getItem("baseMount") || ""; } set baseMount(value: string) { - this.storage.setItem("baseMount", value); + sessionStorage.setItem("baseMount", value); } // Since this is a array we can't act directly on it so we need @@ -74,60 +74,60 @@ export class PageState { } get secretPath(): string[] { - return JSON.parse(this.storage.getItem("secretPath") || "[]") as string[]; + return JSON.parse(sessionStorage.getItem("secretPath") || "[]") as string[]; } set secretPath(value: string[]) { - this.storage.setItem("secretPath", JSON.stringify(value)); + sessionStorage.setItem("secretPath", JSON.stringify(value)); } get secretVersion(): string | null { - const result = this.storage.getItem("secretVersion"); + const result = sessionStorage.getItem("secretVersion"); return result != "null" ? result || null : null; } set secretVersion(value: string) { - this.storage.setItem("secretVersion", String(value)); + sessionStorage.setItem("secretVersion", String(value)); } get secretItem(): string { - return this.storage.getItem("secretItem") || ""; + return sessionStorage.getItem("secretItem") || ""; } set secretItem(value: string) { - this.storage.setItem("secretItem", value); + sessionStorage.setItem("secretItem", value); } get secretMountType(): string { - return this.storage.getItem("secretMountType") || ""; + return sessionStorage.getItem("secretMountType") || ""; } set secretMountType(value: string) { - this.storage.setItem("secretMountType", value); + sessionStorage.setItem("secretMountType", value); } get policyItem(): string { - return this.storage.getItem("policyItem") || ""; + return sessionStorage.getItem("policyItem") || ""; } set policyItem(value: string) { - this.storage.setItem("policyItem", value); + sessionStorage.setItem("policyItem", value); } get authPath(): string { - return this.storage.getItem("authPath") || ""; + return sessionStorage.getItem("authPath") || ""; } set authPath(value: string) { - this.storage.setItem("authPath", value); + sessionStorage.setItem("authPath", value); } get userPassUser(): string { - return this.storage.getItem("userPassUser") || ""; + return sessionStorage.getItem("userPassUser") || ""; } set userPassUser(value: string) { - this.storage.setItem("userPassUser", value); + sessionStorage.setItem("userPassUser", value); } get currentPage(): string { - const curPage = this.storage.getItem("currentPage") || "HOME"; + const curPage = sessionStorage.getItem("currentPage") || "HOME"; return curPage; } set currentPage(value: string) { - this.storage.setItem("currentPage", value); + sessionStorage.setItem("currentPage", value); } } diff --git a/src/elements/CodeBlock.tsx b/src/ui/elements/CodeBlock.tsx similarity index 100% rename from src/elements/CodeBlock.tsx rename to src/ui/elements/CodeBlock.tsx diff --git a/src/elements/CodeEditor.tsx b/src/ui/elements/CodeEditor.tsx similarity index 100% rename from src/elements/CodeEditor.tsx rename to src/ui/elements/CodeEditor.tsx diff --git a/src/elements/CopyableInputBox.tsx b/src/ui/elements/CopyableInputBox.tsx similarity index 95% rename from src/elements/CopyableInputBox.tsx rename to src/ui/elements/CopyableInputBox.tsx index a71547b..70cf353 100644 --- a/src/elements/CopyableInputBox.tsx +++ b/src/ui/elements/CopyableInputBox.tsx @@ -1,6 +1,6 @@ import { Component, JSX, createRef } from "preact"; import { MarginInline } from "./MarginInline"; -import { addClipboardNotifications } from "../pageUtils"; +import { addClipboardNotifications } from "../../pageUtils"; import ClipboardJS from "clipboard"; import i18next from "i18next"; diff --git a/src/elements/CopyableModal.tsx b/src/ui/elements/CopyableModal.tsx similarity index 97% rename from src/elements/CopyableModal.tsx rename to src/ui/elements/CopyableModal.tsx index c84cec4..7e4dbd9 100644 --- a/src/elements/CopyableModal.tsx +++ b/src/ui/elements/CopyableModal.tsx @@ -1,5 +1,5 @@ import { Component, JSX, createRef } from "preact"; -import { addClipboardNotifications } from "../pageUtils"; +import { addClipboardNotifications } from "../../pageUtils"; import ClipboardJS from "clipboard"; import FileSaver from "file-saver"; import i18next from "i18next"; diff --git a/src/elements/FileUploadInput.tsx b/src/ui/elements/FileUploadInput.tsx similarity index 100% rename from src/elements/FileUploadInput.tsx rename to src/ui/elements/FileUploadInput.tsx diff --git a/src/elements/Form.tsx b/src/ui/elements/Form.tsx similarity index 100% rename from src/elements/Form.tsx rename to src/ui/elements/Form.tsx diff --git a/src/elements/Grid.tsx b/src/ui/elements/Grid.tsx similarity index 100% rename from src/elements/Grid.tsx rename to src/ui/elements/Grid.tsx diff --git a/src/elements/HeaderAndContent.tsx b/src/ui/elements/HeaderAndContent.tsx similarity index 100% rename from src/elements/HeaderAndContent.tsx rename to src/ui/elements/HeaderAndContent.tsx diff --git a/src/elements/InputWithTitle.tsx b/src/ui/elements/InputWithTitle.tsx similarity index 100% rename from src/elements/InputWithTitle.tsx rename to src/ui/elements/InputWithTitle.tsx diff --git a/src/elements/Margin.tsx b/src/ui/elements/Margin.tsx similarity index 100% rename from src/elements/Margin.tsx rename to src/ui/elements/Margin.tsx diff --git a/src/elements/MarginInline.tsx b/src/ui/elements/MarginInline.tsx similarity index 100% rename from src/elements/MarginInline.tsx rename to src/ui/elements/MarginInline.tsx diff --git a/src/elements/NavBar.tsx b/src/ui/elements/NavBar.tsx similarity index 96% rename from src/elements/NavBar.tsx rename to src/ui/elements/NavBar.tsx index ac47dc9..8d6b22c 100644 --- a/src/elements/NavBar.tsx +++ b/src/ui/elements/NavBar.tsx @@ -1,5 +1,5 @@ import { JSX, render } from "preact"; -import { PageRouter } from "../pagerouter/PageRouter"; +import { PageRouter } from "../../pagerouter/PageRouter"; import i18next from "i18next"; export type NavBarProps = { diff --git a/src/elements/QRScanner.tsx b/src/ui/elements/QRScanner.tsx similarity index 100% rename from src/elements/QRScanner.tsx rename to src/ui/elements/QRScanner.tsx diff --git a/src/elements/Tile.tsx b/src/ui/elements/Tile.tsx similarity index 100% rename from src/elements/Tile.tsx rename to src/ui/elements/Tile.tsx diff --git a/src/pages/Access/AccessHome.tsx b/src/ui/pages/Access/AccessHome.tsx similarity index 93% rename from src/pages/Access/AccessHome.tsx rename to src/ui/pages/Access/AccessHome.tsx index 7e277ff..153157a 100644 --- a/src/pages/Access/AccessHome.tsx +++ b/src/ui/pages/Access/AccessHome.tsx @@ -1,7 +1,7 @@ import { Grid, GridSizes } from "../../elements/Grid"; -import { Page } from "../../types/Page"; +import { Page } from "../../../types/Page"; import { Tile } from "../../elements/Tile"; -import { notImplemented, prePageChecks } from "../../pageUtils"; +import { notImplemented, prePageChecks } from "../../../pageUtils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Access/Auth/AuthHome.tsx b/src/ui/pages/Access/Auth/AuthHome.tsx similarity index 88% rename from src/pages/Access/Auth/AuthHome.tsx rename to src/ui/pages/Access/Auth/AuthHome.tsx index 9267f72..e313fd2 100644 --- a/src/pages/Access/Auth/AuthHome.tsx +++ b/src/ui/pages/Access/Auth/AuthHome.tsx @@ -1,9 +1,9 @@ -import { AuthMethod } from "../../../api/types/auth"; +import { AuthMethod } from "../../../../api/types/auth"; import { JSX, render } from "preact"; -import { Page } from "../../../types/Page"; -import { listAuth } from "../../../api/auth/listAuth"; -import { notImplemented } from "../../../pageUtils"; -import { objectToMap } from "../../../utils"; +import { Page } from "../../../../types/Page"; +import { listAuth } from "../../../../api/auth/listAuth"; +import { notImplemented } from "../../../../pageUtils"; +import { objectToMap } from "../../../../utils"; import i18next from "i18next"; export type AuthListElementProps = { diff --git a/src/pages/Access/Auth/AuthViewConfig.tsx b/src/ui/pages/Access/Auth/AuthViewConfig.tsx similarity index 90% rename from src/pages/Access/Auth/AuthViewConfig.tsx rename to src/ui/pages/Access/Auth/AuthViewConfig.tsx index 7501567..1a4d60a 100644 --- a/src/pages/Access/Auth/AuthViewConfig.tsx +++ b/src/ui/pages/Access/Auth/AuthViewConfig.tsx @@ -1,8 +1,8 @@ -import { AuthMethod } from "../../../api/types/auth"; +import { AuthMethod } from "../../../../api/types/auth"; import { HeaderAndContent } from "../../../elements/HeaderAndContent"; -import { Page } from "../../../types/Page"; -import { listAuth } from "../../../api/auth/listAuth"; -import { objectToMap, toStr } from "../../../utils"; +import { Page } from "../../../../types/Page"; +import { listAuth } from "../../../../api/auth/listAuth"; +import { objectToMap, toStr } from "../../../../utils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Access/Auth/userpass/UserPassUserDelete.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx similarity index 85% rename from src/pages/Access/Auth/userpass/UserPassUserDelete.tsx rename to src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx index 26adc6c..b3671bb 100644 --- a/src/pages/Access/Auth/userpass/UserPassUserDelete.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx @@ -1,5 +1,5 @@ -import { Page } from "../../../../types/Page"; -import { deleteUserPassUser } from "../../../../api/auth/userpass/deleteUserPassUser"; +import { Page } from "../../../../../types/Page"; +import { deleteUserPassUser } from "../../../../../api/auth/userpass/deleteUserPassUser"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Access/Auth/userpass/UserPassUserEdit.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx similarity index 92% rename from src/pages/Access/Auth/userpass/UserPassUserEdit.tsx rename to src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx index 40af08b..dc55bfa 100644 --- a/src/pages/Access/Auth/userpass/UserPassUserEdit.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx @@ -2,13 +2,13 @@ import { Form } from "../../../../elements/Form"; import { InputWithTitle } from "../../../../elements/InputWithTitle"; import { Margin } from "../../../../elements/Margin"; import { MarginInline } from "../../../../elements/MarginInline"; -import { Page } from "../../../../types/Page"; -import { UserType } from "../../../../api/types/userpass/user"; -import { createOrUpdateUserPassUser } from "../../../../api/auth/userpass/createOrUpdateUserPassUser"; -import { getUserPassUser } from "../../../../api/auth/userpass/getUserPassUser"; +import { Page } from "../../../../../types/Page"; +import { UserType } from "../../../../../api/types/userpass/user"; +import { createOrUpdateUserPassUser } from "../../../../../api/auth/userpass/createOrUpdateUserPassUser"; +import { getUserPassUser } from "../../../../../api/auth/userpass/getUserPassUser"; import { render } from "preact"; -import { setErrorText } from "../../../../pageUtils"; -import { toStr } from "../../../../utils"; +import { setErrorText } from "../../../../../pageUtils"; +import { toStr } from "../../../../../utils"; import i18next from "i18next"; const removeEmptyStrings = (arr: string[]) => arr.filter((e) => e.length > 0); diff --git a/src/pages/Access/Auth/userpass/UserPassUserNew.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx similarity index 86% rename from src/pages/Access/Auth/userpass/UserPassUserNew.tsx rename to src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx index e218677..293db98 100644 --- a/src/pages/Access/Auth/userpass/UserPassUserNew.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx @@ -1,11 +1,11 @@ import { Form } from "../../../../elements/Form"; import { Margin } from "../../../../elements/Margin"; import { MarginInline } from "../../../../elements/MarginInline"; -import { Page } from "../../../../types/Page"; -import { UserType } from "../../../../api/types/userpass/user"; -import { createOrUpdateUserPassUser } from "../../../../api/auth/userpass/createOrUpdateUserPassUser"; +import { Page } from "../../../../../types/Page"; +import { UserType } from "../../../../../api/types/userpass/user"; +import { createOrUpdateUserPassUser } from "../../../../../api/auth/userpass/createOrUpdateUserPassUser"; import { render } from "preact"; -import { setErrorText } from "../../../../pageUtils"; +import { setErrorText } from "../../../../../pageUtils"; import i18next from "i18next"; export class UserPassUserNewPage extends Page { diff --git a/src/pages/Access/Auth/userpass/UserPassUserView.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx similarity index 94% rename from src/pages/Access/Auth/userpass/UserPassUserView.tsx rename to src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx index 2cb71fb..ecc3f03 100644 --- a/src/pages/Access/Auth/userpass/UserPassUserView.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx @@ -1,9 +1,9 @@ import { HeaderAndContent } from "../../../../elements/HeaderAndContent"; import { Margin } from "../../../../elements/Margin"; -import { Page } from "../../../../types/Page"; -import { getUserPassUser } from "../../../../api/auth/userpass/getUserPassUser"; +import { Page } from "../../../../../types/Page"; +import { getUserPassUser } from "../../../../../api/auth/userpass/getUserPassUser"; import { render } from "preact"; -import { toStr } from "../../../../utils"; +import { toStr } from "../../../../../utils"; import i18next from "i18next"; export class UserPassUserViewPage extends Page { diff --git a/src/pages/Access/Auth/userpass/UserPassUsersList.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx similarity index 89% rename from src/pages/Access/Auth/userpass/UserPassUsersList.tsx rename to src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx index 41ee58b..a85b1d7 100644 --- a/src/pages/Access/Auth/userpass/UserPassUsersList.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx @@ -1,5 +1,5 @@ -import { Page } from "../../../../types/Page"; -import { listUserPassUsers } from "../../../../api/auth/userpass/listUserPassUsers"; +import { Page } from "../../../../../types/Page"; +import { listUserPassUsers } from "../../../../../api/auth/userpass/listUserPassUsers"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Home.tsx b/src/ui/pages/Home.tsx similarity index 91% rename from src/pages/Home.tsx rename to src/ui/pages/Home.tsx index e9183c6..de34cfb 100644 --- a/src/pages/Home.tsx +++ b/src/ui/pages/Home.tsx @@ -1,11 +1,11 @@ import { Grid, GridSizes } from "../elements/Grid"; import { Margin } from "../elements/Margin"; -import { Page } from "../types/Page"; +import { Page } from "../../types/Page"; import { Tile } from "../elements/Tile"; -import { TokenInfo } from "../api/types/token"; -import { getCapabilitiesPath } from "../api/sys/getCapabilities"; -import { lookupSelf } from "../api/sys/lookupSelf"; -import { prePageChecks, setErrorText } from "../pageUtils"; +import { TokenInfo } from "../../api/types/token"; +import { getCapabilitiesPath } from "../../api/sys/getCapabilities"; +import { lookupSelf } from "../../api/sys/lookupSelf"; +import { prePageChecks, setErrorText } from "../../pageUtils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Login.tsx b/src/ui/pages/Login.tsx similarity index 94% rename from src/pages/Login.tsx rename to src/ui/pages/Login.tsx index 793a1b3..93042f4 100644 --- a/src/pages/Login.tsx +++ b/src/ui/pages/Login.tsx @@ -2,10 +2,10 @@ import { Component, JSX, render } from "preact"; import { Form } from "../elements/Form"; import { Margin } from "../elements/Margin"; import { MarginInline } from "../elements/MarginInline"; -import { Page } from "../types/Page"; -import { lookupSelf } from "../api/sys/lookupSelf"; -import { setErrorText } from "../pageUtils"; -import { usernameLogin } from "../api/auth/usernameLogin"; +import { Page } from "../../types/Page"; +import { lookupSelf } from "../../api/sys/lookupSelf"; +import { setErrorText } from "../../pageUtils"; +import { usernameLogin } from "../../api/auth/usernameLogin"; import i18next from "i18next"; export class TokenLoginForm extends Component<{ page: Page }, unknown> { diff --git a/src/pages/Me.tsx b/src/ui/pages/Me.tsx similarity index 91% rename from src/pages/Me.tsx rename to src/ui/pages/Me.tsx index 432a6e9..43f010f 100644 --- a/src/pages/Me.tsx +++ b/src/ui/pages/Me.tsx @@ -1,9 +1,9 @@ import { Component, JSX, createRef, render } from "preact"; -import { Page } from "../types/Page"; -import { addClipboardNotifications, prePageChecks, setErrorText } from "../pageUtils"; -import { getCapsPath } from "../api/sys/getCapabilities"; -import { renewSelf } from "../api/sys/renewSelf"; -import { sealVault } from "../api/sys/sealVault"; +import { Page } from "../../types/Page"; +import { addClipboardNotifications, prePageChecks, setErrorText } from "../../pageUtils"; +import { getCapsPath } from "../../api/sys/getCapabilities"; +import { renewSelf } from "../../api/sys/renewSelf"; +import { sealVault } from "../../api/sys/sealVault"; import ClipboardJS from "clipboard"; import i18next from "i18next"; diff --git a/src/pages/Policies/PoliciesHome.tsx b/src/ui/pages/Policies/PoliciesHome.tsx similarity index 89% rename from src/pages/Policies/PoliciesHome.tsx rename to src/ui/pages/Policies/PoliciesHome.tsx index 8d51e7d..c65ba7d 100644 --- a/src/pages/Policies/PoliciesHome.tsx +++ b/src/ui/pages/Policies/PoliciesHome.tsx @@ -1,7 +1,7 @@ import { Margin } from "../../elements/Margin"; -import { Page } from "../../types/Page"; -import { getPolicies } from "../../api/sys/policies/getPolicies"; -import { prePageChecks } from "../../pageUtils"; +import { Page } from "../../../types/Page"; +import { getPolicies } from "../../../api/sys/policies/getPolicies"; +import { prePageChecks } from "../../../pageUtils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Policies/PolicyDelete.tsx b/src/ui/pages/Policies/PolicyDelete.tsx similarity index 85% rename from src/pages/Policies/PolicyDelete.tsx rename to src/ui/pages/Policies/PolicyDelete.tsx index b76266d..f7683b3 100644 --- a/src/pages/Policies/PolicyDelete.tsx +++ b/src/ui/pages/Policies/PolicyDelete.tsx @@ -1,7 +1,7 @@ -import { Page } from "../../types/Page"; -import { deletePolicy } from "../../api/sys/policies/deletePolicy"; +import { Page } from "../../../types/Page"; +import { deletePolicy } from "../../../api/sys/policies/deletePolicy"; import { render } from "preact"; -import { setErrorText } from "../../pageUtils"; +import { setErrorText } from "../../../pageUtils"; import i18next from "i18next"; export class PolicyDeletePage extends Page { diff --git a/src/pages/Policies/PolicyEdit.tsx b/src/ui/pages/Policies/PolicyEdit.tsx similarity index 91% rename from src/pages/Policies/PolicyEdit.tsx rename to src/ui/pages/Policies/PolicyEdit.tsx index 8e3c784..0e42246 100644 --- a/src/pages/Policies/PolicyEdit.tsx +++ b/src/ui/pages/Policies/PolicyEdit.tsx @@ -2,10 +2,10 @@ import { CodeEditor } from "../../elements/CodeEditor"; import { Component, JSX, render } from "preact"; import { Margin } from "../../elements/Margin"; import { MarginInline } from "../../elements/MarginInline"; -import { Page } from "../../types/Page"; -import { createOrUpdatePolicy } from "../../api/sys/policies/createOrUpdatePolicy"; -import { getPolicy } from "../../api/sys/policies/getPolicy"; -import { setErrorText } from "../../pageUtils"; +import { Page } from "../../../types/Page"; +import { createOrUpdatePolicy } from "../../../api/sys/policies/createOrUpdatePolicy"; +import { getPolicy } from "../../../api/sys/policies/getPolicy"; +import { setErrorText } from "../../../pageUtils"; import i18next from "i18next"; type PolicyEditorProps = { diff --git a/src/pages/Policies/PolicyNew.tsx b/src/ui/pages/Policies/PolicyNew.tsx similarity index 86% rename from src/pages/Policies/PolicyNew.tsx rename to src/ui/pages/Policies/PolicyNew.tsx index a9dd461..4dc3289 100644 --- a/src/pages/Policies/PolicyNew.tsx +++ b/src/ui/pages/Policies/PolicyNew.tsx @@ -1,10 +1,10 @@ import { Form } from "../../elements/Form"; import { Margin } from "../../elements/Margin"; -import { Page } from "../../types/Page"; -import { createOrUpdatePolicy } from "../../api/sys/policies/createOrUpdatePolicy"; -import { getPolicies } from "../../api/sys/policies/getPolicies"; +import { Page } from "../../../types/Page"; +import { createOrUpdatePolicy } from "../../../api/sys/policies/createOrUpdatePolicy"; +import { getPolicies } from "../../../api/sys/policies/getPolicies"; import { render } from "preact"; -import { setErrorText } from "../../pageUtils"; +import { setErrorText } from "../../../pageUtils"; import i18next from "i18next"; export class PolicyNewPage extends Page { diff --git a/src/pages/Policies/PolicyView.tsx b/src/ui/pages/Policies/PolicyView.tsx similarity index 89% rename from src/pages/Policies/PolicyView.tsx rename to src/ui/pages/Policies/PolicyView.tsx index 1062404..a71229c 100644 --- a/src/pages/Policies/PolicyView.tsx +++ b/src/ui/pages/Policies/PolicyView.tsx @@ -1,8 +1,8 @@ import { CodeBlock } from "../../elements/CodeBlock"; import { Margin } from "../../elements/Margin"; -import { Page } from "../../types/Page"; -import { getPolicy } from "../../api/sys/policies/getPolicy"; -import { prePageChecks } from "../../pageUtils"; +import { Page } from "../../../types/Page"; +import { getPolicy } from "../../../api/sys/policies/getPolicy"; +import { prePageChecks } from "../../../pageUtils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/PwGen.tsx b/src/ui/pages/PwGen.tsx similarity index 98% rename from src/pages/PwGen.tsx rename to src/ui/pages/PwGen.tsx index 448f8b7..7cd3400 100644 --- a/src/pages/PwGen.tsx +++ b/src/ui/pages/PwGen.tsx @@ -2,7 +2,7 @@ import { Component, JSX, createRef, render } from "preact"; import { CopyableInputBox } from "../elements/CopyableInputBox"; import { Form } from "../elements/Form"; import { Margin } from "../elements/Margin"; -import { Page } from "../types/Page"; +import { Page } from "../../types/Page"; import i18next from "i18next"; const passwordLengthMin = 1; diff --git a/src/pages/Secrets/DeleteSecretsEngine.tsx b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx similarity index 88% rename from src/pages/Secrets/DeleteSecretsEngine.tsx rename to src/ui/pages/Secrets/DeleteSecretsEngine.tsx index cbfda08..ab1f28a 100644 --- a/src/pages/Secrets/DeleteSecretsEngine.tsx +++ b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx @@ -1,9 +1,9 @@ import { Form } from "../../elements/Form"; import { MarginInline } from "../../elements/MarginInline"; -import { Page } from "../../types/Page"; -import { deleteMount } from "../../api/sys/deleteMount"; +import { Page } from "../../../types/Page"; +import { deleteMount } from "../../../api/sys/deleteMount"; import { render } from "preact"; -import { setErrorText } from "../../pageUtils"; +import { setErrorText } from "../../../pageUtils"; import i18next from "i18next"; export class DeleteSecretsEnginePage extends Page { diff --git a/src/pages/Secrets/KeyValue/KeyValueDelete.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx similarity index 92% rename from src/pages/Secrets/KeyValue/KeyValueDelete.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx index 6a3c183..8d4b2fd 100644 --- a/src/pages/Secrets/KeyValue/KeyValueDelete.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx @@ -1,6 +1,6 @@ -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { deleteSecret } from "../../../api/kv/deleteSecret"; +import { deleteSecret } from "../../../../api/kv/deleteSecret"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Secrets/KeyValue/KeyValueNew.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx similarity index 91% rename from src/pages/Secrets/KeyValue/KeyValueNew.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx index 75f695a..0e7d5f4 100644 --- a/src/pages/Secrets/KeyValue/KeyValueNew.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx @@ -1,10 +1,10 @@ import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { createOrUpdateSecret } from "../../../api/kv/createOrUpdateSecret"; +import { createOrUpdateSecret } from "../../../../api/kv/createOrUpdateSecret"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class KeyValueNewPage extends Page { diff --git a/src/pages/Secrets/KeyValue/KeyValueSecret.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueSecret.tsx similarity index 94% rename from src/pages/Secrets/KeyValue/KeyValueSecret.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueSecret.tsx index 5be0c5e..b64aba5 100644 --- a/src/pages/Secrets/KeyValue/KeyValueSecret.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueSecret.tsx @@ -2,12 +2,12 @@ import { CodeBlock } from "../../../elements/CodeBlock"; import { Component, JSX, render } from "preact"; import { CopyableInputBox } from "../../../elements/CopyableInputBox"; import { Grid, GridSizes } from "../../../elements/Grid"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getCapabilities } from "../../../api/sys/getCapabilities"; -import { getSecret } from "../../../api/kv/getSecret"; -import { sortedObjectMap } from "../../../utils"; -import { undeleteSecret } from "../../../api/kv/undeleteSecret"; +import { getCapabilities } from "../../../../api/sys/getCapabilities"; +import { getSecret } from "../../../../api/kv/getSecret"; +import { sortedObjectMap } from "../../../../utils"; +import { undeleteSecret } from "../../../../api/kv/undeleteSecret"; import i18next from "i18next"; export type KVSecretViewProps = { diff --git a/src/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx similarity index 90% rename from src/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx index dbbc973..49067f0 100644 --- a/src/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueSecretsEdit.tsx @@ -1,11 +1,11 @@ import { CodeEditor } from "../../../elements/CodeEditor"; import { Component, JSX, render } from "preact"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { createOrUpdateSecret } from "../../../api/kv/createOrUpdateSecret"; -import { getSecret } from "../../../api/kv/getSecret"; -import { setErrorText } from "../../../pageUtils"; -import { sortedObjectMap, verifyJSONString } from "../../../utils"; +import { createOrUpdateSecret } from "../../../../api/kv/createOrUpdateSecret"; +import { getSecret } from "../../../../api/kv/getSecret"; +import { setErrorText } from "../../../../pageUtils"; +import { sortedObjectMap, verifyJSONString } from "../../../../utils"; import i18next from "i18next"; //import { highlightElement } from "prismjs"; diff --git a/src/pages/Secrets/KeyValue/KeyValueVersions.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueVersions.tsx similarity index 88% rename from src/pages/Secrets/KeyValue/KeyValueVersions.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueVersions.tsx index 1013788..c6dc2bb 100644 --- a/src/pages/Secrets/KeyValue/KeyValueVersions.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueVersions.tsx @@ -1,7 +1,7 @@ -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getSecretMetadata } from "../../../api/kv/getSecretMetadata"; -import { objectToMap } from "../../../utils"; +import { getSecretMetadata } from "../../../../api/kv/getSecretMetadata"; +import { objectToMap } from "../../../../utils"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Secrets/KeyValue/KeyValueView.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx similarity index 93% rename from src/pages/Secrets/KeyValue/KeyValueView.tsx rename to src/ui/pages/Secrets/KeyValue/KeyValueView.tsx index 5566fad..f8c947e 100644 --- a/src/pages/Secrets/KeyValue/KeyValueView.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx @@ -1,10 +1,10 @@ import { Component, JSX, render } from "preact"; -import { DoesNotExistError } from "../../../types/internalErrors"; -import { Page } from "../../../types/Page"; +import { DoesNotExistError } from "../../../../types/internalErrors"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getCapabilitiesPath } from "../../../api/sys/getCapabilities"; -import { getSecrets } from "../../../api/kv/getSecrets"; -import { setErrorText } from "../../../pageUtils"; +import { getCapabilitiesPath } from "../../../../api/sys/getCapabilities"; +import { getSecrets } from "../../../../api/kv/getSecrets"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export type KVKeysListProps = { diff --git a/src/pages/Secrets/NewEngines/NewKVEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx similarity index 92% rename from src/pages/Secrets/NewEngines/NewKVEngine.tsx rename to src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx index ccbcb0a..3d3cbd1 100644 --- a/src/pages/Secrets/NewEngines/NewKVEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx @@ -1,10 +1,10 @@ import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; -import { newMount } from "../../../api/sys/newMount"; +import { Page } from "../../../../types/Page"; +import { newMount } from "../../../../api/sys/newMount"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class NewKVEnginePage extends Page { diff --git a/src/pages/Secrets/NewEngines/NewTOTPEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx similarity index 90% rename from src/pages/Secrets/NewEngines/NewTOTPEngine.tsx rename to src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx index bc2e553..fd86133 100644 --- a/src/pages/Secrets/NewEngines/NewTOTPEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx @@ -1,10 +1,10 @@ import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; -import { newMount } from "../../../api/sys/newMount"; +import { Page } from "../../../../types/Page"; +import { newMount } from "../../../../api/sys/newMount"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class NewTOTPEnginePage extends Page { diff --git a/src/pages/Secrets/NewEngines/NewTransitEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx similarity index 90% rename from src/pages/Secrets/NewEngines/NewTransitEngine.tsx rename to src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx index cd24159..f2be242 100644 --- a/src/pages/Secrets/NewEngines/NewTransitEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx @@ -1,10 +1,10 @@ import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; -import { newMount } from "../../../api/sys/newMount"; +import { Page } from "../../../../types/Page"; +import { newMount } from "../../../../api/sys/newMount"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class NewTransitEnginePage extends Page { diff --git a/src/pages/Secrets/NewSecretsEngine.tsx b/src/ui/pages/Secrets/NewSecretsEngine.tsx similarity index 96% rename from src/pages/Secrets/NewSecretsEngine.tsx rename to src/ui/pages/Secrets/NewSecretsEngine.tsx index 0218f47..294a861 100644 --- a/src/pages/Secrets/NewSecretsEngine.tsx +++ b/src/ui/pages/Secrets/NewSecretsEngine.tsx @@ -1,5 +1,5 @@ import { Grid, GridSizes } from "../../elements/Grid"; -import { Page } from "../../types/Page"; +import { Page } from "../../../types/Page"; import { Tile } from "../../elements/Tile"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Secrets/SecretTitleElement.tsx b/src/ui/pages/Secrets/SecretTitleElement.tsx similarity index 97% rename from src/pages/Secrets/SecretTitleElement.tsx rename to src/ui/pages/Secrets/SecretTitleElement.tsx index 99d904b..c5cc5e8 100644 --- a/src/pages/Secrets/SecretTitleElement.tsx +++ b/src/ui/pages/Secrets/SecretTitleElement.tsx @@ -1,5 +1,5 @@ import { JSX } from "preact/jsx-runtime"; -import { Page } from "../../types/Page"; +import { Page } from "../../../types/Page"; function currentTitleSecretText(page: Page): string { let secretItemText = page.state.secretItem; diff --git a/src/pages/Secrets/SecretsHome.tsx b/src/ui/pages/Secrets/SecretsHome.tsx similarity index 92% rename from src/pages/Secrets/SecretsHome.tsx rename to src/ui/pages/Secrets/SecretsHome.tsx index fdf2b50..cfba41d 100644 --- a/src/pages/Secrets/SecretsHome.tsx +++ b/src/ui/pages/Secrets/SecretsHome.tsx @@ -1,9 +1,9 @@ import { JSX, render } from "preact"; -import { MountType, getMounts } from "../../api/sys/getMounts"; -import { Page } from "../../types/Page"; -import { getCapsPath } from "../../api/sys/getCapabilities"; -import { prePageChecks } from "../../pageUtils"; -import { sortedObjectMap } from "../../utils"; +import { MountType, getMounts } from "../../../api/sys/getMounts"; +import { Page } from "../../../types/Page"; +import { getCapsPath } from "../../../api/sys/getCapabilities"; +import { prePageChecks } from "../../../pageUtils"; +import { sortedObjectMap } from "../../../utils"; import i18next from "i18next"; export type MountLinkProps = { diff --git a/src/pages/Secrets/TOTP/TOTPDelete.tsx b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx similarity index 91% rename from src/pages/Secrets/TOTP/TOTPDelete.tsx rename to src/ui/pages/Secrets/TOTP/TOTPDelete.tsx index 50b9afa..ef5e0e4 100644 --- a/src/pages/Secrets/TOTP/TOTPDelete.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx @@ -1,6 +1,6 @@ -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { deleteTOTP } from "../../../api/totp/deleteTOTP"; +import { deleteTOTP } from "../../../../api/totp/deleteTOTP"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/Secrets/TOTP/TOTPNew.tsx b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx similarity index 95% rename from src/pages/Secrets/TOTP/TOTPNew.tsx rename to src/ui/pages/Secrets/TOTP/TOTPNew.tsx index 11614e2..5532ded 100644 --- a/src/pages/Secrets/TOTP/TOTPNew.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx @@ -2,11 +2,11 @@ import { Component, JSX, createRef, render } from "preact"; import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { QRScanner } from "../../../elements/QRScanner"; import { SecretTitleElement } from "../SecretTitleElement"; -import { addNewTOTP } from "../../../api/totp/addNewTOTP"; -import { setErrorText } from "../../../pageUtils"; +import { addNewTOTP } from "../../../../api/totp/addNewTOTP"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; function replaceAll(str: string, replace: string, replaceWith: string): string { diff --git a/src/pages/Secrets/TOTP/TOTPView.tsx b/src/ui/pages/Secrets/TOTP/TOTPView.tsx similarity index 90% rename from src/pages/Secrets/TOTP/TOTPView.tsx rename to src/ui/pages/Secrets/TOTP/TOTPView.tsx index c9d2a60..f215bce 100644 --- a/src/pages/Secrets/TOTP/TOTPView.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPView.tsx @@ -1,15 +1,15 @@ import { Component, JSX, render } from "preact"; import { CopyableInputBox } from "../../../elements/CopyableInputBox"; -import { DoesNotExistError } from "../../../types/internalErrors"; +import { DoesNotExistError } from "../../../../types/internalErrors"; import { Grid, GridSizes } from "../../../elements/Grid"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getCapabilitiesPath, getCapsPath } from "../../../api/sys/getCapabilities"; -import { getTOTPCode } from "../../../api/totp/getTOTPCode"; -import { getTOTPKeys } from "../../../api/totp/getTOTPKeys"; -import { removeDoubleSlash } from "../../../utils"; -import { setErrorText } from "../../../pageUtils"; +import { getCapabilitiesPath, getCapsPath } from "../../../../api/sys/getCapabilities"; +import { getTOTPCode } from "../../../../api/totp/getTOTPCode"; +import { getTOTPKeys } from "../../../../api/totp/getTOTPKeys"; +import { removeDoubleSlash } from "../../../../utils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class RefreshingTOTPGridItem extends Component< diff --git a/src/pages/Secrets/Transit/NewTransitKey.tsx b/src/ui/pages/Secrets/Transit/NewTransitKey.tsx similarity index 93% rename from src/pages/Secrets/Transit/NewTransitKey.tsx rename to src/ui/pages/Secrets/Transit/NewTransitKey.tsx index 4497e10..d71149f 100644 --- a/src/pages/Secrets/Transit/NewTransitKey.tsx +++ b/src/ui/pages/Secrets/Transit/NewTransitKey.tsx @@ -1,11 +1,11 @@ import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; import { MarginInline } from "../../../elements/MarginInline"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { newTransitKey } from "../../../api/transit/newTransitKey"; +import { newTransitKey } from "../../../../api/transit/newTransitKey"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; +import { setErrorText } from "../../../../pageUtils"; import i18next from "i18next"; export class NewTransitKeyPage extends Page { diff --git a/src/pages/Secrets/Transit/TransitDecrypt.tsx b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx similarity index 92% rename from src/pages/Secrets/Transit/TransitDecrypt.tsx rename to src/ui/pages/Secrets/Transit/TransitDecrypt.tsx index 3aad7e0..0f04a1f 100644 --- a/src/pages/Secrets/Transit/TransitDecrypt.tsx +++ b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx @@ -3,12 +3,12 @@ import { FileUploadInput } from "../../../elements/FileUploadInput"; import { Form } from "../../../elements/Form"; import { InputWithTitle } from "../../../elements/InputWithTitle"; import { Margin } from "../../../elements/Margin"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { fileToBase64 } from "../../../htmlUtils"; +import { fileToBase64 } from "../../../../htmlUtils"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; -import { transitDecrypt } from "../../../api/transit/transitDecrypt"; +import { setErrorText } from "../../../../pageUtils"; +import { transitDecrypt } from "../../../../api/transit/transitDecrypt"; import UIkit from "uikit"; import i18next from "i18next"; diff --git a/src/pages/Secrets/Transit/TransitEncrypt.tsx b/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx similarity index 92% rename from src/pages/Secrets/Transit/TransitEncrypt.tsx rename to src/ui/pages/Secrets/Transit/TransitEncrypt.tsx index 431fd0c..d434a04 100644 --- a/src/pages/Secrets/Transit/TransitEncrypt.tsx +++ b/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx @@ -3,12 +3,12 @@ import { FileUploadInput } from "../../../elements/FileUploadInput"; import { Form } from "../../../elements/Form"; import { InputWithTitle } from "../../../elements/InputWithTitle"; import { Margin } from "../../../elements/Margin"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { fileToBase64 } from "../../../htmlUtils"; +import { fileToBase64 } from "../../../../htmlUtils"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; -import { transitEncrypt } from "../../../api/transit/transitEncrypt"; +import { setErrorText } from "../../../../pageUtils"; +import { transitEncrypt } from "../../../../api/transit/transitEncrypt"; import UIkit from "uikit"; import i18next from "i18next"; diff --git a/src/pages/Secrets/Transit/TransitRewrap.tsx b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx similarity index 91% rename from src/pages/Secrets/Transit/TransitRewrap.tsx rename to src/ui/pages/Secrets/Transit/TransitRewrap.tsx index efdb0ee..faae513 100644 --- a/src/pages/Secrets/Transit/TransitRewrap.tsx +++ b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx @@ -1,13 +1,13 @@ import { CopyableModal } from "../../../elements/CopyableModal"; import { Form } from "../../../elements/Form"; import { Margin } from "../../../elements/Margin"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getTransitKey } from "../../../api/transit/getTransitKey"; -import { objectToMap } from "../../../utils"; +import { getTransitKey } from "../../../../api/transit/getTransitKey"; +import { objectToMap } from "../../../../utils"; import { render } from "preact"; -import { setErrorText } from "../../../pageUtils"; -import { transitRewrap } from "../../../api/transit/transitRewrap"; +import { setErrorText } from "../../../../pageUtils"; +import { transitRewrap } from "../../../../api/transit/transitRewrap"; import UIkit from "uikit"; import i18next from "i18next"; diff --git a/src/pages/Secrets/Transit/TransitView.tsx b/src/ui/pages/Secrets/Transit/TransitView.tsx similarity index 93% rename from src/pages/Secrets/Transit/TransitView.tsx rename to src/ui/pages/Secrets/Transit/TransitView.tsx index 0bebc4d..f5e56e7 100644 --- a/src/pages/Secrets/Transit/TransitView.tsx +++ b/src/ui/pages/Secrets/Transit/TransitView.tsx @@ -1,8 +1,8 @@ import { Component, JSX, render } from "preact"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; -import { getCapabilitiesPath } from "../../../api/sys/getCapabilities"; -import { getTransitKeys } from "../../../api/transit/getTransitKeys"; +import { getCapabilitiesPath } from "../../../../api/sys/getCapabilities"; +import { getTransitKeys } from "../../../../api/transit/getTransitKeys"; import i18next from "i18next"; type TransitViewListState = { diff --git a/src/pages/Secrets/Transit/TransitViewSecret.tsx b/src/ui/pages/Secrets/Transit/TransitViewSecret.tsx similarity index 94% rename from src/pages/Secrets/Transit/TransitViewSecret.tsx rename to src/ui/pages/Secrets/Transit/TransitViewSecret.tsx index 3f636dd..dce33a9 100644 --- a/src/pages/Secrets/Transit/TransitViewSecret.tsx +++ b/src/ui/pages/Secrets/Transit/TransitViewSecret.tsx @@ -1,8 +1,8 @@ import { Grid, GridSizes } from "../../../elements/Grid"; -import { Page } from "../../../types/Page"; +import { Page } from "../../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; import { Tile } from "../../../elements/Tile"; -import { getTransitKey } from "../../../api/transit/getTransitKey"; +import { getTransitKey } from "../../../../api/transit/getTransitKey"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/SetLanguage.tsx b/src/ui/pages/SetLanguage.tsx similarity index 94% rename from src/pages/SetLanguage.tsx rename to src/ui/pages/SetLanguage.tsx index 0746294..e95dc66 100644 --- a/src/pages/SetLanguage.tsx +++ b/src/ui/pages/SetLanguage.tsx @@ -1,11 +1,11 @@ // @ts-ignore -import translations from "../translations/index.mjs"; +import translations from "../../translations/index.mjs"; // ts-unignore import { Form } from "../elements/Form"; import { Margin } from "../elements/Margin"; import { MarginInline } from "../elements/MarginInline"; -import { Page } from "../types/Page"; +import { Page } from "../../types/Page"; import { reloadNavBar } from "../elements/NavBar"; import { render } from "preact"; import i18next from "i18next"; diff --git a/src/pages/SetVaultURL.tsx b/src/ui/pages/SetVaultURL.tsx similarity index 96% rename from src/pages/SetVaultURL.tsx rename to src/ui/pages/SetVaultURL.tsx index 822408a..c28938f 100644 --- a/src/pages/SetVaultURL.tsx +++ b/src/ui/pages/SetVaultURL.tsx @@ -1,6 +1,6 @@ import { Form } from "../elements/Form"; import { Margin } from "../elements/Margin"; -import { Page } from "../types/Page"; +import { Page } from "../../types/Page"; import { render } from "preact"; export class SetVaultURLPage extends Page { diff --git a/src/pages/Unseal.tsx b/src/ui/pages/Unseal.tsx similarity index 93% rename from src/pages/Unseal.tsx rename to src/ui/pages/Unseal.tsx index f32fc9b..b68093e 100644 --- a/src/pages/Unseal.tsx +++ b/src/ui/pages/Unseal.tsx @@ -1,13 +1,13 @@ import { Component, JSX, render } from "preact"; import { Form } from "../elements/Form"; import { MarginInline } from "../elements/MarginInline"; -import { Page } from "../types/Page"; +import { Page } from "../../types/Page"; import { QRScanner } from "../elements/QRScanner"; -import { getSealStatus } from "../api/sys/getSealStatus"; +import { getSealStatus } from "../../api/sys/getSealStatus"; -import { setErrorText } from "../pageUtils"; -import { submitUnsealKey } from "../api/sys/submitUnsealKey"; -import { toStr } from "../utils"; +import { setErrorText } from "../../pageUtils"; +import { submitUnsealKey } from "../../api/sys/submitUnsealKey"; +import { toStr } from "../../utils"; import i18next from "i18next"; const UnsealInputModes = {