From 16e0baa90a4f5428fc5d1006c076b6a2e660e1fb Mon Sep 17 00:00:00 2001 From: Laurin Weger Date: Fri, 5 Jul 2024 15:12:27 +0200 Subject: [PATCH] user panel updates: wallet and account infos --- ng-app/src/App.svelte | 4 + ng-app/src/lib/components/DeviceIcon.svelte | 57 +++ ng-app/src/routes/AccountInfo.svelte | 370 ++++++++++++++++++++ ng-app/src/routes/User.svelte | 118 ++----- ng-app/src/routes/WalletInfo.svelte | 351 +++++++++++++++++++ ng-app/src/routes/WalletLogin.svelte | 7 + 6 files changed, 809 insertions(+), 98 deletions(-) create mode 100644 ng-app/src/lib/components/DeviceIcon.svelte create mode 100644 ng-app/src/routes/AccountInfo.svelte create mode 100644 ng-app/src/routes/WalletInfo.svelte diff --git a/ng-app/src/App.svelte b/ng-app/src/App.svelte index e643f52..87570ac 100644 --- a/ng-app/src/App.svelte +++ b/ng-app/src/App.svelte @@ -29,11 +29,13 @@ import WalletCreate from "./routes/WalletCreate.svelte"; import Invitation from "./routes/Invitation.svelte"; import WalletLogin from "./routes/WalletLogin.svelte"; + import WalletInfo from "./routes/WalletInfo.svelte"; import User from "./routes/User.svelte"; import UserRegistered from "./routes/UserRegistered.svelte"; import Install from "./routes/Install.svelte"; import ng from "./api"; + import AccountInfo from "./routes/AccountInfo.svelte"; const routes = new Map(); routes.set("/", Home); @@ -43,6 +45,8 @@ routes.set("/i/:invitation", Invitation); routes.set("/user", User); routes.set("/user/registered", UserRegistered); + routes.set("/wallet", WalletInfo); + routes.set("/user/account", AccountInfo); if (import.meta.env.NG_APP_WEB) routes.set("/install", Install); routes.set(/^\/did:ng(.*)/i, NURI); routes.set("*", NotFound); diff --git a/ng-app/src/lib/components/DeviceIcon.svelte b/ng-app/src/lib/components/DeviceIcon.svelte new file mode 100644 index 0000000..03b2370 --- /dev/null +++ b/ng-app/src/lib/components/DeviceIcon.svelte @@ -0,0 +1,57 @@ + + + + + + + diff --git a/ng-app/src/routes/AccountInfo.svelte b/ng-app/src/routes/AccountInfo.svelte new file mode 100644 index 0000000..23365ff --- /dev/null +++ b/ng-app/src/routes/AccountInfo.svelte @@ -0,0 +1,370 @@ + + + + + + + +
+
+ + + + +
  • +

    Account Info

    +
  • + +
  • window.history.go(-1)} + on:click={() => window.history.go(-1)} + > + + Back +
  • +
    + + + {#each display_sites as site} +
  • +

    + {site.name} +

    +
  • + + + +
  • +

    + Devices +

    +
  • + {#each site.devices as device, index} +
  • +
    + +
    +
    +
    + + {device.name} +
    +
    + + {device.peer_id} +
    +
    + + {device.version} +
    +
    + + {device.device_name} +
    +
    +
  • + {/each} +
    + + + +
  • +

    + Brokers +

    +
  • + + {#if display_brokers.length > 0} + {#each Object.values(display_brokers) as broker, index} + +
  • +
    + +
    + +
    +
    + + {broker.address} +
    +
    + + {broker.last_connected} +
    +
    + + {broker.id} +
    +
    + + {broker.can_forward} +
    +
    + + {broker.can_verify} +
    +
    +
  • + {/each} + {:else} +
  • + No brokers connected +
  • + {/if} +
    + {/each} +
    +
    +
    + {#if error} +
    + + {#if error == "AlreadyExists"} +

    + The user is already registered with the selected broker.
    Try logging + in instead +

    + + + + {:else} +

    + An error occurred:
    {error} +

    + + + + {/if} +
    + {/if} +
    +
    + + diff --git a/ng-app/src/routes/User.svelte b/ng-app/src/routes/User.svelte index 753fb83..05233e9 100644 --- a/ng-app/src/routes/User.svelte +++ b/ng-app/src/routes/User.svelte @@ -8,6 +8,13 @@ // notice may not be copied, modified, or distributed except // according to those terms. --> + + + + + +
    +
    + + + +
  • +

    Wallet Info

    +
  • + + + +
  • window.history.go(-1)} + on:click={() => window.history.go(-1)} + > + + Back +
  • + + + + {#if !downloading} + + {:else if download_error} +
  • +
    + +
    + Download failed:
    {download_error}
    +
  • + {:else if !wallet_file_ready} +
  • +
    + +
    + Download in progress... +
  • + {:else if download_link === true} +
  • + You will find the file named "{wallet_file_ready}"
    in + your Downloads folder
    +
  • + {:else} +
  • + + + +
  • + {/if} + + +
  • +
    + +
    + Remove Wallet from Device + +

    + Are you sure you want to remove this wallet from your device? +

    +
    + + + +
    +
    +
  • + + + {#if false} +
  • +
    + +
    + Wallet QR-Code + Use this QR-Code to log in with your wallet on new devices. + +
  • + {/if} + + + {#if false} +
  • +
    + +
    + Copy Wallet Link +
  • + {/if} + + + {#if false} +
  • + + + Save to Device for Future Logins +
  • + {/if} +
    +
    +
    +
    + {#if error} +
    + + {#if error == "AlreadyExists"} +

    + The user is already registered with the selected broker.
    Try logging + in instead +

    + + + + {:else} +

    + An error occurred:
    {error} +

    + + + + {/if} +
    + {/if} +
    +
    + + diff --git a/ng-app/src/routes/WalletLogin.svelte b/ng-app/src/routes/WalletLogin.svelte index fe54473..cff2274 100644 --- a/ng-app/src/routes/WalletLogin.svelte +++ b/ng-app/src/routes/WalletLogin.svelte @@ -9,6 +9,13 @@ // according to those terms. --> + +