errors in sync header
This commit is contained in:
parent
7e7e51a094
commit
92dc356b0b
@ -368,4 +368,10 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status .text-danger {
|
||||||
|
color: white;
|
||||||
|
background: red;
|
||||||
|
display: inline-block;
|
||||||
|
padding:0px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,31 +25,33 @@ 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.error) {
|
||||||
$rootScope.syncError = sync.error;
|
$scope.syncError = sync.error;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (sync.blocksToSync > sync.syncedBlocks) {
|
if (sync.blocksToSync > sync.syncedBlocks) {
|
||||||
var p = parseInt(100*(sync.syncedBlocks) / sync.blocksToSync);
|
var p = parseInt(100*(sync.syncedBlocks) / sync.blocksToSync);
|
||||||
var delta = sync.blocksToSync - sync.syncedBlocks;
|
var delta = sync.blocksToSync - sync.syncedBlocks;
|
||||||
sync.message = 'Sync ' + p + '% ['+delta+' blocks remaining]';
|
sync.message = 'Sync ' + p + '% ['+delta+' blocks remaining]';
|
||||||
sync.style = 'warn';
|
sync.style = 'warn';
|
||||||
} else {
|
} else {
|
||||||
sync.message = 'On sync';
|
sync.message = 'On sync';
|
||||||
sync.style = 'success';
|
sync.style = 'success';
|
||||||
|
}
|
||||||
|
sync.tooltip = 'Synced blocks: '+sync.syncedBlocks;
|
||||||
}
|
}
|
||||||
sync.tooltip = 'Synced blocks: '+sync.syncedBlocks;
|
|
||||||
$scope.sync = sync;
|
$scope.sync = sync;
|
||||||
|
$scope.hola = 'hola';
|
||||||
|
console.log('[status.js.43:hola:]'); //TODO
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.getSync = function() {
|
$scope.getSync = function() {
|
||||||
Sync.get({},
|
Sync.get({},
|
||||||
function(sync) {
|
function(sync) {
|
||||||
$rootScope.syncError = null;
|
$scope.syncError = null;
|
||||||
on_sync_update(sync);
|
on_sync_update(sync);
|
||||||
},
|
},
|
||||||
function(e) {
|
function(e) {
|
||||||
$rootScope.syncError = 'Could not get sync information' + e;
|
$scope.syncError = 'Could not get sync information' + e;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
</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="syncError" tooltip="{{sync.error}}" tooltip-placement="bottom"> ERROR </div>
|
||||||
|
|
||||||
<span class="small" tooltip="{{sync.tooltip}}" tooltip-placement="down">
|
<span class="small" tooltip="{{sync.tooltip}}" tooltip-placement="down">
|
||||||
<i class="{{sync.style}}"><strong> {{sync.message}} </strong></i>
|
<i class="{{sync.style}}"><strong> {{sync.message}} </strong></i>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -55,8 +55,11 @@ walk(models_path);
|
|||||||
|
|
||||||
// historic_sync process
|
// historic_sync process
|
||||||
var historicSync = {};
|
var historicSync = {};
|
||||||
|
|
||||||
|
|
||||||
if (!config.disableHistoricSync) {
|
if (!config.disableHistoricSync) {
|
||||||
historicSync = new HistoricSync();
|
historicSync = new HistoricSync();
|
||||||
|
|
||||||
historicSync.init({
|
historicSync.init({
|
||||||
skipDbConnection: true,
|
skipDbConnection: true,
|
||||||
shouldBroadcast: true,
|
shouldBroadcast: true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user