-
Notifications
You must be signed in to change notification settings - Fork 1
/
explorer.63e129c45f62a01f1923.js
4082 lines (3499 loc) · 409 KB
/
explorer.63e129c45f62a01f1923.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(this["webpackJsonp"] = this["webpackJsonp"] || []).push([[20],{
/***/ 2842:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Witnesses__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2843);
/* harmony import */ var _CommitteeMembers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2846);
/* harmony import */ var _Blockchain_FeesContainer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2847);
/* harmony import */ var _BlocksContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2850);
/* harmony import */ var _AssetsContainer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2856);
/* harmony import */ var _AccountsContainer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2858);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(578);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(counterpart__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _Exchange_MarketsContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2860);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(728);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_9__);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Explorer = function (_React$Component) {
_inherits(Explorer, _React$Component);
function Explorer(props) {
_classCallCheck(this, Explorer);
var _this = _possibleConstructorReturn(this, (Explorer.__proto__ || Object.getPrototypeOf(Explorer)).call(this, props));
_this.state = {
tabs: [{
name: "blocks",
link: "/explorer/blocks",
translate: "explorer.blocks.title",
content: _BlocksContainer__WEBPACK_IMPORTED_MODULE_4__["default"]
}, {
name: "assets",
link: "/explorer/assets",
translate: "explorer.assets.title",
content: _AssetsContainer__WEBPACK_IMPORTED_MODULE_5__["default"]
}, {
name: "accounts",
link: "/explorer/accounts",
translate: "explorer.accounts.title",
content: _AccountsContainer__WEBPACK_IMPORTED_MODULE_6__["default"]
}, {
name: "witnesses",
link: "/explorer/witnesses",
translate: "explorer.witnesses.title",
content: _Witnesses__WEBPACK_IMPORTED_MODULE_1__["default"]
}, {
name: "committee_members",
link: "/explorer/committee-members",
translate: "explorer.committee_members.title",
content: _CommitteeMembers__WEBPACK_IMPORTED_MODULE_2__["default"]
}, {
name: "markets",
link: "/explorer/markets",
translate: "markets.title",
content: _Exchange_MarketsContainer__WEBPACK_IMPORTED_MODULE_8__["default"]
}, {
name: "fees",
link: "/explorer/fees",
translate: "fees.title",
content: _Blockchain_FeesContainer__WEBPACK_IMPORTED_MODULE_3__["default"]
}]
};
return _this;
}
_createClass(Explorer, [{
key: "render",
value: function render() {
var _this2 = this;
var onChange = function onChange(value) {
_this2.props.history.push(value);
};
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_9__["Tabs"],
{
activeKey: this.props.location.pathname,
animated: false,
style: { display: "table", height: "100%", width: "100%" },
onChange: onChange
},
this.state.tabs.map(function (tab) {
var TabContent = tab.content;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_9__["Tabs"].TabPane,
{
key: tab.link,
tab: counterpart__WEBPACK_IMPORTED_MODULE_7___default.a.translate(tab.translate)
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "padding" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(TabContent, null)
)
);
})
);
}
}]);
return Explorer;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (Explorer);
/***/ }),
/***/ 2843:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(578);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(counterpart__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(518);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1973);
/* harmony import */ var _Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1974);
/* harmony import */ var bitsharesjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(410);
/* harmony import */ var _Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2117);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1860);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_translate_component__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _Utility_TimeAgo__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2532);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1854);
/* harmony import */ var actions_SettingsActions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(718);
/* harmony import */ var stores_SettingsStore__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(717);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(732);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(1836);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(728);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var sanitize__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(563);
/* harmony import */ var sanitize__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(sanitize__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _Utility_SearchInput__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2811);
/* harmony import */ var common_utils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(562);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
__webpack_require__(2844);
var WitnessRow = function (_React$Component) {
_inherits(WitnessRow, _React$Component);
function WitnessRow() {
_classCallCheck(this, WitnessRow);
return _possibleConstructorReturn(this, (WitnessRow.__proto__ || Object.getPrototypeOf(WitnessRow)).apply(this, arguments));
}
_createClass(WitnessRow, [{
key: "_onRowClick",
value: function _onRowClick(e) {
e.preventDefault();
this.props.history.push("/account/" + this.props.witness.get("name"));
}
// componentWillUnmount() {
// ChainStore.unSubFrom("witnesses", ChainStore.getWitnessById( this.props.witness.get("id") ).get("id"));
// }
}, {
key: "render",
value: function render() {
var _props = this.props,
witness = _props.witness,
isCurrent = _props.isCurrent,
rank = _props.rank;
var witness_data = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getWitnessById(this.props.witness.get("id"));
if (!witness_data) return null;
var total_votes = witness_data.get("total_votes");
var witness_aslot = witness_data.get("last_aslot");
var color = {};
if (this.props.most_recent - witness_aslot > 100) {
color = { borderLeft: "1px solid #FCAB53" };
} else {
color = { borderLeft: "1px solid #50D2C2" };
}
var last_aslot_time = new Date(Date.now() - (this.props.most_recent - witness_aslot) * bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject("2.0.0").getIn(["parameters", "block_interval"]) * 1000);
var currentClass = isCurrent ? "active-witness" : "";
var missed = witness_data.get("total_missed");
var missedClass = classnames__WEBPACK_IMPORTED_MODULE_12___default()("txtlabel", { success: missed <= 500 }, { info: missed > 500 && missed <= 1250 }, { warning: missed > 1250 && missed <= 2000 }, { error: missed >= 200 });
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"tr",
{ className: currentClass, onClick: this._onRowClick.bind(this) },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
rank
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
{ style: color },
witness.get("name")
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_TimeAgo__WEBPACK_IMPORTED_MODULE_8__["default"], { time: new Date(last_aslot_time) })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
witness_data.get("last_confirmed_block_num")
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
{ className: missedClass },
missed
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_6__["default"], {
amount: witness_data.get("total_votes"),
asset: "1.3.0",
decimalOffset: 5
})
)
);
}
}]);
return WitnessRow;
}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
WitnessRow.propTypes = {
witness: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__["default"].ChainAccount.isRequired
};
WitnessRow = Object(_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__["default"])(WitnessRow);
WitnessRow = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_13__["withRouter"])(WitnessRow);
var WitnessList = function (_React$Component2) {
_inherits(WitnessList, _React$Component2);
function WitnessList() {
_classCallCheck(this, WitnessList);
var _this2 = _possibleConstructorReturn(this, (WitnessList.__proto__ || Object.getPrototypeOf(WitnessList)).call(this));
_this2.state = {
sortBy: "rank",
inverseSort: true
};
_this2.handleBlockIdClick = _this2.handleBlockIdClick.bind(_this2);
return _this2;
}
_createClass(WitnessList, [{
key: "_setSort",
value: function _setSort(field) {
this.setState({
sortBy: field,
inverseSort: field === this.state.sortBy ? !this.state.inverseSort : this.state.inverseSort
});
}
}, {
key: "handleBlockIdClick",
value: function handleBlockIdClick(blockId) {
var _this3 = this;
return function () {
_this3.props.history.push("/block/" + blockId);
};
}
}, {
key: "render",
value: function render() {
var _this4 = this;
var _props2 = this.props,
witnesses = _props2.witnesses,
current = _props2.current,
cardView = _props2.cardView,
witnessList = _props2.witnessList;
var _state = this.state,
sortBy = _state.sortBy,
inverseSort = _state.inverseSort;
var most_recent_aslot = 0;
var ranks = {};
witnesses.filter(function (a) {
if (!a) {
return false;
}
return witnessList.indexOf(a.get("id")) !== -1;
}).sort(function (a, b) {
if (a && b) {
return parseInt(b.get("total_votes"), 10) - parseInt(a.get("total_votes"), 10);
}
}).forEach(function (w, index) {
if (w) {
var s = w.get("last_aslot");
if (most_recent_aslot < s) {
most_recent_aslot = s;
}
ranks[w.get("id")] = index + 1;
}
});
var dataSource = [];
if (witnesses.length > 0 && witnesses[1]) {
dataSource = witnesses.filter(function (a) {
if (!a) {
return false;
}
var witness = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(a.get("witness_account"));
if (!witness) return false;
var witness_data = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getWitnessById(witness.get("id"));
if (!witness_data) return false;
var name = witness.get("name");
if (!name) return false;
return name.indexOf(_this4.props.filter) !== -1;
}).map(function (a) {
var witness = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(a.get("witness_account"));
var witness_data = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getWitnessById(witness.get("id"));
var witness_aslot = witness_data.get("last_aslot");
var last_aslot_time = new Date(Date.now() - (_this4.props.current_aslot - witness_aslot) * bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject("2.0.0").getIn(["parameters", "block_interval"]) * 1000);
return {
id: a.get("id"),
key: witness.get("name"),
rank: ranks[a.get("id")],
name: witness.get("name"),
signing_key: witness_data.get("signing_key"),
url: common_utils__WEBPACK_IMPORTED_MODULE_17__["default"].sanitize(witness_data.get("url")),
lastConfirmedBlock: {
id: witness_data.get("last_confirmed_block_num"),
timestamp: last_aslot_time.getTime()
},
blocksMissed: witness_data.get("total_missed"),
votes: witness_data.get("total_votes")
};
});
}
var urlValid = function urlValid(item) {
var regex = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
return regex.test(item);
};
var urlRender = function urlRender(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__["Popover"],
{
content: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"a",
{
href: item,
target: "_blank",
rel: "noopener noreferrer"
},
item
),
trigger: "hover"
},
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__["Icon"], { type: "link" })
);
};
var keyRender = function keyRender(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__["Popover"],
{ content: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"span",
null,
item
), trigger: "hover" },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__["Icon"], { type: "key" })
);
};
var columns = [{
key: "#",
title: "#",
dataIndex: "rank",
sorter: function sorter(a, b) {
return a.rank > b.rank ? 1 : a.rank < b.rank ? -1 : 0;
}
}, {
key: "name",
title: "NAME",
dataIndex: "name",
sorter: function sorter(a, b) {
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
}
}, {
key: "url",
title: "URL",
dataIndex: "url",
align: "center",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ style: { width: "100%", textAlign: "center" } },
item && urlValid(item) && urlRender(item) || null
);
}
}, {
key: "lastConfirmedBlock",
title: "LAST CONFIRMED BLOCK",
dataIndex: "lastConfirmedBlock",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"span",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"a",
{
style: { display: "inline-block", minWidth: "100px" },
href: "javascript:void(0)",
onClick: _this4.handleBlockIdClick(item.id)
},
"#",
Number(item.id).toLocaleString()
),
" ",
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_TimeAgo__WEBPACK_IMPORTED_MODULE_8__["default"], { time: new Date(item.timestamp) })
);
},
sorter: function sorter(a, b) {
return a.lastConfirmedBlock.timestamp > b.lastConfirmedBlock.timestamp ? -1 : a.lastConfirmedBlock.timestamp < b.lastConfirmedBlock.timestamp ? 1 : 0;
}
}, {
key: "blocksMissed",
title: "BLOCKS MISSED",
dataIndex: "blocksMissed",
render: function render(item) {
var blocksMissedClassName = classnames__WEBPACK_IMPORTED_MODULE_12___default()("txtlabel", { success: item <= 500 }, { info: item > 500 && item <= 1250 }, { warning: item > 1250 && item <= 2000 }, { error: item >= 200 });
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"span",
{ className: blocksMissedClassName },
item
);
},
sorter: function sorter(a, b) {
return a.blocksMissed > b.blocksMissed ? 1 : a.blocksMissed < b.blocksMissed ? -1 : 0;
}
}, {
key: "votes",
title: "VOTES",
dataIndex: "votes",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_6__["default"], {
amount: item,
asset: "1.3.0",
decimalOffset: 5
});
},
sorter: function sorter(a, b) {
return a.votes > b.votes ? 1 : a.votes < b.votes ? -1 : 0;
}
}, {
key: "key",
title: "KEY",
dataIndex: "signing_key",
align: "center",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ style: { textAlign: "center", width: "100%" } },
keyRender(item)
);
}
}];
var getRowClassName = function getRowClassName(record) {
if (record.id === current) return "active-witness";
return "";
};
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_14__["Table"], {
rowClassName: getRowClassName,
columns: columns,
dataSource: dataSource,
pagination: false
});
}
}]);
return WitnessList;
}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
WitnessList.propTypes = {
witnesses: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__["default"].ChainObjectsList.isRequired
};
WitnessList = Object(_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__["default"])(WitnessList, {
show_loader: true
});
WitnessList = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_13__["withRouter"])(WitnessList);
var Witnesses = function (_React$Component3) {
_inherits(Witnesses, _React$Component3);
function Witnesses(props) {
_classCallCheck(this, Witnesses);
var _this5 = _possibleConstructorReturn(this, (Witnesses.__proto__ || Object.getPrototypeOf(Witnesses)).call(this, props));
_this5.state = {
filterWitness: props.filterWitness || "",
cardView: props.cardView
};
return _this5;
}
_createClass(Witnesses, [{
key: "_onFilter",
value: function _onFilter(e) {
this.setState({ filterWitness: e.target.value.toLowerCase() });
actions_SettingsActions__WEBPACK_IMPORTED_MODULE_10__["default"].changeViewSetting({
filterWitness: e.target.value.toLowerCase()
});
}
}, {
key: "_toggleView",
value: function _toggleView() {
actions_SettingsActions__WEBPACK_IMPORTED_MODULE_10__["default"].changeViewSetting({
cardView: !this.state.cardView
});
this.setState({
cardView: !this.state.cardView
});
}
}, {
key: "render",
value: function render() {
var _props3 = this.props,
dynGlobalObject = _props3.dynGlobalObject,
globalObject = _props3.globalObject;
dynGlobalObject = dynGlobalObject.toJS();
globalObject = globalObject.toJS();
var current = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(dynGlobalObject.current_witness),
currentAccount = null;
if (current) {
currentAccount = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(current.get("witness_account"));
}
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ className: "grid-block" },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ className: "grid-block" },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ className: "grid-block" },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ className: "grid-content " },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"div",
{ className: "explore-witness--info" },
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"table",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"thead",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"tr",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.witnesses.current" })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.blocks.active_witnesses" })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.witnesses.participation" })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.witnesses.pay" })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.witnesses.budget" })
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"th",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_7___default.a, { content: "explorer.witnesses.next_vote" })
)
)
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"tbody",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"tr",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
currentAccount ? currentAccount.get("name") : null
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
Object.keys(globalObject.active_witnesses).length
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
dynGlobalObject.participation,
"%"
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_6__["default"], {
amount: globalObject.parameters.witness_pay_per_block,
asset: "1.3.0"
})
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
" ",
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_6__["default"], {
amount: dynGlobalObject.witness_budget,
asset: "1.3.0"
})
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"td",
null,
" ",
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_TimeAgo__WEBPACK_IMPORTED_MODULE_8__["default"], {
time: new Date(dynGlobalObject.next_maintenance_time + "Z")
})
)
)
)
)
),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_SearchInput__WEBPACK_IMPORTED_MODULE_16__["default"], {
placeholder: counterpart__WEBPACK_IMPORTED_MODULE_0___default.a.translate("explorer.witnesses.filter_by_name"),
value: this.state.filterWitness,
onChange: this._onFilter.bind(this),
style: {
width: "200px",
marginBottom: "12px",
marginTop: "4px"
}
}),
react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(WitnessList, {
current_aslot: dynGlobalObject.current_aslot,
current: current ? current.get("id") : null,
witnesses: immutable__WEBPACK_IMPORTED_MODULE_2___default.a.List(globalObject.active_witnesses),
witnessList: globalObject.active_witnesses,
filter: this.state.filterWitness,
cardView: this.state.cardView
})
)
)
)
);
}
}]);
return Witnesses;
}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
Witnesses.propTypes = {
globalObject: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__["default"].ChainObject.isRequired,
dynGlobalObject: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__["default"].ChainObject.isRequired
};
Witnesses.defaultProps = {
globalObject: "2.0.0",
dynGlobalObject: "2.1.0"
};
Witnesses = Object(_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__["default"])(Witnesses);
var WitnessStoreWrapper = function (_React$Component4) {
_inherits(WitnessStoreWrapper, _React$Component4);
function WitnessStoreWrapper() {
_classCallCheck(this, WitnessStoreWrapper);
return _possibleConstructorReturn(this, (WitnessStoreWrapper.__proto__ || Object.getPrototypeOf(WitnessStoreWrapper)).apply(this, arguments));
}
_createClass(WitnessStoreWrapper, [{
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Witnesses, this.props);
}
}]);
return WitnessStoreWrapper;
}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
WitnessStoreWrapper = Object(alt_react__WEBPACK_IMPORTED_MODULE_9__["connect"])(WitnessStoreWrapper, {
listenTo: function listenTo() {
return [stores_SettingsStore__WEBPACK_IMPORTED_MODULE_11__["default"]];
},
getProps: function getProps() {
return {
cardView: stores_SettingsStore__WEBPACK_IMPORTED_MODULE_11__["default"].getState().viewSettings.get("cardView"),
filterWitness: stores_SettingsStore__WEBPACK_IMPORTED_MODULE_11__["default"].getState().viewSettings.get("filterWitness")
};
}
});
/* harmony default export */ __webpack_exports__["default"] = (WitnessStoreWrapper);
/***/ }),
/***/ 2844:
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 2846:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(578);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(counterpart__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(518);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1973);
/* harmony import */ var _Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1974);
/* harmony import */ var bitsharesjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(410);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1854);
/* harmony import */ var actions_SettingsActions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(718);
/* harmony import */ var _Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2117);
/* harmony import */ var stores_SettingsStore__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(717);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(728);
/* harmony import */ var bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _Utility_SearchInput__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2811);
/* harmony import */ var common_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(562);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var CommitteeMemberList = function (_React$Component) {
_inherits(CommitteeMemberList, _React$Component);
function CommitteeMemberList() {
_classCallCheck(this, CommitteeMemberList);
return _possibleConstructorReturn(this, (CommitteeMemberList.__proto__ || Object.getPrototypeOf(CommitteeMemberList)).call(this));
}
_createClass(CommitteeMemberList, [{
key: "render",
value: function render() {
var _this2 = this;
var _props = this.props,
committee_members = _props.committee_members,
membersList = _props.membersList;
var dataSource = null;
var ranks = {};
committee_members.filter(function (a) {
if (!a) {
return false;
}
return membersList.indexOf(a.get("id")) !== -1;
}).forEach(function (c, index) {
if (c) {
ranks[c.get("id")] = index + 1;
}
});
if (committee_members.length > 0 && committee_members[1]) {
dataSource = committee_members.filter(function (a) {
if (!a) {
return false;
}
var account = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(a.get("committee_member_account"));
if (!account) {
return false;
}
var account_data = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getCommitteeMemberById(account.get("id"));
if (!account_data) return false;
return account.get("name").indexOf(_this2.props.filter || "") !== -1;
}).map(function (a) {
var account = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getObject(a.get("committee_member_account"));
var account_data = bitsharesjs__WEBPACK_IMPORTED_MODULE_5__["ChainStore"].getCommitteeMemberById(account.get("id"));
return {
key: a.get("id"),
rank: ranks[a.get("id")],
name: account.get("name"),
votes: account_data.get("total_votes"),
url: common_utils__WEBPACK_IMPORTED_MODULE_12__["default"].sanitize(account_data.get("url"))
};
});
}
var columns = [{
key: "#",
title: "#",
dataIndex: "rank",
sorter: function sorter(a, b) {
return a.rank > b.rank ? 1 : a.rank < b.rank ? -1 : 0;
}
}, {
key: "name",
title: "NAME",
dataIndex: "name",
sorter: function sorter(a, b) {
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
}
}, {
key: "votes",
title: "VOTES",
dataIndex: "votes",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_Utility_FormattedAsset__WEBPACK_IMPORTED_MODULE_8__["default"], {
amount: item,
asset: "1.3.0",
decimalOffset: 5
});
},
sorter: function sorter(a, b) {
return a.votes > b.votes ? 1 : a.votes < b.votes ? -1 : 0;
}
}, {
key: "url",
title: "WEBPAGE",
dataIndex: "url",
render: function render(item) {
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(
"a",
{ href: item, target: "_blank", rel: "noopener noreferrer" },
item
);
}
}];
return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(bitshares_ui_style_guide__WEBPACK_IMPORTED_MODULE_10__["Table"], {
columns: columns,
dataSource: dataSource,
pagination: false
});
}
}]);
return CommitteeMemberList;
}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
CommitteeMemberList.propTypes = {
committee_members: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_3__["default"].ChainObjectsList.isRequired
};
CommitteeMemberList = Object(_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_4__["default"])(CommitteeMemberList, {
show_loader: true
});
var CommitteeMembers = function (_React$Component2) {
_inherits(CommitteeMembers, _React$Component2);
function CommitteeMembers(props) {
_classCallCheck(this, CommitteeMembers);
var _this3 = _possibleConstructorReturn(this, (CommitteeMembers.__proto__ || Object.getPrototypeOf(CommitteeMembers)).call(this, props));
_this3.state = {
filterCommitteeMember: props.filterCommitteeMember || ""
};
return _this3;
}
_createClass(CommitteeMembers, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps, nextState) {
return !immutable__WEBPACK_IMPORTED_MODULE_2___default.a.is(nextProps.globalObject, this.props.globalObject) || nextState.filterCommitteeMember !== this.state.filterCommitteeMember || nextState.cardView !== this.state.cardView;
}
}, {
key: "_onFilter",
value: function _onFilter(e) {
this.setState({ filterCommitteeMember: e.target.value.toLowerCase() });
actions_SettingsActions__WEBPACK_IMPORTED_MODULE_7__["default"].changeViewSetting({
filterCommitteeMember: e.target.value.toLowerCase()
});
}
}, {
key: "render",
value: function render() {
var globalObject = this.props.globalObject;
globalObject = globalObject.toJS();
var activeCommitteeMembers = [];