From f46231573ebd2c726debae59cee33d72b621b832 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Mon, 13 Dec 2021 12:32:26 +0800 Subject: [PATCH 01/14] feat: add new node icon --- src/styles/img/api-node.png | Bin 0 -> 613 bytes src/styles/img/peer-node.png | Bin 0 -> 664 bytes src/styles/img/voting-node.png | Bin 0 -> 651 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/styles/img/api-node.png create mode 100644 src/styles/img/peer-node.png create mode 100644 src/styles/img/voting-node.png diff --git a/src/styles/img/api-node.png b/src/styles/img/api-node.png new file mode 100644 index 0000000000000000000000000000000000000000..61e503b43d42208521baa95b5dd3eb6ee68cf5a7 GIT binary patch literal 613 zcmV-r0-F7aP)khG~y;i38O<+Tad z>-CbmTmT3J0{@H1_Crw=FzyhW4s9NX4tld=V%J2@H>{+Ow;>-ZA9-z8)mo!o~;^CfP`|M0=kL{IY|mNkc=WP zEHW{+JLPPCTl}<|bLyqiO&x;Cf7y z`(t2z8_EGR;;{`*!y4R)*~6mFTQ1Kh+X zKh*a74d+3x=!V`ya}p>Q##1!B?;)3pvk`3z9n>he#1?v1$;maURxC}9Aq3Tsec8~H zeQ1xpl0(bil&?sjf}-1cbgam}%5gR7jdkD^P%Hbnyg3@mRg*jl2p3QJ2H!~sM!{Ws zC0EoOuoSs24tJFY%Tjuxl!5}Zcxf?{kt^(f81%NOH)p8Rl)8p+^5(*+E-uRHs*cn_ zU)n&Q@nC7&LMPx(=1E2}Hx1tQpJahR;1BZ!nVQ44pa^h-00000NkvXXu0mjfOoRxo literal 0 HcmV?d00001 diff --git a/src/styles/img/peer-node.png b/src/styles/img/peer-node.png new file mode 100644 index 0000000000000000000000000000000000000000..39056a0786c5d83e0b1816942930e44941e532f2 GIT binary patch literal 664 zcmV;J0%!e+P)NS!C`UYYHQ)FcaHcGr%I0 zBSJ~YiV?Lb-OjY`S5i2Un@u-(fj!A*5ujq?CxzL%f^L^e7H`kq)g1kYGXDa_7G^)> zNah_c)cP*|Db$rC{xMCEvSz5(PoFQV)dqu%@w~g@M$JE(W2PIdsZCIvEm`423vd)a zIOeR8kINUSzn-WYJu{eNU2X7Nw6~C{lDc?{r03`AdE1;-o?<08Hc^uq6Uy zBM>Kj{cA*sx8Mor@-|I;y{X8{}5?ZS)9wiG`N27T!SuU2g--CsH52UDKXQ|UyMsx zPB$Uy#mDt&fH`rshMbtnMu?rfc5FdY1XEdl^C^nsqXBGgzK(4PXORzSxIw4UQd|_D8-u9d|@} zeo-7JF~G#c|7HdwKtx493yMdIIfe34_7o?IPm1kqHaoyQA%iuA#&k4A0~sWBlm;vpRD%$rCas`$N+5)|Nh`XuVmgwyz<$}< z-5NB-B%W{L76uq~Y$JJmiUiH3b`sC;1M#cLL^qMVigo{&Sn9&<% zvu+&9+ol-p+<-8UfZ1e|R!0vWo1N7$aS-2Z@)E>q^^oN31>c%A^Q_GnGUG=)zq}2LdeTG8d<-2bOsZi0J36%O2QC550 zG{egkpp!IfO?FKG9mYTcYp=5njKoYOuaoZ}ff2$>HkiKw(Rx~IkR)K%8LlIB<{?lA z3>xAKyCrp#Owo^7=TzYE7xbHDC-$G)imU>;uf;aX9M~@@8q?93`5h*;k^2OF*XCZz l0s5`TZ}^Li+=+=h@&ll1Vyv&oc$NSF002ovPDHLkV1lB{8^Hho literal 0 HcmV?d00001 From d470c5036443bfc8a553fdd9c1786b06b9ebca84 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Tue, 14 Dec 2021 00:32:42 +0800 Subject: [PATCH 02/14] feat: add Icon field component display icon on table column --- src/components/fields/IconField.vue | 89 +++++++++++++++++++++++++ src/components/tables/TableListView.vue | 5 +- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 src/components/fields/IconField.vue diff --git a/src/components/fields/IconField.vue b/src/components/fields/IconField.vue new file mode 100644 index 000000000..3927aef48 --- /dev/null +++ b/src/components/fields/IconField.vue @@ -0,0 +1,89 @@ +/* + * + * (C) Symbol Contributors 2021 + * + * Licensed under the Apache License, Version 2.0 (the "License "); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + + + + + diff --git a/src/components/tables/TableListView.vue b/src/components/tables/TableListView.vue index d1ed0fedc..936fb8c05 100644 --- a/src/components/tables/TableListView.vue +++ b/src/components/tables/TableListView.vue @@ -42,6 +42,7 @@ +
Show Detail @@ -116,6 +117,7 @@ import SoftwareVersion from '@/components/fields/SoftwareVersion.vue'; import Harvester from '@/components/fields/Harvester.vue'; import EpochInfoField from '@/components/fields/EpochInfoField.vue'; import MosaicFlagsField from '@/components/fields/MosaicFlagsField.vue'; +import IconField from '@/components/fields/IconField.vue'; export default { extends: TableView, @@ -136,7 +138,8 @@ export default { SoftwareVersion, Harvester, EpochInfoField, - MosaicFlagsField + MosaicFlagsField, + IconField }, props: { From 233fdad73314c7a1fae740bb0ca90afbe4bfebb1 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Tue, 14 Dec 2021 11:26:38 +0800 Subject: [PATCH 03/14] fix: replace roles type text to icon --- src/config/pages/node-list.json | 2 +- src/infrastructure/NodeService.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config/pages/node-list.json b/src/config/pages/node-list.json index 6b081076a..8605832fd 100644 --- a/src/config/pages/node-list.json +++ b/src/config/pages/node-list.json @@ -40,7 +40,7 @@ "fields": [ "host", "friendlyName", - "roles", + "rolesIcon", "nodePublicKey", "chainInfo", "softwareVersion" diff --git a/src/infrastructure/NodeService.js b/src/infrastructure/NodeService.js index 90ca8fb67..4a66af667 100644 --- a/src/infrastructure/NodeService.js +++ b/src/infrastructure/NodeService.js @@ -129,6 +129,15 @@ class NodeService { node['softwareVersion'] = { version: el.version }; + if (el.roles) { + // convert Peer Voting node -> Peer Voting + const roles = el.roles.split(' '); + roles.pop(); + node['rolesIcon'] = Object.fromEntries(roles.map(role => [role.toLowerCase(), true])) + } + + console.log('node[] :>> ', node); + if (el.apiStatus) { const { chainHeight, finalization, lastStatusCheck, restVersion, isHttpsEnabled } = el.apiStatus; From a80ec8931ab34d8a3f641935f41b5428c51d8ee8 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Tue, 14 Dec 2021 11:46:54 +0800 Subject: [PATCH 04/14] fix: update translation --- src/config/i18n/en-us.json | 3 ++- src/config/i18n/es.json | 3 ++- src/config/i18n/ja.json | 3 ++- src/config/i18n/pt.json | 3 ++- src/config/i18n/ru.json | 3 ++- src/config/i18n/ua.json | 3 ++- src/config/i18n/zh.json | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/config/i18n/en-us.json b/src/config/i18n/en-us.json index 111ed6742..411662a9b 100644 --- a/src/config/i18n/en-us.json +++ b/src/config/i18n/en-us.json @@ -409,5 +409,6 @@ "reclaimed": "Reclaimed", "first": "First", "last": "Last", - "mosaicFlags": "Flags" + "mosaicFlags": "Flags", + "rolesIcon": "Roles" } diff --git a/src/config/i18n/es.json b/src/config/i18n/es.json index 11c3eaa64..b328e3735 100644 --- a/src/config/i18n/es.json +++ b/src/config/i18n/es.json @@ -405,5 +405,6 @@ "reclaimed": "Reclaimed", "first": "First", "last": "Last", - "mosaicFlags": "Flags" + "mosaicFlags": "Flags", + "rolesIcon": "Roles" } diff --git a/src/config/i18n/ja.json b/src/config/i18n/ja.json index 4009e3693..18ca902a0 100644 --- a/src/config/i18n/ja.json +++ b/src/config/i18n/ja.json @@ -409,5 +409,6 @@ "reclaimed": "回収", "first": "最初", "last": "最後", - "mosaicFlags": "フラグ" + "mosaicFlags": "フラグ", + "rolesIcon": "ロール" } diff --git a/src/config/i18n/pt.json b/src/config/i18n/pt.json index a79ed0d8c..6aa0f93de 100644 --- a/src/config/i18n/pt.json +++ b/src/config/i18n/pt.json @@ -405,5 +405,6 @@ "reclaimed": "Reclaimed", "first": "First", "last": "Last", - "mosaicFlags": "Flags" + "mosaicFlags": "Flags", + "rolesIcon": "Roles" } diff --git a/src/config/i18n/ru.json b/src/config/i18n/ru.json index 05f68f822..dc95f6c69 100644 --- a/src/config/i18n/ru.json +++ b/src/config/i18n/ru.json @@ -409,5 +409,6 @@ "reclaimed": "Возвращенная", "first": "Первая", "last": "Последняя", - "mosaicFlags": "Флаги" + "mosaicFlags": "Флаги", + "rolesIcon": "Роли" } diff --git a/src/config/i18n/ua.json b/src/config/i18n/ua.json index 1dbbe4ccb..8c4384a3f 100644 --- a/src/config/i18n/ua.json +++ b/src/config/i18n/ua.json @@ -405,5 +405,6 @@ "reclaimed": "Reclaimed", "first": "First", "last": "Last", - "mosaicFlags": "Flags" + "mosaicFlags": "Flags", + "rolesIcon": "Roles" } diff --git a/src/config/i18n/zh.json b/src/config/i18n/zh.json index 56180124b..85d5e0a3a 100644 --- a/src/config/i18n/zh.json +++ b/src/config/i18n/zh.json @@ -405,5 +405,6 @@ "reclaimed": "Reclaimed", "first": "First", "last": "Last", - "mosaicFlags": "Flags" + "mosaicFlags": "Flags", + "rolesIcon": "Roles" } From a2e1f1b1e22cee9dc8d081d2a4825d319e584e1a Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Wed, 12 Jan 2022 03:57:19 +0800 Subject: [PATCH 05/14] feat: add new node pin icons --- src/styles/img/pin-api-voter.png | Bin 0 -> 2231 bytes src/styles/img/pin-api.png | Bin 0 -> 2236 bytes src/styles/img/pin-peer-api-voter.png | Bin 0 -> 2477 bytes src/styles/img/pin-peer-api.png | Bin 0 -> 2144 bytes src/styles/img/pin-peer-voter.png | Bin 0 -> 2215 bytes src/styles/img/pin-peer.png | Bin 0 -> 2257 bytes src/styles/img/pin-voter.png | Bin 0 -> 2294 bytes 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/styles/img/pin-api-voter.png create mode 100644 src/styles/img/pin-api.png create mode 100644 src/styles/img/pin-peer-api-voter.png create mode 100644 src/styles/img/pin-peer-api.png create mode 100644 src/styles/img/pin-peer-voter.png create mode 100644 src/styles/img/pin-peer.png create mode 100644 src/styles/img/pin-voter.png diff --git a/src/styles/img/pin-api-voter.png b/src/styles/img/pin-api-voter.png new file mode 100644 index 0000000000000000000000000000000000000000..015e6df4130ecd6e742b8d562630aace55134f6c GIT binary patch literal 2231 zcmV;o2uSydP)iX00009a7bBm001F4 z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yPWh7mtG3rpnL+%q34D#(1bGwK=h8) z3bhAPg(Ik_TT~GNf~Gj+#rE#>c_uUVWNVt(JG)+B|I%b<*X#A}&(GWJtOJlJQKCeN z5+zEMC{d!$#h`~O{&Ktk^;*fcSrJd=J>XE_oad)zR^i0VGVS8fAI{ia%kwHJfcekC zaUeoP4ybth!=eTJ6nOj`W313_pA$bULuqE^Rflj8*o}(HTdF+3nyniaM7gd^cpVP$zp8Q_Pk4Bf=WTiD%~pOtLf@AcE8cL6Od>1 zXHacaVZ~j6HE*r;T5SyWz*uv=j(}FMy+BmU;6Y6S^Ef}}F?Q}pwl_3Tp#mbSsj{VO zXsCI$t=d?Eg|$Zl%vO~~L#H+bmRNs@ke)z8EJ+en=_W5+_!6A!U{Dr>qz`T%yNE7z z3%ddifw}+kKDK)u!D**$c-ng)BU+{vB?=guuHCfuUIc>*1rWhu9Lj2aVQs+(7{3VA ze&~a7%@HsQmQ6x34oHVXafYns(dr`zQv_%?+LA4;$s{DBfR6t3(Pr% zbE2{wzbG!f+lonfn^`juKt=!w>j5U}94hp}jyaoY3;}IxUK&4*u2zCBWdxA09w~CI zIA}v=W320d9T<>qJyh!~yUP# zVsMI<6nhryix4M~1*x=;cMeWK7YYQZc&nJlVPlc{y~>MuuJ6mC^n?Uol>djUFBAV7?*7lx#jm}D=%(i$KOtoNZq1q{-7 z9~suiU2&By?2Jo$K%7;V zvmp5QALvlQ>L3oyu|>w}gE(qc&U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U?Yqb=lQ z(5zKWsA-1d5vBe~-TvBvls%DHoLfeFE2UfgMw$sd5C1dw*fd#^-&x~~W^J@p4}&QuYK!$jKEHAP}LaPPVcz?q7_^@&g% zCi2OfYLU1L@TGwrL}EcWQ!Sb6{A`s&1TP$YV2e&*d;ox10OZ*)=e^Fe1@we3poWw;$NK@xWxijfW z?>HRC@4x7=+kP(@2mc~d#~Yq974peOUfTqv=@ZB-(#)?$C(O9CN5;#u{~T{##qoMS zzO+S)%&>38C33k#+U1D%l+{EQZyp-H{`xP!iZ*T9d=aoYVeCkn+i(bVT<6GSM_si$=x`QB%rDL>re^amoiKDcElgs5m7a60Xk8cVRGfHV2iQpvYBpt6t3V0G#3?Hy3tc|ZQn zxtFZ4`{2QYe4I{oT>d02q0VPMjF!U}h^-0b3+1sxl3ajq!W3yQ74{_-iEo?*;4k5Q zv6L|VYJFdSe?RZjqyDB#9mf|Zo6Yh$;;K};Y|G&bq(w3;Dan>JIy&l$G%_;MNiI@L zq&{*ZQxx8&h2j0RI4LE%7AHn76;tPJU4hu=t1gm@e!9N9?O;t@dW_P|?xcj|(y9I? z#m6x$#}@}>>uqhS1oB;tZ$QT+bz>=IO<3g3L9N({d!A$6&Csm~P^ zmSn__l30cqr2uR!9n)$aihx`%)fukJqDo>_iRTzgEo>w->j~66uQ8VMo5s4DyW@+1 rVNpP(Rp|~V@Hvb%ZQ8VHvm5>gAl=UDSXZJ700000NkvXXu0mjfcuU4X literal 0 HcmV?d00001 diff --git a/src/styles/img/pin-peer-api.png b/src/styles/img/pin-peer-api.png new file mode 100644 index 0000000000000000000000000000000000000000..a122addf3526b4b447b2420c9711435b96ea720c GIT binary patch literal 2144 zcmV-m2%qiX00009a7bBm001F4 z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yPa>6$* z4N7mc6{=gQP1ToRn$WbdcZcVhow3JT)70JJz>aPY}_IddJN*b_I1GMB`VM{qd)mp#5d%i^52X@*L z_bR7xZ}v1mZL|<<`$>p1^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~>-%cwa$;56w(IWjE=Y3} pz)n}G0Vlv)m}?RxN|b0n`X7fuWRDW*FbV(w002ovPDHLkV1hSN39kSE literal 0 HcmV?d00001 diff --git a/src/styles/img/pin-peer.png b/src/styles/img/pin-peer.png new file mode 100644 index 0000000000000000000000000000000000000000..d7e5950126b34e12c92f8bb8f1704547e80ab034 GIT binary patch literal 2257 zcmV;?2rl=DP)iX00009a7bBm001F4 z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yP|2pT~X91+7 zq@<*zq@<*zr1TGi0aCFpl>t_(83q+#>>1!t=DvmKfIHKWVKZ=i zzYQ@GyFeA|e8n)>o51-22CUrcnAzFcjzGP!F`WQ|AC5z;*aWIr7syf$VYb@q_qM~K zUNsTSrU-_UQXbkcGMfOLyAP zXgaWh!rT)QsntOB>gbWnSZ=QUJwl-(6==t&=k|;Y8%Ho(Qu~(fI51aR6GXkGng=5+IIkMUG-QLv*6_0pF>Dw zAOgJNkj4Bx-xTpBR16a!Khepzmet-WJhuE)K<+i~lw;*0do~vg-iM zp^nRO@e)E4DO4BR`Pumc`5{IzM~HLoT2lnz*bpvv8C_1k5bo>^8j}nNiC3`Emme|? zsj_{2HC}Ou%rHQ4Yq!iYM_|gDgaCvl&?;NC@RgM*Pcf&q9I;#73v#!0n`MEQ;Hl@o zg#d&i(DqNxSMYVcPk9Q&v$Ylslwl0q=DJRvVf$;(_f_yoC<5j4+){b_dJ_^sLG!FO zI|M!nED*(>Y{qz#^3=u&wVe|LQM0*LRE6r168IpnKsTBz2UY&RTLX42FS-?t4j%*` z1QuvyDEk_1DfSF3Fy9NZB11Oy9R3FQAdod3~#JHB1>_}&87_a(qvp@np zUCLHeKCuFsg>JqyRE0hXBoL1NxdJUW6Dm+{T{qu`GW1CxftYL<5{;w^#I#2=j2EF# zf(2nov|Rh`}`YAn+40U`JJceKBEfrn?t& zPJj;r3v|k^yKc5=G+_cY7F7=2%isK1aGyB3yM~jQ-%vJVFyU&6V5O$DfBd-@5z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ari|MtNL%I|Y$iBkV`GkX{F-Y>%hmTiQuK5=Wl_@Q zR1#K2`&5#(pldZCEhq8urXM;l_pTZ)qa}KH(<6pRQb?7&F7;Tk#*(!7;fke+;RaxB z%XF)GBm#23cxyP1MY&>m#ADi42^$N8dILSLtM%nXQQOz^aCj2XEDB()RjCFiz+)I| fQc_Y<9)|w`1mSJ&EHYyT00000NkvXXu0mjf8XGDt literal 0 HcmV?d00001 diff --git a/src/styles/img/pin-voter.png b/src/styles/img/pin-voter.png new file mode 100644 index 0000000000000000000000000000000000000000..138bf69156a3a8ff23fedc3fb802493679240ecc GIT binary patch literal 2294 zcmViX00009a7bBm001F4 z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yP@9D_p5XdRx7EgUTy$dG(rCdJnv)kcj5O1(5gysKmWSoRP|z z190L{5Un^OM7VKir69zCpV_8u3{BmdCT)}0JHzu#X6%WZ0PCGyZ(%>ucxUbP{`l_m zV`g?1AR{9qBO@atBO@atJPi6s?aA44u$8L_#%EmSJSsqxL5NbVR)ZBRh)*Aau`eCY z7d(K)r@{9jK@u0}+P~&!Tp^z0Lc9cwm3P}_rM3dKmD*mr@KLafdCt!zAy#4nU47zo z#RWJk04lrvE&>h^1R%DypnkIs^?Ds}4Vw5HEqB9V>|K}h*W(l_c7c{Ev!(oPcn5Oc ztoc0&!t1wzuiXQ2|2~M#=AQd#qCmI>+(D`C0f((F!QvDuR)LoP{`9OnH1rNuOZq#$ zeiwq3RTSnf^vYcn=?1jq(!ggzoH+&l1+YkL0@a>4eHKr@s@KK+4QO5cDUvYVY@k5P zXkVs9F~+K=_>ZrHC0vMsZgE;Qyx%`w!}!t!n|OGC_v0sFSX1Q%XB^%aw?799SQp3? zhvH1@`zsi08W1N#;J`jC>nM`4C2JyCb+P4toO;O}7@(LV#c6)CBwZ^hHc*}=bU2;$ zFec4KjY-x7qDCJN+|RI8SElvW56ciV)*xxf)kq{o<6E(D>@}#}gdTCg5<%0gw#C7i z(+_b7a<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le@UX0`udhR~SQKk(YkEl!+xhtTxVUxe7S*X8Aiq0){J1C-3WByD6j;IqqG55tyTd~(!rwlZwlfVrTrUDc z+0-Eg(jpm_lp{+zdi1CiX?l9PfG)C|NTcXRrYQ8A7KXOh;^dX+S{w&m%2CHnuR!GU zT_;IJ-(Bf$zhO;OibfeGcTz%9DX9PCX+MVLNO7QJz3HY)An9s!0XinB3(G5O(n1wf zT+xDQYmu=AGvPk9J&8*(O^Tz0>CTAOh@~&4vWA&rW!gP|{=BSHra_T-KA+dy$?t2m z8duxWQ@{WP2~?e9Gl7qej&fuB9mi0XYkv1ov8&5zi&8G9i?k~GP8XF0+g1b0a#9~} z!mxdFAINa7QRw2mE-_?LLh91(QhzFTSdtMx+F}`Ev;(lQWTw?T6ahIb-5IXSqS|70 ziN}nk7B&(3bq97muF;p1tHyV`ZVrD142uHTX;r$x3GgS3H5nNh8GnRd0lo03+-w&a Q7ytkO07*qoM6N<$f`|z-vH$=8 literal 0 HcmV?d00001 From 247b4e700188d13e1d79d23e859efff3fa23af2d Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Wed, 12 Jan 2022 04:02:21 +0800 Subject: [PATCH 06/14] feat: add new constants ROLE_TYPE_RAW --- src/config/constants.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/config/constants.js b/src/config/constants.js index 41f12e62b..ccd6de56d 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -152,6 +152,16 @@ class Constants { 7: 'Peer Api Voting node' } + static ROLE_TYPE_RAW = { + 'PEER': 1, + 'API': 2, + 'PEER_API': 3, + 'VOTER': 4, + 'PEER_VOTER': 5, + 'API_VOTER': 6, + 'PEER_API_VOTER': 7 + } + static AddressRestrictionFlag = { [AddressRestrictionFlag.AllowIncomingAddress]: 'Allow Incoming Addresses', [AddressRestrictionFlag.AllowOutgoingAddress]: 'Allow Outgoing Addresses', From 9e42272565fc45de96c775fe091b3dd25a1175ae Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Wed, 12 Jan 2022 04:08:50 +0800 Subject: [PATCH 07/14] fix: replace icon from the map --- src/components/NodesMap.vue | 47 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/components/NodesMap.vue b/src/components/NodesMap.vue index 3cf1f06ae..de6712c39 100644 --- a/src/components/NodesMap.vue +++ b/src/components/NodesMap.vue @@ -8,10 +8,14 @@ import 'leaflet/dist/leaflet.css'; import leaflet from 'leaflet'; import markerCluster from 'leaflet.markercluster'; // eslint-disable-line -import IconOrange from '../styles/img/connector_orange.png'; -import IconBlue from '../styles/img/connector_blue.png'; -import IconGreen from '../styles/img/connector_green.png'; -import IconPink from '../styles/img/connector_pink.png'; +import IconApiVoter from '../styles/img/pin-api-voter.png' +import IconApi from '../styles/img/pin-api.png' +import IconPeerApiVoter from '../styles/img/pin-peer-api-voter.png' +import IconPeerApi from '../styles/img/pin-peer-api.png' +import IconPeerVoter from '../styles/img/pin-peer-voter.png' +import IconPeer from '../styles/img/pin-peer.png' +import IconVoter from '../styles/img/pin-voter.png' +import Constants from '../config/constants'; export default { props: { @@ -66,7 +70,7 @@ export default { }, button1Style() { - return `border-radius: 3px; + return `border-radius: 3px; color: #fff; background-color: #5200c6; font-family: Noto Sans; @@ -143,10 +147,13 @@ export default { }); }; - const iconPeer = getIcon(IconBlue); - const iconVoting = getIcon(IconGreen); - const iconApi = getIcon(IconPink); - const iconApiVoting = getIcon(IconOrange); + const iconPeer = getIcon(IconPeer); + const iconVoter = getIcon(IconVoter); + const iconApi = getIcon(IconApi); + const iconApiVoter = getIcon(IconApiVoter); + const iconPeerApiVoter = getIcon(IconPeerApiVoter); + const iconPeerApi = getIcon(IconPeerApi); + const iconPeerVoter = getIcon(IconPeerVoter); const markerClusters = leaflet.markerClusterGroup({ // iconCreateFunction: this.createClusterGroup, @@ -170,17 +177,23 @@ export default { let icon = iconPeer; switch (node.rolesRaw) { - case 2: - case 3: + case Constants.ROLE_TYPE_RAW.API: icon = iconApi; break; - case 4: - case 5: - icon = iconVoting; + case Constants.ROLE_TYPE_RAW.PEER_API: + icon = iconPeerApi; + break; + case Constants.ROLE_TYPE_RAW.PEER_VOTER: + icon = iconPeerVoter; + break; + case Constants.ROLE_TYPE_RAW.VOTER: + icon = iconVoter; + break; + case Constants.ROLE_TYPE_RAW.API_VOTER: + icon = iconApiVoter; break; - case 6: - case 7: - icon = iconApiVoting; + case Constants.ROLE_TYPE_RAW.PEER_API_VOTER: + icon = iconPeerApiVoter; break; } From 91a7b7e5e0899441c862c0596649fb9f6eb17606 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Wed, 12 Jan 2022 21:57:09 +0800 Subject: [PATCH 08/14] fix: remove network and roles in pop up info --- src/components/NodesMap.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/NodesMap.vue b/src/components/NodesMap.vue index de6712c39..4015fa91f 100644 --- a/src/components/NodesMap.vue +++ b/src/components/NodesMap.vue @@ -8,13 +8,13 @@ import 'leaflet/dist/leaflet.css'; import leaflet from 'leaflet'; import markerCluster from 'leaflet.markercluster'; // eslint-disable-line -import IconApiVoter from '../styles/img/pin-api-voter.png' -import IconApi from '../styles/img/pin-api.png' -import IconPeerApiVoter from '../styles/img/pin-peer-api-voter.png' -import IconPeerApi from '../styles/img/pin-peer-api.png' -import IconPeerVoter from '../styles/img/pin-peer-voter.png' -import IconPeer from '../styles/img/pin-peer.png' -import IconVoter from '../styles/img/pin-voter.png' +import IconApiVoter from '../styles/img/pin-api-voter.png'; +import IconApi from '../styles/img/pin-api.png'; +import IconPeerApiVoter from '../styles/img/pin-peer-api-voter.png'; +import IconPeerApi from '../styles/img/pin-peer-api.png'; +import IconPeerVoter from '../styles/img/pin-peer-voter.png'; +import IconPeer from '../styles/img/pin-peer.png'; +import IconVoter from '../styles/img/pin-voter.png'; import Constants from '../config/constants'; export default { @@ -164,9 +164,7 @@ export default { const popup = '
' + this.getNameByKey('friendlyName') + ': ' + this.formatText(node.friendlyName) + '
' + this.getNameByKey('host') + ': ' + this.formatText(node.host) + - '
' + this.getNameByKey('roles') + ': ' + this.formatText(node.roles) + - '
' + this.getNameByKey('network') + ': ' + this.formatText(node.network) + - '
' + this.getNameByKey('address') + ': ' + this.formatText(node.address) + + '
' + this.getNameByKey('address') + ': ' + node.address + '
' + this.getNameByKey('location') + ': ' + this.formatText(node.location) + '
' + '' + this.getNameByKey('nodeDetailTitle') + From fc75f31ded9c45abbe961dc0023ed33edafe8c3e Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 05:30:26 +0800 Subject: [PATCH 09/14] feat: add mouse over on node pop up --- src/components/NodesMap.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/NodesMap.vue b/src/components/NodesMap.vue index 4015fa91f..3133e4058 100644 --- a/src/components/NodesMap.vue +++ b/src/components/NodesMap.vue @@ -197,9 +197,18 @@ export default { const m = leaflet.marker([node.coordinates.latitude, node.coordinates.longitude], { icon }); - if (this.showPopup === true) + if (this.showPopup === true) { m.bindPopup(popup); + m.on('mouseover', function (e) { + this.openPopup(); + }); + + m.on('mouseout', function (e) { + this.closePopup(); + }); + } + markerClusters.addLayer(m); } } From 31eecb6b6f4c9075f57dcd9c1297e4a38fb4991b Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 06:22:05 +0800 Subject: [PATCH 10/14] refactor: remove unused icons --- src/styles/img/connector_blue.png | Bin 1799 -> 0 bytes src/styles/img/connector_green.png | Bin 1819 -> 0 bytes src/styles/img/connector_orange.png | Bin 1861 -> 0 bytes src/styles/img/connector_pink.png | Bin 1754 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/styles/img/connector_blue.png delete mode 100644 src/styles/img/connector_green.png delete mode 100644 src/styles/img/connector_orange.png delete mode 100644 src/styles/img/connector_pink.png diff --git a/src/styles/img/connector_blue.png b/src/styles/img/connector_blue.png deleted file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IXpf*)LSWwM`Bi%DhY%1tN}A?Ad%FO z2pHOh5EMvYydqA_77@i)h2`+!QycdoySxL|k~UD4t zCIE^&%Ub+Y-IH^(F@#@6&nz@-`vIfPT5IGId9&Sy)saLZZ$l3v@V+5n*uMfEU_b(3 z1`&Z21fVmH94OX;%nfGV z-jL`_-I?f2*@>^+I%<^zCud;g{; zJO%+!<#Cu|D^lJwbfNWP{F&FV>*r6_#?AjD_=LW=^$6^I8bQ%(Pb^5SvAfa_TKVL) zY82u0m-fILD1cO&8WzwD*Z=^Pi=>OEVTW6d-H)G)9=abp{`iAwXU-Y;guZp?BF6qv zr1>{?z2DARUrVKwd(QN|+H!W=k!j#FA}a`>%a3PkXU#sSd=q1ahjDF^!o(Y7iASk5*v)0rvF;zhQ(xI#SCdwk z<5Sfi2)vTn4D0I5U7{510<(UlJ%s3n_G2pft2`_mY)$OLj-7pPdG9%Qe5!g)6|36& z5to7rSPI}WaAtUSe*mTLt~?*iOP*0B@REA#|F<81yJD6A5i?{h5)+aPvAhG$!?!@> zlF(e9X|}$D;E(`QZ2(gda zfZ{M%Z7|1qyiJ?{XUWj!Wub*h@DLC>%+iq{t&zZ4UK+w=Ig}t)p$rpzH$Yr=pp_j+ zO>3}>Pb*&x5JMJR&~XP=bqsN-2(3~E>v{u%Pg{H#qEJL?;4Cr}z$?88wK4{1MuSC# zE(0eZ_8llkPoXWDL%BE#Sve0yw;Qk=LSC`*RnMJ5dnyff36AH(Xeh_2Rt9SspYD1! zEW)b}!&Wk=k^*gx%8D{) p)O>l>1aE>j!JFVs@OMK09so{Xafk(b&HVrX002ovPDHLkV1oZHL=6A{ diff --git a/src/styles/img/connector_green.png b/src/styles/img/connector_green.png deleted file mode 100644 index af1f4c79e8bbcdd7c78f0eaf136975e2fbe0f933..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1819 zcmV+$2juvPP)(_`g8%^e{{R4h=l}px2mk>USO5SzmjD14Z`WEM zkN^M%p-DtRRCwC#nR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6?W-vVnZHN4c(b93O=h zqv*fs2&`)$!edQNYdod#cpnz*=+~qw`Z_lh)}WAnMqhX^eth38IDD3bd{)ILTle=q z4&9YN4bpkisy0fy`Vx0wQ8nt&b=`a6@2diwsha=y{9{KPK1m)whD>t5_w4pV=BADK z`3v8la^E?*U}PcrOkfM|J1_oF0HSAFb8p_8L#|~V|ey=RAshO zYkm)kDYLWpwliKo>)_+IEW94Zh*y^O&zDo!q3%A{Y0n+JtPBH0BH*c! zkOB971ZNA7G)1t+fM#j$GCSa4K&boxlg$I%8yqApA!13Og`q%|1J1(b`T_!s`=tQt zd^n22x~k3J%1T3IdmM-7&dRga8Bu zzu$u!IIyP#PF__QIL5#yhc6OfK#+MYizvw;$p>)q4#cY{aKVJ9OaeFkF}&UsGF5fJ zu!Rg;kndCw_*gwIlVc$Px)ekIB}R2i1I%CuGZer{c@^d=bQ<_r<}1EFgn2jjPF6Gek@Lw-hgGpt&QDM zovEuFa7r=A=OVdWgkper>@Ad4Pb9#JxG$fs$r$#za(vv+SwP8tTT)--80*Ah1(;eu z5F)%u9_>atc<68Y_UQVhvy(Y#?$4_^@Hy}~@Hy}~@c)PXX8@23lmqJLQ?~#B002ov JPDHLkV1fxySM&e? diff --git a/src/styles/img/connector_orange.png b/src/styles/img/connector_orange.png deleted file mode 100644 index c5fbe3dc27cc8593bb721a895f32a5dbd44b11a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1861 zcmV-L2fFx)P)(_`g8%^e{{R4h=l}px2mk>USO5SzmjD14Z`WEM zkN^M%%Sl8*RCwC#nQM$yR~5(qYoEt`&7B8#h8gA20xi!{E!9vpQcS7Z_$UHtrLELf zP>YoYYhv2)!Sn;MYSR~{T1}}DrBG9C#1D`d(^6IQTgDIQTgD=!QMqhxwO* zT|3@{>$;OY&wEzK`YN!!vAU}IMX%(0YkoBws)k1N;+wG=SI|O0OjSf!(Kuz=ibPGe zEooOh5}UYd!&3`j-+1}wX*dIV?w&Vc+g5$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yhS1R00000NkvXXu0mjfhE;A8 diff --git a/src/styles/img/connector_pink.png b/src/styles/img/connector_pink.png deleted file mode 100644 index 54694a9d72ff816955137c1210c91396ef59720c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1754 zcmV<01||84P)(_`g8%^e{{R4h=l}px2mk>USO5SzmjD14Z`WEM zkN^M%U`a$lRCwC#nR|#_R~^Sc=e}m<&fS^Wog^!okVo?pjbIe5AXZRYTU%(&+Eh}A zK?24SB|)e!v zFZ}tbqj;XXBn-n}=~S;IbM7g1l^$=@n~kjxti`IRwmQDf{Sn=%jX)rZzQs#E+UJ)S z4CbBSCux=r|M33xIG=v|&#SpMpa-|Sf@3=i8)5yIQ8VsKB2AV^1F`n!ynO%4)hiB; zT^P@{>{J#CH#zaI|i)qxF#fj0{#&c&!o;djYi+2y59$5ykZ~Mq4f&0~7BoICz3swZ; z{VX8AuS9V}Dd_c$ZJ|wKMQONstTFPqF^)#Ll9PI81qOaD7wl|2^#3ZVj zQ=DH=AhkiE0EKNigL%il<>$vg`(j&)HyYvX%|_fCg$YqJA&wG~I3-O}QmskTRE1&q zq0!ON-6v0;9B^E9?SaRSyZ3zN5CFFYLmcN2A2TIy8Nm%DyuB3)_b#AoZ7*fD(C#KF z2Sk>}h$fTPQJZ9GtixN|o}5t_e=d$w(paMtL#8t_V-O>)B7z`@h@0x<+9+;*vJut? zx`NVu1K%}=zw*;(RE_+)Cib_%-r!)Dd^}<@8g|A%D-)daY8Ycss-?C~ zX@y(hSW?H$eosE`kFGlL(!l{)VpmvoQ+Q8f$k(StiVm=oFt2Y7@7j8Z2-7kUW3 z)I+edhx{kHaqJ4h--@T%8=S&i<_0vSF$%EFF_p`96Eydz;qD9R^?zmHp$A*Tmv;z0 z6;JUT-Q=i|F6zPC+>O1hM7BJ&>g=i=FEAxA%ws6X_jas{9SC!UkKryo7^ zgSWhXF1EJZ;WF0oDOO9B`VkMd+hiMy!t)k_VBWGA4B}*mEkD`nEDSdx{H5pC!*2_H z$?vTl#b-vwer{ZJj9%m2TvvKP5ONzra(+M7U^2e9F_grkw zJN3mjH_|8lG?cCxOvViGscx?^Rc@~@9xk5^260o=lbhaMKYqDk#Gp{pN{iW>(Hg77 zZOt{5wJ+iT6yE&@iOUVa01AVdwFTKIt}|Crm0qx{$rgdML%z6P z5i`sY_c#T&NFzzGY~49O!L=Tl&GgPW`<3xVcATc&G%HFUk)mJe9B`F0sGO-Q$JDV5 zD1%HEln_(r6t9kZ-8r2V(#}a0Z&3z{!&yUZGckRVsjD%(4}~bjY2~PArO^2G3rC+$ wyVhk_1YFJkc{L9{4?Yh*4?Yk6|A>DN08;lzhsFZD2><{907*qoM6N<$g7}b1i~s-t From a119f24b7e703adf47171c81cf0a552e9705530f Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 06:24:54 +0800 Subject: [PATCH 11/14] refactor: remove icons and color properties --- src/components/widgets/NodeStatsWidget.vue | 35 +++++----------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/components/widgets/NodeStatsWidget.vue b/src/components/widgets/NodeStatsWidget.vue index 4eba487dd..bc4b274da 100644 --- a/src/components/widgets/NodeStatsWidget.vue +++ b/src/components/widgets/NodeStatsWidget.vue @@ -38,10 +38,6 @@ import Card from '@/components/containers/Card.vue'; import ButtonMore from '@/components/controls/ButtonMore.vue'; import Constants from '../../config/constants'; -import IconOrange from '../../styles/img/connector_orange.png'; -import IconBlue from '../../styles/img/connector_blue.png'; -import IconGreen from '../../styles/img/connector_green.png'; -import IconPink from '../../styles/img/connector_pink.png'; export default { components: { @@ -78,50 +74,35 @@ export default { return [ { name: this.getNameByKey('allNodes'), - count: Array.from(Array(8).keys()).reduce((acc, val) => acc + (data[val] || 0)), - icon: IconBlue + count: Array.from(Array(8).keys()).reduce((acc, val) => acc + (data[val] || 0)) }, { name: Constants.RoleType[1], - count: data[1] || 0, - icon: IconBlue, - color: 'blue' + count: data[1] || 0 }, { name: Constants.RoleType[2], - count: data[2] || 0, - icon: IconPink, - color: 'pink' + count: data[2] || 0 }, { name: Constants.RoleType[3], - count: data[3] || 0, - icon: IconPink, - color: 'pink' + count: data[3] || 0 }, { name: Constants.RoleType[4], - count: data[4] || 0, - icon: IconGreen, - color: 'green' + count: data[4] || 0 }, { name: Constants.RoleType[5], - count: data[5] || 0, - icon: IconGreen, - color: 'green' + count: data[5] || 0 }, { name: Constants.RoleType[6], - count: data[6] || 0, - icon: IconOrange, - color: 'orange' + count: data[6] || 0 }, { name: Constants.RoleType[7], - count: data[7] || 0, - icon: IconOrange, - color: 'orange' + count: data[7] || 0 } ]; }, From 366cc9f8df6d9c38116b7efcb87d312083e3488a Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 06:30:11 +0800 Subject: [PATCH 12/14] fix: rename label text --- src/config/constants.js | 14 +++++++------- src/config/filters.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/config/constants.js b/src/config/constants.js index ccd6de56d..9b7487256 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -143,13 +143,13 @@ class Constants { } static RoleType = { - 1: 'Peer node', - 2: 'Api node', - 3: 'Peer Api node', - 4: 'Voting node', - 5: 'Peer Voting node', - 6: 'Api Voting node', - 7: 'Peer Api Voting node' + 1: 'Peer', + 2: 'Api', + 3: 'Peer Api', + 4: 'Voter', + 5: 'Peer Voter', + 6: 'Api Voter', + 7: 'Peer Api Voter' } static ROLE_TYPE_RAW = { diff --git a/src/config/filters.js b/src/config/filters.js index b972cc8d1..a1ba4e3b3 100644 --- a/src/config/filters.js +++ b/src/config/filters.js @@ -282,7 +282,7 @@ export const mosaicRestriction = [ export const nodeRoles = [ { - label: 'All Nodes', + label: 'Show All', icon: '', value: { rolesRaw: null From 5f8c4a3300d501007273260218dad67185c19184 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 06:35:53 +0800 Subject: [PATCH 13/14] feat: add node map "legends" --- src/components/widgets/NodesMapWidget.vue | 137 +++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/NodesMapWidget.vue b/src/components/widgets/NodesMapWidget.vue index d5c18e748..9cdb82342 100644 --- a/src/components/widgets/NodesMapWidget.vue +++ b/src/components/widgets/NodesMapWidget.vue @@ -28,6 +28,27 @@ /> + +
+ +
+ +
+
+ + {{ getNodeRoleName(item.rolesRaw) }} ({{ item.count }}) +
+
+
@@ -36,6 +57,14 @@ import Card from '@/components/containers/Card.vue'; import NodesMap from '@/components/NodesMap.vue'; import DropdownFilter from '@/components/controls/DropdownFilter.vue'; +import IconApiVoter from '../../styles/img/pin-api-voter.png'; +import IconApi from '../../styles/img/pin-api.png'; +import IconPeerApiVoter from '../../styles/img/pin-peer-api-voter.png'; +import IconPeerApi from '../../styles/img/pin-peer-api.png'; +import IconPeerVoter from '../../styles/img/pin-peer-voter.png'; +import IconPeer from '../../styles/img/pin-peer.png'; +import IconVoter from '../../styles/img/pin-voter.png'; +import Constants from '../../config/constants'; export default { components: { @@ -113,6 +142,76 @@ export default { filterOptions() { return this.manager.filterOptions; + }, + + getRolesCounter() { + const rolesCounter = { + peer: 0, + apiVoter: 0, + api: 0, + peerApiVoter: 0, + peerApi: 0, + peerVoter: 0, + voter: 0 + }; + + if (this.nodeList.length !== 0) { + this.nodeList.forEach(node => { + if (node.rolesRaw === Constants.ROLE_TYPE_RAW.PEER) + rolesCounter.peer++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.API) + rolesCounter.api++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.PEER_API) + rolesCounter.peerApi++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.VOTER) + rolesCounter.voter++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.PEER_VOTER) + rolesCounter.peerVoter++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.API_VOTER) + rolesCounter.apiVoter++; + else if (node.rolesRaw === Constants.ROLE_TYPE_RAW.PEER_API_VOTER) + rolesCounter.peerApiVoter++; + }); + } + + return rolesCounter; + }, + + mapLegends() { + const rolesCounter = this.getRolesCounter; + + const legends = [{ + rolesRaw: Constants.ROLE_TYPE_RAW.PEER, + iconUrl: IconPeer, + count: rolesCounter.peer + }, + { + rolesRaw: Constants.ROLE_TYPE_RAW.API, + iconUrl: IconApi, + count: rolesCounter.api + }, { + rolesRaw: Constants.ROLE_TYPE_RAW.VOTER, + iconUrl: IconVoter, + count: rolesCounter.voter + }, { + rolesRaw: Constants.ROLE_TYPE_RAW.PEER_VOTER, + iconUrl: IconPeerVoter, + count: rolesCounter.peerVoter + }, { + rolesRaw: Constants.ROLE_TYPE_RAW.API_VOTER, + iconUrl: IconApiVoter, + count: rolesCounter.apiVoter + }, { + rolesRaw: Constants.ROLE_TYPE_RAW.PEER_API, + iconUrl: IconPeerApi, + count: rolesCounter.peerApi + }, { + rolesRaw: Constants.ROLE_TYPE_RAW.PEER_API_VOTER, + iconUrl: IconPeerApiVoter, + count: rolesCounter.peerApiVoter + }]; + + return this.filterIndex === 0 ? legends : legends.filter(legend => legend.rolesRaw === this.filterIndex); } }, @@ -133,12 +232,16 @@ export default { 'Failed to change filter value. "changeFilterValue" is not a function' ); } + }, + + getNodeRoleName(rolesRaw) { + return Constants.RoleType[rolesRaw].replaceAll(' ', ' + '); } } }; - From 10d9975a6b59e65176215e5d6dd410003a783907 Mon Sep 17 00:00:00 2001 From: AnthonyLaw Date: Thu, 13 Jan 2022 06:36:34 +0800 Subject: [PATCH 14/14] fix: removed top right node filter drop down --- src/components/widgets/NodesMapWidget.vue | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/widgets/NodesMapWidget.vue b/src/components/widgets/NodesMapWidget.vue index 9cdb82342..c04c33e2d 100644 --- a/src/components/widgets/NodesMapWidget.vue +++ b/src/components/widgets/NodesMapWidget.vue @@ -4,17 +4,6 @@ {{getNameByKey(title)}} -