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

View File

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

View File

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

View File

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

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/> <hr/>
<section class="box"> <section class="box">
<div class="row"> <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"> <div class="input-group">
{{input {{input
type="text" type="text"
value=config.endpoint value=config.endpoint
classNames="form-control" classNames="form-control"
placeholder=(t 'loggingPage.syslog.endpointPlaceholder') placeholder=(t "loggingPage.syslog.endpointPlaceholder")
id="syslog-endpoint" id="syslog-endpoint"
}} }}
<div class="input-group-btn bg-primary"> <div class="input-group-btn bg-primary">
@ -20,38 +20,38 @@
{{/dd.trigger}} {{/dd.trigger}}
{{#dd.content}} {{#dd.content}}
<li><a {{action "changeProtocol" 'tcp'}}>TCP</a></li> <li><a {{action "changeProtocol" "tcp"}}>TCP</a></li>
<li><a {{action "changeProtocol" 'udp'}}>UDP</a></li> <li><a {{action "changeProtocol" "udp"}}>UDP</a></li>
{{/dd.content}} {{/dd.content}}
{{/basic-dropdown}} {{/basic-dropdown}}
</div> </div>
</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>
<div class="row"> <div class="row">
<div class="col span-6 mt-0 pt-0"> <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 {{input
type="text" type="text"
value=config.program value=config.program
classNames="form-control" 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>
<div class="col span-6 mt-0 pt-0"> <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 {{input
type="text" type="text"
value=config.token value=config.token
classNames="form-control" classNames="form-control"
placeholder=(t 'loggingPage.splunk.tokenPlaceholder') placeholder=(t "loggingPage.splunk.tokenPlaceholder")
}} }}
<p class="text-info text-small"> <p class="text-info text-small">
{{t 'loggingPage.syslog.tokenHelpText' htmlSafe=true}} {{t "loggingPage.syslog.tokenHelpText" htmlSafe=true}}
</p> </p>
</div> </div>
</div> </div>
@ -64,7 +64,7 @@
{{t item.label}} {{t item.label}}
</label> </label>
{{/each}} {{/each}}
{{t 'loggingPage.syslog.severityHelpText' htmlSafe=true}} {{t "loggingPage.syslog.severityHelpText" htmlSafe=true}}
</div> </div>
</section> </section>
@ -74,7 +74,11 @@
disabled=(or (not enableSSLConfig) (not config.enableTls)) 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}} {{#advanced-section advanced=showAdvanced}}
{{logging/form-log-docker model=model parentModel=parentModel}} {{logging/form-log-docker model=model parentModel=parentModel}}