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

feat(dcellar-web-ui): upgrade mainnet. #302

Merged
merged 36 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ffa35cb
feat(dcellar-web-ui): add entry link for data marketplace
aiden-cao Nov 15, 2023
5bb36ca
fix(dcellar-web-ui): menu option type
aiden-cao Nov 16, 2023
c00b0fd
fix(dcellar-web-ui): worker test
aiden-cao Nov 16, 2023
ff743b5
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 20, 2023
53dc9af
feat(dcellar-web-ui): fix undefined reading error
aiden-cao Nov 20, 2023
7dcff91
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 20, 2023
8b6c455
feat(dcellar-web-ui): fix undefined reading error
aiden-cao Nov 20, 2023
10aa6a7
feat(dcellar-web-ui): add apollo list for sell
aiden-cao Nov 20, 2023
00cf841
feat(dcellar-web-ui): add drag upload
aiden-cao Nov 21, 2023
c1a6819
feat(dcellar-web-ui): add global notification
aiden-cao Nov 21, 2023
b158cb1
feat(dcellar-web-ui): add sp latency
aiden-cao Nov 21, 2023
8c8870d
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 21, 2023
ed16a05
feat(dcellar-web-ui): fix uppercase endpoint
aiden-cao Nov 21, 2023
e3fc087
feat(dcellar-web-ui): update list for params
aiden-cao Nov 22, 2023
cee33a8
feat(dcellar-web-ui): fix get start button redirect back
aiden-cao Nov 22, 2023
9d26e44
feat(dcellar-web-ui): fix protect path
aiden-cao Nov 22, 2023
3f9bd6f
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 24, 2023
16d140b
feat(dcellar-web-ui): fix auto connect connector always undefined
aiden-cao Nov 24, 2023
e153ee3
feat(dcellar-web-ui): add preconnect for sps
aiden-cao Nov 27, 2023
f0afd12
feat(dcellar-web-ui): fix navigate to pricing calculator page too slow
aiden-cao Nov 27, 2023
8e86d6a
feat(dcellar-web-ui): fix header mobile render
aiden-cao Nov 27, 2023
f0ca98c
Merge pull request #282 from node-real/feat/aiden-cao
aiden-cao Nov 30, 2023
8b5d785
feat(dcellar-web-ui): fix wallet connector unfined
aiden-cao Nov 30, 2023
a689cf9
Merge pull request #291 from node-real/fix/connector-undefined
aiden-cao Nov 30, 2023
12d06ba
fix(dcellar-web-ui): create bucket can not get payment account data (…
devinxl Nov 30, 2023
708380b
feat(dcellar-web-ui): add dashboard module (#288)
devinxl Nov 30, 2023
844d8bf
Revert "feat(dcellar-web-ui): fix wallet connector unfined"
aiden-cao Nov 30, 2023
fe5d8cc
Merge pull request #293 from node-real/fix/revert-trust-wallet-hack
aiden-cao Nov 30, 2023
32c81d0
Revert "Merge pull request #293 from node-real/fix/revert-trust-walle…
aiden-cao Dec 1, 2023
455cf8c
feat(dcellar-web-ui): update walletkit
aiden-cao Dec 1, 2023
0fce13c
feat(dcellar-web-ui): update connector detect time
aiden-cao Dec 4, 2023
cc5195a
fix(dcellar-web-ui): new Array error (#298)
devinxl Dec 4, 2023
512b03f
fix(dcellar-web-ui): opt dashboard style (#299)
devinxl Dec 5, 2023
b7ce2c0
Merge branch 'main' into feat/update-walletkit
aiden-cao Dec 5, 2023
1b04a50
Merge pull request #295 from node-real/feat/update-walletkit
aiden-cao Dec 5, 2023
f4e42b4
Merge remote-tracking branch 'origin/mainnet-main' into feat/upgrade-…
devinxl Dec 7, 2023
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
Prev Previous commit
Next Next commit
feat(dcellar-web-ui): add dashboard module (#288)
* feat(dcellar-web-ui): add billing history

* feat(dcellar-web-ui): add billing history

* fix(dcellar-web-ui): fix some billint history issues

* feat(dcellar-web-ui): add billing history

* fix(dcellar-web-ui): fix some billint history issues

* feat(dcellar-web-ui): migrate billing type to types

* chore(dcellar-web-ui): remove log

* feat(dcellar-web-ui): change the precision of billing history to 18

* fix(dcellar-web-ui): delete object format

* feat(dcellar-web-ui): update filter type data

* feat(dcellar-web-ui): add billing history

* feat(dcellar-web-ui): add billing history

* fix(dcellar-web-ui): fix some billint history issues

* feat(dcellar-web-ui): migrate billing type to types

* chore(dcellar-web-ui): remove log

* feat(dcellar-web-ui): change the precision of billing history to 18

* fix(dcellar-web-ui): delete object format

* feat(dcellar-web-ui): update filter type data

* feat(dcellar-web-ui): add dashboard module

* feat(dcellar-web-ui): add loading to dashboard

* feat(dcellar-web-ui): add bucket chart and opt constants

* fix(dcellar-web-ui): remove feature value in barchart hook

* fix(dcellar-web-ui): fix bar chart y-axis

* fix(dcellar-web-ui): fix invlid date and compatiable 429

* fix(dcellar-web-ui): set as nonrefundable button width

* fix(dcellar-web-ui): mergeArr function error

* fix(dcellar-web-ui): merge arr error

* feat(dcellar-web-ui): enlargement upload limit to 100 (#286)

* feat(dcellar-web-ui): enlargement upload limit to 100

* fix(dcellar-web-ui): upload tab z-index

* feat(dcellar-web-ui): only one task can be signed before the upload task
devinxl authored Nov 30, 2023
commit 708380b55c7ad711c03ce8935ddf438fa14627bf
2 changes: 1 addition & 1 deletion apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
"ahooks": "3.7.7",
"hash-wasm": "4.10.0",
"@babel/core": "^7.20.12",
"@bnb-chain/greenfield-js-sdk": "1.0.4",
"@bnb-chain/greenfield-js-sdk": "1.0.6",
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.23",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
1 change: 1 addition & 0 deletions apps/dcellar-web-ui/public/js/iconfont_v0.6.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions apps/dcellar-web-ui/src/base/env.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ const {
NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_RPC_URL,
} = publicRuntimeConfig || {};
const {
NEXT_PRIVATE_BILLING_API_URL
NEXT_PRIVATE_BILLING_API_URL,
NEXT_PRIVATE_EXPLORER_API_URL,
} = serverRuntimeConfig || {};

export type TRuntimeEnv = 'development' | 'qa' | 'testnet' | 'mainnet';
@@ -36,4 +37,5 @@ export const GREENFIELD_CHAIN_EXPLORER_URL = NEXT_PUBLIC_GREENFIELD_CHAIN_EXPLOR
export const BSC_EXPLORER_URL = NEXT_PUBLIC_BSC_EXPLORER_URL;
export const GREENFIELD_MAINNET_ID = NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_ID;
export const GREENFIELD_MAINNET_RPC_URL = NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_RPC_URL;
export const BILLING_API_URL = NEXT_PRIVATE_BILLING_API_URL;
export const BILLING_API_URL = NEXT_PRIVATE_BILLING_API_URL;
export const EXPLORER_API_URL = NEXT_PRIVATE_EXPLORER_API_URL;
1 change: 1 addition & 0 deletions apps/dcellar-web-ui/src/base/theme/light.ts
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ export const light = {
'label-normal': '#EEBE11',
'label-active': '#F1CA3C',
primary: '#00BA34',
chartTick: rgba('#AEB4BC', 0.3),
},
bg: {
bottom: '#f5f5f5',
6 changes: 3 additions & 3 deletions apps/dcellar-web-ui/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ import { DCButton, DCButtonProps } from '@/components/common/DCButton';
import { Text } from '@totejs/uikit';
import { smMedia } from '@/modules/responsive';
import { useRouter } from 'next/router';
import { InternalRoutePaths } from '@/utils/constant';
import { useAccount, useDisconnect } from 'wagmi';
import { ssrLandingRoutes } from '@/pages/_app';
import { useOffChainAuth } from '@/context/off-chain-auth/useOffChainAuth';
import { checkOffChainDataAvailable, setLogin } from '@/store/slices/persist';
import { useAsyncEffect } from 'ahooks';
import { useAppDispatch } from '@/store';
import { useModal } from '@totejs/walletkit';
import { InternalRoutePaths } from '@/constants/paths';

interface ConnectWalletProps extends DCButtonProps {
icon?: ReactElement;
@@ -67,7 +67,7 @@ export const ConnectWallet = memo<Partial<ConnectWalletProps>>(function ConnectB
router.push(
!!router.query.originAsPath
? decodeURIComponent(router.query.originAsPath as string)
: InternalRoutePaths.buckets,
: InternalRoutePaths.dashboard,
);
}, [address, trustEvent, isAuthPending, router]);

@@ -79,7 +79,7 @@ export const ConnectWallet = memo<Partial<ConnectWalletProps>>(function ConnectB
router.push(
!!router.query.originAsPath
? decodeURIComponent(router.query.originAsPath as string)
: InternalRoutePaths.buckets,
: InternalRoutePaths.dashboard,
);
};

4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/components/ErrorComponent/index.tsx
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import Link from 'next/link';
import { Image } from '@totejs/uikit';
import { useRouter } from 'next/router';
import { useAppSelector } from '@/store';
import { InternalRoutePaths } from '@/utils/constant';
import { InternalRoutePaths } from '@/constants/paths';
import { IconFont } from '@/components/IconFont';

const Container = styled.main`
@@ -98,7 +98,7 @@ function ErrorComponent({ statusCode }: ErrorComponentProps) {
>
{desc}
</Text>
<Link href={address ? InternalRoutePaths.buckets : '/'} legacyBehavior passHref replace>
<Link href={address ? InternalRoutePaths.dashboard : '/'} legacyBehavior passHref replace>
<DCButton w={132} h={32} as="a" mb={40} fontSize={12} borderRadius={4}>
{isNoBucket ? 'Back to Home' : 'Go to Home'}
</DCButton>
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { DCButton } from '../common/DCButton';
import { useWalletSwitchNetWork } from '@/context/WalletConnectContext';
import { useLogin } from '@/hooks/useLogin';
import { IconFont } from '@/components/IconFont';
import { CHAIN_NAMES } from '@/utils/constant';
import { CHAIN_NAMES } from '@/constants/wallet';

export const WrongNetworkModal = ({ isOpen, onClose }: any) => {
const { logout } = useLogin();
13 changes: 13 additions & 0 deletions apps/dcellar-web-ui/src/components/charts/BarChart/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { BaseChart, BaseChartProps } from '@/components/charts/BaseChart';
import { useBarChartOptions } from './useBarChartOptions';

export interface BarChartProps extends BaseChartProps {
noData: boolean
}

export function BarChart({noData, ...props}: BarChartProps) {
const { options, ...restProps } = props;
const finalOptions = useBarChartOptions(options, noData);

return <BaseChart options={finalOptions} {...restProps} />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { useColorMode, useColorModeValue, useTheme } from '@totejs/uikit';
import { useEffect, useState } from 'react';
import { merge } from 'lodash-es';
import { cssVar } from '@/utils/common';
import { noDataOptions } from '@/constants/chart';

export function useBarChartOptions(options: any, noData: boolean) {
const theme = useTheme();
const { colorMode } = useColorMode();
const colors = useColorModeValue(theme.colors.light, theme.colors.dark);

const [finalOptions, setFinalOptions] = useState({});

useEffect(() => {
if (colorMode !== document.documentElement.dataset.theme) {
return;
}
if (noData) {
return setFinalOptions(noDataOptions);
}
const defaultOptions = {
title: {
text: 'Cost Trend',
textStyle: {
color: cssVar('readable.normal'),
fontSize: 16,
fontWeight: 700,
},
left: 0,
padding: [5, 5, 5, 0],
textAlign: 'left',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
grid: {
containLabel: true,
left: 'left',
right: '0%',
bottom: '0%',
},
toolbox: {
feature: {
dataView: { show: false, readOnly: false },
restore: { show: false },
saveAsImage: { show: false },
},
},
legend: {
icon: 'circle',
itemHeight: 8,
itemWidth: 8,
itemGap: 16,
right: 30,
textStyle: {
fontWeight: 400,
},
},
xAxis: [{
type: 'category',
axisTick: {
show: true,
alignWithLabel: true,
lineStyle: {
color: cssVar('bg.bottom'),
},
},
axisLabel: {
color: cssVar('readable.tertiary'),
fontSize: 12,
fontWeight: 500,
margin: 16,
lineHeight: 12,
},
axisLine: {
show: false,
margin: 18,
},
axisPointer: {
lineStyle: {
color: cssVar('readable.secondary'),
type: 'solid',
},
},
}],
yAxis: [{
type: 'value',
position: 'left',
alignTicks: true,
splitNumber: 5,
axisLine: {
show: false,
},
axisLabel: {
color: cssVar('readable.tertiary'),
fontSize: 12,
fontWeight: 500,
},
splitLine: {
lineStyle: {
color: cssVar('bg.bottom'),
},
},
}],
series: [
],
};

const finalOptions = merge(defaultOptions, options);

setFinalOptions(finalOptions);
}, [colors, options, colorMode, noData]);

return finalOptions;
}
12 changes: 7 additions & 5 deletions apps/dcellar-web-ui/src/components/charts/LineChart/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { BaseChart, BaseChartProps } from '@/components/charts/BaseChart';
import { useLineChartOptions } from '@/components/charts/LineChart/useLineChartOptions';

export interface LineChartProps extends BaseChartProps {}
export interface LineChartProps extends BaseChartProps {
noData: boolean
}

export function LineChart(props: LineChartProps) {
const { options } = props;
const finalOptions = useLineChartOptions(options);
export function LineChart({noData, ...props}: LineChartProps) {
const { options, ...restProps } = props;
const finalOptions = useLineChartOptions(options, noData);

return <BaseChart options={finalOptions} />;
return <BaseChart options={finalOptions} {...restProps} />;
}
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@ import {merge} from 'lodash-es';
import * as echarts from 'echarts/core';

import { cssVar } from '@/utils/common';
import { noDataOptions } from '@/constants/chart';

export function useLineChartOptions(options: any) {
export function useLineChartOptions(options: any, noData: boolean) {
const theme = useTheme();
const { colorMode } = useColorMode();
const colors = useColorModeValue(theme.colors.light, theme.colors.dark);
@@ -16,6 +17,9 @@ export function useLineChartOptions(options: any) {
if (colorMode !== document.documentElement.dataset.theme) {
return;
}
if (noData) {
return setFinalOptions(noDataOptions);
}
const defaultOptions = {
tooltip: {
trigger: 'axis',
@@ -24,12 +28,14 @@ export function useLineChartOptions(options: any) {
padding: 8,
textStyle: {
color: cssVar('readable.normal'),
fontSize: 12,
},
axisPointer: {
type: 'line',
z: -1,
lineStyle: {
color: cssVar('readable.secondary'),
type: 'solid',
color: cssVar('readable.disable'),
},
},
extraCssText: `box-shadow: ${cssVar('chartTooltip', 'shadows')};border-radius:4px;`,
@@ -45,12 +51,19 @@ export function useLineChartOptions(options: any) {
type: 'category',
boundaryGap: false,
axisLabel: {
margin: 7,
fontSize: 10,
marginTop: 4,
fontWeight: 500,
lineHeight: 14,
lineHeight: 15,
color: cssVar('readable.disable'),
fontSize: 10,
fontFamily: 'Inter',
color: cssVar('readable.secondary'),
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
color: cssVar('readable.chartTick'),
},
},
axisLine: {
lineStyle: {
@@ -60,31 +73,47 @@ export function useLineChartOptions(options: any) {
axisTick: {
alignWithLabel: true,
lineStyle: {
color: cssVar('readable.border'),
color: cssVar('readable.chartTick'),
},
},
},
yAxis: {
show: true,
type: 'value',
splitNumber: 4,
scale: true,
splitLine: {
spiltLine: {
lineStyle: {
color: 'red',
}
},
axisTick: {
show: true,
alignWithLabel: true,
lineStyle: {
color: cssVar('readable.border'),
},
},
axisLine: {
show: true,
lineStyle: {
color: cssVar('readable.border'),
},
},
splitLine: {
show: false,
},
axisLabel: {
margin: 4,
fontSize: 10,
marginRight: 4,
fontWeight: 500,
lineHeight: 14,
lineHeight: 15,
color: cssVar('readable.disabled'),
fontSize: 12,
fontFamily: 'Inter',
color: cssVar('readable.secondary'),
},
},
grid: {
left: 6,
right: 18,
left: 4,
right: 20,
top: 6,
bottom: 0,
containLabel: true,
@@ -94,7 +123,7 @@ export function useLineChartOptions(options: any) {
type: 'line',
smooth: true,
symbol: 'circle',
symbolSize: 8,
symbolSize: 6,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
@@ -111,8 +140,8 @@ export function useLineChartOptions(options: any) {
color: colors.scene.primary.active,
},
itemStyle: {
borderWidth: 1,
color: colors.bg.middle,
borderWidth: 2,
borderColor: colors.scene.primary.active,
opacity: 0,
},
@@ -126,9 +155,11 @@ export function useLineChartOptions(options: any) {
],
};

// const variantOptions = merge(defaultOptions, detailOptions);
const finalOptions = merge(defaultOptions, options);

setFinalOptions(finalOptions);
}, [colors, options, colorMode]);
}, [colors, options, colorMode, noData]);

return finalOptions;
}
Loading