Pass logging config down to logging targets for json parsing

rancher/rancher#24367
This commit is contained in:
Westly Wright 2019-12-16 11:22:26 -07:00
parent fcaaa0f53c
commit 004a9286ee
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
6 changed files with 184 additions and 173 deletions

View File

@ -61,7 +61,7 @@
@type="checkbox"
class="form-control"
id="enable-json-parsing"
@checked={{model.enableJSONParsing}}
@checked={{loggingModel.enableJSONParsing}}
/>
{{t "loggingPage.additional.jsonParsing.label"}}
</label>

View File

@ -1,14 +1,14 @@
<h2 class="mt-30">{{t 'loggingPage.elasticsearch.header'}}</h2>
<h2 class="mt-30">{{t "loggingPage.elasticsearch.header"}}</h2>
<hr/>
<div class="box">
<section class="mb-30">
<div>
<label class="acc-label" for="">{{t 'loggingPage.endpoint'}}{{field-required}}</label>
<label class="acc-label" for="">{{t "loggingPage.endpoint"}}{{field-required}}</label>
{{input
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t 'loggingPage.endpointPlaceholder')
placeholder=(t "loggingPage.endpointPlaceholder")
id="elasticsearch-endpoint"
focus-out=(action "alertMessage")
}}
@ -16,51 +16,51 @@
{{#if endpointError}}
<p class="text-error text-small">{{t endpointErrorText}}</p>
{{else}}
<p class="text-info text-small">{{t 'loggingPage.elasticsearch.endpointHelpText'}}</p>
<p class="text-info text-small">{{t "loggingPage.elasticsearch.endpointHelpText"}}</p>
{{/if}}
</section>
<h4>{{t 'loggingPage.elasticsearch.xpack.header'}} <span class="text-muted">{{t 'loggingPage.elasticsearch.xpack.headerOptional'}}</span></h4>
<h4>{{t "loggingPage.elasticsearch.xpack.header"}} <span class="text-muted">{{t "loggingPage.elasticsearch.xpack.headerOptional"}}</span></h4>
<section>
<p class="text-info text-small"> {{t 'loggingPage.elasticsearch.xpack.helpText'}} </p>
<p class="text-info text-small"> {{t "loggingPage.elasticsearch.xpack.helpText"}} </p>
<div class="row">
<div class="col span-6">
<label class="acc-label" for=""> {{t 'loggingPage.elasticsearch.xpack.username'}} </label>
<label class="acc-label" for=""> {{t "loggingPage.elasticsearch.xpack.username"}} </label>
{{input
type="text"
utocomplete="off"
value=config.authUsername
classNames="form-control"
placeholder=(t 'loggingPage.elasticsearch.xpack.usernamePlaceholder')
placeholder=(t "loggingPage.elasticsearch.xpack.usernamePlaceholder")
}}
</div>
<div class="col span-6">
<label class="acc-label"> {{t 'loggingPage.elasticsearch.xpack.password'}} </label>
<label class="acc-label"> {{t "loggingPage.elasticsearch.xpack.password"}} </label>
{{input
utocomplete="off"
type="password"
value=config.authPassword
classNames="form-control"
placeholder=(t 'loggingPage.elasticsearch.xpack.passwordPlaceholder')
placeholder=(t "loggingPage.elasticsearch.xpack.passwordPlaceholder")
}}
</div>
</div>
</section>
<h4 class="mt-20">{{t 'loggingPage.elasticsearch.indexPatterns.header'}}</h4>
<p class="text-info text-small">{{t 'loggingPage.elasticsearch.indexPatterns.helpText'}}</p>
<h4 class="mt-20">{{t "loggingPage.elasticsearch.indexPatterns.header"}}</h4>
<p class="text-info text-small">{{t "loggingPage.elasticsearch.indexPatterns.helpText"}}</p>
<section>
<div class="row">
<div class="col span-6">
<label class="acc-label">{{t 'loggingPage.elasticsearch.indexPatterns.prefix'}}{{field-required}}</label>
<label class="acc-label">{{t "loggingPage.elasticsearch.indexPatterns.prefix"}}{{field-required}}</label>
{{input
type="text"
value=config.indexPrefix
className="form-control"
placeholder=(t 'loggingPage.elasticsearch.indexPatterns.prefixPlaceholder')
placeholder=(t "loggingPage.elasticsearch.indexPatterns.prefixPlaceholder")
}}
</div>
<div class="col span-6">
<div style="margin-top: 34px;">
<label>{{t 'loggingPage.elasticsearch.indexPatterns.dateFormat'}}</label>
<label>{{t "loggingPage.elasticsearch.indexPatterns.dateFormat"}}</label>
<label class="mr-10">{{radio-button selection=config.dateFormat value="YYYY-MM-DD"}} YYYY-MM-DD</label>
<label class="mr-10">{{radio-button selection=config.dateFormat value="YYYY-MM"}} YYYY-MM</label>
<label class="mr-10">{{radio-button selection=config.dateFormat value="YYYY"}} YYYY</label>
@ -68,7 +68,7 @@
</div>
</div>
<div>
{{t 'loggingPage.elasticsearch.generatedIndex'
{{t "loggingPage.elasticsearch.generatedIndex"
esIndex=esIndex
indexFormat=indexFormat
htmlSafe=true
@ -84,8 +84,12 @@
disabled=(not enableSSLConfig)
}}
{{logging/form-log-format logPreview=logPreview model=model}}
{{logging/form-log-format
logPreview=logPreview
model=model
loggingModel=parentModel
}}
{{!--
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}

View File

@ -148,4 +148,5 @@
{{logging/form-log-format
logPreview=logPreview
model=model
loggingModel=parentModel
}}

View File

@ -126,8 +126,9 @@
{{logging/form-log-format
logPreview=logPreview
model=model
loggingModel=parentModel
}}
{{!--
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}

View File

@ -68,8 +68,9 @@
{{logging/form-log-format
logPreview=logPreview
model=model
loggingModel=parentModel
}}
{{!--
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}

View File

@ -1,14 +1,14 @@
<h2 class="mt-30">{{t 'loggingPage.syslog.header'}}</h2>
<h2 class="mt-30">{{t "loggingPage.syslog.header"}}</h2>
<hr/>
<section class="box">
<div class="row">
<label class="acc-label">{{t 'loggingPage.endpoint'}}{{field-required}}</label>
<label class="acc-label">{{t "loggingPage.endpoint"}}{{field-required}}</label>
<div class="input-group">
{{input
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t 'loggingPage.syslog.endpointPlaceholder')
placeholder=(t "loggingPage.syslog.endpointPlaceholder")
id="syslog-endpoint"
}}
<div class="input-group-btn bg-primary">
@ -20,38 +20,38 @@
{{/dd.trigger}}
{{#dd.content}}
<li><a {{action "changeProtocol" 'tcp'}}>TCP</a></li>
<li><a {{action "changeProtocol" 'udp'}}>UDP</a></li>
<li><a {{action "changeProtocol" "tcp"}}>TCP</a></li>
<li><a {{action "changeProtocol" "udp"}}>UDP</a></li>
{{/dd.content}}
{{/basic-dropdown}}
</div>
</div>
<p class="text-info text-small mb-0">{{t 'loggingPage.syslog.endpointHelpText'}}</p>
<p class="text-info text-small mb-0">{{t "loggingPage.syslog.endpointHelpText"}}</p>
</div>
<div class="row">
<div class="col span-6 mt-0 pt-0">
<label class="acc-label" for="">{{t 'loggingPage.syslog.program'}}</label>
<label class="acc-label" for="">{{t "loggingPage.syslog.program"}}</label>
{{input
type="text"
value=config.program
classNames="form-control"
placeholder=(t 'loggingPage.syslog.programPlaceholder')
placeholder=(t "loggingPage.syslog.programPlaceholder")
}}
<p class="text-info text-small">{{t 'loggingPage.syslog.programHelpText'}}</p>
<p class="text-info text-small">{{t "loggingPage.syslog.programHelpText"}}</p>
</div>
<div class="col span-6 mt-0 pt-0">
<label class="acc-label" for="">{{t 'loggingPage.splunk.token'}}</label>
<label class="acc-label" for="">{{t "loggingPage.splunk.token"}}</label>
{{input
type="text"
value=config.token
classNames="form-control"
placeholder=(t 'loggingPage.splunk.tokenPlaceholder')
placeholder=(t "loggingPage.splunk.tokenPlaceholder")
}}
<p class="text-info text-small">
{{t 'loggingPage.syslog.tokenHelpText' htmlSafe=true}}
{{t "loggingPage.syslog.tokenHelpText" htmlSafe=true}}
</p>
</div>
</div>
@ -64,7 +64,7 @@
{{t item.label}}
</label>
{{/each}}
{{t 'loggingPage.syslog.severityHelpText' htmlSafe=true}}
{{t "loggingPage.syslog.severityHelpText" htmlSafe=true}}
</div>
</section>
@ -74,8 +74,12 @@
disabled=(or (not enableSSLConfig) (not config.enableTls))
}}
{{logging/form-log-format logPreview=logPreview model=model}}
{{logging/form-log-format
logPreview=logPreview
model=model
loggingModel=parentModel
}}
{{!--
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}
{{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}}
{{/advanced-section}} --}}