Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
41401da
feat: block unconfirmed ssr
Oct 14, 2022
0812ed1
feat: blockDetail
Oct 14, 2022
078f023
feat: reduce Script Evaluation
Oct 17, 2022
1407488
feat: fix accessibility
Oct 17, 2022
8ab1b98
feat: delete /static
Oct 17, 2022
6e21a49
feat: merge develop branch
Oct 17, 2022
4efd24d
feat: /txs
Oct 17, 2022
2952e72
feat: txs unconfirmedtxs
Oct 18, 2022
8e45f53
feat: fix types error
Oct 18, 2022
f5b818b
feat: fix router jump color
Oct 18, 2022
c6b1437
feat: fix BUILD_ENDPOINT_CHAIN
Oct 18, 2022
d222c73
feat: test
Oct 18, 2022
feab9bb
feat: delete and require antd less
Oct 18, 2022
b37669c
feat: bUILD_ENDPOINT_CHAIN
Oct 18, 2022
ab9ed3d
feat: update .gitignore
Oct 18, 2022
15f67bc
feat: back-btn
Oct 18, 2022
603c148
feat: tx
Oct 19, 2022
f46d8a6
feat: add suppressHydrationWarning in getFormattedDate
Oct 19, 2022
59b7372
feat: fix accessibility
Oct 19, 2022
2b8ec9a
Merge branch 'refactor/nextjs-version' of github.com:AElfProject/aelf…
Oct 19, 2022
c3759f9
feat: chainSelect tsx, add file in gitignore
Oct 19, 2022
112382b
feat: rm –cache
Oct 19, 2022
2db7e02
feat: component js -> tsx
Oct 19, 2022
b9ca7bd
feat: accounts
Oct 19, 2022
bea3dc0
feat: update addressDetail
Oct 20, 2022
b7dd9d0
feat: accounts ssr
Oct 20, 2022
41375e2
feat: addressDetail
Oct 20, 2022
fcf5f13
feat: txDetail
Oct 21, 2022
44ba00c
feat: addressDetail
Oct 21, 2022
ea68f44
feat: add price
Oct 21, 2022
d44e9ed
feat: blockDetail price
Oct 24, 2022
3166628
feat: contacts page
Oct 24, 2022
e6a11b6
feat: contract addressDetail
Oct 24, 2022
f1e9a44
feat: fix build ts bug
Oct 24, 2022
5d3fbd0
feat: faild invalid
Oct 24, 2022
9b6ffed
feat: tokens
Oct 25, 2022
ceec1a6
feat: tokenDetail
Oct 25, 2022
c41a998
feat: fix build error
Oct 25, 2022
d806f62
feat: js -> ts, add queryString
Oct 26, 2022
6515b2e
feat: block tx token request
Oct 26, 2022
32fb5b8
feat: queryConfig
Oct 26, 2022
fdb29e6
feat: queryConfig
Oct 26, 2022
6e7eb27
feat: delete path.resolve
Oct 26, 2022
e3f9f7f
feat: delete console
Oct 26, 2022
5f3f41f
feat: delete CHAIN_ID
Oct 26, 2022
d6e14c9
feat: fix ts error
Oct 26, 2022
ccb696f
feat: resource js -> ts
Oct 26, 2022
3c436af
feat: js -> ts
Oct 26, 2022
3b3066a
feat: redux js -> ts
Oct 27, 2022
bc4c899
feat: resource
Oct 27, 2022
9da3f4a
feat: handle error
Oct 27, 2022
b298b9b
feat: error handle
Oct 27, 2022
bc3f49a
feat: error handle
Oct 27, 2022
3b69327
feat: fix token error
Oct 27, 2022
fea056d
feat: delete description
Oct 27, 2022
f773d00
feat: add getContractNames
Oct 27, 2022
7ab3b19
feat: fix Image
Oct 27, 2022
6e6fd9e
feat: style mobile
Oct 28, 2022
35a347d
feat: delete console
Oct 28, 2022
ed593e8
feat: add description and delete useless file
Oct 28, 2022
da0666f
feat: add suppressHydrationWarning for time
Oct 28, 2022
483c0e8
feat: header ts
Oct 28, 2022
87c2495
feat: proposal og less
Nov 3, 2022
9bcd82f
feat: chache&nodeInfo
Nov 4, 2022
3603b32
feat: change socket url
Nov 4, 2022
74d8fbd
feat: delete console
Nov 4, 2022
263e343
feat: test
Nov 4, 2022
8abb125
feat: delete sourcemap
Nov 4, 2022
c33cd88
feat: test
Nov 4, 2022
466ebf1
feat: add console
Nov 4, 2022
876cbd3
feat: delete production
Nov 4, 2022
b91c9bc
feat: change production
Nov 4, 2022
87a6d50
feat: aelf prod rewrite
Nov 7, 2022
00c22d5
feat: aelf prod rewrite
Nov 7, 2022
608be76
feat: add log
Nov 7, 2022
92032a3
feat: add log
Nov 7, 2022
d08464a
feat: change prod rewrite
Nov 7, 2022
c3fe587
feat: change rewrite
Nov 7, 2022
5edf469
feat: add prod rewrite fc
Nov 7, 2022
7cdff33
feat: change queryConfig
Nov 7, 2022
978341e
feat: prod rewrite
Nov 7, 2022
5f92226
feat: prod
Nov 7, 2022
7e5f34d
feat: prod rewrites
Nov 7, 2022
24bab1d
feat: test
Nov 7, 2022
bdcbcd4
feat: hOST change
Nov 7, 2022
873ff34
feat: queryCOnfig
Nov 7, 2022
a7f8a56
feat: prod rewrites
Nov 7, 2022
1d3f1f8
feat: rewrites
Nov 7, 2022
7e36da0
feat: test
Nov 7, 2022
5c85d25
feat: test
Nov 7, 2022
ea94670
feat: pro rewrites
Nov 7, 2022
692a1c9
feat: add log
Nov 7, 2022
9f3f1f8
feat: delete socket
Nov 7, 2022
38195e5
feat: test
Nov 7, 2022
633b494
feat: socket timeout
Nov 7, 2022
c227c3d
feat: timeout
Nov 7, 2022
c154dbd
feat: add log
Nov 7, 2022
7ee872a
feat: socket error
Nov 7, 2022
b1eb3ce
feat: compatible with old url
Nov 10, 2022
ea147f7
feat: delete flag
Nov 11, 2022
dc43578
feat: add -nextjs
Nov 11, 2022
668d3bb
feat: change style
Nov 11, 2022
e10cce9
feat: sentry
Nov 11, 2022
a615f8d
feat: readme
Nov 11, 2022
cee790d
feat: fix blockheight
Nov 14, 2022
2ed41ce
feat: fix header style
Nov 14, 2022
cda8cc7
feat: conflict solve
Nov 14, 2022
5382fe9
Merge pull request #160 from AElfProject/refactor/nextjs-sentry
hzz780 Nov 14, 2022
dec71c8
feat: add console error
Nov 16, 2022
3a611f4
feat: add config lang
Nov 16, 2022
2d3622d
feat: clear redirectRes
Nov 17, 2022
fce9415
feat: fix wallet null
Nov 17, 2022
d4beb7b
feat: fix vote modal
Nov 17, 2022
16232f3
feat: add reset
Nov 21, 2022
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
5 changes: 0 additions & 5 deletions .env

This file was deleted.

13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# for handling environment variables
# use .env on every environment
NEXT_PUBLIC_APP_NAME = explorer.aelf.io
NEXT_PUBLIC_BUNDLE_ANALYZER = false
NEXT_PUBLIC_CSS_APP_PREFIX = ant
NEXT_PUBLIC_SENTRY_DSN = your dsn
__NEXT_REACT_ROOT = false
# use .env.local on development
# use .env.production on production
BUILD_ENDPOINT=https://explorer-test.aelf.io
BUILD_ENDPOINT_SOCKET=https://explorer-test.aelf.io
BUILD_ENDPOINT_CMS=https://explorer-test.aelf.io
BUILD_ENDPOINT_CHAIN=https://explorer-test.aelf.io
3 changes: 0 additions & 3 deletions .env.production

This file was deleted.

1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

#env
.env
# local env files
.env*.local
# production env files
Expand All @@ -38,3 +40,9 @@ yarn-error.log*

# shell
*.sh

# cache
.eslintcache

.sentryclirc
baseConfig.js
14 changes: 14 additions & 0 deletions .sentryclirc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[defaults]
url=https://sentry.io/
project=aelf-block-explorer
org=ienyan

[auth]
token=your token

[log]
level=debug

[http]
verify_ssl=false
check_ssl_revoke=false
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next

## Getting Started

1. add .sentryclirc referring .sentryclirc.example
2. add .env、.env.local refferring .env.example
3. add baseConfig.js including prodRewrites and firebaseConfig, prodRewrites is just like `build/rewrites/development.js`, firebaseConfig can be found at firebase settings.

```bash
# install dependencies
$ yarn
Expand Down Expand Up @@ -29,4 +33,9 @@ The `pages/api` directory is mapped to `/api/*`. Files in this directory are tre

### Production

Change the chain node URL in script such as `yarn build -- --CHAIN_ENDPOINT https://aelf-test-node.aelf.io`
```bash
# Change the chain node URL in script such as
yarn beforeBuild -- --CHAIN_ENDPOINT https://aelf-test-node.aelf.io
yarn build
yarn start
```
56 changes: 54 additions & 2 deletions build/common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,63 @@
const rewritesConfig = require('./rewrites/index');
const { ROOT, getLessVariables } = require('./util.js');
const path = require('path');
const { NEXT_PUBLIC_CSS_APP_PREFIX, NEXT_PUBLIC_CSS_EXAMPLE_PREFIX } = process.env;
module.exports = {
reactStrictMode: true,
// `Warning: findDOMNode is deprecated in StrictMode.` when use antd
reactStrictMode: false,
concurrentFeatures: true,
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
async rewrites() {
return rewritesConfig;
},
lessLoaderOptions: {
lessOptions: {
javascriptEnabled: true,
modifyVars: Object.assign(getLessVariables(path.resolve(ROOT, 'src/assets/theme/color.less')), {
'@app-prefix': NEXT_PUBLIC_CSS_EXAMPLE_PREFIX,
'@ant-prefix': NEXT_PUBLIC_CSS_APP_PREFIX,
}),
lessVarsFilePath: 'src/assets/theme/color.less', // optional
lessVarsFilePathAppendToEndOfContent: false, // optional
},
},
images: {
domains: ['raw.githubusercontent.com'],
disableStaticImages: true,
},
webpack: function (config) {
config.module.rules.push(
{
test: /\.(jpe?g|png|gif|svg|webp)$/i,
use: [
{
loader: 'url-loader',
options: {
name: 'static/img/[name]-[hash:5].[ext]',
limit: 8192,
},
},
],
},
{
test: /\.(woff|woff2|ttf|eot|svg)(#.+)?$/,
use: [
{
loader: 'url-loader',
options: {
name: 'static/fonts/[name].[ext]',
limit: 8192,
},
},
],
},
);
return config;
},
productionBrowserSourceMaps: true,
sentry: {
hideSourceMaps: true,
},
};
65 changes: 15 additions & 50 deletions build/plugin.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,23 @@
const path = require('path');
const withAntdLess = require('next-plugin-antd-less');
const { NEXT_PUBLIC_CSS_APP_PREFIX, NEXT_PUBLIC_BUNDLE_ANALYZER, NEXT_PUBLIC_CSS_EXAMPLE_PREFIX } = process.env;
const { NEXT_PUBLIC_BUNDLE_ANALYZER } = process.env;
const { withSentryConfig } = require('@sentry/nextjs');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: NEXT_PUBLIC_BUNDLE_ANALYZER === 'true',
});
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore

const { ROOT, getLessVariables } = require('./util.js');

silent: true, // Suppresses all logs
include: '.next',
configFile: '.sentryclirc',
urlPrefix: '~/_next',
};
module.exports = [
[withBundleAnalyzer],
[
// withLess,
withAntdLess({
lessLoaderOptions: {
lessOptions: {
javascriptEnabled: true,
modifyVars: Object.assign(getLessVariables(path.resolve(ROOT, 'src/assets/theme/color.less')), {
'@app-prefix': NEXT_PUBLIC_CSS_EXAMPLE_PREFIX,
'@ant-prefix': NEXT_PUBLIC_CSS_APP_PREFIX,
}),
},
},
images: {
disableStaticImages: true,
},
webpack: function (config) {
config.module.rules.push(
{
test: /\.(jpe?g|png|gif|svg|webp)$/i,
use: [
{
loader: 'url-loader',
options: {
name: 'static/img/[name]-[hash:5].[ext]',
limit: 8192,
},
},
],
},
{
test: /\.(woff|woff2|ttf|eot|svg)(#.+)?$/,
use: [
{
loader: 'url-loader',
options: {
name: 'static/fonts/[name].[ext]',
limit: 8192,
},
},
],
},
);
return config;
},
}),
],
[withAntdLess],
(nextConfig) => withSentryConfig(nextConfig, sentryWebpackPluginOptions),
];
10 changes: 5 additions & 5 deletions build/rewrites/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ module.exports = [
destination: 'https://explorer-test.aelf.io/cms/:path*',
},
{
source: '/api/blockChain',
destination: 'https://explorer-test.aelf.io/chain/api/blockChain',
source: '/api/blockChain/:path*',
destination: 'http://10.147.20.67:8888/chain/api/blockChain/:path*',
},
{
source: '/api/:path*',
destination: 'https://explorer-test.aelf.io/api/:path*',
destination: 'http://10.147.20.67:8888/api/:path*',
},
{
source: '/chain/:path*',
destination: 'https://explorer-test.aelf.io/chain/:path*',
destination: 'http://10.147.20.67:8888/chain/:path*',
},
{
source: '/socket',
destination: 'https://explorer-test.aelf.io/socket',
destination: 'http://10.147.20.67:8888/socket',
},
];
25 changes: 3 additions & 22 deletions build/rewrites/production.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
module.exports = [
{
source: '/api/blockChain',
destination: 'https://explorer-test.aelf.io/chain/api/blockChain',
},
{
source: '/api/:path*',
destination: 'https://explorer-test.aelf.io/api/:path*',
},
{
source: '/cms/:path*',
destination: 'https://explorer-test.aelf.io/cms/:path*',
},
{
source: '/chain/:path*',
destination: 'https://explorer-test.aelf.io/chain/:path*',
},
{
source: '/socket',
destination: 'https://explorer-test.aelf.io/socket',
},
];
// git ignore
const prodRewrites = require('../../baseConfig').prodRewrites;
module.exports = prodRewrites;
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "next-demo",
"name": "aelf-block-explorer",
"version": "0.1.0",
"private": true,
"scripts": {
"dev:AELF": "CHAIN_ID='AELF' next dev",
"dev:tDVW": "CHAIN_ID='tDVW' next dev",
"build:AELF": "CHAIN_ID='AELF' next build",
"build:tDVW": "CHAIN_ID='tDVW' next build",
"start:AELF": "CHAIN_ID='AELF' next start",
"start:tDVW": "CHAIN_ID='tDVW' next start",
"dev": "next dev",
"beforeBuild": "node scripts/queryConfig.js",
"build": "next build",
"start": " next start",
"lint": "next lint",
"dev:analyze": "PORT=4000 ANALYZE=true next dev",
"prepare": "husky install"
Expand All @@ -22,13 +20,13 @@
"@monaco-editor/react": "^4.4.5",
"@reduxjs/toolkit": "^1.8.5",
"@sentry/apm": "^5.19.0",
"@sentry/node": "^5.19.0",
"@sentry/nextjs": "^7.19.0",
"@sentry/react": "^5.19.0",
"aelf-block-scan": "^0.4.1",
"aelf-bridge": "^0.0.9",
"aelf-sdk": "3.2.40",
"aelf-sdk-cross-chain": "^1.0.14",
"antd": "4.21.0",
"antd": "^4.23.6",
"apisauce": "^0.16.0",
"axios": "^0.19.0",
"axios-hooks": "^3.1.5",
Expand All @@ -45,6 +43,7 @@
"eslint-config-prettier": "6.7.0",
"eslint-plugin-prettier": "^4.2.1",
"file-saver": "^2.0.2",
"firebase": "^9.13.0",
"i18next": "^19.0.0",
"i18next-browser-languagedetector": "^4.0.1",
"ismobilejs": "^1.1.1",
Expand All @@ -56,6 +55,7 @@
"lodash.throttle": "^4.1.1",
"lru-cache": "^7.14.0",
"memoize-one": "^5.1.1",
"memory-cache": "^0.2.0",
"mobx": "^5.1.1",
"mobx-react": "^5.2.8",
"mobx-state-tree": "^3.3.0",
Expand Down Expand Up @@ -125,7 +125,7 @@
"copy-webpack-plugin": "^5.0.5",
"cross-env": "^5.2.1",
"cssnano": "^4.1.10",
"dotenv": "^8.2.0",
"dotenv": "^16.0.3",
"eslint": "^8.23.1",
"eslint-config-airbnb": "18.0.1",
"eslint-config-airbnb-base": "^14.0.0",
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon_main.ico
Binary file not shown.
Binary file added public/favicon_test.ico
Binary file not shown.
Binary file removed public/font/Roboto-Bold.ttf
Binary file not shown.
Binary file removed public/font/Roboto-Medium.ttf
Binary file not shown.
Binary file removed public/font/Roboto-Regular.ttf
Binary file not shown.
Loading