Merge pull request #2663 from loganhz/monitoring

Support enable project monitoring only
This commit is contained in:
Westly Wright 2019-02-20 08:03:08 -07:00 committed by GitHub
commit b7201e552e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 7 deletions

View File

@ -251,7 +251,7 @@
}} }}
{{#unless isSidekick}} {{#unless isSidekick}}
{{#if scope.currentCluster.enableClusterMonitoring}} {{#if scope.currentProject.enableProjectMonitoring}}
{{container/form-custom-metrics {{container/form-custom-metrics
classNames="accordion-wrapper" classNames="accordion-wrapper"
workload=service workload=service

View File

@ -126,9 +126,6 @@ const rootNav = [
resourceScope: 'global', resourceScope: 'global',
resource: [], resource: [],
ctx: [getProjectId], ctx: [getProjectId],
condition() {
return get(this, 'cluster.enableClusterMonitoring')
}
}, },
{ {
id: 'tools-pipeline', id: 'tools-pipeline',

View File

@ -15,6 +15,14 @@
</div> </div>
</section> </section>
{{#if (and (eq selected "prometheus") scope.currentProject.enableProjectMonitoring (not scope.currentCluster.enableClusterMonitoring))}}
{{#banner-message color="bg-warning"}}
<p>
{{t "monitoringPage.clusterNotEnabled"}}
</p>
{{/banner-message}}
{{/if}}
{{#banner-message color="bg-info"}} {{#banner-message color="bg-info"}}
<p> <p>
{{#if (eq selected "none")}} {{#if (eq selected "none")}}
@ -24,7 +32,7 @@
{{t (concat "monitoringPage." level ".disabled")}} {{t (concat "monitoringPage." level ".disabled")}}
{{/if}} {{/if}}
{{else if (eq selected "prometheus")}} {{else if (eq selected "prometheus")}}
{{t (if enabled "monitoringPage.toUpdate" "monitoringPage.prometheus")}} {{t (if enabled (concat "monitoringPage.toUpdate." level) "monitoringPage.prometheus")}}
{{/if}} {{/if}}
</p> </p>
{{/banner-message}} {{/banner-message}}

View File

@ -87,7 +87,10 @@ clusterDashboard:
monitoringPage: monitoringPage:
update: Update configuration update: Update configuration
toUpdate: Monitoring is enabled. toUpdate:
cluster: Cluster level monitoring is enabled.
project: Project level monitoring is enabled.
clusterNotEnabled: Cluster level monitoring is not enabled. Only custom metrics will be collected.
prometheus: Monitoring is not enabled yet, click the Save button below to enable it. prometheus: Monitoring is not enabled yet, click the Save button below to enable it.
config: config:
types: types:

View File

@ -80,7 +80,10 @@ clusterDashboard:
monitoringPage: monitoringPage:
update: 更新监控配置 update: 更新监控配置
toUpdate: 监控已启用。 toUpdate:
cluster: 集群级别监控已启用。
project: 项目级别监控已启用。
clusterNotEnabled: 集群级别监控未启用。将只采集自定义指标。
prometheus: 监控尚未启用,点击下面的保存按钮去启用监控。 prometheus: 监控尚未启用,点击下面的保存按钮去启用监控。
config: config:
header: Prometheus配置 header: Prometheus配置