Commit 6b3bfec8 authored by Brett Walker's avatar Brett Walker

hide verification UI if feature disabled

parent 58ee6fc1
......@@ -204,6 +204,7 @@
<template v-if="showAdvanceItems">
<template v-if="node.primary">
<geo-node-detail-item
v-if="nodeDetails.repository_verification_enabled"
:item-title="s__('GeoNodes|Repositories checksummed:')"
:success-label="s__('GeoNodes|Checksummed')"
:neutral-label="s__('GeoNodes|Not checksummed')"
......@@ -212,6 +213,7 @@
:item-value-type="valueType.GRAPH"
/>
<geo-node-detail-item
v-if="nodeDetails.repository_verification_enabled"
:item-title="s__('GeoNodes|Wikis checksummed:')"
:success-label="s__('GeoNodes|Checksummed')"
:neutral-label="s__('GeoNodes|Not checksummed')"
......@@ -236,6 +238,7 @@
</template>
<template v-else>
<geo-node-detail-item
v-if="nodeDetails.repository_verification_enabled"
:item-title="s__('GeoNodes|Repository checksums verified:')"
:success-label="s__('GeoNodes|Verified')"
:neutral-label="s__('GeoNodes|Unverified')"
......@@ -244,6 +247,7 @@
:item-value-type="valueType.GRAPH"
/>
<geo-node-detail-item
v-if="nodeDetails.repository_verification_enabled"
:item-title="s__('GeoNodes|Wiki checksums verified:')"
:success-label="s__('GeoNodes|Verified')"
:neutral-label="s__('GeoNodes|Unverified')"
......
......@@ -87,6 +87,7 @@ export default class GeoNodesStore {
successCount: rawNodeDetails.wikis_synced_count || 0,
failureCount: rawNodeDetails.wikis_failed_count || 0,
},
repository_verification_enabled: rawNodeDetails.repositories_verified_count != null,
verifiedRepositories: {
totalCount: rawNodeDetails.repositories_count || 0,
successCount: rawNodeDetails.repositories_verified_count || 0,
......
......@@ -131,6 +131,7 @@ class GeoNodeStatus < ActiveRecord::Base
load_primary_data
load_secondary_data
load_verification_data
self
end
......@@ -140,10 +141,6 @@ class GeoNodeStatus < ActiveRecord::Base
self.replication_slots_count = geo_node.replication_slots_count
self.replication_slots_used_count = geo_node.replication_slots_used_count
self.replication_slots_max_retained_wal_bytes = geo_node.replication_slots_max_retained_wal_bytes
self.repositories_verified_count = repository_verification_finder.count_verified_repositories
self.repositories_verification_failed_count = repository_verification_finder.count_verification_failed_repositories
self.wikis_verified_count = repository_verification_finder.count_verified_wikis
self.wikis_verification_failed_count = repository_verification_finder.count_verification_failed_wikis
end
end
......@@ -156,10 +153,6 @@ class GeoNodeStatus < ActiveRecord::Base
self.repositories_failed_count = projects_finder.count_failed_repositories
self.wikis_synced_count = projects_finder.count_synced_wikis
self.wikis_failed_count = projects_finder.count_failed_wikis
self.repositories_verified_count = projects_finder.count_verified_repositories
self.repositories_verification_failed_count = projects_finder.count_verification_failed_repositories
self.wikis_verified_count = projects_finder.count_verified_wikis
self.wikis_verification_failed_count = projects_finder.count_verification_failed_wikis
self.lfs_objects_synced_count = lfs_objects_finder.count_synced_lfs_objects
self.lfs_objects_failed_count = lfs_objects_finder.count_failed_lfs_objects
self.job_artifacts_synced_count = job_artifacts_finder.count_synced_job_artifacts
......@@ -169,6 +162,20 @@ class GeoNodeStatus < ActiveRecord::Base
end
end
def load_verification_data
if Feature.enabled?('geo_repository_verification')
finder = Gitlab::Geo.primary? ? repository_verification_finder : projects_finder
self.repositories_verified_count = finder.count_verified_repositories
self.repositories_verification_failed_count = finder.count_verification_failed_repositories
self.wikis_verified_count = finder.count_verified_wikis
self.wikis_verification_failed_count = finder.count_verification_failed_wikis
else
self.repositories_verified_count = self.repositories_verification_failed_count = nil
self.wikis_verified_count = self.wikis_verification_failed_count = nil
end
end
alias_attribute :health, :status_message
def healthy?
......
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