提交 4feb14c1 编写于 作者: 王博士JD's avatar 王博士JD

build

上级 9513246e
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n=window.webpackJsonp;window.webpackJsonp=function(r,i,s){for(var a,u,l,c=0,d=[];c<r.length;c++)u=r[c],o[u]&&d.push(o[u][0]),o[u]=0;for(a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a]);for(n&&n(r,i,s);d.length;)d.shift()();if(s)for(c=0;c<s.length;c++)l=t(t.s=s[c]);return l};var r={},o={5:0};t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(u);var t=o[e];0!==t&&(t&&t[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var r=o[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var i=new Promise(function(t,n){r=o[e]=[t,n]});r[2]=i;var s=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+"web/20170928/"+({0:"block",1:"search",2:"user",3:"account"}[e]||e)+".chunk.js";var u=setTimeout(n,12e4);return a.onerror=a.onload=n,s.appendChild(a),i},t.m=e,t.c=r,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t.oe=function(e){throw console.error(e),e},t(t.s=1)}({"./node_modules/array-from/index.js":function(e,t,n){e.exports="function"==typeof Array.from?Array.from:n("./node_modules/array-from/polyfill.js")},"./node_modules/array-from/polyfill.js":function(e,t){e.exports=function(){var e=function(e){return"function"==typeof e},t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},n=Math.pow(2,53)-1,r=function(e){var r=t(e);return Math.min(Math.max(r,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(t,n){if(null!=t&&null!=n){var r=t[n];if(null==r)return;if(!e(r))throw new TypeError(r+" is not a function");return r}},s=function(e){var t=e.next();return!Boolean(t.done)&&t};return function(t){"use strict";var n,a=this,u=arguments.length>1?arguments[1]:void 0;if(void 0!==u){if(!e(u))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var l,c,d=i(t,o(t));if(void 0!==d){l=e(a)?Object(new a):[];var f=d.call(t);if(null==f)throw new TypeError("Array.from requires an array-like or iterable object");c=0;for(var p,m;;){if(!(p=s(f)))return l.length=c,l;m=p.value,l[c]=u?u.call(n,m,c):m,c++}}else{var h=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var v=r(h.length);l=e(a)?Object(new a(v)):new Array(v),c=0;for(var y;c<v;)y=h[c],l[c]=u?u.call(n,y,c):y,c++;l.length=v}return l}}()},"./node_modules/console-polyfill/index.js":function(e,t){!function(e){"use strict";e.console||(e.console={});for(var t,n,r=e.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)r[t]||(r[t]={});for(;n=s.pop();)r[n]||(r[n]=o)}("undefined"==typeof window?this:window)},"./node_modules/core-decorators/lib/applyDecorators.js":function(e,t,n){"use strict";function r(e,t){var n=e.prototype;for(var r in t)for(var s=t[r],a=0,u=s.length;a<u;a++){var l=s[a];o(n,r,l(n,r,i(n,r)))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=Object.defineProperty,i=Object.getOwnPropertyDescriptor;e.exports=t.default},"./node_modules/core-decorators/lib/autobind.js":function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){return e.bind?e.bind(t):function(){return e.apply(t,arguments)}}function i(e,t){if("undefined"==typeof WeakMap)throw new Error("Using @autobind on "+t.name+"() requires WeakMap support due to its use of super."+t.name+"()\n See https://github.com/jayphelps/core-decorators.js/issues/20");p||(p=new WeakMap),!1===p.has(e)&&p.set(e,new WeakMap);var n=p.get(e);return!1===n.has(t)&&n.set(t,o(t,e)),n.get(t)}function s(e){for(var t=(0,c.getOwnPropertyDescriptors)(e.prototype),n=(0,c.getOwnKeys)(t),r=0,o=n.length;r<o;r++){var i=n[r],s=t[i];"function"==typeof s.value&&"constructor"!==i&&d(e.prototype,i,a(e.prototype,i,s))}}function a(e,t,n){var r=n.value,s=n.configurable,a=n.enumerable;if("function"!=typeof r)throw new SyntaxError("@autobind can only be used on functions, not: "+r);var u=e.constructor;return{configurable:s,enumerable:a,get:function(){if(this===e)return r;if(this.constructor!==u&&f(this).constructor===u)return r;if(this.constructor!==u&&t in this.constructor.prototype)return i(this,r);var n=o(r,this);return d(this,t,{configurable:!0,writable:!0,enumerable:!1,value:n}),n},set:(0,c.createDefaultSetter)(t)}}function u(e){return 1===e.length?s.apply(void 0,r(e)):a.apply(void 0,r(e))}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(){return u(arguments)}:u(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n("./node_modules/core-decorators/lib/private/utils.js"),d=Object.defineProperty,f=Object.getPrototypeOf,p=void 0;e.exports=t.default},"./node_modules/core-decorators/lib/core-decorators.js":function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}/**
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n=window.webpackJsonp;window.webpackJsonp=function(r,i,s){for(var a,u,l,c=0,d=[];c<r.length;c++)u=r[c],o[u]&&d.push(o[u][0]),o[u]=0;for(a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a]);for(n&&n(r,i,s);d.length;)d.shift()();if(s)for(c=0;c<s.length;c++)l=t(t.s=s[c]);return l};var r={},o={6:0};t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(u);var t=o[e];0!==t&&(t&&t[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var r=o[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var i=new Promise(function(t,n){r=o[e]=[t,n]});r[2]=i;var s=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+"web/20170928/"+({0:"block",1:"user",2:"contract",3:"search",4:"account"}[e]||e)+".chunk.js";var u=setTimeout(n,12e4);return a.onerror=a.onload=n,s.appendChild(a),i},t.m=e,t.c=r,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t.oe=function(e){throw console.error(e),e},t(t.s=1)}({"./node_modules/array-from/index.js":function(e,t,n){e.exports="function"==typeof Array.from?Array.from:n("./node_modules/array-from/polyfill.js")},"./node_modules/array-from/polyfill.js":function(e,t){e.exports=function(){var e=function(e){return"function"==typeof e},t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},n=Math.pow(2,53)-1,r=function(e){var r=t(e);return Math.min(Math.max(r,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(t,n){if(null!=t&&null!=n){var r=t[n];if(null==r)return;if(!e(r))throw new TypeError(r+" is not a function");return r}},s=function(e){var t=e.next();return!Boolean(t.done)&&t};return function(t){"use strict";var n,a=this,u=arguments.length>1?arguments[1]:void 0;if(void 0!==u){if(!e(u))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var l,c,d=i(t,o(t));if(void 0!==d){l=e(a)?Object(new a):[];var f=d.call(t);if(null==f)throw new TypeError("Array.from requires an array-like or iterable object");c=0;for(var p,m;;){if(!(p=s(f)))return l.length=c,l;m=p.value,l[c]=u?u.call(n,m,c):m,c++}}else{var h=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var v=r(h.length);l=e(a)?Object(new a(v)):new Array(v),c=0;for(var y;c<v;)y=h[c],l[c]=u?u.call(n,y,c):y,c++;l.length=v}return l}}()},"./node_modules/console-polyfill/index.js":function(e,t){!function(e){"use strict";e.console||(e.console={});for(var t,n,r=e.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)r[t]||(r[t]={});for(;n=s.pop();)r[n]||(r[n]=o)}("undefined"==typeof window?this:window)},"./node_modules/core-decorators/lib/applyDecorators.js":function(e,t,n){"use strict";function r(e,t){var n=e.prototype;for(var r in t)for(var s=t[r],a=0,u=s.length;a<u;a++){var l=s[a];o(n,r,l(n,r,i(n,r)))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=Object.defineProperty,i=Object.getOwnPropertyDescriptor;e.exports=t.default},"./node_modules/core-decorators/lib/autobind.js":function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){return e.bind?e.bind(t):function(){return e.apply(t,arguments)}}function i(e,t){if("undefined"==typeof WeakMap)throw new Error("Using @autobind on "+t.name+"() requires WeakMap support due to its use of super."+t.name+"()\n See https://github.com/jayphelps/core-decorators.js/issues/20");p||(p=new WeakMap),!1===p.has(e)&&p.set(e,new WeakMap);var n=p.get(e);return!1===n.has(t)&&n.set(t,o(t,e)),n.get(t)}function s(e){for(var t=(0,c.getOwnPropertyDescriptors)(e.prototype),n=(0,c.getOwnKeys)(t),r=0,o=n.length;r<o;r++){var i=n[r],s=t[i];"function"==typeof s.value&&"constructor"!==i&&d(e.prototype,i,a(e.prototype,i,s))}}function a(e,t,n){var r=n.value,s=n.configurable,a=n.enumerable;if("function"!=typeof r)throw new SyntaxError("@autobind can only be used on functions, not: "+r);var u=e.constructor;return{configurable:s,enumerable:a,get:function(){if(this===e)return r;if(this.constructor!==u&&f(this).constructor===u)return r;if(this.constructor!==u&&t in this.constructor.prototype)return i(this,r);var n=o(r,this);return d(this,t,{configurable:!0,writable:!0,enumerable:!1,value:n}),n},set:(0,c.createDefaultSetter)(t)}}function u(e){return 1===e.length?s.apply(void 0,r(e)):a.apply(void 0,r(e))}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(){return u(arguments)}:u(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n("./node_modules/core-decorators/lib/private/utils.js"),d=Object.defineProperty,f=Object.getPrototypeOf,p=void 0;e.exports=t.default},"./node_modules/core-decorators/lib/core-decorators.js":function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}/**
* core-decorators.js
* (c) 2016 Jay Phelps and contributors
* MIT Licensed
......
此差异已折叠。
......@@ -15,7 +15,7 @@
<script src="web/js/es6-promise.auto.min.js"></script>
</head>
<body>
<div id="app" style="position:relative"></div>
<div id="app" style="position:relative;"></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/20170928/vendors.min.js"></script></body>
......
......@@ -208,6 +208,107 @@ router.get('/:ledger/blocks/height/:height/txs', function(req, res) {
res.send(ret);
});
// 4.6 获取交易详细信息
// GET /ledgers/{ledger}/txs/hash/{tx_hash}
router.get('/:ledger/txs/hash/:tx_hash', function(req, res) {
res.type('json');
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
});
res.send(ret);
});
// 5 用户
// 5.1 获取用户总数
// GET /ledgers/{ledger}/users/count
......
......@@ -119,7 +119,7 @@ const BlockStore = types
// 根据哈希查询交易数量
getTxCount(param) {
return fetchData(`${__HOST}/ledgers/${param}/blocks/search`,
return fetchData(`${__HOST}/ledgers/${param}/txs/count`,
self.setTxCount,
'', {
method: 'get',
......@@ -133,13 +133,13 @@ const BlockStore = types
setTxCount(result) {
if (result&&result.success) {
self.txCount= result.data.txCount||0;
self.txCount= result.data||0;
}
},
// 根据区块的详细信息
getBlockInformation(param) {
return fetchData(`${__HOST}/ledgers/${param}/blocks/search`,
return fetchData(`${__HOST}/ledgers/${param}/blocks/latest`,
self.setBlockInformation,
'', {
method: 'get',
......@@ -153,33 +153,33 @@ const BlockStore = types
setBlockInformation(result) {
if (result&&result.success) {
self.txCount= result.data.txCount||0;
self.transactionInfo= result.data;
}
},
// 根据区块的详细信息
getBlockInformation(param) {
return fetchData(`${__HOST}/ledgers/${param}/blocks/search`,
self.setBlockInformation,
'', {
method: 'get',
headers: {
cookie: document.cookie,
}
}
).catch(error => {
});
},
// getBlockInformation(param) {
// return fetchData(`${__HOST}/ledgers/${param}/blocks/search`,
// self.setBlockInformation,
// '', {
// method: 'get',
// headers: {
// cookie: document.cookie,
// }
// }
// ).catch(error => {
// });
// },
setBlockInformation(result) {
if (result&&result.success) {
self.txCount= result.data.txCount||0;
}
},
// setBlockInformation(result) {
// if (result&&result.success) {
// self.txCount= result.data.txCount||0;
// }
// },
// 查找交易
getTransaction(param) {
return fetchData(`${__HOST}/api/v1/query/tx/range`,
return fetchData(`${__HOST}/ledgers/${param.ledger}/blocks/height/${param.height}/txs`,
self.setTransaction,param,
{
method: 'get',
......@@ -189,18 +189,14 @@ const BlockStore = types
},
setTransaction(result){
if (result.message == 'OK')
{
self.transactionList = result.data && result.data.txs || [];// 交易数据
}
else{
self.transactionList=[];
}
if (result&&result.success) {
self.transactionList = result.data || [];// 交易数据
}
},
// 查找交易详情
getTransactionMore(param) {
return fetchData(`${__HOST}/api/v1/query/writeset/tx`,
return fetchData(`${__HOST}/ledgers/${param.ledger}/txs/hash/${param.tx_hash}`,
self.setTransactionMore,param,
{
method: 'get',
......@@ -210,13 +206,10 @@ const BlockStore = types
},
setTransactionMore(result){
if (result.message == 'OK')
{
return result.data && result.data.kvs || [];
}
else{
return [];
}
if (result&&result.success) {
self.transactionInfo = result.data || [];// 交易数据
}
},
// 获取交易Hash
getTransactionHash(param) {
......
......@@ -7,6 +7,7 @@ import { registerTmpl } from 'nornj-react';
import { autobind } from 'core-decorators';
import { Drawer} from 'antd';
import { BlockCollapse,BlockCollapseSmall,BlockCollapsePanel } from '../../components/blockCollapse';
import TransactionInfo from '../../components/transactionInfo';
import 'flarej/lib/components/antd/table';
import 'flarej/lib/components/antd/input';
import 'flarej/lib/components/antd/button';
......@@ -26,7 +27,7 @@ import Swiper from 'swiper/dist/js/swiper.js';
import 'swiper/dist/css/swiper.min.css';
//页面容器组件
@registerTmpl('Block')
@registerTmpl('BlockInfo')
@inject('store')
@observer
export default class BlockInfo extends Component {
......@@ -39,161 +40,44 @@ export default class BlockInfo extends Component {
@observable mySwiper='';
@observable blockDetails=false;
@observable show=false;
@observable transactioninfoData={};
// jinlong12
// @observable inputRole = 0;
// @observable blockList = [];
componentDidMount() {
const { store: { header,block } } = this.props;
// const { store: { header,block },} = this.props;
}
@autobind
onClose(visible){
//获取详细信息
this.show=visible;
}
@autobind
onCloseblockDetails(){
this.blockDetails=!this.blockDetails;
}
@autobind
onInputRole(e) {
const { store: { block } } = this.props;
if (isNotANumber(e.target.value)) {
// this.inputRole = e.target.value;
block.setInputRole(e.target.value);
}
}
@autobind
onPressEnterInputRole(){
const { store: { block } } = this.props;
this.Search();
// this.searchTransaction(this.inputRole);
this.searchTransaction(block.inputRole);
this.mySwiper.slideTo(block.inputRole*1);
$('.swiper-slide').each(function(){
if ($(this).attr('data-con')*1==block.inputRole*1) {
$('.swiper-slide').removeClass('lights');
$(this).addClass('lights');
}
});
}
@autobind
Search(){
const { store: { block, common } } = this.props;
const closeLoading = Message.loading('正在获取数据...', 0);
onShowBlockDetails(record,index){
const { store: { block }} = this.props;
let legder=this.props.store.common.getDefaultLedger();
// let legder = common.defaultledger;
Promise.all([
block.getBlockHeight(legder),
block.getTransactionMore({"ledger":legder,'tx_hash':record.transactionContent.ledgerHash.value}),
]).then((success) => {
// let totalBlock=success[0];// 最高区块
// let searchBlock=this.inputRole*1; // 将要搜索的区块
// if(this.inputRole==0){
// searchBlock=totalBlock-3; // 将要搜索的区块
// }
// this.inputRole=searchBlock;
// // 验证区块是否超过最大区块
// if (searchBlock>totalBlock) {
// searchBlock= totalBlock;
// }
// // 验证区块是否小于1
// if (searchBlock<1) {
// searchBlock=1;
// }
// let interval=3,// 区块列表显示数量前后间隔
// length=7,// 区块列表显示数量
// startBlock=searchBlock-3,// 区块列表显示起始高度
// endBlock=searchBlock+3;// 区块列表显示终止高度
// // 起始高度是开始的情况
// if (startBlock<=1) {
// // 计算起始高度
// for (let i = 0; i < length; i++) {
// if (startBlock<1) {
// startBlock++;
// endBlock++;
// }
// }
// // 计算终止高度
// for (let i = 0; i <length; i++) {
// if (endBlock>totalBlock) {
// endBlock--;
// }
// }
// } else if(endBlock>=totalBlock){
// // 计算起始高度
// for (let i = 0; i < length; i++) {
// if (endBlock>totalBlock) {
// startBlock>1&&startBlock--;
// endBlock--;
// }
// }
// }
// this.blockList=[];
// for (let i = startBlock; i <= endBlock; i++) {
// this.blockList.push({
// height:i,
// check:i==searchBlock
// });
// }
// // this.blockList=this.blockList.reverse();
block.searchData(success, legder);
closeLoading();
});
}
searchTransaction(height){
console.log(height);
const { store: { block } } = this.props;
Promise.all([
block.getTransaction({
height:height,
from:0,
to:60,
ledgers:this.props.store.common.getDefaultLedger()
}),
block.getTransactionHash({
from:height,
to:height,
ledgers:this.props.store.common.getDefaultLedger()
})
]).then(() => {
this.show=!this.show;
this.transactioninfoData=block.transactionInfo;
});
}
@autobind
onClickSearch(height){
const { store: { block } } = this.props;
return e => {
// this.inputRole=height;
block.setInputRole(height);
this.Search();
this.searchTransaction(height);
}
}
@autobind
onShowBlockDetails(record,index){
this.show=!this.show;
}
@computed get tableColumns() {
return [{
title: '交易哈希',
dataIndex: 'address',
dataIndex: 'transactionContent.ledgerHash.value',
width:'80%',
key:'name'
}, {
title: '执行状态',
dataIndex: 'public_key',
dataIndex: 'executionState',
width:'10%',
key:'describe',
render: (text, record, index) => nj `
......@@ -211,23 +95,13 @@ export default class BlockInfo extends Component {
}
render() {
const { store: { block } } = this.props;
return tmpls.container({
components: {
'ant-Drawer': Drawer,
'BlockCollapse':BlockCollapse,
'BlockCollapseSmall':BlockCollapseSmall,
'BlockCollapsePanel':BlockCollapsePanel,
}
},this.props, this, {
const { store: { block },blockinfo,txCount,transactionList } = this.props;
return tmpls.container(this.props, this, {
styles,
block,
tableData: [{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'}],
blockdata:blockinfo,
txCount:txCount,
transactionList:transactionList,
});
}
}
\ No newline at end of file
......@@ -4,49 +4,49 @@
<fj-Row class="{styles.gl}">
<fj-Col l=1>区块高度
</fj-Col>
<fj-Col l=3>12345
<fj-Col l=3>{blockdata && blockdata.height || 0 }
</fj-Col>
<fj-Col l=1>交易数量
</fj-Col>
<fj-Col l=3>145
<fj-Col l=3>{txCount || 0}
</fj-Col>
<fj-Col l=1>区块哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.hash && blockdata.hash.value || ''}
</fj-Col>
</fj-Row>
<fj-Row class="{styles.gl}">
<fj-Col l=1>账本哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.ledgerHash && blockdata.ledgerHash.value || ''}
</fj-Col>
<fj-Col l=1>前置区块哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.previousHash && blockdata.previousHash.value || ''}
</fj-Col>
<fj-Col l=1>交易集哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.transactionSetHash && blockdata.transactionSetHash.value || ''}
</fj-Col>
</fj-Row>
<fj-Row class="{styles.gl}">
<fj-Col l=1>用户集哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.userAccountSetHash && blockdata.userAccountSetHash.value || ''}
</fj-Col>
<fj-Col l=1>合约集哈希
</fj-Col>
<fj-Col l=3>EP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.contractAccountSetHash && blockdata.contractAccountSetHash.value || ''}
</fj-Col>
<fj-Col l=1>管理员集哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.adminAccountHash && blockdata.adminAccountHash.value || ''}
</fj-Col>
</fj-Row>
<fj-Row class="{styles.gl}">
<fj-Col l=1>数据账户集哈希
</fj-Col>
<fj-Col l=3>64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
<fj-Col l=3>{blockdata && blockdata.dataAccountSetHash && blockdata.dataAccountSetHash.value || ''}
</fj-Col>
<fj-Col l=1>
</fj-Col>
......@@ -61,9 +61,9 @@
<h3>交易</h3>
<ant-Table rowSelection={rowSelection}
columns={toJS(tableColumns)}
dataSource={toJS(tableData)}
dataSource={toJS(transactionList)}
:pagination="{showQuickJumper:true}"
bordered />
<TransactionInfo key="123" data={[]} visible={show} onClose={onClose}/>
<TransactionInfo key="123" data={transactioninfoData} visible={show} onClose={onClose}/>
</div>
</template>
\ No newline at end of file
......@@ -35,7 +35,7 @@ export default class TransactionInfo extends Component {
return this.props.onClose(!this.props.visible);
}
render() {
const { data,visible } = this.props;
const { data,visible} = this.props;
return tmpls.container({
components: {
'ant-Drawer': Drawer,
......
......@@ -9,7 +9,7 @@
onClose={onCloseblockDetails}
>
<div class="{styles.option}">
交易哈希:64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty
交易哈希:{data.transactionContent.ledgerHash.value}
</div>
<div class="{styles.option}">
执行状态: 成功
......
......@@ -8,7 +8,6 @@ import { autobind } from 'core-decorators';
import { Drawer} from 'antd';
import { BlockCollapse,BlockCollapseSmall,BlockCollapsePanel } from '../../components/blockCollapse';
import BlockInfo from '../../components/blockInfo';
import TransactionInfo from '../../components/transactionInfo';
import 'flarej/lib/components/antd/table';
import 'flarej/lib/components/antd/input';
import 'flarej/lib/components/antd/button';
......@@ -130,6 +129,9 @@ export default class Block extends Component {
// let legder = common.defaultledger;
Promise.all([
block.getBlockHeight(legder),
block.getBlockInformation(legder),
block.getTxCount(legder),
block.getTransaction({"getTransaction":legder,height:2}),
]).then((success) => {
// let totalBlock=success[0];// 最高区块
// let searchBlock=this.inputRole*1; // 将要搜索的区块
......@@ -251,24 +253,9 @@ export default class Block extends Component {
render() {
const { store: { block } } = this.props;
return tmpls.container({
components: {
'ant-Drawer': Drawer,
'BlockCollapse':BlockCollapse,
'BlockCollapseSmall':BlockCollapseSmall,
'BlockCollapsePanel':BlockCollapsePanel,
'BlockInfo':BlockInfo,
'TransactionInfo':TransactionInfo
}
},this.props, this, {
return tmpls.container(this.props, this, {
styles,
block,
tableData: [{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'},
{"address":'64hnH4a8n48LeEP5HU2bMWmNxUPcaZ1JRCehRwvuNS8Ty ',"public_key":'成功'}],
});
});
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
<div class="swiper-button-prev"></div><!--左箭头-->
<div class="swiper-button-next"></div><!--右箭头-->
</div>
<BlockInfo />
<BlockInfo key={123} blockinfo={block.blockInformation} txCount={block.txCount} transactionList={block.transactionList}/>
<!-- <div class="{styles.summary}" #show={!flagSerch}>
<#each {{block.blockList}}>
<div class="{styles.tabs} {styles.blockHeight} {!check && styles.dark}" onClick={onClickSearch(height)} data-height={{height}} key={{height}}>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册