提交 d5a0d4f5 编写于 作者: H huanghaiquan

Merge commit 'cc563455'

......@@ -17,6 +17,7 @@ class Bundle extends Component {
notification.destroy();
// 初始化全局数据
const { store:{common,header} } = this.props;
this.props.store.setLoading(true);
// 设置菜单高亮
if (common&&common.ledgers.length==0) {
Promise.all([
......@@ -77,8 +78,13 @@ class Bundle extends Component {
});
});
}
componentWillUnmount(){
const { store } = this.props;
store.setLoading(true);
}
render() {
const { store } = this.props;
store.setLoading(false);
return this.state.mod ? this.props.children(this.state.mod) : null;
}
}
......
......@@ -27,6 +27,8 @@ import moment from 'moment';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
import Notification from 'flarej/lib/components/antd/notification';
import 'flarej/lib/components/antd/icon';
import 'flarej/lib/components/antd/spin';
import { LocaleProvider } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import { createNotification } from './src/utils/notification';
......
......@@ -13,7 +13,160 @@
<script src="web/js/es6-promise.auto.min.js"></script>
<link href="web/css/20190101/app.css" rel="stylesheet"></head>
<body>
<div id="app" style="position:relative;"></div>
<div id="app" style="position:relative;">
<style>
.page-loading-warp {
padding: 120px;
display: flex;
justify-content: center;
align-items: center;
}
.ant-spin {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
-webkit-font-feature-settings: 'tnum';
font-feature-settings: 'tnum';
position: absolute;
display: none;
color: #1890ff;
text-align: center;
vertical-align: middle;
opacity: 0;
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
-webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
}
.ant-spin-spinning {
position: static;
display: inline-block;
opacity: 1;
}
.ant-spin-dot {
position: relative;
display: inline-block;
font-size: 20px;
width: 20px;
height: 20px;
}
.ant-spin-dot-item {
position: absolute;
display: block;
width: 9px;
height: 9px;
background-color: #1890ff;
border-radius: 100%;
-webkit-transform: scale(0.75);
-ms-transform: scale(0.75);
transform: scale(0.75);
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
opacity: 0.3;
-webkit-animation: antSpinMove 1s infinite linear alternate;
animation: antSpinMove 1s infinite linear alternate;
}
.ant-spin-dot-item:nth-child(1) {
top: 0;
left: 0;
}
.ant-spin-dot-item:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.ant-spin-dot-item:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.ant-spin-dot-item:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
.ant-spin-dot-spin {
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-animation: antRotate 1.2s infinite linear;
animation: antRotate 1.2s infinite linear;
}
.ant-spin-lg .ant-spin-dot {
font-size: 32px;
width: 32px;
height: 32px;
}
.ant-spin-lg .ant-spin-dot i {
width: 14px;
height: 14px;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.ant-spin-blur {
background: #fff;
opacity: 0.5;
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
@keyframes antSpinMove {
to {
opacity: 1;
}
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
</style>
<div class="page-loading-warp">
<div class="ant-spin ant-spin-lg ant-spin-spinning">
<span class="ant-spin-dot ant-spin-dot-spin">
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
</span>
</div>
</div>
</div>
<script src="web/js/jquery-3.1.1.min.js"></script>
<script src="web/js/babelHelpers.min.js"></script>
<script type="text/javascript" src="web/20190101/vendors.min.js"></script><script type="text/javascript" src="web/20190101/app.js"></script></body>
......
......@@ -12,7 +12,158 @@
<script src="{{ path }}js/es6-promise.auto.min.js"></script>
</head>
<body>
<div id="app" style="position:relative;"></div>
<div id="app" style="position:relative;">
<style>
.page-loading-warp {
padding: 120px;
display: flex;
justify-content: center;
align-items: center;
}
.ant-spin {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
-webkit-font-feature-settings: 'tnum';
font-feature-settings: 'tnum';
position: absolute;
display: none;
color: #1890ff;
text-align: center;
vertical-align: middle;
opacity: 0;
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
-webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
}
.ant-spin-spinning {
position: static;
display: inline-block;
opacity: 1;
}
.ant-spin-dot {
position: relative;
display: inline-block;
font-size: 20px;
width: 20px;
height: 20px;
}
.ant-spin-dot-item {
position: absolute;
display: block;
width: 9px;
height: 9px;
background-color: #1890ff;
border-radius: 100%;
-webkit-transform: scale(0.75);
-ms-transform: scale(0.75);
transform: scale(0.75);
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
opacity: 0.3;
-webkit-animation: antSpinMove 1s infinite linear alternate;
animation: antSpinMove 1s infinite linear alternate;
}
.ant-spin-dot-item:nth-child(1) {
top: 0;
left: 0;
}
.ant-spin-dot-item:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.ant-spin-dot-item:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.ant-spin-dot-item:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
.ant-spin-dot-spin {
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-animation: antRotate 1.2s infinite linear;
animation: antRotate 1.2s infinite linear;
}
.ant-spin-lg .ant-spin-dot {
font-size: 32px;
width: 32px;
height: 32px;
}
.ant-spin-lg .ant-spin-dot i {
width: 14px;
height: 14px;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.ant-spin-blur {
background: #fff;
opacity: 0.5;
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
@keyframes antSpinMove {
to {
opacity: 1;
}
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
</style>
<div class="page-loading-warp">
<div class="ant-spin ant-spin-lg ant-spin-spinning">
<span class="ant-spin-dot ant-spin-dot-spin"
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
></span>
</div>
</div>
</div>
<script src="{{ path }}js/jquery-3.1.1.min.js"></script>
<script src="{{ path }}js/babelHelpers.min.js"></script>
</body>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>com.jd.blockchain</groupId>
<artifactId>explorer</artifactId>
<version>1.1.2.RELEASE</version>
<version>1.1.3.RELEASE</version>
</parent>
<artifactId>data-explorer</artifactId>
<packaging>jar</packaging>
......
......@@ -106,8 +106,12 @@ const Contract = inject('store')(
const PageWrap = inject('store')(
observer(({ store, children }) => t`
<div id="page-wrap">
<ant-Spin size="large" spinning=${store.loading}>
<div style="width:100%;min-height:300px;">
${children}
</div>
</ant-Spin>
</div>
`)
);
......
......@@ -605,96 +605,7 @@ router.get('/:ledger/txs/hash/:tx_hash', function(req, res) {
let params = req.body,
ret = {};
Object.assign(ret, resultData,{
"data": {
"blockHeight": 1,
"executionState": "SUCCESS",
"transactionContent": {
"ledgerHash": {
"value": "657TQAw6ssVoeKniWGwbovk7njvCTvikPambM9eBv6ezs"
},
"operations": [
{
"userID": {
"address": {
"value": "5SmBgzsrnY6u9Y7DgSSkXfTkCgp83hiFin3v"
},
"pubKey": {
"value": "mb5kukaqjWtXyAerfHU1JDtVwabSeBU5c3khMZbNh7R8VJ"
}
}
},
{
"accountID": {
"address": {
"value": "5SmA98VknTbZ1Z7fmbNPHBuN2pbD89ogy8Ha"
},
"pubKey": {
"value": "mbC8hzmYBz2SsLLqwoBXAJiGeHrCnByBEvcaUZWscAiPqR"
}
}
},
{
"contractID": {
"address": {
"value": "5SmA98VknTbZ1Z7fmbNPHBuN2pbD89ogy8Ha"
},
"pubKey": {
"value": "mbC8hzmYBz2SsLLqwoBXAJiGeHrCnByBEvcaUZWscAiPqR"
}
},
"chainCode": "----------"
},
{
"contractAddress": {
"value": "mbC8hzmYBz2SsLLqwoBXAJiGeHrCnByBEvcaUZWscAiPqR"
},
"event": "----------",
"args": "----------"
},
{
"writeSet": [{
"key": "jdchain",
"value": {
"type": "TEXT",
"value": {
"value": "----------"
}
},
"expectedVersion": 0
}],
"accountAddress": {
"value": "mbC8hzmYBz2SsLLqwoBXAJiGeHrCnByBEvcaUZWscAiPqR"
}
}
],
"hash": {
"value": "6BLtM1agb7ERKoN5AJgZKiTjzdS7BpjgzQNYK8ZeDqotA"
}
},
"endpointSignatures": [
{
"digest": {
"value": "42pbfM5YKnf39Gitr4UsjTCzhhnJjwNyi8MnLFYgP4VKewTLzHitzArHEMrCt3hZYUe5ex9XvqtmiCoWpeAbdc31F"
},
"pubKey": {
"value": "mb5kbwzACnhK9P1dVxgMPB2ySJLFyJKQbHpH7T9oRK3LpS"
}
}
],
"nodeSignatures": [
{
"digest": {
"value": "66SQ95SbDaApAJhN2NsFx5sfAQTxsWhMW26D5iPqXc1jZU9rJEhRnqT1nzt62ZAcCvsfrjEsay3MxqXYA5tWPoA2U"
},
"pubKey": {
"value": "mb5kbwzACnhK9P1dVxgMPB2ySJLFyJKQbHpH7T9oRK3LpS"
}
}
]
},
"success": true
});
Object.assign(ret, resultData,{"data":{"blockHeight":2,"operationResults":[],"userAccountSetHash":{"value":"j5nyfcUoZ1YgfnQCV5U6iHQZPQ4aqCp5sx1Vf9UPqiBc56"},"executionState":"SUCCESS","transactionContent":{"ledgerHash":{"value":"j5s3Xx2djijUi7NewerfPtRTta3EAa9ErNcBsHgzkDND7g"},"operations":[{"accountID":{"address":{"value":"LdeNkb56uxHjqz4HJaDGtbGqaHd2D73nz5dGo"},"pubKey":{"value":"7VeR9CqbpKb6EnWrobskY8JBTh5ZS3MjhLFgw8cp6ZBntJa6"}}},{"writeSet":[{"expectedVersion":-1,"value":{"bytes":{"value":"21x71Vecp"},"type":"TEXT"},"key":"key1"}],"accountAddress":{"value":"LdeNkb56uxHjqz4HJaDGtbGqaHd2D73nz5dGo"}}],"hash":{"value":"j5gTM121tKdm3GTC6ET2XDr2aKivDEM5Tp9XFWsxKPxLxG"},"timestamp":1583142977001},"endpointSignatures":[{"digest":{"value":"SMHunDZXh7GUUUmdCwL1RybD2QD9wxDmCuF6Xy7up7Acv8NTi2X9QwuSdMgbGtuvXXMssXreTZZvygxMTkaGxtSTjg"},"pubKey":{"value":"7VeRPKizLbSmqNEBF6VsJEgwN84pEk1WZck5pLgL5N2E7xhJ"}}],"adminAccountHash":{"value":"j5t6rn6W4b89CymyvYbXyx8MtLN7RCvPd94C53BeYaqPJa"},"dataAccountSetHash":{"value":"j5gtK7Q4WMNbu47EucgELFNBvZxQZMuDnmVejCf5QSg2C9"},"nodeSignatures":[{"digest":{"value":"SMHunDZXh7GUUUmdCwL1RybD2QD9wxDmCuF6Xy7up7Acv8NTi2X9QwuSdMgbGtuvXXMssXreTZZvygxMTkaGxtSTjg"},"pubKey":{"value":"7VeRPKizLbSmqNEBF6VsJEgwN84pEk1WZck5pLgL5N2E7xhJ"}}]},"success":true});
res.send(ret);
});
......
......@@ -109,7 +109,7 @@ const ContractStore = types
}
},
// 根据合约地址查询详细信息
getContractsByAddress(param) {debugger
getContractsByAddress(param) {
return fetchData(`${__HOST}/ledgers/${param.ledger}/contracts/address/${param.address}`,
self.setContractsByAddress,
'', {
......@@ -123,7 +123,7 @@ const ContractStore = types
console.log(error);
});
},
setContractsByAddress(result) {debugger
setContractsByAddress(result) {
if (result&&result.success) {
return result.data||[];
}
......
......@@ -10,6 +10,7 @@ import ContractStore from './pages/contractStore';
// prettier-ignore
const RootStore = types.model('RootStore', {
loading:true,
common: types.optional(CommonStore, {}),
header: types.optional(HeaderStore, {
......@@ -21,6 +22,12 @@ const RootStore = types.model('RootStore', {
block: types.optional(BlockStore, {}),
contract: types.optional(ContractStore, {}),
//{pageStore}//
}).actions(self => {
return {
setLoading(v){
self.loading=v;
},
}
});
export default RootStore;
\ No newline at end of file
......@@ -41,7 +41,7 @@ export function tranBase58(value) {
for (i = 0; i < value.length; i++) {
let c = value[i];
// c是不是ALPHABET_MAP的key
if (!(c in ALPHABET_MAP)) throw new Error('Non-base58 character');
if (!(c in ALPHABET_MAP)) return value;
for (j = 0; j < bytes.length; j++) bytes[j] *= BASE;
bytes[0] += ALPHABET_MAP[c];
let carry = 0;
......
......@@ -34,7 +34,7 @@ export default class BlockInfo extends Component {
// 跳转到前置区块
@autobind
goBlock(e){debugger;
goBlock(e){
const {goPrev}= this.props;
if (goPrev) {
goPrev(e.target.innerText);
......
......@@ -38,7 +38,6 @@ export default class TransactionInfo extends Component {
result=byteToString(text);
break;
case 'JSON':
debugger
let json=stringToBase58(data);
result=byteToString(json);
break;
......@@ -74,7 +73,6 @@ export default class TransactionInfo extends Component {
render() {
const { data,visible} = this.props;
console.log(this)
return tmpls.container({
components: {
'ant-Drawer': Drawer,
......
......@@ -49,7 +49,7 @@
</fj-Row>
<#each {{this.writeSet}}>
<BlockCollapseSmall title="键:{{this.key}}">
值:{{formatData(this.value.type,this.value.value)}}<br>
值:{{formatData(this.value.type,this.value.bytes)}}<br>
预期版本:{{this.expectedVersion}}<br>
类型:{{this.value.type}}
</BlockCollapseSmall>
......
......@@ -67,6 +67,15 @@ export default class Search extends Component {
return String(content).replace(this.searchParamInput, '<i>'+this.searchParamInput+'</i>');
}
// 文字动态大小
scientificCount=(number)=>{
let length=number.toString().length;
if (length>5) {
return <p class={styles.data} style={{fontSize:(36-(length-6)*3)+'px'}}>{number}</p>;
}
return <p class={styles.data}>{number}</p>;
}
componentDidMount() {
const { store: { search,header } } = this.props;
header.setSelectMenu(['search']);
......
......@@ -20,7 +20,7 @@
区块高度
</p>
<p class="{styles.data}">{search.blockHeight || 0}</p>
{scientificCount(search.blockHeight || 0)}
</div>
<div class="{styles.right}">
<div class="{styles.logo} {styles.logoBH}">
......@@ -35,7 +35,7 @@
<div class="{styles.span}">
<div class="{styles.left}">
<p class="{styles.title}">交易总数</p>
<p class="{styles.data}">{search.transactionTotal || 0}</p>
{scientificCount(search.transactionTotal || 0)}
</div>
<div class="{styles.right}">
<div class="{styles.logo} {styles.logoTR}">
......@@ -50,7 +50,7 @@
<div class="{styles.span}">
<div class="{styles.left}">
<p class="{styles.title}">用户总数</p>
<p class="{styles.data}">{search.userTotal || 0}</p>
{scientificCount(search.userTotal || 0)}
</div>
<div class="{styles.right}">
<div class="{styles.logo} {styles.logoUS}">
......@@ -65,7 +65,7 @@
<div class="{styles.span}">
<div class="{styles.left}">
<p class="{styles.title}">数据账户总数</p>
<p class="{styles.data}">{search.dataLedgersTotal || 0}</p>
{scientificCount(search.dataLedgersTotal || 0)}
</div>
<div class="{styles.right}">
<div class="{styles.logo} {styles.logoLE}">
......@@ -80,7 +80,7 @@
<div class="{styles.span}">
<div class="{styles.left}">
<p class="{styles.title}">合约总数</p>
<p class="{styles.data}">{search.contractTotal || 0}</p>
{scientificCount(search.contractTotal || 0)}
</div>
<div class="{styles.right}">
<div class="{styles.logo} {styles.logoCO}">
......
......@@ -10,7 +10,7 @@
const isProd = process.env.NODE_ENV == 'production';
const isTest = process.env.NODE_ENV == 'test';
const isLocal = process.env.Project == 'local';
const isSelf = true;// true使用代理服务,false不使用
const isSelf = false;// true使用代理服务,false不使用
const pxToRem = require('postcss-pxtorem');
const VERSION = '20190101';
const modifyVars = Object.assign({});
......@@ -228,11 +228,11 @@ module.exports = {
proxy: [
{
context: ['/ledgers'],
target: 'http://192.168.151.39:8081',
target: 'http://jdchain-cloud4-8080.jdfmgt.com',
},
{
context: ['/schema',],
target: 'http://192.168.151.39:8081',
target: 'http://jdchain-cloud4-8080.jdfmgt.com',
}
],
}
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>com.jd.blockchain</groupId>
<artifactId>explorer</artifactId>
<version>1.1.2.RELEASE</version>
<version>1.1.3.RELEASE</version>
</parent>
<artifactId>manager-explorer</artifactId>
<packaging>jar</packaging>
......
......@@ -10,7 +10,7 @@
<groupId>com.jd.blockchain</groupId>
<artifactId>explorer</artifactId>
<version>1.1.2.RELEASE</version>
<version>1.1.3.RELEASE</version>
<packaging>pom</packaging>
<modules>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册