Skip to content
Snippets Groups Projects
Commit 5cefec37 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Network: sort on API not working - fix #412

[fix] Network: better alignment of API icons (SSL and Cesium+)
parent 5220c5db
No related branches found
No related tags found
No related merge requests found
...@@ -458,7 +458,9 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se ...@@ -458,7 +458,9 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se
if (data.sort.type) { if (data.sort.type) {
var sortScore = 0; var sortScore = 0;
sortScore += (data.sort.type == 'uid' ? computeScoreAlphaValue(peer.uid||peer.pubkey, 3, data.sort.asc) : 0); sortScore += (data.sort.type == 'uid' ? computeScoreAlphaValue(peer.uid||peer.pubkey, 3, data.sort.asc) : 0);
sortScore += (data.sort.type == 'api' ? (peer.hasEndpoint('ES_USER_API') && data.sort.asc ? 1 : 0) : 0); sortScore += (data.sort.type == 'api' ?
(peer.isSsl() ? (data.sort.asc ? 1 : -1) :
(peer.hasEndpoint('ES_USER_API') ? (data.sort.asc ? 0.5 : -0.5) : 0)) : 0);
sortScore += (data.sort.type == 'difficulty' ? (peer.difficulty ? (data.sort.asc ? (1000-peer.difficulty) : peer.difficulty): 0) : 0); sortScore += (data.sort.type == 'difficulty' ? (peer.difficulty ? (data.sort.asc ? (1000-peer.difficulty) : peer.difficulty): 0) : 0);
sortScore += (data.sort.type == 'current_block' ? (peer.currentNumber ? (data.sort.asc ? (1000000000 - peer.currentNumber) : peer.currentNumber) : 0) : 0); sortScore += (data.sort.type == 'current_block' ? (peer.currentNumber ? (data.sort.asc ? (1000000000 - peer.currentNumber) : peer.currentNumber) : 0) : 0);
score += (10000000000 * sortScore); score += (10000000000 * sortScore);
......
...@@ -59,14 +59,16 @@ ...@@ -59,14 +59,16 @@
<span class="gray">{{:rebind:peer.server}}</span> <span class="gray">{{:rebind:peer.server}}</span>
</h4> </h4>
</div> </div>
<div class="col col-15 no-padding text-center" ng-if="::expertMode"> <div class="col col-15 no-padding text-center hidden-xs hidden-sm" ng-if="::expertMode">
<div class="hidden-xs hidden-sm" ng-if=":rebind:peer.hasEndpoint('ES_USER_API')"> <div style="min-width: 50px; padding-top: 5px;" >
<i class="ion-es-user-api"></i> <span ng-if=":rebind:peer.isSsl()">
<b class="ion-plus dark" style="position: relative; left: -14px; top:-17px; font-size : 16px;"></b>
</div>
<div class="hidden-xs hidden-sm dark" ng-if=":rebind:peer.isSsl()">
<i class="ion-locked"></i> <small>SSL</small> <i class="ion-locked"></i> <small>SSL</small>
</span>
</div> </div>
<span class="" ng-if=":rebind:peer.hasEndpoint('ES_USER_API')">
<i class="ion-es-user-api"></i>
<b class="ion-plus dark" style="position: relative; left: -14px; top:-17px; font-size : 16px;"></b>
</span>
</div> </div>
<div class="col col-20 no-padding text-center" ng-if="::expertMode && search.type != 'offline'"> <div class="col col-20 no-padding text-center" ng-if="::expertMode && search.type != 'offline'">
<h3 class="hidden-sm hidden-xs gray"> <h3 class="hidden-sm hidden-xs gray">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment