1
0
Fork 0

fixed replication status display

This commit is contained in:
Jan Steemann 2013-07-22 19:20:56 +02:00
parent 444a110b72
commit 8c35c4ff14
2 changed files with 44 additions and 36 deletions

View File

@ -50,12 +50,12 @@
</tr>
</thead>
<tr>
<th class="alignLeft" id="logRunning">Running</th>
<th id="logRunningVal"></th>
<td class="alignLeft" id="logRunning">Running</td>
<td id="logRunningVal"></td>
</tr>
<tr>
<th class="alignLeft" id="logLastTick">Last log tick</th>
<th id="logLastTickVal"></th>
<td class="alignLeft" id="logLastTick">Last log tick</td>
<td id="logLastTickVal"></td>
</tr>
</table>
</div>
@ -67,33 +67,27 @@
<tr>
<th>State</th>
<th>Value</th>
<th>Info</th>
</tr>
</thead>
<tr>
<th class="alignLeft" id="applyRunning">Running</th>
<th id="applyRunningVal"></th>
<th>--</th>
<td class="alignLeft" id="applyRunning">Running</td>
<td id="applyRunningVal"></td>
</tr>
<tr>
<th class="alignLeft" id="applyLastTick">Last processed tick</th>
<th id="applyLastTickVal"></th>
<th>--</th>
<td class="alignLeft" id="applyLastTick">Last applied tick</th>
<td id="applyLastAppliedTickVal"></td>
</tr>
<tr class="checkApplyRunningStatus">
<th class="alignLeft" id="applyCurrentPhase">Current phase</th>
<th id="applyCurrentPhaseId"></th>
<th id="applyCurrentPhaseLabel"></th>
<td class="alignLeft" id="applyCurrentPhase">Current phase</td>
<td id="applyCurrentPhaseLabel"></td>
</tr>
<tr class="checkApplyRunningStatus">
<th class="alignLeft" id="applyProgress">Progress</th>
<th id="applyProgressVal"></th>
<th>--</th>
<td class="alignLeft" id="applyProgress">Progress</td>
<td id="applyProgressVal"></td>
</tr>
<tr class="checkApplyRunningStatus">
<th class="alignLeft" id="applyLastError">Last error</th>
<th id="applyLastErrorTime"></th>
<th id="applyLastErrorErrorNum"></th>
<td class="alignLeft" id="applyLastError">Last error</td>
<td id="applyLastError"></td>
</tr>
</table>
</div>

View File

@ -98,7 +98,7 @@ var dashboardView = Backbone.View.extend({
},
putReplicationStatus: function () {
if (this.replApplyState.running === true) {
if (this.replApplyState.state.running === true) {
$('#detailReplication').height(290);
$('.checkApplyRunningStatus').show();
}
@ -111,26 +111,40 @@ var dashboardView = Backbone.View.extend({
$('#logLastTickVal').text(this.replLogState.state.lastLogTick);
//apply table
var convertedProgressTime;
var convertedLastErrorTime;
var convertedLastTick;
if (this.replApplyState.state.progress.time === '') {
convertedProgressTime = 'n/A';
var lastAppliedTick;
var phase = "-";
var progress = "-";
var lastError = "-";
if (this.replApplyState.state.lastAppliedContinuousTick === null) {
lastAppliedTick = this.replApplyState.state.lastAppliedInitialTick;
}
if (this.replApplyState.state.lastError.time === '') {
convertedLastErrorTime = 'n/A';
else {
lastAppliedTick = this.replApplyState.state.lastAppliedContinuousTick;
}
if (this.replApplyState.state.lastProcessedContinuousTick === null) {
convertedLastTick = 0;
if (lastAppliedTick === null) {
lastAppliedTick = "-";
}
if (this.replApplyState.state.currentPhase) {
phase = this.replApplyState.state.currentPhase.label;
}
if (this.replApplyState.state.progress) {
progress = this.replApplyState.state.progress.message;
}
if (this.replApplyState.state.lastError) {
lastError = this.replApplyState.state.lastError.errorMessage;
}
$('#applyRunningVal').text(this.replApplyState.state.running);
$('#applyLastTickVal').text(convertedLastTick);
$('#applyCurrentPhaseId').text(this.replApplyState.state.currentPhase.id);
$('#applyCurrentPhaseLabel').text(this.replApplyState.state.currentPhase.label);
$('#applyProgressVal').text(convertedProgressTime);
$('#applyLastErrorTime').text(convertedLastErrorTime);
$('#applyLastErrorErrorNum').text(this.replApplyState.state.lastError.errorNum);
$('#applyLastAppliedTickVal').text(lastAppliedTick);
$('#applyCurrentPhaseLabel').text(phase);
$('#applyProgressVal').text(progress);
$('#applyLastError').text(lastError);
},