Merge pull request #1657 from lvuch/lv0208

cluster tool changes
This commit is contained in:
Vincent Fiduccia 2018-02-23 18:18:22 -07:00 committed by GitHub
commit d8c41512a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 70 additions and 89 deletions

View File

@ -2,7 +2,7 @@
// Placeholder text color // Placeholder text color
$label-color : $dark-grey !default; $label-color : $dark-grey !default;
$input-color-placeholder : lighten($mid-grey, 5) !default; $input-color-placeholder : lighten($mid-grey, 5) !default;
$input-bg : lighten($light-grey, 2) !default; $input-bg : lighten($light-grey, 5) !default;
$input-bg-hover : $mid-grey !default; $input-bg-hover : $mid-grey !default;
$input-bg-disabled : lighten($mid-grey, 15%) !default; $input-bg-disabled : lighten($mid-grey, 15%) !default;
$input-color : $secondary !default; $input-color : $secondary !default;

View File

@ -1,11 +1,11 @@
.fail-whale { .fail-whale {
background: url('images/login-container-farm.svg') center center no-repeat fixed; background: url('images/login-container-farm.svg') center center no-repeat fixed;
position: fixed; background-size: cover;
background-size: cover; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 0; left: 0;
left: 0; right: 0;
.error { .error {
width: 30%; width: 30%;

View File

@ -8,12 +8,12 @@
<div class="col span-10"> <div class="col span-10">
<div class="row"> <div class="row">
<div class="col span-3"> <div class="col span-2">
<label> <label class="acc-label">
{{radio-button selection=model._targetType value="systemService"}} {{t 'alertPage.targetTypes.systemService'}} {{radio-button selection=model._targetType value="systemService"}} {{t 'alertPage.targetTypes.systemService'}}
</label> </label>
</div> </div>
<div class="col span-8 mt-0"> <div class="col span-9 mt-0">
{{searchable-select {{searchable-select
content=systemServices content=systemServices
class="form-control" class="form-control"
@ -25,15 +25,12 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col span-3"> <div class="col span-2">
<label class="pr-5"> <label class="acc-label">
{{radio-button selection=model._targetType value="normalEvent"}} {{t 'alertPage.newOrEdit.normal'}} {{radio-button selection=model._targetType value="normalEvent"}} {{t 'alertPage.newOrEdit.normal'}}
</label> </label>
<label>
{{radio-button selection=model._targetType value="warningEvent"}} {{t 'alertPage.newOrEdit.warning'}}
</label>
</div> </div>
<div class="col span-8 mt-0"> <div class="col span-9 mt-0">
{{searchable-select {{searchable-select
content=resourceKinds content=resourceKinds
class="form-control" class="form-control"
@ -46,12 +43,12 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col span-3"> <div class="col span-2">
<label> <label class="acc-label">
{{radio-button selection=model._targetType value="node"}} {{t 'alertPage.targetTypes.node'}} {{radio-button selection=model._targetType value="node"}} {{t 'alertPage.targetTypes.node'}}
</label> </label>
</div> </div>
<div class="col span-8 mt-0"> <div class="col span-9 mt-0">
{{searchable-select {{searchable-select
content=resourceMap.nodes content=resourceMap.nodes
class="form-control" class="form-control"
@ -64,12 +61,12 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col span-3"> <div class="col span-2">
<label> <label class="acc-label">
{{radio-button selection=model._targetType value="nodeSelector"}} {{t 'alertPage.targetTypes.nodeSelector'}} {{radio-button selection=model._targetType value="nodeSelector"}} {{t 'alertPage.targetTypes.nodeSelector'}}
</label> </label>
</div> </div>
<div class="col span-8 mt-0"> <div class="col span-9 mt-0">
{{#if (eq model._targetType 'nodeSelector')}} {{#if (eq model._targetType 'nodeSelector')}}
{{form-key-value {{form-key-value
addActionLabel="alertPage.addSelectorLabel" addActionLabel="alertPage.addSelectorLabel"
@ -93,14 +90,14 @@
</div> </div>
<div class="col span-10"> <div class="col span-10">
{{#if (eq model._targetType 'systemService')}} {{#if (eq model._targetType 'systemService')}}
<label class="mr-10 pt-5"> <label class="acc-label">
{{radio-button selection="whatever" value="whatever"}} {{t 'alertPage.newOrEdit.unhealthy'}} {{radio-button selection="whatever" value="whatever"}} {{t 'alertPage.newOrEdit.unhealthy'}}
</label> </label>
{{else if (or (eq model._targetType 'node') (eq model._targetType 'nodeSelector'))}} {{else if (or (eq model._targetType 'node') (eq model._targetType 'nodeSelector'))}}
<label class="mr-10"> <label class="acc-label">
{{radio-button selection=model.targetNode.condition value="notready"}} {{t 'alertPage.newOrEdit.notReady'}} {{radio-button selection=model.targetNode.condition value="notready"}} {{t 'alertPage.newOrEdit.notReady'}}
</label> </label>
<label class="ml-10"> <label class="acc-label">
{{radio-button selection=model.targetNode.condition value="cpu"}} {{t 'alertPage.newOrEdit.cpuUsage'}} {{radio-button selection=model.targetNode.condition value="cpu"}} {{t 'alertPage.newOrEdit.cpuUsage'}}
</label> </label>
<div style="display:inline-block;width:60px;"> <div style="display:inline-block;width:60px;">
@ -135,8 +132,8 @@
{{t 'alertPage.newOrEdit.sendA'}} {{t 'alertPage.newOrEdit.sendA'}}
</div> </div>
<div class="col span-10"> <div class="col span-10">
<label class="mr-10">{{radio-button selection=model.severity value="critical"}} {{t 'alertPage.newOrEdit.critical'}}</label> <label class="acc-label mr-10">{{radio-button selection=model.severity value="critical"}} {{t 'alertPage.newOrEdit.critical'}}</label>
<label class="mr-10">{{radio-button selection=model.severity value="warning"}} {{t 'alertPage.newOrEdit.warning'}}</label> <label class="acc-label mr-10">{{radio-button selection=model.severity value="warning"}} {{t 'alertPage.newOrEdit.warning'}}</label>
<label class="mr-10">{{radio-button selection=model.severity value="info"}} {{t 'alertPage.newOrEdit.info'}}</label> <label class="acc-label mr-10">{{radio-button selection=model.severity value="info"}} {{t 'alertPage.newOrEdit.info'}}</label>
</div> </div>
</section> </section>

View File

@ -1,7 +1,7 @@
<section class="row"> <section class="row">
<div class="col span-1-of-24"> <label class="acc-label col span-1-of-24">
{{if isFirst (t 'alertPage.newOrEdit.to') (t 'alertPage.newOrEdit.and')}} {{if isFirst (t 'alertPage.newOrEdit.to') (t 'alertPage.newOrEdit.and')}}
</div> </label>
<div class="col mt-0 span-9-of-24"> <div class="col mt-0 span-9-of-24">
{{searchable-select {{searchable-select
classNames="text-capitalize" classNames="text-capitalize"

View File

@ -13,7 +13,7 @@
</div> </div>
</div> </div>
<div class="box mt-20"> <div class="">
{{# if (eq pageScope 'cluster')}} {{# if (eq pageScope 'cluster')}}
{{alert/form-cluster-rules {{alert/form-cluster-rules
resourceMap=resourceMap resourceMap=resourceMap

View File

@ -14,12 +14,12 @@ alertPage:
initialWaitHelpText: How long to wait before sending a notification when an alert is triggered. initialWaitHelpText: How long to wait before sending a notification when an alert is triggered.
repeatIntervalHelpText: Repeat interval of sending a notification when an alert is active. repeatIntervalHelpText: Repeat interval of sending a notification when an alert is active.
whenA: When A whenA: When A
happens: HAPPENS happens: Happens
sendA: SEND A sendA: Send a
to: TO to: To
alert: ALERT alert: Alert
is: IS is: Is
and: AND and: And
critical: Critical critical: Critical
addRecipient: Add Recipient addRecipient: Add Recipient
info: Info info: Info

View File

@ -1,14 +1,15 @@
<main class="row mt-20"> <main class="row mt-20">
<div class="col span-6 logging-format"> {{!-- <div class="col span-6 logging-format"> --}}
<h2 class="mt-0">{{t 'loggingPage.logPreview.header'}}</h2> <h2 class="mt-0">{{t 'loggingPage.logPreview.header'}}</h2>
<hr/> <hr/>
{{code-block code=logPreview}} {{code-block code=logPreview}}
</div> {{!-- </div>
<div class="col span-6"> <div class="col span-6"> --}}
<hr class="mt-30 mb-30" />
<h2 class="mt-0">{{t 'loggingPage.additional.header'}}</h2> <h2 class="mt-0">{{t 'loggingPage.additional.header'}}</h2>
<hr/> <hr/>
<section class="box additional-logging-configuration-content"> <section class="additional-logging-configuration-content">
<h4>{{t 'loggingPage.additional.fields.header'}}</h4> <label>{{t 'loggingPage.additional.fields.header'}}</label>
<div class="mb-30"> <div class="mb-30">
<p class="text-info text-small">{{t 'loggingPage.additional.fields.helpText'}}</p> <p class="text-info text-small">{{t 'loggingPage.additional.fields.helpText'}}</p>
{{form-key-value {{form-key-value
@ -17,10 +18,10 @@
changed=(action (mut model.outputTags)) changed=(action (mut model.outputTags))
}} }}
</div> </div>
<h4>{{t 'loggingPage.additional.flushInterval.header'}}</h4> {{!-- <h4>{{t 'loggingPage.additional.flushInterval.header'}}</h4>
<div class="row"> --}} <div class="row">
<div class="col span-8"> <div class="col span-8">
<span class="acc-label">{{t 'loggingPage.additional.flushInterval.label'}}</span> <label class="acc-label">{{t 'loggingPage.additional.flushInterval.label'}}</label>
<div class="input-group"> <div class="input-group">
{{input-integer {{input-integer
min=1 min=1
@ -35,5 +36,5 @@
</div> </div>
</div> </div>
</section> </section>
</div> {{!-- </div> --}}
</main> </main>

View File

@ -1,11 +1,11 @@
<h2 class="mt-30">{{t 'loggingPage.embedded.header'}}</h2> <h2 class="mt-30">{{t 'loggingPage.embedded.header'}}</h2>
<hr/> <hr/>
<section class="box"> <section class="">
<h4>{{t 'loggingPage.embedded.indexPatterns.header'}}</h4> <h4>{{t 'loggingPage.embedded.indexPatterns.header'}}</h4>
<p class="text-info text-small">{{t 'loggingPage.embedded.indexPatterns.helpText'}}</p> <p class="text-info text-small">{{t 'loggingPage.embedded.indexPatterns.helpText'}}</p>
<div class="row">
<div class="col span-6">
<label class="acc-label">{{t 'loggingPage.embedded.indexPatterns.prefix'}}{{field-required}}</label> <label class="acc-label">{{t 'loggingPage.embedded.indexPatterns.prefix'}}{{field-required}}</label>
{{input {{input
type="text" type="text"
@ -13,16 +13,15 @@
className="form-control" className="form-control"
placeholder=(t 'loggingPage.embedded.indexPatterns.prefixPlaceholder') placeholder=(t 'loggingPage.embedded.indexPatterns.prefixPlaceholder')
}} }}
</div>
<div class="col span-6">
<div style="margin-top: 34px;"> <div style="margin-top: 34px;">
<label>{{t 'loggingPage.embedded.indexPatterns.dateFormat'}}</label> <label>{{t 'loggingPage.embedded.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"}} YYY-MMM</label> <label class="mr-10">{{radio-button selection=config.dateFormat value="YYYY-MM"}} YYY-MMM</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>
</div> </div>
</div>
</div>
<div> <div>
{{t 'loggingPage.embedded.generatedIndex' {{t 'loggingPage.embedded.generatedIndex'
esIndex=esIndex esIndex=esIndex
@ -30,5 +29,5 @@
}} }}
</div> </div>
</section> </section>
<hr class="mt-30 mb-30" />
{{logging/form-log-format logPreview=logPreview model=model}} {{logging/form-log-format logPreview=logPreview model=model}}

View File

@ -161,8 +161,18 @@
</div> </div>
{{/if}} {{/if}}
{{#if (eq currentType 'slack')}}
<div class="">
{{t 'notifierPage.slack.helpText' htmlSafe=true}}
</div>
{{/if}}
{{top-errors errors=errors}} {{top-errors errors=errors}}
{{#if (eq currentType 'pagerduty')}}
{{t 'notifierPage.pagerduty.helpText' htmlSafe=true}}
{{/if}}
<div class="over-hr mt-40"> <div class="over-hr mt-40">
<span> <span>
{{#if testing}} {{#if testing}}
@ -196,23 +206,4 @@
<div class="footer-actions"> <div class="footer-actions">
{{save-cancel createLabel=addBtnLabel save="save" cancel="cancel"}} {{save-cancel createLabel=addBtnLabel save="save" cancel="cancel"}}
</div> </div>
{{#if (eq currentType 'slack')}}
<div class="box mt-20">
<h3></h3>
<h3> {{t 'notifierPage.slack.helpTitle'}}</h3>
<ol>
{{t 'notifierPage.slack.helpText' htmlSafe=true}}
</ol>
</div>
{{/if}}
{{#if (eq currentType 'pagerduty')}}
<div class="box mt-20">
<h3> {{t 'notifierPage.pagerduty.helpTitle'}}</h3>
<ol>
{{t 'notifierPage.pagerduty.helpText' htmlSafe=true}}
</ol>
</div>
{{/if}}

View File

@ -170,7 +170,7 @@ function addTicks(svg, tooltip, width, height, margin, ticks, currentValue, thic
svg.append("circle").attr('tick', 'custom').attr("class", `gauge-circle-fill`).attr("cx", point.x).attr("cy", point.y).attr("r", 5); svg.append("circle").attr('tick', 'custom').attr("class", `gauge-circle-fill`).attr("cx", point.x).attr("cy", point.y).attr("r", 5);
svg.append("circle").attr('tick', 'custom').attr("class", `gauge-tick-path`).style("stroke-width", '2').attr("cx", point.x).attr("cy", point.y).attr("r", 8); svg.append("circle").attr('tick', 'custom').attr("class", `gauge-tick-path`).style("stroke-width", '2').attr("cx", point.x).attr("cy", point.y).attr("r", 8);
const rangePath = addArc(svg, width, margin, thickness, 'gauge-tick-path', max, min, 2.5); const rangePath = addArc(svg, width, margin, thickness, 'gauge-tick-path', max, min, 2);
rangePath.attr('tick', 'custom'); rangePath.attr('tick', 'custom');
} }
} }

View File

@ -1339,13 +1339,9 @@ notifierPage:
urlPlaceholder: e.g. https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX urlPlaceholder: e.g. https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
defaultRecipient: Default Recipient (Channel) defaultRecipient: Default Recipient (Channel)
defaultRecipientPlaceholder: 'e.g. #example' defaultRecipientPlaceholder: 'e.g. #example'
helpTitle: Don't know How to create a slack webhook URL?
helpText: | helpText: |
<li><a role="button" class="btn pl-0 btn-sm bg-transparent" target="_blank" rel="nofollow noreferer" href="https://rancher.slack.com/apps/A0F7XDUAZ-incoming-webhooks?page=1">Click here</a>to go to the<span class="text-muted ml-10 mr-10">Incoming WebHooks</span>page. If you haven't logined yet, please login first.</li> Here's how you <a href="https://get.slack.help/hc/en-us/articles/115005265063-Incoming-WebHooks-for-Slack">create incoming WebHooks</a> for slack.
<li>After logined, click the left<span class="text-muted ml-10 mr-10">Add Configuration</span>button to enter the<span class="text-muted ml-10 mr-10">New configuration</span>page.</li>
<li>At the bottom of the<span class="text-muted ml-10 mr-10">New configuration</span>page, choose a existing channel from the dropdown input box or click the <span class="text-muted ml-10 mr-10">create a new channel</span> link to create a new channel.</li>
<li>With a channel selected, click the<span class="text-muted ml-10 mr-10">Add Incomming WebHooks Intergration</span>button to generate a Webhook URL. The generated Webhook URL looks like: <code class="ml-10 mr-10">https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX</code></li>
<li>Copy the generated Webhook URL, paste it in the above input box and then click the save button.</li>
smtp: smtp:
server: Smtp Server server: Smtp Server
host: Host host: Host
@ -1361,19 +1357,16 @@ notifierPage:
pagerduty: pagerduty:
serviceKey: Service Key serviceKey: Service Key
serviceKeyPlaceholder: Your pagerduty serviceKey serviceKeyPlaceholder: Your pagerduty serviceKey
helpTitle: Don't know How to create a Pagerduty service key?
helpText: | helpText: |
<li>Click <a role="button" class="btn pl-0 btn-sm bg-transparent" target="_blank" rel="nofollow noreferer" href="https://www.pagerduty.com">here</a>to go to the pagerduty website. If you haven't logined yet, please login first.</li> Here's how you <a href="https://support.pagerduty.com/docs/webhooks">create incoming WebHooks</a> for slack.
<li>After logined, navigate to<span class="text-muted ml-10 mr-10">Configuration > Service</span>to go to the Services pages.</li>
<li>If you want to use existing service, go to the detail page. If you want to create a new service, Click<span class="text-muted ml-10 mr-10">Add New Service</span></li>
<li>In the detailed service page, you can click<span class="text-muted ml-10 mr-10">New Integration</span>to add new key or use the key for existing integration.</li>
webhook: webhook:
url: URL url: URL
urlPlaceholder: Your webhook URL urlPlaceholder: Your webhook URL
testAction: testAction:
testing: TESTING testing: TESTING
testOk: OK! testOk: Please check your chosen application for the notifier.
testFailed: NO! testFailed: Something's not quite right. Check your inputs.
test: TEST test: TEST
clone: Clone clone: Clone
index: index: