diff --git a/deploy-web/package.json b/deploy-web/package.json index 44453ad0d..001f21dad 100644 --- a/deploy-web/package.json +++ b/deploy-web/package.json @@ -1,6 +1,6 @@ { "name": "akash-console", - "version": "2.0.6", + "version": "2.0.8", "description": "Web UI to deploy on the Akash Network and view statistic about network usage.", "author": "Akash Network", "private": true, diff --git a/deploy-web/src/components/deployments/DeploymentDetail.tsx b/deploy-web/src/components/deployments/DeploymentDetail.tsx index 3c93496c0..6e8f470b0 100644 --- a/deploy-web/src/components/deployments/DeploymentDetail.tsx +++ b/deploy-web/src/components/deployments/DeploymentDetail.tsx @@ -82,7 +82,7 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin } } }); - const isDeploymentNotFound = deploymentError && (deploymentError as any).response?.data?.message?.includes("Deployment not found"); + const isDeploymentNotFound = (deploymentError && (deploymentError as any).response?.data?.message?.includes("Deployment not found")) || !address; const hasLeases = leases && leases.length > 0; const { isLocalCertMatching, localCert, isCreatingCert, createCertificate } = useCertificate(); const { data: providers, isFetching: isLoadingProviders, refetch: getProviders } = useProviderList(); @@ -155,9 +155,9 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin {isDeploymentNotFound && (
404 - + <p> This deployment does not exist or it was created using another wallet. - +

diff --git a/deploy-web/src/components/deployments/GranteeDepositMenuItem.tsx b/deploy-web/src/components/deployments/GranteeDepositMenuItem.tsx index b3866ff98..04c87903b 100644 --- a/deploy-web/src/components/deployments/GranteeDepositMenuItem.tsx +++ b/deploy-web/src/components/deployments/GranteeDepositMenuItem.tsx @@ -16,18 +16,17 @@ export const GranteeDepositMenuItem: React.FunctionComponent = ({ grant } const denomData = useDenomData(grant.authorization.spend_limit.denom); return ( -
-
-  |  +
+
+  |    {denomData?.label}   - + (Exp:  - + ) - )
); }; diff --git a/deploy-web/src/components/get-started/GetStartedStepper.tsx b/deploy-web/src/components/get-started/GetStartedStepper.tsx index dceb4fff6..c8e3b0417 100644 --- a/deploy-web/src/components/get-started/GetStartedStepper.tsx +++ b/deploy-web/src/components/get-started/GetStartedStepper.tsx @@ -162,7 +162,7 @@ export const GetStartedStepper: React.FunctionComponent = () => {

For the sake of getting started, we will deploy a simple Next.js app that you can find in the deploy page.

-
+
@@ -171,7 +171,7 @@ export const GetStartedStepper: React.FunctionComponent = () => {
- + Explore Marketplace
diff --git a/deploy-web/src/components/layout/Layout.tsx b/deploy-web/src/components/layout/Layout.tsx index 63f675a3b..e65537c9b 100644 --- a/deploy-web/src/components/layout/Layout.tsx +++ b/deploy-web/src/components/layout/Layout.tsx @@ -115,8 +115,8 @@ const LayoutApp: React.FunctionComponent = ({ children, isLoading, isUsin
{isLoading !== undefined && } diff --git a/deploy-web/src/components/new-deployment/BidRow.tsx b/deploy-web/src/components/new-deployment/BidRow.tsx index 09e74986e..e532ffbe5 100644 --- a/deploy-web/src/components/new-deployment/BidRow.tsx +++ b/deploy-web/src/components/new-deployment/BidRow.tsx @@ -133,7 +133,7 @@ export const BidRow: React.FunctionComponent = ({ bid, selectedBid, handl {gpuModels.length > 0 && (
- {gpuModels.map((gpu) => ( + {gpuModels.map(gpu => ( {gpu.vendor}-{gpu.model} @@ -198,7 +198,7 @@ export const BidRow: React.FunctionComponent = ({ bid, selectedBid, handl )} {isSendingManifest && isCurrentBid && ( -
+
Deploying! 🚀
)} diff --git a/deploy-web/src/components/new-deployment/CreateLease.tsx b/deploy-web/src/components/new-deployment/CreateLease.tsx index 632923e9c..8d01e86b1 100644 --- a/deploy-web/src/components/new-deployment/CreateLease.tsx +++ b/deploy-web/src/components/new-deployment/CreateLease.tsx @@ -89,53 +89,31 @@ export const CreateLease: React.FunctionComponent = ({ dseq }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - // Filter bids by search + // Filter bids useEffect(() => { - let fBids: string[] = []; if ((search || isFilteringFavorites || isFilteringAudited) && providers) { - bids?.forEach(bid => { - let isAdded = false; - - // Filter for search - if (search) { - const provider = providers.find(p => p.owner === bid.provider); - // Filter by attribute value - provider?.attributes.forEach(att => { - if (att.value?.toLowerCase().includes(search.toLowerCase())) { - fBids.push(bid.id); - isAdded = true; - } - }); - - if (!isAdded && provider?.hostUri.includes(search)) { - fBids.push(bid.id); - } - } + let filteredBids = [...(bids || [])]; - // Filter for favorites - if (!isAdded && !search && isFilteringFavorites) { - const provider = favoriteProviders.find(p => p === bid.provider); + if (search) { + filteredBids = filteredBids.filter(bid => { + const provider = providers?.find(p => p.owner === bid.provider); + return provider?.attributes.some(att => att.value?.toLowerCase().includes(search.toLowerCase())) || provider?.hostUri.includes(search); + }); + } - if (provider) { - fBids.push(bid.id); - isAdded = true; - } - } + if (isFilteringFavorites) { + filteredBids = filteredBids.filter(bid => favoriteProviders.some(y => y === bid.provider)); + } - // Filter for audited - if (!isAdded && !search && isFilteringAudited) { - const provider = providers.filter(x => x.isAudited).find(p => p.owner === bid.provider); + if (isFilteringAudited) { + filteredBids = filteredBids.filter(bid => !!providers.filter(x => x.isAudited).find(p => p.owner === bid.provider)); + } - if (provider) { - fBids.push(bid.id); - } - } - }); + setFilteredBids(filteredBids.map(bid => bid.id)); } else { - fBids = bids?.map(b => b.id) || []; + setFilteredBids(bids?.map(bid => bid.id) || []); } - setFilteredBids(fBids); // eslint-disable-next-line react-hooks/exhaustive-deps }, [search, bids, providers, isFilteringFavorites, isFilteringAudited, favoriteProviders]); diff --git a/deploy-web/src/components/new-deployment/ManifestEdit.tsx b/deploy-web/src/components/new-deployment/ManifestEdit.tsx index 1486fe7ab..2aa48f707 100644 --- a/deploy-web/src/components/new-deployment/ManifestEdit.tsx +++ b/deploy-web/src/components/new-deployment/ManifestEdit.tsx @@ -214,14 +214,11 @@ export const ManifestEdit: React.FunctionComponent = ({ editedManifest, s return ( <> - +
-
+
setDeploymentName(ev.target.value)} label="Name your deployment (optional)" />
@@ -237,10 +234,10 @@ export const ManifestEdit: React.FunctionComponent = ({ editedManifest, s

} > - + -
+
+
- diff --git a/deploy-web/src/components/providers/ProviderDetail.tsx b/deploy-web/src/components/providers/ProviderDetail.tsx index 0eab0e4b2..0e425b0c1 100644 --- a/deploy-web/src/components/providers/ProviderDetail.tsx +++ b/deploy-web/src/components/providers/ProviderDetail.tsx @@ -166,8 +166,8 @@ export const ProviderDetail: React.FunctionComponent = ({ owner, _provide

General Info

- - + +
@@ -191,16 +191,16 @@ export const ProviderDetail: React.FunctionComponent = ({ owner, _provide

Features

- - + +
- } /> - } /> + } /> + } />
- } /> + } />
@@ -208,8 +208,8 @@ export const ProviderDetail: React.FunctionComponent = ({ owner, _provide

Stats

- - + + @@ -219,8 +219,8 @@ export const ProviderDetail: React.FunctionComponent = ({ owner, _provide

Raw attributes

- - + + {provider.attributes.map(x => ( ))} diff --git a/deploy-web/src/components/providers/ProviderList.tsx b/deploy-web/src/components/providers/ProviderList.tsx index d48b5452d..23ad85e03 100644 --- a/deploy-web/src/components/providers/ProviderList.tsx +++ b/deploy-web/src/components/providers/ProviderList.tsx @@ -232,7 +232,7 @@ export const ProviderList: React.FunctionComponent = ({}) => {
-
+
@@ -245,7 +245,7 @@ export const ProviderList: React.FunctionComponent = ({}) => {
-
+
= ({}) => { } /> -
+
{ - setPageSize(Number(value)); - }} - > - - - - - {[10, 20, 30, 40, 50].map((val, i) => ( - - {val} - - ))} - - -
-
-
- Page {pageIndex + 1} of {totalPageCount} -
- - setPageIndex(pageNumber - 1)} showPreviousNext /> -
+
+
+

Rows per page

+ +
+
+ Page {pageIndex + 1} of {totalPageCount} +
+
+ setPageIndex(pageNumber - 1)} showPreviousNext />
); diff --git a/deploy-web/src/components/shared/Pagninator.tsx b/deploy-web/src/components/shared/Pagninator.tsx index f273e6343..0e576e332 100644 --- a/deploy-web/src/components/shared/Pagninator.tsx +++ b/deploy-web/src/components/shared/Pagninator.tsx @@ -13,13 +13,13 @@ export default function Paginator({ currentPage, totalPages, onPageChange, showP {showPreviousNext && totalPages ? ( - + onPageChange(currentPage - 1)} disabled={currentPage - 1 < 1} /> ) : null} {generatePaginationLinks(currentPage, totalPages, onPageChange)} {showPreviousNext && totalPages ? ( - + onPageChange(currentPage + 1)} disabled={currentPage > totalPages - 1} /> ) : null} diff --git a/deploy-web/src/components/shared/Popup.tsx b/deploy-web/src/components/shared/Popup.tsx index 376ca43f5..1c24fb0ba 100644 --- a/deploy-web/src/components/shared/Popup.tsx +++ b/deploy-web/src/components/shared/Popup.tsx @@ -7,7 +7,7 @@ import { DialogProps } from "@radix-ui/react-dialog"; import Spinner from "./Spinner"; import { InputWithIcon } from "../ui/input"; import { cn } from "@src/utils/styleUtils"; -import { ScrollArea } from "../ui/scroll-area"; +import { ScrollArea, ScrollBar } from "../ui/scroll-area"; type MessageProps = { variant: "message"; @@ -45,7 +45,6 @@ type CommonProps = { maxWidth?: false | "xs" | "sm" | "md" | "lg" | "xl"; dialogProps?: Partial; fixedTopPosition?: boolean; - fixedTopPositionHeight?: "10%" | "15%" | "20%" | "25%"; enableCloseOnBackdropClick?: boolean; hideCloseButton?: boolean; }; @@ -56,7 +55,6 @@ export type ActionButton = ButtonProps & { label: string | React.ReactNode; side: ActionButtonSide; isLoading?: boolean; - isLoadingColor?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning"; }; export type PopupProps = (MessageProps | ConfirmProps | PromptProps | CustomPrompt) & CommonProps; @@ -102,6 +100,7 @@ export function Popup(props: React.PropsWithChildren) { component.push( {props.message} + ); } else { @@ -120,6 +119,7 @@ export function Popup(props: React.PropsWithChildren) { props.children )}
+ ); } @@ -194,38 +194,20 @@ export function Popup(props: React.PropsWithChildren) { case "custom": { const leftButtons = props.actions ?.filter(x => x.side === "left") - .map(({ isLoading, isLoadingColor, side, label, ...rest }, idx) => ( + .map(({ isLoading, side, label, ...rest }, idx) => ( )); const rightButtons = props.actions ?.filter(x => x.side === "right") - .map(({ isLoading, isLoadingColor, side, label, ...rest }, idx) => ( + .map(({ isLoading, side, label, ...rest }, idx) => ( )); component.push( - +
{leftButtons}
{rightButtons}
@@ -234,31 +216,11 @@ export function Popup(props: React.PropsWithChildren) { } } - // const getFixedPositionHeightClass = () => { - // switch (props.fixedTopPositionHeight) { - // case "10%": - // return classes.fixedTopPosition10; - // case "15%": - // return classes.fixedTopPosition15; - // case "20%": - // return classes.fixedTopPosition20; - // case "25%": - // return classes.fixedTopPosition25; - - // default: - // break; - // } - // }; - /** * Prevent close because of click on backdrop unless enabled through the setting 'enableCloseOnBackdropClick'. */ const handleOnClose = (open: boolean) => { - // if ((props.enableCloseOnBackdropClick || reason !== "backdropClick") && props.onClose) { - // props.onClose(); - // } if (!open && props.onClose) { - // TODO props.onClose(null, "action"); } }; @@ -267,8 +229,6 @@ export function Popup(props: React.PropsWithChildren) { diff --git a/deploy-web/src/components/ui/switch.tsx b/deploy-web/src/components/ui/switch.tsx index e40f36c17..d20a318fe 100644 --- a/deploy-web/src/components/ui/switch.tsx +++ b/deploy-web/src/components/ui/switch.tsx @@ -9,7 +9,7 @@ const Switch = React.forwardRef, ({ className, ...props }, ref) => ( { // Update balances on wallet address change useEffect(() => { if (walletAddress) { - // Redirect to deployment list if on deployment detail page - if (pathname?.startsWith("/deployments/")) { - router.push(UrlService.deploymentList()); - } loadWallet(); } }, [walletAddress]); @@ -328,7 +324,8 @@ export function useWallet() { } const TransactionSnackbarContent = ({ snackMessage, transactionHash }) => { - const txUrl = transactionHash && `https://stats.akash.network/transactions/${transactionHash}`; + const selectedNetwork = useSelectedNetwork(); + const txUrl = transactionHash && `https://stats.akash.network/transactions/${transactionHash}?network=${selectedNetwork.id}`; return ( <>