diff --git a/html/admin/js/templates/.dashboardView.ejs.swp b/html/admin/js/templates/.dashboardView.ejs.swp new file mode 100644 index 0000000000..d2f22a0271 Binary files /dev/null and b/html/admin/js/templates/.dashboardView.ejs.swp differ diff --git a/html/admin/js/templates/dashboardView.ejs b/html/admin/js/templates/dashboardView.ejs index 0234e7ab9a..26ae8dc07f 100644 --- a/html/admin/js/templates/dashboardView.ejs +++ b/html/admin/js/templates/dashboardView.ejs @@ -91,6 +91,14 @@ Last applied tick + + Total number of requests + + + + Total number of failed connection attempts + + Progress diff --git a/html/admin/js/views/dashboardView.js b/html/admin/js/views/dashboardView.js index 502dad6dcd..15c26ebefc 100644 --- a/html/admin/js/views/dashboardView.js +++ b/html/admin/js/views/dashboardView.js @@ -98,10 +98,10 @@ var dashboardView = Backbone.View.extend({ }, putReplicationStatus: function () { - var time; - var clientString = '-'; + var loggerRunning = this.replLogState.state.running; + var applierRunning = this.replApplyState.state.running; - if (this.replApplyState.state.running === true) { + if (applierRunning || this.replApplyState.state.lastError != '') { $('#detailReplication').height(290); $('.checkApplyRunningStatus').show(); } @@ -109,19 +109,15 @@ var dashboardView = Backbone.View.extend({ $('.checkApplyRunningStatus').hide(); } - time = this.replLogState.state.time; + var time = this.replLogState.state.time; - var runningLog; - if (this.replLogState.state.running === true) { - runningLog = '
true
'; - } - else { - runningLog = '
false
'; - } + var cls = loggerRunning ? 'true' : 'false'; + var runningLog = '
' + cls + '
'; + var clientString = '-'; if (this.replLogState.state.clients) { $.each(this.replLogState.state.clients, function(k,v) { - clientString = clientString + "Server: "+v.serverId+" | Time: "+v.time+"\n"; + clientString = clientString + "Server: " + v.serverId + " | Time: " + v.time + "\n"; }); } @@ -138,22 +134,17 @@ var dashboardView = Backbone.View.extend({ //apply table - var lastAppliedTick; + var lastAppliedTick = "-"; var progress = "-"; var lastError = "-"; var endpoint = "-"; + var numRequests = "-"; + var numFailed = "-"; - if (this.replApplyState.state.lastAppliedContinuousTick === null) { - lastAppliedTick = this.replApplyState.state.lastAppliedInitialTick; - } - else { + if (this.replApplyState.state.lastAppliedContinuousTick !== null) { lastAppliedTick = this.replApplyState.state.lastAppliedContinuousTick; } - if (lastAppliedTick === null) { - lastAppliedTick = "-"; - } - if (this.replApplyState.state.endpoint !== undefined) { endpoint = this.replApplyState.state.endpoint; } @@ -167,22 +158,21 @@ var dashboardView = Backbone.View.extend({ if (this.replApplyState.state.lastError) { lastError = this.replApplyState.state.lastError.errorMessage; } - var runningApply; - if (this.replApplyState.state.running === true) { - runningApply = '
true
'; - } - else { - runningApply = '
false
'; - } + cls = applierRunning ? 'true' : 'false'; + var runningApply = '
' + cls + '
'; + + numRequests = this.replApplyState.state.totalRequests || 0; + numFailed = this.replApplyState.state.totalFailedConnects || 0; $('#applyRunningVal').html(runningApply); $('#applyEndpointVal').text(endpoint); $('#applyLastAppliedTickVal').text(lastAppliedTick); $('#applyTimeVal').text(time); $('#applyProgressVal').text(progress); + $('#applyTotalRequestsVal').text(numRequests); + $('#applyTotalFailedVal').text(numFailed); $('#applyLastErrorVal').text(lastError); - }, render: function() {