Template Lint

This commit is contained in:
n313893254 2019-08-20 15:01:19 +08:00
parent c48f594c67
commit a5b958e181
4 changed files with 192 additions and 100 deletions

View File

@ -1,86 +1,133 @@
<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">
{{t "loggingPage.endpoint"}}
{{field-required}}
</label>
{{input
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t "loggingPage.endpointPlaceholder")
id="elasticsearch-endpoint"
focus-out=(action "alertMessage")
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t "loggingPage.endpointPlaceholder")
id="elasticsearch-endpoint"
focus-out=(action "alertMessage")
}}
</div>
{{#if endpointError}}
<p class="text-error text-small">{{t endpointErrorText}}</p>
<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">
{{t "loggingPage.elasticsearch.xpack.username"}}
</label>
{{input
type="text"
utocomplete="off"
value=config.authUsername
classNames="form-control"
placeholder=(t "loggingPage.elasticsearch.xpack.usernamePlaceholder")
type="text"
utocomplete="off"
value=config.authUsername
classNames="form-control"
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")
autocomplete="off"
type="password"
value=config.authPassword
classNames="form-control"
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")
}}
type="text"
value=config.indexPrefix
className="form-control"
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 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>
<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>
</div>
</div>
</div>
<div>
{{t "loggingPage.elasticsearch.generatedIndex"
esIndex=esIndex
indexFormat=indexFormat
htmlSafe=true
{{t "loggingPage.elasticsearch.generatedIndex"
esIndex=esIndex
indexFormat=indexFormat
htmlSafe=true
}}
</div>
</section>
</div>
{{logging/form-log-ssl
config=config
targetType=targetType
disabled=(not enableSSLConfig)
config=config
targetType=targetType
disabled=(not enableSSLConfig)
}}
{{logging/form-log-format

View File

@ -1,30 +1,36 @@
<h2 class="mt-30">
{{t "loggingPage.splunk.header"}}
<span class="text-info text-small">
{{t "loggingPage.splunk.helpText" htmlSafe=true}}
{{t "loggingPage.splunk.helpText" htmlSafe=true}}
</span>
</h2>
<hr/>
<section class="box">
<div class="mb-30">
<label class="acc-label" for="">{{t "loggingPage.endpoint"}}{{field-required}}</label>
<label class="acc-label">
{{t "loggingPage.endpoint"}}
{{field-required}}
</label>
{{input
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t "loggingPage.splunk.endpoint.placeholder")
id="splunk-endpoint"
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t "loggingPage.splunk.endpoint.placeholder")
id="splunk-endpoint"
}}
</div>
<div class="row">
<div class="col span-12 mt-0 pt-0">
<label class="acc-label" for="">{{t "loggingPage.splunk.token"}}{{field-required}}</label>
<label class="acc-label">
{{t "loggingPage.splunk.token"}}
{{field-required}}
</label>
{{input
type="text"
value=config.token
classNames="form-control"
placeholder=(t "loggingPage.splunk.tokenPlaceholder")
type="text"
value=config.token
classNames="form-control"
placeholder=(t "loggingPage.splunk.tokenPlaceholder")
}}
<p class="text-info text-small">
{{t "loggingPage.splunk.tokenHelpText" htmlSafe=true}}
@ -33,24 +39,28 @@
</div>
<div class="row">
<div class="col span-6 mt-0 pt-0">
<label class="acc-label" for="">{{t "loggingPage.splunk.source"}}</label>
<label class="acc-label">
{{t "loggingPage.splunk.source"}}
</label>
{{input
type="text"
value=config.source
classNames="form-control"
placeholder=(t "loggingPage.splunk.sourcePlaceholder")
type="text"
value=config.source
classNames="form-control"
placeholder=(t "loggingPage.splunk.sourcePlaceholder")
}}
<p class="text-info text-small">
{{t "loggingPage.splunk.sourceHelpText" htmlSafe=true}}
</p>
</div>
<div class="col span-6 mt-0 pt-0">
<label class="acc-label" for="">{{t "loggingPage.splunk.index"}}</label>
<label class="acc-label">
{{t "loggingPage.splunk.index"}}
</label>
{{input
type="text"
value=config.index
classNames="form-control"
placeholder=(t "loggingPage.splunk.indexPlaceholder")
type="text"
value=config.index
classNames="form-control"
placeholder=(t "loggingPage.splunk.indexPlaceholder")
}}
<p class="text-info text-small">
{{t "loggingPage.splunk.indexHelpText" htmlSafe=true}}
@ -60,14 +70,14 @@
</section>
{{logging/form-log-ssl
config=config
targetType=targetType
disabled=(not enableSSLConfig)
config=config
targetType=targetType
disabled=(not enableSSLConfig)
}}
{{logging/form-log-format
logPreview=logPreview
model=model
logPreview=logPreview
model=model
}}
{{#accordion-list showExpandAll=false as | al expandFn |}}

View File

@ -1,80 +1,114 @@
<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')
id="syslog-endpoint"
type="text"
value=config.endpoint
classNames="form-control"
placeholder=(t "loggingPage.syslog.endpointPlaceholder")
id="syslog-endpoint"
}}
<div class="input-group-btn bg-primary">
{{#basic-dropdown
horizontalPosition="right"
as |dd|}}
{{#dd.trigger class="btn bg-default text-uppercase"}}
<span class="pr-5">{{config.protocol}}</span><i class="icon icon-chevron-down"></i>
<span class="pr-5">
{{config.protocol}}
</span>
<i class="icon icon-chevron-down"></i>
{{/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">
{{t "loggingPage.syslog.program"}}
</label>
{{input
type="text"
value=config.program
classNames="form-control"
placeholder=(t 'loggingPage.syslog.programPlaceholder')
type="text"
value=config.program
classNames="form-control"
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">
{{t "loggingPage.splunk.token"}}
</label>
{{input
type="text"
value=config.token
classNames="form-control"
placeholder=(t 'loggingPage.splunk.tokenPlaceholder')
type="text"
value=config.token
classNames="form-control"
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>
<div>
<span class="mr-10">Log Severity:</span>
<span class="mr-10">
{{t "loggingPage.syslog.logSeverity"}}
</span>
{{#each severities as |item|}}
<label class="mr-10 text-capitalize">
{{radio-button selection=config.severity value=item.value }}
{{radio-button
selection=config.severity
value=item.value
}}
{{t item.label}}
</label>
{{/each}}
{{t 'loggingPage.syslog.severityHelpText' htmlSafe=true}}
{{t "loggingPage.syslog.severityHelpText" htmlSafe=true}}
</div>
</section>
{{logging/form-log-ssl
config=config
targetType=targetType
disabled=(or (not enableSSLConfig) (not config.enableTls))
config=config
targetType=targetType
disabled=(or (not enableSSLConfig) (not config.enableTls))
}}
{{logging/form-log-format logPreview=logPreview model=model}}{{#accordion-list showExpandAll=false as | al expandFn |}}
{{logging/form-log-format
logPreview=logPreview
model=model
}}
{{#accordion-list showExpandAll=false as | al expandFn |}}
{{#accordion-list-item title=(t "loggingPage.multiLine.title")
detail=(t "loggingPage.multiLine.detail")
expandAll=expandAll

View File

@ -137,6 +137,7 @@ loggingPage:
tokenHelpText: Will add a token to the structured data in every syslog message. For cloud syslog such as <a href="https://help.sumologic.com/Send-Data/Sources/02Sources-for-Hosted-Collectors/Cloud-Syslog-Source" target="_blank">Sumologic</a>, <a href="https://www.loggly.com/docs/customer-token-authentication-token" target="_blank">Loggly</a>, etc, you could generate a token on their respective configuration pages.
endpoint:
required: '"Endpoint" is required'
logSeverity: 'Log Severity:'
fluentd:
header: Fluentd Configuration
compress: