Commit 5462dcc4 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Kushal Pandya

Show a warning if secondary node revision is not the same of primary

parent eb880edb
...@@ -13,7 +13,7 @@ const healthyIcon = 'fa-check'; ...@@ -13,7 +13,7 @@ const healthyIcon = 'fa-check';
const unhealthyIcon = 'fa-times'; const unhealthyIcon = 'fa-times';
const unknownIcon = 'fa-times'; const unknownIcon = 'fa-times';
const notAvailable = 'Not Available'; const notAvailable = 'Not Available';
const versionMismatch = 'does not match the primary node version'; const versionMismatch = 'Does not match the primary node version';
const versionMismatchClass = 'geo-node-version-mismatch'; const versionMismatchClass = 'geo-node-version-mismatch';
class GeoNodeStatus { class GeoNodeStatus {
...@@ -23,7 +23,6 @@ class GeoNodeStatus { ...@@ -23,7 +23,6 @@ class GeoNodeStatus {
this.$loadingIcon = $('.js-geo-node-loading', this.$el); this.$loadingIcon = $('.js-geo-node-loading', this.$el);
this.$dbReplicationLag = $('.js-db-replication-lag', this.$status); this.$dbReplicationLag = $('.js-db-replication-lag', this.$status);
this.$healthStatus = $('.js-health-status', this.$el); this.$healthStatus = $('.js-health-status', this.$el);
this.$primaryVersion = $('.js-primary-version');
this.$status = $('.js-geo-node-status', this.$el); this.$status = $('.js-geo-node-status', this.$el);
this.$repositories = $('.js-repositories', this.$status); this.$repositories = $('.js-repositories', this.$status);
this.$lfsObjects = $('.js-lfs-objects', this.$status); this.$lfsObjects = $('.js-lfs-objects', this.$status);
...@@ -37,6 +36,8 @@ class GeoNodeStatus { ...@@ -37,6 +36,8 @@ class GeoNodeStatus {
this.endpoint = this.$el.data('status-url'); this.endpoint = this.$el.data('status-url');
this.$advancedStatus = $('.js-advanced-geo-node-status-toggler', this.$status.parent()); this.$advancedStatus = $('.js-advanced-geo-node-status-toggler', this.$status.parent());
this.$advancedStatus.on('click', GeoNodeStatus.toggleShowAdvancedStatus.bind(this)); this.$advancedStatus.on('click', GeoNodeStatus.toggleShowAdvancedStatus.bind(this));
this.primaryVersion = $('.js-primary-version').text();
this.primaryRevision = $('.js-primary-revision').text().replace(/\W/g, '');
this.statusInterval = new SmartInterval({ this.statusInterval = new SmartInterval({
callback: this.getStatus.bind(this), callback: this.getStatus.bind(this),
...@@ -200,12 +201,12 @@ class GeoNodeStatus { ...@@ -200,12 +201,12 @@ class GeoNodeStatus {
this.$dbReplicationLag.text('UNKNOWN'); this.$dbReplicationLag.text('UNKNOWN');
} }
if (this.$primaryVersion.text() !== status.version) { if (this.primaryVersion === status.version && this.primaryRevision === status.revision) {
this.$secondaryVersion.removeClass(`${versionMismatchClass}`); this.$secondaryVersion.removeClass(`${versionMismatchClass}`);
this.$secondaryVersion.text(status.version); this.$secondaryVersion.text(`${status.version} (${status.revision})`);
} else { } else {
this.$secondaryVersion.addClass(`${versionMismatchClass}`); this.$secondaryVersion.addClass(`${versionMismatchClass}`);
this.$secondaryVersion.text(`${status.version} (${versionMismatch})`); this.$secondaryVersion.text(`${status.version} (${status.revision}) - ${versionMismatch}`);
} }
if (status.repositories_count > 0) { if (status.repositories_count > 0) {
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
%p %p
%span.help-block %span.help-block
Gitlab version: Gitlab version:
%strong.node-info.js-primary-version= Gitlab::VERSION %span.js-primary-version= Gitlab::VERSION
%small.js-primary-revision= "(#{Gitlab::REVISION})"
- else - else
= status_loading_icon = status_loading_icon
%table.geo-node-status.js-geo-node-status.hidden %table.geo-node-status.js-geo-node-status.hidden
...@@ -44,7 +45,6 @@ ...@@ -44,7 +45,6 @@
GitLab Version: GitLab Version:
%td %td
.node-info.prepend-top-10.prepend-left-5.js-gitlab-version .node-info.prepend-top-10.prepend-left-5.js-gitlab-version
%span.node-info.geo-node-version-mismatch Foo
- if node.enabled? - if node.enabled?
%tr %tr
%td %td
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment