From 6baec10b45ec6d51ac39e9743e5a6e1016801770 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sat, 17 Apr 2021 10:45:42 +0100 Subject: [PATCH] Reorganise pages folder. --- src/pages/{ => KeyValue}/KeyValueDelete.js | 8 +++---- src/pages/{ => KeyValue}/KeyValueNew.js | 8 +++---- src/pages/{ => KeyValue}/KeyValueSecrets.js | 14 ++++------- .../{ => KeyValue}/KeyValueSecretsEdit.js | 10 ++++---- src/pages/{ => KeyValue}/KeyValueVersions.js | 8 +++---- src/pages/{ => KeyValue}/KeyValueView.js | 8 +++---- src/pages/{ => TOTP}/NewTOTP.js | 12 +++++----- src/pages/{ => TOTP}/TOTPView.js | 10 ++++---- src/pages/{ => Transit}/TransitDecrypt.js | 12 +++++----- src/pages/{ => Transit}/TransitEncrypt.js | 12 +++++----- src/pages/{ => Transit}/TransitView.js | 8 +++---- src/pages/{ => Transit}/TransitViewSecret.js | 6 ++--- src/pages/index.js | 24 +++++++++---------- 13 files changed, 68 insertions(+), 72 deletions(-) rename src/pages/{ => KeyValue}/KeyValueDelete.js (82%) rename src/pages/{ => KeyValue}/KeyValueNew.js (91%) rename src/pages/{ => KeyValue}/KeyValueSecrets.js (93%) rename src/pages/{ => KeyValue}/KeyValueSecretsEdit.js (88%) rename src/pages/{ => KeyValue}/KeyValueVersions.js (81%) rename src/pages/{ => KeyValue}/KeyValueView.js (90%) rename src/pages/{ => TOTP}/NewTOTP.js (88%) rename src/pages/{ => TOTP}/TOTPView.js (86%) rename src/pages/{ => Transit}/TransitDecrypt.js (85%) rename src/pages/{ => Transit}/TransitEncrypt.js (89%) rename src/pages/{ => Transit}/TransitView.js (86%) rename src/pages/{ => Transit}/TransitViewSecret.js (94%) diff --git a/src/pages/KeyValueDelete.js b/src/pages/KeyValue/KeyValueDelete.js similarity index 82% rename from src/pages/KeyValueDelete.js rename to src/pages/KeyValue/KeyValueDelete.js index 432308b..b9a2387 100644 --- a/src/pages/KeyValueDelete.js +++ b/src/pages/KeyValue/KeyValueDelete.js @@ -1,7 +1,7 @@ -import { Page } from "../types/Page.js"; -import { deleteSecret } from "../api.js"; -import { setPageContent, setTitleElement } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { deleteSecret } from "../../api.js"; +import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class KeyValueDeletePage extends Page { constructor() { diff --git a/src/pages/KeyValueNew.js b/src/pages/KeyValue/KeyValueNew.js similarity index 91% rename from src/pages/KeyValueNew.js rename to src/pages/KeyValue/KeyValueNew.js index 2cac8c0..7ee6e98 100644 --- a/src/pages/KeyValueNew.js +++ b/src/pages/KeyValue/KeyValueNew.js @@ -1,7 +1,7 @@ -import { Page } from "../types/Page.js"; -import { createOrUpdateSecret } from "../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { createOrUpdateSecret } from "../../api.js"; +import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class KeyValueNewPage extends Page { constructor() { diff --git a/src/pages/KeyValueSecrets.js b/src/pages/KeyValue/KeyValueSecrets.js similarity index 93% rename from src/pages/KeyValueSecrets.js rename to src/pages/KeyValue/KeyValueSecrets.js index b6c8dfc..91d054e 100644 --- a/src/pages/KeyValueSecrets.js +++ b/src/pages/KeyValue/KeyValueSecrets.js @@ -1,15 +1,11 @@ -import { Page } from "../types/Page.js"; -import { getSecret, undeleteSecret, getCapabilities } from "../api.js"; -import { setPageContent, setTitleElement } from "../pageUtils.js"; -import { CopyableInputBox } from "../elements/CopyableInputBox.js"; -import { makeElement } from "../htmlUtils.js"; - +import { Page } from "../../types/Page.js"; +import { getSecret, undeleteSecret, getCapabilities } from "../../api.js"; +import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; +import { makeElement } from "../../htmlUtils.js"; import Prism from "prismjs"; - - - export class KeyValueSecretsPage extends Page { constructor() { super(); diff --git a/src/pages/KeyValueSecretsEdit.js b/src/pages/KeyValue/KeyValueSecretsEdit.js similarity index 88% rename from src/pages/KeyValueSecretsEdit.js rename to src/pages/KeyValue/KeyValueSecretsEdit.js index fc74dab..2e65392 100644 --- a/src/pages/KeyValueSecretsEdit.js +++ b/src/pages/KeyValue/KeyValueSecretsEdit.js @@ -1,9 +1,9 @@ -import { Page } from "../types/Page.js"; -import { getSecret, createOrUpdateSecret } from "../api.js"; -import { verifyJSONString } from "../utils.js"; -import { setPageContent, setTitleElement, setErrorText } from "../pageUtils.js"; +import { Page } from "../../types/Page.js"; +import { getSecret, createOrUpdateSecret } from "../../api.js"; +import { verifyJSONString } from "../../utils.js"; +import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; import { CodeJar } from "codejar"; -import { makeElement } from "../htmlUtils.js"; export class KeyValueSecretsEditPage extends Page { constructor() { diff --git a/src/pages/KeyValueVersions.js b/src/pages/KeyValue/KeyValueVersions.js similarity index 81% rename from src/pages/KeyValueVersions.js rename to src/pages/KeyValue/KeyValueVersions.js index 0ec4b08..4a11148 100644 --- a/src/pages/KeyValueVersions.js +++ b/src/pages/KeyValue/KeyValueVersions.js @@ -1,7 +1,7 @@ -import { Page } from "../types/Page.js"; -import { getSecretMetadata } from "../api.js"; -import { setPageContent, setTitleElement } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { getSecretMetadata } from "../../api.js"; +import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class KeyValueVersionsPage extends Page { constructor() { diff --git a/src/pages/KeyValueView.js b/src/pages/KeyValue/KeyValueView.js similarity index 90% rename from src/pages/KeyValueView.js rename to src/pages/KeyValue/KeyValueView.js index f6d9d82..5805009 100644 --- a/src/pages/KeyValueView.js +++ b/src/pages/KeyValue/KeyValueView.js @@ -1,7 +1,7 @@ -import { Page } from "../types/Page.js"; -import { DoesNotExistError, getSecrets } from "../api.js"; -import { setErrorText, setTitleElement } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { DoesNotExistError, getSecrets } from "../../api.js"; +import { setErrorText, setTitleElement } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class KeyValueViewPage extends Page { constructor() { diff --git a/src/pages/NewTOTP.js b/src/pages/TOTP/NewTOTP.js similarity index 88% rename from src/pages/NewTOTP.js rename to src/pages/TOTP/NewTOTP.js index d3995b3..48db55c 100644 --- a/src/pages/NewTOTP.js +++ b/src/pages/TOTP/NewTOTP.js @@ -1,9 +1,9 @@ -import { Page } from "../types/Page.js"; -import { addNewTOTP } from "../api.js"; -import { setTitleElement, setPageContent, setErrorText, changePage } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; -import { Margin } from "../elements/Margin.js"; -import { MarginInline } from "../elements/MarginInline.js"; +import { Page } from "../../types/Page.js"; +import { addNewTOTP } from "../../api.js"; +import { setTitleElement, setPageContent, setErrorText, changePage } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; +import { Margin } from "../../elements/Margin.js"; +import { MarginInline } from "../../elements/MarginInline.js"; export class NewTOTPPage extends Page { constructor() { diff --git a/src/pages/TOTPView.js b/src/pages/TOTP/TOTPView.js similarity index 86% rename from src/pages/TOTPView.js rename to src/pages/TOTP/TOTPView.js index 6d3cdb7..2b25da4 100644 --- a/src/pages/TOTPView.js +++ b/src/pages/TOTP/TOTPView.js @@ -1,8 +1,8 @@ -import { Page } from "../types/Page.js"; -import { getTOTPKeys, getTOTPCode } from "../api.js"; -import { setTitleElement, setPageContent } from "../pageUtils.js"; -import { CopyableInputBox } from "../elements/CopyableInputBox.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { getTOTPKeys, getTOTPCode } from "../../api.js"; +import { setTitleElement, setPageContent } from "../../pageUtils.js"; +import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; +import { makeElement } from "../../htmlUtils.js"; export class TOTPViewPage extends Page { constructor() { diff --git a/src/pages/TransitDecrypt.js b/src/pages/Transit/TransitDecrypt.js similarity index 85% rename from src/pages/TransitDecrypt.js rename to src/pages/Transit/TransitDecrypt.js index bea329f..60b4ee8 100644 --- a/src/pages/TransitDecrypt.js +++ b/src/pages/Transit/TransitDecrypt.js @@ -1,9 +1,9 @@ -import { Page } from "../types/Page.js"; -import { transitDecrypt } from "../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; -import { Margin } from "../elements/Margin.js"; -import { CopyableModal } from "../elements/CopyableModal.js"; +import { Page } from "../../types/Page.js"; +import { transitDecrypt } from "../../api.js"; +import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; +import { Margin } from "../../elements/Margin.js"; +import { CopyableModal } from "../../elements/CopyableModal.js"; import UIkit from 'uikit/dist/js/uikit.min.js'; diff --git a/src/pages/TransitEncrypt.js b/src/pages/Transit/TransitEncrypt.js similarity index 89% rename from src/pages/TransitEncrypt.js rename to src/pages/Transit/TransitEncrypt.js index 050f162..f3bdc0b 100644 --- a/src/pages/TransitEncrypt.js +++ b/src/pages/Transit/TransitEncrypt.js @@ -1,9 +1,9 @@ -import { Page } from "../types/Page.js"; -import { transitEncrypt } from "../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; -import { Margin } from "../elements/Margin.js"; -import { CopyableModal } from "../elements/CopyableModal.js"; +import { Page } from "../../types/Page.js"; +import { transitEncrypt } from "../../api.js"; +import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; +import { Margin } from "../../elements/Margin.js"; +import { CopyableModal } from "../../elements/CopyableModal.js"; import UIkit from 'uikit/dist/js/uikit.min.js'; diff --git a/src/pages/TransitView.js b/src/pages/Transit/TransitView.js similarity index 86% rename from src/pages/TransitView.js rename to src/pages/Transit/TransitView.js index acf0864..fcdb7dd 100644 --- a/src/pages/TransitView.js +++ b/src/pages/Transit/TransitView.js @@ -1,7 +1,7 @@ -import { Page } from "../types/Page.js"; -import { DoesNotExistError, getTransitKeys } from "../api.js"; -import { setErrorText, setTitleElement } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { DoesNotExistError, getTransitKeys } from "../../api.js"; +import { setErrorText, setTitleElement } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class TransitViewPage extends Page { constructor() { diff --git a/src/pages/TransitViewSecret.js b/src/pages/Transit/TransitViewSecret.js similarity index 94% rename from src/pages/TransitViewSecret.js rename to src/pages/Transit/TransitViewSecret.js index 102cc0c..cca7242 100644 --- a/src/pages/TransitViewSecret.js +++ b/src/pages/Transit/TransitViewSecret.js @@ -1,6 +1,6 @@ -import { Page } from "../types/Page.js"; -import { changePage, setPageContent, setTitleElement } from "../pageUtils.js"; -import { makeElement } from "../htmlUtils.js"; +import { Page } from "../../types/Page.js"; +import { changePage, setPageContent, setTitleElement } from "../../pageUtils.js"; +import { makeElement } from "../../htmlUtils.js"; export class TransitViewSecretPage extends Page { constructor() { diff --git a/src/pages/index.js b/src/pages/index.js index a4e6d0a..e89bb4c 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,17 +1,17 @@ export { HomePage } from "./Home.js"; -export { TOTPViewPage } from "./TOTPView.js"; -export { NewTOTPPage } from "./NewTOTP.js"; +export { TOTPViewPage } from "./TOTP/TOTPView.js"; +export { NewTOTPPage } from "./TOTP/NewTOTP.js"; export { LoginPage } from "./Login.js"; export { SetVaultURLPage } from "./SetVaultURL.js"; export { UnsealPage } from "./Unseal.js"; -export { KeyValueViewPage } from "./KeyValueView.js"; -export { KeyValueSecretsPage } from "./KeyValueSecrets.js"; -export { KeyValueVersionsPage } from "./KeyValueVersions.js"; -export { KeyValueNewPage } from "./KeyValueNew.js"; -export { KeyValueDeletePage } from "./KeyValueDelete.js"; -export { KeyValueSecretsEditPage } from "./KeyValueSecretsEdit.js"; +export { KeyValueViewPage } from "./KeyValue/KeyValueView.js"; +export { KeyValueSecretsPage } from "./KeyValue/KeyValueSecrets.js"; +export { KeyValueVersionsPage } from "./KeyValue/KeyValueVersions.js"; +export { KeyValueNewPage } from "./KeyValue/KeyValueNew.js"; +export { KeyValueDeletePage } from "./KeyValue/KeyValueDelete.js"; +export { KeyValueSecretsEditPage } from "./KeyValue/KeyValueSecretsEdit.js"; export { PwGenPage } from "./PwGen.js"; -export { TransitViewPage } from "./TransitView.js"; -export { TransitViewSecretPage } from "./TransitViewSecret.js"; -export { TransitEncryptPage } from "./TransitEncrypt.js"; -export { TransitDecryptPage } from "./TransitDecrypt.js"; \ No newline at end of file +export { TransitViewPage } from "./Transit/TransitView.js"; +export { TransitViewSecretPage } from "./Transit/TransitViewSecret.js"; +export { TransitEncryptPage } from "./Transit/TransitEncrypt.js"; +export { TransitDecryptPage } from "./Transit/TransitDecrypt.js"; \ No newline at end of file