From e1643e251988b52f735168192c556d921982e29b Mon Sep 17 00:00:00 2001 From: n313893254 Date: Thu, 14 Feb 2019 11:07:58 +0800 Subject: [PATCH] Remove project includeSystemComponent https://github.com/rancher/rancher/issues/15555 --- .../logging/form-log-format/component.js | 11 ++++++-- .../logging/form-log-format/template.hbs | 26 ++++++++++--------- lib/logging/translations/zh-hans.yaml | 2 ++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/lib/logging/addon/components/logging/form-log-format/component.js b/lib/logging/addon/components/logging/form-log-format/component.js index 74112105f..d323a7801 100644 --- a/lib/logging/addon/components/logging/form-log-format/component.js +++ b/lib/logging/addon/components/logging/form-log-format/component.js @@ -1,10 +1,17 @@ import Component from '@ember/component'; +import { inject as service } from '@ember/service'; +import { observer } from '@ember/object'; +import { reads } from '@ember/object/computed'; export default Component.extend({ + scope: service(), - outputTagsChanged: function() { + pageScope: reads('scope.currentPageScope'), + + outputTagsChanged: observer('model.outputTags', function() { this.setCodeBlockHeight(); - }.observes('model.outputTags'), + }), + setCodeBlockHeight() { const h = this.$('.additional-logging-configuration-content').height() + 12; diff --git a/lib/logging/addon/components/logging/form-log-format/template.hbs b/lib/logging/addon/components/logging/form-log-format/template.hbs index f5afa1f6d..baa8ea97d 100644 --- a/lib/logging/addon/components/logging/form-log-format/template.hbs +++ b/lib/logging/addon/components/logging/form-log-format/template.hbs @@ -1,40 +1,42 @@
-

{{t 'loggingPage.additional.header'}}

+

{{t "loggingPage.additional.header"}}


- +
-

{{t 'loggingPage.additional.fields.helpText'}}

+

{{t "loggingPage.additional.fields.helpText"}}

{{form-key-value addActionLabel="loggingPage.tags.addActionLabel" initialMap=model.outputTags changed=(action (mut model.outputTags)) }}
- {{#if (not-eq targetType 'customTarget')}} + {{#if (not-eq targetType "customTarget")}}
- +
{{input-integer min=1 value=model.outputFlushInterval class="form-control" - placeholder=(t 'loggingPage.additional.flushInterval.placeholder') + placeholder=(t "loggingPage.additional.flushInterval.placeholder") aria-describedby="basic-addon2" }} - {{t 'loggingPage.additional.flushInterval.sec'}} + {{t "loggingPage.additional.flushInterval.sec"}}
-

{{t 'loggingPage.additional.flushInterval.helpText'}}

+

{{t "loggingPage.additional.flushInterval.helpText"}}

{{/if}} -
- {{input type="checkbox" classNames="form-control" checked=model.includeSystemComponent}} - {{t 'loggingPage.additional.includeSystemComponent.label'}} -
+ {{#if (eq pageScope "cluster")}} +
+ {{input type="checkbox" classNames="form-control" checked=model.includeSystemComponent}} + {{t "loggingPage.additional.includeSystemComponent.label"}} +
+ {{/if}}
diff --git a/lib/logging/translations/zh-hans.yaml b/lib/logging/translations/zh-hans.yaml index 14643993f..4abd3b6cd 100644 --- a/lib/logging/translations/zh-hans.yaml +++ b/lib/logging/translations/zh-hans.yaml @@ -52,6 +52,8 @@ loggingPage: placeholder: '例如: 1' sec: 秒 helpText: 日志刷新频率 + includeSystemComponent: + label: 包含系统日志 elasticsearch: header: Elasticsearch配置