Skip to content

Commit

Permalink
Merge branch 'main' into feat/daily-consumed-quota
Browse files Browse the repository at this point in the history
  • Loading branch information
devinxl authored May 31, 2024
2 parents ae86b84 + 944f3a4 commit 223b83f
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 31 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ If you use editor other than vscode, just make your app's directory as your work
## Documentation Links
- [Greenfield Whitepaper](https://github.com/bnb-chain/greenfield-whitepaper)
- [Guide to BNB Greenfield](https://docs.bnbchain.org/greenfield-docs/docs/guide/home)
- [Guide to BNB Greenfield](https://docs.bnbchain.org/bnb-greenfield/)
- [Guide to DCellar](https://docs.nodereal.io/docs/dcellar-get-started)
- [Guide to Rush](https://rushjs.io/pages/intro/welcome/)
- [Guide to Apollo](https://github.com/apolloconfig/apollo)
- [BNB Greenfield Release Notes](https://docs.bnbchain.org/greenfield-docs/docs/release-notes/releaseNotes/#greenfield-v023---testnet-maintenance-upgrade-reset)
- [BNB Greenfield RPC Endpoints](https://docs.bnbchain.org/greenfield-docs/docs/api/endpoints/)
- [BNB Greenfield Release Notes](https://docs.bnbchain.org/bnb-greenfield/release-notes/releaseNotes/)
- [BNB Greenfield RPC Endpoints](https://docs.bnbchain.org/bnb-greenfield/for-developers/network-endpoint/endpoints/?h=rpc)
- [@bnb-chain/greenfield-js-sdk](https://docs.bnbchain.org/greenfield-js-sdk/)
- [@node-real/uikit](https://node-real.github.io/uikit/#/guides)
- [@node-real/wallketkit](https://node-real.github.io/walletkit/)
Expand Down
30 changes: 30 additions & 0 deletions apps/dcellar-web-ui/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
{
"name": "dcellar-web-ui",
"entries": [
{
"version": "1.6.1",
"tag": "dcellar-web-ui_v1.6.1",
"date": "Thu, 30 May 2024 10:00:54 GMT",
"comments": {
"patch": [
{
"comment": "Correct the bucket status"
}
]
}
},
{
"version": "1.6.0",
"tag": "dcellar-web-ui_v1.6.0",
"date": "Thu, 30 May 2024 09:05:12 GMT",
"comments": {
"minor": [
{
"comment": "Unified encoding method same as go-sdk"
},
{
"comment": "Replace the related links of bnb greenfield doc"
},
{
"comment": "Add bucket status tip to the bucket detail drawer"
}
]
}
},
{
"version": "1.5.0",
"tag": "dcellar-web-ui_v1.5.0",
Expand Down
18 changes: 17 additions & 1 deletion apps/dcellar-web-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Change Log - dcellar-web-ui

This log was last generated on Thu, 23 May 2024 03:42:29 GMT and should not be manually modified.
This log was last generated on Thu, 30 May 2024 10:00:54 GMT and should not be manually modified.

## 1.6.1
Thu, 30 May 2024 10:00:54 GMT

### Patches

- Correct the bucket status

## 1.6.0
Thu, 30 May 2024 09:05:12 GMT

### Minor changes

- Unified encoding method same as go-sdk
- Replace the related links of bnb greenfield doc
- Add bucket status tip to the bucket detail drawer

## 1.5.0
Thu, 23 May 2024 03:42:29 GMT
Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcellar-web-ui",
"version": "1.5.0",
"version": "1.6.1",
"private": false,
"scripts": {
"dev": "node ./scripts/dev.js -p 3200",
Expand All @@ -19,7 +19,7 @@
"antd": "5.11.0",
"ahooks": "3.7.7",
"hash-wasm": "4.10.0",
"@bnb-chain/greenfield-js-sdk": "2.1.0-alpha.0",
"@bnb-chain/greenfield-js-sdk": "2.1.0-alpha.2",
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.32",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/components/layout/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ const MENU_ITEMS = [

const ASIDE = [
{
link: 'https://docs.bnbchain.org/greenfield-docs/',
link: 'https://docs.bnbchain.org/bnb-greenfield/',
trackId: 'dc.main.nav.doc.click',
icon: 'book',
text: 'BNB Greenfield Docs',
},
{
link: 'https://docs.bnbchain.org/greenfield-docs/docs/release-notes/releaseNotes/',
link: 'https://docs.bnbchain.org/bnb-greenfield/for-developers/network-endpoint/endpoints/?h=rpc',
trackId: 'dc.main.nav.release_note.click',
icon: 'doc',
text: 'Release Notes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { useMount, useUnmount } from 'ahooks';
import { DEFAULT_TAG } from '@/components/common/ManageTags';
import { Activities } from '@/components/Activities';
import { BucketStatus } from '@bnb-chain/greenfield-js-sdk';
import { DiscontinueBanner } from '@/components/common/DiscontinueBanner';

export const Label = ({ children }: PropsWithChildren) => (
<Text as={'div'} fontSize={'14px'} fontWeight={500} color="readable.tertiary">
Expand Down Expand Up @@ -101,6 +102,12 @@ export const DetailBucketOperation = memo<DetailBucketOperationProps>(function D
},
};

const isFlowRateLimit = ['1', '3'].includes(selectedBucketInfo?.OffChainStatus);
const isBucketDiscontinue =
selectedBucketInfo.BucketStatus === BucketStatus.BUCKET_STATUS_DISCONTINUED;
const isBucketMigrating =
selectedBucketInfo.BucketStatus === BucketStatus.BUCKET_STATUS_MIGRATING;

const quotaDetail = [
{
key: 'Monthly quota',
Expand Down Expand Up @@ -418,7 +425,7 @@ export const DetailBucketOperation = memo<DetailBucketOperationProps>(function D
<>
<QDrawerHeader>Bucket Detail</QDrawerHeader>
<QDrawerBody>
<Flex mb={24}>
<Flex mb={16}>
<IconFont type="detail-bucket" w={120} />
<Box marginLeft={'24px'} flex={1}>
<Text color="readable.tertiary" fontSize={'12px'} marginBottom="4px">
Expand Down Expand Up @@ -477,6 +484,27 @@ export const DetailBucketOperation = memo<DetailBucketOperationProps>(function D
</Text>
</Box>
</Flex>
{isFlowRateLimit && (
<DiscontinueBanner
marginBottom={16}
content="The bucket's flow rate exceeds the payment account limit."
/>
)}
{isBucketDiscontinue && (
<DiscontinueBanner
marginBottom={16}
content="All discontinued items in this bucket will be deleted by SP soon."
/>
)}
{isBucketMigrating && (
<DiscontinueBanner
icon={<IconFont w={16} type={'migrate'} color={'#1184EE'} />}
color={'#1184EE'}
bg="opacity7"
marginBottom={16}
content="This bucket is in the process of data migration to another provider."
/>
)}
<Tabs>
<TabList mb={24}>
{VERSION_TABS.map((tab) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export const FAQ = ({ openKeys, toggleOpenKeys }: FAQProps) => {
more about it, please refer to{' '}
<UnderlineLink
target="_blank"
href="https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/billing-and-payment#storage-fee-price-and-adjustment"
href="https://github.com/bnb-chain/greenfield/blob/master/docs/modules/billing-and-payment.md#storage-fee-price-and-adjustment"
>
https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/billing-and-payment#storage-fee-price-and-adjustment
https://github.com/bnb-chain/greenfield/blob/master/docs/modules/billing-and-payment.md#storage-fee-price-and-adjustment
</UnderlineLink>
.
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const PricingCard = ({ storeParams }: PricingCardProps) => {
}}
>
Global prices will update monthly based on all the SPs&apos; suggested prices.{' '}
<UnderlineLink href="https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/billing-and-payment">
<UnderlineLink href="https://github.com/bnb-chain/greenfield/blob/master/docs/modules/billing-and-payment.md#billing-and-payment">
Learn More
</UnderlineLink>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const datas = [
icon: <ResponsiveIcon type="filled-docs" color={'readable.white'} />,
iconBg: '#F5A861',
name: 'BNB Greenfield Docs',
link: 'https://docs.bnbchain.org/greenfield-docs/docs/guide/home',
link: 'https://docs.bnbchain.org/bnb-greenfield/',
gaClickName: 'dc_lp.homepage.tool.docs.click',
},
{
Expand Down
37 changes: 23 additions & 14 deletions apps/dcellar-web-ui/src/utils/string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IQuotaProps } from '@bnb-chain/greenfield-js-sdk';
import BigNumber from 'bignumber.js';
import { hexlify, toUtf8Bytes } from 'ethers/lib/utils';

export const trimFloatZero = (str: string) => {
const [intStr, floatStr] = str.split('.');
Expand Down Expand Up @@ -89,22 +90,30 @@ export const encodeObjectName = (pathName: string) => {
encodedPathName += s;
continue;

// default:
// // . ! @ # $ % ^ & * ) ( - + = { } [ ] / " , ' < > ~ \ .` ? : ; | \\
// // eslint-disable-next-line no-useless-escape
// if (/[.!@#$%^&*)(\-+={}\[\]\/",'<>~·`?:;|\\]+$/.test(s)) {
// // english characters
// const hexStr = s.charCodeAt(0).toString(16);
// encodedPathName += '%' + hexStr.toUpperCase();
// } else {
// // others characters
// try {
// encodedPathName += encodeURI(s);
// } catch (e) {
// encodedPathName += s;
// }
// }
// others characters need to be encoded
default:
// . ! @ # $ % ^ & * ) ( - + = { } [ ] / " , ' < > ~ \ .` ? : ; | \\
// eslint-disable-next-line no-useless-escape
if (/[.!@#$%^&*)(\-+={}\[\]\/",'<>~·`?:;|\\]+$/.test(s)) {
// english characters
const hexStr = s.charCodeAt(0).toString(16);
encodedPathName += '%' + hexStr.toUpperCase();
} else {
// others characters
try {
encodedPathName += encodeURI(s);
} catch (e) {
encodedPathName += s;
}
default: {
const u = toUtf8Bytes(s);

for (let i = 0; i < u.length; i++) {
const hexStr = hexlify(u[i]);
encodedPathName += '%' + hexStr.slice(2).toUpperCase();
}
}
}
}
return encodedPathName;
Expand Down
8 changes: 4 additions & 4 deletions common/config/rush/pnpm-lock.yaml

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

0 comments on commit 223b83f

Please sign in to comment.