Merge pull request #2739 from loganhz/test2

minitoring
This commit is contained in:
Westly Wright 2019-03-11 09:07:43 -07:00 committed by GitHub
commit 10014d9b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 11 deletions

View File

@ -1,4 +1,5 @@
import Component from '@ember/component'; import Component from '@ember/component';
import { get, computed } from '@ember/object';
import layout from './template'; import layout from './template';
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
@ -9,4 +10,8 @@ export default Component.extend({
layout, layout,
classNames: 'row', classNames: 'row',
largeScale: computed('scope.currentCluster.nodes.length', function() {
return get(this, 'scope.currentCluster.nodes.length') > 10;
}),
}); });

View File

@ -5,7 +5,7 @@
grafanaUrl=scope.currentCluster.grafanaUrl grafanaUrl=scope.currentCluster.grafanaUrl
title=(t "clusterDashboard.sections.cluster") title=(t "clusterDashboard.sections.cluster")
}} }}
{{cluster-metrics}} {{cluster-metrics largeScale=largeScale}}
{{/metrics-summary}} {{/metrics-summary}}
{{#if scope.currentCluster.isRKE}} {{#if scope.currentCluster.isRKE}}
@ -13,10 +13,10 @@
expandAll=al.expandAll expandAll=al.expandAll
expandFn=expandFn expandFn=expandFn
grafanaUrl=grafana.etcdUrl grafanaUrl=grafana.etcdUrl
classNames='mt-20' classNames="mt-20"
title=(t "clusterDashboard.sections.etcd") title=(t "clusterDashboard.sections.etcd")
}} }}
{{etcd-metrics}} {{etcd-metrics largeScale=largeScale}}
{{/metrics-summary}} {{/metrics-summary}}
{{/if}} {{/if}}
@ -24,19 +24,19 @@
expandAll=al.expandAll expandAll=al.expandAll
expandFn=expandFn expandFn=expandFn
grafanaUrl=grafana.k8sUrl grafanaUrl=grafana.k8sUrl
classNames='mt-20' classNames="mt-20"
title=(t "clusterDashboard.sections.k8s") title=(t "clusterDashboard.sections.k8s")
}} }}
{{k8s-metrics}} {{k8s-metrics largeScale=largeScale}}
{{/metrics-summary}} {{/metrics-summary}}
{{#metrics-summary {{#metrics-summary
expandAll=al.expandAll expandAll=al.expandAll
expandFn=expandFn expandFn=expandFn
grafanaUrl=grafana.rancherUrl grafanaUrl=grafana.rancherUrl
classNames='mt-20 mb-20' classNames="mt-20 mb-20"
title=(t "clusterDashboard.sections.rancher" appName=settings.appName) title=(t "clusterDashboard.sections.rancher" appName=settings.appName)
}} }}
{{rancher-metrics noDataLabel='clusterDashboard.noRancherComponents'}} {{rancher-metrics largeScale=largeScale noDataLabel="clusterDashboard.noRancherComponents"}}
{{/metrics-summary}} {{/metrics-summary}}
{{/accordion-list}} {{/accordion-list}}

View File

@ -229,13 +229,14 @@ export default Mixin.create({
projectScope: false, projectScope: false,
metricParams: null, metricParams: null,
timeOutAnchor: null, timeOutAnchor: null,
largeScale: false,
init() { init() {
this._super(...arguments); this._super(...arguments);
set(this, 'state', { set(this, 'state', {
loading: false, loading: false,
detail: true, detail: !get(this, 'largeScale'),
noGraphs: false, noGraphs: false,
isCustom: false, isCustom: false,
from: null, from: null,