Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/instance logs #97

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5a43a6b
feat: site restructure WIP
amalcaraz Jun 13, 2024
c7708a0
feat(ui): create ComputingEntityDataPill component
gmolki Jun 18, 2024
d9a1899
feat(ui): create ComputingInformation component
gmolki Jun 18, 2024
1547b75
feat(ui): create StorageInformation component
gmolki Jun 18, 2024
3e2ffcd
refactor(ui): add more custom props for InfoTooltipButton
gmolki Jun 18, 2024
48394fd
feat(ui): create EntityCard component
gmolki Jun 18, 2024
ba7d1d7
feat(ui): create EntitySummaryCard component
gmolki Jun 18, 2024
5199582
refactor(ui): Prepare DashboardPage UI
gmolki Jun 18, 2024
7ea4e29
deps: upgrade front-core to 1.19
gmolki Jun 18, 2024
23b9da1
refactor/fix(ui): Use front-core CardWithSideImage component
gmolki Jun 18, 2024
408397c
feat(ui): Web3 Hosting Dashboard page
gmolki Jun 18, 2024
d250dee
site-restructure WIP
amalcaraz Jun 18, 2024
3d29b07
refactor(ui): create and use DashboardCardWithSideImage Component
gmolki Jun 19, 2024
bbfeea6
[WIP] feat(ui): Volumes dashboard entity summary cards
gmolki Jun 19, 2024
d97a2ed
Merge branch 'site-restructure-ui' into feature/site-restructure
gmolki Jun 19, 2024
d0c0237
dashboard refactor WIP
amalcaraz Jun 19, 2024
1ececcb
fix(ui): SOON label on entity cards
gmolki Jun 19, 2024
1ce9e38
refactor: DashboardPage use hook data for page components
gmolki Jun 19, 2024
cf96993
refactor: StorageDashboardPage use hook data for page components
gmolki Jun 19, 2024
f4f36a5
fix(ui): Entity Cards perfect circle for ButtonLink
gmolki Jun 20, 2024
d858bce
feat: dashboard volumes calculation
amalcaraz Jun 20, 2024
0df2635
refactor: use common useAttachedVolumes hook
gmolki Jun 20, 2024
46ca1af
WIP: refinement agreements
gmolki Jun 20, 2024
8b84bb0
refactor: dashboard page
gmolki Jun 21, 2024
6eadba3
fix: use ExecutableManager instead of model
gmolki Jun 21, 2024
92c45e8
fix(ui): remove persistent storage from volumes dashboard
gmolki Jun 21, 2024
687272b
fix: linter
gmolki Jun 21, 2024
09a603b
refactor(ui): DashboardCardWithSideImage conditional button rendering
gmolki Jun 21, 2024
5b73633
refactor: add Back button on create website page
gmolki Jun 21, 2024
484d0cc
fix: storage dashboard summary cards
gmolki Jun 26, 2024
3ef338e
feat: adjust custom names for new navigation
gmolki Jun 27, 2024
989efb0
feat: instance-operations and logs WIP
amalcaraz Jun 27, 2024
7e32a2f
Merge branch 'feature/site-restructure' into feature/instance-logs
amalcaraz Jun 27, 2024
42a0b9c
fix: various fixes
amalcaraz Jun 27, 2024
4c69199
Fix: Solve allocation state issues for holding instances.
nesitor Jul 3, 2024
f8b1c85
Instance & persistent function logs
amalcaraz Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

certificates
3 changes: 2 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ if (isGithubActions) {
const nextConfig = {
assetPrefix,
basePath,
reactStrictMode: true,
// reactStrictMode: true,
reactStrictMode: false,
images: {
unoptimized: true,
},
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.11.3",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --experimental-https",
"build": "next build",
"export": "next export",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix"
},
"dependencies": {
"@aleph-front/core": "^1.17.10",
"@aleph-front/core": "^1.19.1",
"@aleph-sdk/account": "^1.0.3",
"@aleph-sdk/avalanche": "^1.0.3",
"@aleph-sdk/client": "^1.0.6",
Expand Down Expand Up @@ -64,4 +64,4 @@
"preset": "styled-components"
}
}
}
}
227 changes: 227 additions & 0 deletions public/img/dashboard/function.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
269 changes: 269 additions & 0 deletions public/img/dashboard/instance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions public/img/dashboard/ssh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions public/img/dashboard/volume.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
257 changes: 257 additions & 0 deletions public/img/dashboard/website.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/components/common/AmountInformation/cmp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { memo } from 'react'
import { AmountInformationProps } from './types'
import { StyledAmountInformationContainer } from './styles'

export const AmountInformation = ({
amount = 0,
}: AmountInformationProps = {}) => {
if (amount === 0) return <></>

return (
<StyledAmountInformationContainer tw="px-3">
<p className="fs-18 text-base2 tp-body2">{amount}</p>
</StyledAmountInformationContainer>
)
}
AmountInformation.displayName = 'AmountInformation'

export default memo(AmountInformation) as typeof AmountInformation
11 changes: 11 additions & 0 deletions src/components/common/AmountInformation/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled, { css } from 'styled-components'

export const StyledAmountInformationContainer = styled.div`
display: flex;
align-items: center;
justify-content: center;

${({ theme }) => css`
background: ${theme.color.base1};
`}
`
3 changes: 3 additions & 0 deletions src/components/common/AmountInformation/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type AmountInformationProps = {
amount?: number
}
4 changes: 2 additions & 2 deletions src/components/common/ButtonLink/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ButtonProps } from '@aleph-front/core'
import { AnchorHTMLAttributes, ReactElement } from 'react'
import { AnchorHTMLAttributes, ReactNode } from 'react'

export type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &
Omit<ButtonProps, 'variant' | 'color' | 'kind' | 'size'> &
Partial<Pick<ButtonProps, 'variant' | 'color' | 'kind' | 'size'>> & {
href: string
children: ReactElement | string
children: ReactNode
}
7 changes: 5 additions & 2 deletions src/components/common/CRNList/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export default function CRNList(props: CRNListProps) {
<>
<SpinnerOverlay show={!filteredNodes} />

<NoisyContainer tw="w-full">
<NoisyContainer tw="h-full w-full">
<div tw="flex mb-8 gap-10 justify-between flex-wrap flex-col md:flex-row items-stretch md:items-center">
<div tw="flex-1">
<TextInput
Expand All @@ -311,7 +311,10 @@ export default function CRNList(props: CRNListProps) {
/>
</div>
</div>
<div tw="h-[30rem] overflow-auto" ref={infiniteScrollContainerRef}>
<div
tw="min-h-[20rem] h-full overflow-auto"
ref={infiniteScrollContainerRef}
>
<NodesTable
{...{
columns,
Expand Down
28 changes: 28 additions & 0 deletions src/components/common/ComputingEntityDataPill/cmp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { memo } from 'react'
import { ComputingEntityDataPillProps } from './types'
import { StyledComputingEntityDataPill } from './styles'
import { Icon } from '@aleph-front/core'
import { useTheme } from 'styled-components'

export const ComputingEntityDataPill = ({
value = 0,
icon,
}: ComputingEntityDataPillProps) => {
const theme = useTheme()

return (
<StyledComputingEntityDataPill>
<p
className="fs-12 tp-h7 text-base2"
tw="flex text-center items-center justify-center gap-1"
>
{value}
{icon && <Icon size="0.7em" name={icon} color={theme.color.base2} />}
</p>
</StyledComputingEntityDataPill>
)
}

ComputingEntityDataPill.displayName = 'ComputingEntityDataPill'

export default memo(ComputingEntityDataPill) as typeof ComputingEntityDataPill
14 changes: 14 additions & 0 deletions src/components/common/ComputingEntityDataPill/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styled, { css } from 'styled-components'

export const StyledComputingEntityDataPill = styled.div`
display: flex;
align-items: center;
justify-content: center;
gap: 0.125rem;
padding: 0.125rem 0.375rem;
border-radius: 0.75rem;

${({ theme }) => css`
background: ${theme.color.base1};
`}
`
6 changes: 6 additions & 0 deletions src/components/common/ComputingEntityDataPill/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { IconName } from '@aleph-front/core'

export type ComputingEntityDataPillProps = {
value?: number
icon?: IconName
}
19 changes: 19 additions & 0 deletions src/components/common/ComputingInformation/cmp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { memo } from 'react'
import { ComputingInformationProps } from './types'
import ComputingEntityDataPill from '../ComputingEntityDataPill'

export const ComputingInformation = ({
running = 0,
paused = 0,
booting = 0,
}: ComputingInformationProps = {}) => (
<div tw="flex justify-end gap-x-2.5 rounded-xl">
<ComputingEntityDataPill value={running} icon="play" />
<ComputingEntityDataPill value={paused} icon="pause" />
<ComputingEntityDataPill value={booting} icon="loader" />
</div>
)

ComputingInformation.displayName = 'ComputingInformation'

export default memo(ComputingInformation) as typeof ComputingInformation
1 change: 1 addition & 0 deletions src/components/common/ComputingInformation/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './cmp'
14 changes: 14 additions & 0 deletions src/components/common/ComputingInformation/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styled, { css } from 'styled-components'

export const StyledInformationContainer = styled.div`
display: flex;
align-items: center;
justify-content: center;
gap: 0.125rem;
padding: 0.125rem 0.375rem;
border-radius: 0.75rem;

${({ theme }) => css`
background: ${theme.color.base1};
`}
`
5 changes: 5 additions & 0 deletions src/components/common/ComputingInformation/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type ComputingInformationProps = {
running?: number
paused?: number
booting?: number
}
54 changes: 54 additions & 0 deletions src/components/common/DashboardCardWithSideImage/cmp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Container } from '@/components/pages/dashboard/common'
import {
CardWithSideImage,
NoisyContainer,
TextGradient,
} from '@aleph-front/core'
import ButtonLink from '../ButtonLink'
import ExternalLinkButton from '../ExternalLinkButton'
import { DashboardCardWithSideImageProps } from './types'

export const DashboardCardWithSideImage = ({
info,
title,
description,
imageSrc,
imageAlt,
withButton = true,
buttonUrl,
buttonText,
externalLinkUrl,
}: DashboardCardWithSideImageProps) => (
<NoisyContainer type="grain-1" tw="py-20">
<Container $variant="xl">
<CardWithSideImage
imageSrc={imageSrc}
imageAlt={imageAlt}
cardBackgroundColor="bg-white"
>
<div tw="flex flex-col gap-16">
<div>
<div className="tp-info text-main0">{info}</div>
<TextGradient as="h2" type="h3">
{title}
</TextGradient>
{description}
</div>
<div tw="mt-6 flex flex-wrap items-center justify-between gap-6">
{withButton && (
<ButtonLink variant="primary" size="md" href={buttonUrl}>
{buttonText}
</ButtonLink>
)}

<ExternalLinkButton href={externalLinkUrl}>
Learn more
</ExternalLinkButton>
</div>
</div>
</CardWithSideImage>
</Container>
</NoisyContainer>
)

export default DashboardCardWithSideImage
1 change: 1 addition & 0 deletions src/components/common/DashboardCardWithSideImage/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './cmp'
11 changes: 11 additions & 0 deletions src/components/common/DashboardCardWithSideImage/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type DashboardCardWithSideImageProps = {
info: string
title: string
description: string
imageSrc: string
imageAlt: string
withButton?: boolean
buttonUrl: string
buttonText: string
externalLinkUrl: string
}
Loading