better header for sync

This commit is contained in:
Matias Alejo Garcia 2014-01-21 19:40:41 -03:00
parent 18bbe828cd
commit 7ac3b5b1aa
4 changed files with 18 additions and 22 deletions

View File

@ -296,13 +296,13 @@ function spec() {
if (!self.step) { if (!self.step) {
var step = parseInt( (self.blockChainHeight - self.syncedBlocks) / 100); var step = parseInt( (self.blockChainHeight - self.syncedBlocks) / 1000);
if (self.opts.progressStep) { if (self.opts.progressStep) {
step = self.opts.progressStep; step = self.opts.progressStep;
} }
if (step < 100) step = 100; if (step < 10) step = 10;
self.step = step; self.step = step;
} }

View File

@ -368,10 +368,21 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-size: 80%; font-size: 80%;
} }
.status .text-danger { .status .t {
color: white; color: white;
background: red;
display: inline-block; display: inline-block;
padding:0px 5px; padding:0px 5px;
} }
.status .text-danger {
background: red;
}
.status .text-warning {
background: yellow;
color: black;
}
.status .text-default {
}

View File

@ -23,19 +23,6 @@ function($scope, $routeParams, $location, $rootScope, Global, Status, Sync, get_
}; };
var on_sync_update = function(sync) { var on_sync_update = function(sync) {
if (!sync.error) {
if (sync.blocksToSync > sync.syncedBlocks) {
var p = parseInt(100*(sync.syncedBlocks) / sync.blocksToSync);
var delta = sync.blocksToSync - sync.syncedBlocks;
sync.message = 'Sync ' + p + '% ['+delta+' blocks remaining]';
sync.style = 'warn';
} else {
sync.message = 'On sync';
sync.style = 'success';
}
sync.tooltip = 'Synced blocks: '+sync.syncedBlocks;
}
$scope.sync = sync; $scope.sync = sync;
}; };
@ -52,7 +39,6 @@ function($scope, $routeParams, $location, $rootScope, Global, Status, Sync, get_
var socket = get_socket($scope); var socket = get_socket($scope);
socket.emit('subscribe', 'sync'); socket.emit('subscribe', 'sync');
socket.on('status', function(sync) { socket.on('status', function(sync) {
console.log('[status.js.55::] sync status update received!'); console.log('[status.js.55::] sync status update received!');
on_sync_update(sync); on_sync_update(sync);
}); });

View File

@ -25,10 +25,9 @@
</div> </div>
<div class="status" data-ng-controller="StatusController"> <div class="status" data-ng-controller="StatusController">
<span data-ng-init="getSync()"> <span data-ng-init="getSync()">
<div class="text-danger" data-ng-show="sync.error" tooltip="{{sync.error}}" tooltip-placement="bottom"> ERROR </div> <div class="t text-danger" data-ng-show="sync.error" tooltip="{{sync.error}}" tooltip-placement="bottom"> ERROR </div>
<div class="t text-warning " tooltip="{{sync.syncedBlocks}} / {{sync.blockChainHeight}} synced. {{sync.skippedBlocks}} skipped" tooltip-placement="bottom" data-ng-show="sync.status==='syncing'"> {{sync.status}} {{sync.syncPercentage}}%</div>
<span class="small" tooltip="{{sync.tooltip}}" tooltip-placement="down"> <div class="t text-default" tooltip="historic sync finished" tooltip-placement="bottom" data-ng-show="sync.status==='finished'"> On sync</div>
<i class="{{sync.style}}"><strong> {{sync.message}} </strong></i>
</span> </span>
</span> </span>
<span data-ng-init="getStatus('Info')"> <span data-ng-init="getStatus('Info')">