From 2945ed50d18d1e0ee6d95d6c720aa4bd735fa772 Mon Sep 17 00:00:00 2001 From: Christoph Stenglein Date: Sun, 18 Feb 2024 16:23:39 +0100 Subject: [PATCH] add custom page functionality; add electrs page --- backend-mock/apps.js | 15 +++ backend-mock/sse/installed_app_status.js | 14 +++ public/assets/apps/logos/electrs.png | Bin 0 -> 21366 bytes src/App.tsx | 26 ++++ src/components/AppStatusItem.tsx | 23 +++- src/hooks/use-sse.tsx | 2 +- src/i18n/langs/en.json | 8 ++ src/models/app.model.ts | 4 + src/pages/Apps/AppCard.tsx | 17 ++- src/pages/Apps/AppInfo.tsx | 91 ++++++++------ src/pages/Apps/AppList.tsx | 7 +- src/pages/Apps/AppPage.tsx | 48 ++++++++ src/pages/Apps/ImageCarousel.tsx | 4 + src/pages/Apps/__tests__/AppCard.test.tsx | 1 - src/pages/Apps/customApps/Electrs.tsx | 139 ++++++++++++++++++++++ src/pages/Apps/index.tsx | 41 +------ src/utils/availableApps.ts | 133 +++++++++------------ 17 files changed, 406 insertions(+), 167 deletions(-) create mode 100644 public/assets/apps/logos/electrs.png create mode 100644 src/pages/Apps/AppPage.tsx create mode 100644 src/pages/Apps/customApps/Electrs.tsx diff --git a/backend-mock/apps.js b/backend-mock/apps.js index 1b34cef8..6e1df483 100644 --- a/backend-mock/apps.js +++ b/backend-mock/apps.js @@ -23,6 +23,21 @@ router.post("/uninstall/:id", (req, res) => { res.status(200).send(); }); +router.get("/status_advanced/electrs", (req, res) => { + console.info("call to /api/v1/apps/status_advanced/electrs"); + res.status(200).send( + JSON.stringify({ + version: "v0.10.2", + localIP: "192.168.0.1", + publicIP: "127.0.0.1", + portTCP: "50001", + portSSL: "50002", + TORaddress: "myTorURL.onion", + initialSyncDone: true, + }), + ); +}); + const installApp = () => { console.info("call to installApp"); diff --git a/backend-mock/sse/installed_app_status.js b/backend-mock/sse/installed_app_status.js index 137453c5..e52da86b 100644 --- a/backend-mock/sse/installed_app_status.js +++ b/backend-mock/sse/installed_app_status.js @@ -47,6 +47,20 @@ const appStatus = () => { status: "offline", error: "", }, + { + id: "jam", + installed: false, + version: "v1.0.0", + status: "offline", + error: "", + }, + { + id: "electrs", + installed: true, + version: "v1.0.0", + status: "offline", + error: "", + }, ]); }; diff --git a/public/assets/apps/logos/electrs.png b/public/assets/apps/logos/electrs.png new file mode 100644 index 0000000000000000000000000000000000000000..06b3e0cf01be831dce955cb4111e1864a74201fc GIT binary patch literal 21366 zcmV*-Kr+9HP)EX>4Tx04R}tkv&MmKpe$iQ>7{u5j%)DWT;MdsUnVAg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`jaO1Pr1VaRg*$8FP}9g75gcM}V()F`ngr?$6P$<}C&UMB-Uym^SeS@${x` zaNZ}5u#&72pA%1*bV1@rt}7nDaW1+n@XUyrNzW5Uh{a+DD;>;ArbawP991=)@`bF& zD(5ZETBXKX_v9}O=k=9kuG1Vv5{p=Z1Q7~qD5C-!Fz5RQp)!z?eJaV9&9?jeU000JJOGiWi6aYg2XkC_2&Hw-a32;bRa{vGh z*8l(w*8xH(n|J^K00(qQO+^Rj0uc!_3ctzcbN~P#07*naRCwC#op*FpMH`2o*^=G# zKtc(j_ufeYh|-j57dwcQfFLMVEQr`pQLs=XC>B7hhy^KvG%2C?-XZja^lZKJ{jnCd zB-wH|@G0*(oI~#J&di;e-@IksBDh9Z0|{f&;L#vP01-&OHtB6oux4iNwW+zXq`5W) z0aDV4C|afH18KsTGZ_A{l;nB~)`I*!#D3r~LnqAwtX z5Wf^^t@mH!M%OqYlUZqJ~Z(O_6e$6*m(fh;lQek5Ir`AUUQgW+|r zxl!_&cYp^yeDn~lQo^pS+BJZb3Kr#-Q77)WwsO}1QcBu~=HX)JPSVAYY5t0iV|7Jx4`F^CsN~HWNhzk# zr;oO1&XF<_!3!loZNRmKyQZXj#{rU3Ith4OO5)JS&rIuQ%EKawTIv*c&M{;lLeB7FEv3{_$GkT6u-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7*aq8kVl%21@SJ$e+%-wbfb+)G^`dgh=BOmd&|r9s)nX!H{808x_T8gwe`4lrvbO_)Z_ZC zI$Wu|iJIEG2uCn+FM}X~>RkBbq%(j6%v?%DKL!xend`1gpzK0L(CWem0apReB+zRN zjP~{1qR=QstY3^w}Y88^El?AV>i9b7==hZ-B7MY?20xB6(q>l5zThyN91B;9QgBw+l&GH|O+YiB^5CZZb$3#YuYzFPi$?>yWSYG@q{9OVYW6Ux0^+V5OK-H zA}&h-OY~C!E%$%lV2P${iu`kw$eso65fjDJjIFz+sak>jATOtgY5Y9^e=-E_(wvUG z|NYREjQs?jd*A8yZm`+22CP52rCKPC8AS9hfR@DsYjoDvM4G%1A`n*lqLC)>G%!`F zmZpE=Uz@$&8vA(4fk`@$szTIYcvi#0|5$QV7t#0tEbh7L^?H-YAKL=FIuny`d` zJ6_CSrJ5~aLq}~i#qlA4-*wPL*es?U#>g222?{hNArHWnwz import("./pages/Setup")); const LazyHome = lazy(() => import("./pages/Home")); const LazyApps = lazy(() => import("./pages/Apps")); const LazySettings = lazy(() => import("./pages/Settings")); +const LazyAppInfo = lazy(() => import("./pages/Apps/AppInfo")); const App: FC = () => { const [isLoading, setIsLoading] = useState(true); @@ -140,6 +142,30 @@ const App: FC = () => { } /> + }> + + + + + + + } + /> + }> + + + + + + + } + /> ); }; diff --git a/src/components/AppStatusItem.tsx b/src/components/AppStatusItem.tsx index 9e481989..1be4f65d 100644 --- a/src/components/AppStatusItem.tsx +++ b/src/components/AppStatusItem.tsx @@ -3,6 +3,7 @@ import { getHrefFromApp } from "@/utils"; import AppIcon from "@/components/AppIcon"; import { AppStatus } from "@/models/app-status"; import { availableApps } from "@/utils/availableApps"; +import { useNavigate } from "react-router-dom"; type Props = { app: AppStatus; @@ -10,13 +11,29 @@ type Props = { export const AppStatusItem: FC = ({ app }) => { const { id } = app; - const appName = availableApps.get(id)?.name; + const navigate = useNavigate(); + const appName = availableApps[id]!.name; + const customComponent = availableApps[id]!.customComponent; + + if (customComponent) { + return ( + navigate(`/apps/${id}`)} + className="flex w-full cursor-pointer items-center justify-center py-4 opacity-80 hover:text-yellow-500 dark:text-white dark:hover:text-yellow-500 md:flex-col lg:flex-row" + > + {/* Icon */} + + {/* Content */} + {appName} + + ); + } return ( {/* Icon */} diff --git a/src/hooks/use-sse.tsx b/src/hooks/use-sse.tsx index e3ba536b..bdfab5e1 100644 --- a/src/hooks/use-sse.tsx +++ b/src/hooks/use-sse.tsx @@ -106,7 +106,7 @@ function useSSE() { const setInstall = (event: MessageEvent) => { toast.dismiss(); const installAppData = JSON.parse(event.data) as InstallAppData; - const appName = availableApps.get(installAppData.id)?.name || ""; + const appName = availableApps[installAppData.id]?.name || ""; if (installAppData.result === "fail") { appInstallErrorHandler(installAppData, appName); sseCtx.setInstallingApp(null); diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 522e1c2a..dd41ff18 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -33,6 +33,14 @@ "about": "Jam is a web interface for JoinMarket focusing on user-friendliness and ease-of-use. It aims to provide sensible defaults and be easy to use for beginners while still having the features advanced users expect.", "shortDescription": "Jam - A web interface for JoinMarket" }, + "electrs": { + "about": "Electrs is an efficient re-implementation of Electrum Server in Rust. It indexes the entire Bitcoin blockchain, and allows your Lightning node to query it for on-chain transactions.", + "shortDescription": "Efficient re-implementation of Electrum Server in Rust", + "initialSync": "The index database needs to be created before Electrum Server can be used. This can take hours / days depending on your RaspiBlitz. Please check back later.", + "connectLocal": "Connect to Electrum Server over Local Network", + "connectTor": "Connect to Electrum Server over Tor", + "connectionInfo": "Use these addresses to connect to ElectRS from your Bitcoin Core node. You can use the local connection if you are on the same network or the Tor address if you are using Tor. You can also use the QR code to connect to ElectRS." + }, "alby": { "about": "Alby Browser Extension", "shortDescription": "Connect your RaspiBlitz LND node and use Bitcoin & Nostr apps with the Alby Extension", diff --git a/src/models/app.model.ts b/src/models/app.model.ts index 2538c021..28282947 100644 --- a/src/models/app.model.ts +++ b/src/models/app.model.ts @@ -1,6 +1,10 @@ +import { FC } from "react"; + export interface App { id: string; name: string; author: string; repository: string; + // allow any props + customComponent?: FC; } diff --git a/src/pages/Apps/AppCard.tsx b/src/pages/Apps/AppCard.tsx index 2e91c03d..4a739a0c 100644 --- a/src/pages/Apps/AppCard.tsx +++ b/src/pages/Apps/AppCard.tsx @@ -11,6 +11,7 @@ import { } from "@heroicons/react/24/outline"; import { FC, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; +import { useNavigate } from "react-router-dom"; import { Tooltip } from "react-tooltip"; export type Props = { @@ -19,7 +20,6 @@ export type Props = { installed: boolean; installingApp: any | null; onInstall: (id: string) => void; - onOpenDetails: (app: App) => void; }; export const AppCard: FC = ({ @@ -28,11 +28,11 @@ export const AppCard: FC = ({ installed, installingApp, onInstall, - onOpenDetails, }) => { const { id, name } = appInfo; const { t } = useTranslation(); const [isInstallWaiting, setInstallWaiting] = useState(false); + const navigate = useNavigate(); useEffect(() => { setInstallWaiting(false); @@ -102,7 +102,7 @@ export const AppCard: FC = ({  {t("apps.open")} )} - {installed && !appStatusInfo.address && ( + {installed && !appStatusInfo.address && !appInfo.customComponent && ( )} + {installed && appInfo.customComponent && ( + + )} {(installingApp === null || installingApp.id !== id || installingApp.result === "fail") && @@ -139,7 +148,7 @@ export const AppCard: FC = ({ )} )} {installingApp && - installingApp.id === id && + installingApp.appId === appId && installingApp.mode === "on" && ( = ({ )} {installingApp && - installingApp.id === id && + installingApp.appId === appId && installingApp.mode === "off" && ( = ({ {t("apps.uninstalling")} )} - {(installingApp == null || installingApp.id !== id) && - appStatusInfo.installed && ( + {(installingApp == null || installingApp.appId !== appId) && + installed && ( + +
+
+ {initialSyncDone && ( + <> +
+

Electrs Version {version}

+ {showTorConn && ( + <> +

{t("appInfo.electrs.connectLocal")}:

+

{`${localIP}:${portSSL}:s`}

+ + )} + {showTorConn && ( + <> +

{t("appInfo.electrs.connectTor")}:

+

{`${TORaddress}:${portSSL}:s`}

+ + )} +
+

+ {t("appInfo.electrs.connectionInfo")} +

+ + )} +
+ {initialSyncDone && ( +
+
+ + +
+ {QRAddress && ( + + )} + {!QRAddress && ( +

Address not available

+ )} +
+ )} +
+ + ); +}; + +export default Electrs; diff --git a/src/pages/Apps/index.tsx b/src/pages/Apps/index.tsx index e9098fc3..743e50d9 100644 --- a/src/pages/Apps/index.tsx +++ b/src/pages/Apps/index.tsx @@ -1,24 +1,19 @@ import { SSEContext } from "@/context/sse-context"; import PageLoadingScreen from "@/layouts/PageLoadingScreen"; import { AppStatus } from "@/models/app-status"; -import { App } from "@/models/app.model"; import { enableGutter } from "@/utils"; import { checkError } from "@/utils/checkError"; import { instance } from "@/utils/interceptor"; import type { FC } from "react"; -import { useContext, useEffect, useState } from "react"; +import { useContext, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "react-toastify"; import AppCardAlby from "./AppCardAlby"; -import AppInfo from "./AppInfo"; import AppList from "./AppList"; export const Apps: FC = () => { const { t } = useTranslation(["translation", "apps"]); - const { appStatus, installingApp } = useContext(SSEContext); - - const [showDetails, setShowDetails] = useState(false); - const [app, setApp] = useState(null); + const { appStatus } = useContext(SSEContext); useEffect(() => { enableGutter(); @@ -38,36 +33,6 @@ export const Apps: FC = () => { }); }; - const uninstallHandler = (id: string) => { - instance.post(`apps/uninstall/${id}`, { keepData: true }).catch((err) => { - toast.error(checkError(err)); - }); - }; - - const openDetailsHandler = (app: App) => { - setApp(app); - setShowDetails(true); - }; - - const closeDetailsHandler = () => { - setApp(null); - setShowDetails(false); - }; - - if (showDetails && app) { - const appInfos = appStatus.find((a) => a.id === app.id)!; - return ( - installHandler(app.id)} - onUninstall={() => uninstallHandler(app.id)} - onClose={closeDetailsHandler} - /> - ); - } - // in case no App data received yet => show loading screen if (appStatus.length === 0) { return ; @@ -80,13 +45,11 @@ export const Apps: FC = () => { apps={installedApps} title={t("apps.installed")} onInstall={installHandler} - onOpenDetails={openDetailsHandler} />
diff --git a/src/utils/availableApps.ts b/src/utils/availableApps.ts index a39e656d..d7e7ccfc 100644 --- a/src/utils/availableApps.ts +++ b/src/utils/availableApps.ts @@ -1,77 +1,60 @@ +import Electrs from "@/pages/Apps/customApps/Electrs"; import { App } from "@/models/app.model"; -export const availableApps: Map = new Map([ - [ - "btc-rpc-explorer", - { - id: "btc-rpc-explorer", - name: "BTC RPC Explorer", - author: "janoside", - version: "v3.3.0", - repository: "https://github.com/janoside/btc-rpc-explorer", - }, - ], - [ - "rtl", - { - id: "rtl", - name: "Ride the Lightning", - author: "Shahana Farooqui", - repository: "https://github.com/Ride-The-Lightning/RTL", - }, - ], - [ - "specter", - { - id: "specter", - name: "Specter", - author: "Specter Solutions", - repository: "https://github.com/cryptoadvance/specter-desktop", - }, - ], - [ - "btcpayserver", - { - id: "btcpayserver", - name: "BTCPay Server", - author: "BTCPay Server", - repository: "https://github.com/btcpayserver/btcpayserver", - }, - ], - [ - "lnbits", - { - id: "lnbits", - name: "LNbits", - author: "arcbtc", - repository: "https://github.com/lnbits/lnbits", - }, - ], - [ - "mempool", - { - id: "mempool", - name: "Mempool.space", - author: "The Mempool Open Source Project", - repository: "https://github.com/mempool/mempool", - }, - ], - [ - "thunderhub", - { - id: "thunderhub", - name: "Thunderhub", - author: "apotdevin", - repository: "https://github.com/apotdevin/thunderhub", - }, - ], - [ - "jam", - { - id: "jam", - name: "Jam", - author: "Jam Team", - repository: "https://github.com/joinmarket-webui/jam", - }, - ], -]); +export const availableApps: { [name: string]: App } = { + "btc-rpc-explorer": { + id: "btc-rpc-explorer", + name: "BTC RPC Explorer", + author: "janoside", + repository: "https://github.com/janoside/btc-rpc-explorer", + }, + rtl: { + id: "rtl", + name: "Ride the Lightning", + author: "Shahana Farooqui", + repository: "https://github.com/Ride-The-Lightning/RTL", + }, + specter: { + id: "specter", + name: "Specter", + author: "Specter Solutions", + repository: "https://github.com/cryptoadvance/specter-desktop", + }, + btcpayserver: { + id: "btcpayserver", + name: "BTCPay Server", + author: "BTCPay Server", + repository: "https://github.com/btcpayserver/btcpayserver", + }, + lnbits: { + id: "lnbits", + name: "LNbits", + author: "arcbtc", + repository: "https://github.com/lnbits/lnbits", + }, + mempool: { + id: "mempool", + name: "Mempool.space", + author: "The Mempool Open Source Project", + repository: "https://github.com/mempool/mempool", + }, + thunderhub: { + id: "thunderhub", + name: "Thunderhub", + author: "apotdevin", + repository: "https://github.com/apotdevin/thunderhub", + }, + jam: { + id: "jam", + name: "Jam", + author: "Jam Team", + repository: "https://github.com/joinmarket-webui/jam", + }, + electrs: { + id: "electrs", + name: "ElectRs", + author: "romanz", + repository: "https://github.com/romanz/electrs", + customComponent: Electrs, + }, +};