Skip to content

Commit

Permalink
git wip - fetch replication reindx status
Browse files Browse the repository at this point in the history
  • Loading branch information
andaley committed Apr 29, 2020
1 parent 97f272e commit f414d8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion ui/app/adapters/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ export default ApplicationAdapter.extend({
};
if (this.get('version.isEnterprise') && this.get('namespaceService.inRootNamespace')) {
fetches.replicationStatus = this.replicationStatus().catch(e => e);
fetches.replicationModeStatus = this.replicationModeStatus().catch(e => e);
}
return hash(fetches).then(({ health, sealStatus, replicationStatus }) => {
return hash(fetches).then(({ health, sealStatus, replicationStatus, replicationModeStatus }) => {
let ret = {
id,
name: snapshot.attr('name'),
Expand All @@ -57,6 +58,11 @@ export default ApplicationAdapter.extend({
ret = assign(ret, { nodes: [sealStatus] });
}
if (replicationStatus && replicationStatus instanceof AdapterError === false) {
console.log(replicationModeStatus.data.reindex_stage, ' - reindex stage');
console.log(replicationModeStatus.data.reindex_building_progress, ' - build progress');
console.log(replicationModeStatus.data.reindex_building_total, ' - build total');
console.log(replicationModeStatus.data.reindex_in_progress, ' - reindex in progress?');

ret = assign(ret, replicationStatus.data);
}
return resolve(ret);
Expand Down Expand Up @@ -174,6 +180,10 @@ export default ApplicationAdapter.extend({
return this.ajax(`${this.buildURL()}/replication/status`, 'GET', { unauthenticated: true });
},

replicationModeStatus() {
return this.ajax(`${this.buildURL()}/replication/performance/status`, 'GET', { unauthenticated: true });
},

replicationDrPromote(data, options) {
const verb = options && options.checkStatus ? 'GET' : 'PUT';
return this.ajax(`${this.buildURL()}/replication/dr/secondary/promote`, verb, {
Expand Down
1 change: 0 additions & 1 deletion ui/lib/core/addon/mixins/replication-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default Mixin.create({
}, {});
delete data.replicationMode;
}

return yield this.save.perform(action, replicationMode, clusterMode, data);
}),

Expand Down

0 comments on commit f414d8d

Please sign in to comment.