Skip to content

Commit

Permalink
Add page titles (#148)
Browse files Browse the repository at this point in the history
Refs #2834
  • Loading branch information
edmundoa authored and bernd committed Dec 14, 2016
1 parent 632ba22 commit 9b4c17a
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 110 deletions.
61 changes: 33 additions & 28 deletions plugin/src/web/pipelines/PipelineDetailsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Reflux from 'reflux';
import { Row, Col, Button } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';

import { PageHeader, Spinner } from 'components/common';
import { DocumentTitle, PageHeader, Spinner } from 'components/common';
import Pipeline from './Pipeline';
import NewPipeline from './NewPipeline';

Expand Down Expand Up @@ -117,34 +117,39 @@ const PipelineDetailsPage = React.createClass({
);
}

const pageTitle = (this._isNewPipeline(this.props.params.pipelineId) ? 'New pipeline' : `Pipeline ${this.state.pipeline.title}`);

return (
<div>
<PageHeader title={title} experimental>
<span>
Pipelines let you transform and process messages coming from streams. Pipelines consist of stages where{' '}
rules are evaluated and applied. Messages can go through one or more stages.
</span>
<span>
After each stage is completed, you can decide if messages matching all or one of the rules continue to the next stage.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
{' '}
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
{content}
</Col>
</Row>
</div>
<DocumentTitle title={pageTitle}>
<div>
<PageHeader title={title} experimental>
<span>
Pipelines let you transform and process messages coming from streams. Pipelines consist of stages where
rules are evaluated and applied. Messages can go through one or more stages.
</span>
<span>
After each stage is completed, you can decide if messages matching all or one of the rules continue to
the next stage.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
{' '}
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
{content}
</Col>
</Row>
</div>
</DocumentTitle>
);
},
});
Expand Down
54 changes: 28 additions & 26 deletions plugin/src/web/pipelines/PipelinesOverviewPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Row, Col, Button } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';

import { PageHeader } from 'components/common';
import { DocumentTitle, PageHeader } from 'components/common';
import DocumentationLink from 'components/support/DocumentationLink';
import ProcessingTimelineComponent from './ProcessingTimelineComponent';

Expand All @@ -12,33 +12,35 @@ import DocsHelper from 'util/DocsHelper';
const PipelinesOverviewPage = React.createClass({
render() {
return (
<div>
<PageHeader title="Pipelines overview" experimental>
<span>
Pipelines let you transform and process messages coming from streams. Pipelines consist of stages where{' '}
rules are evaluated and applied. Messages can go through one or more stages.
</span>
<span>
Read more about Graylog pipelines in the <DocumentationLink page={DocsHelper.PAGES.PIPELINES} text="documentation" />.
</span>
<DocumentTitle title="Pipelines">
<div>
<PageHeader title="Pipelines overview" experimental>
<span>
Pipelines let you transform and process messages coming from streams. Pipelines consist of stages where
rules are evaluated and applied. Messages can go through one or more stages.
</span>
<span>
Read more about Graylog pipelines in the <DocumentationLink page={DocsHelper.PAGES.PIPELINES} text="documentation" />.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_SIMULATE')}>
<Button bsStyle="info">Simulate processing</Button>
</LinkContainer>
&nbsp;
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>
<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_SIMULATE')}>
<Button bsStyle="info">Simulate processing</Button>
</LinkContainer>
&nbsp;
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
<ProcessingTimelineComponent/>
</Col>
</Row>
</div>
<Row className="content">
<Col md={12}>
<ProcessingTimelineComponent/>
</Col>
</Row>
</div>
</DocumentTitle>
);
},
});
Expand Down
10 changes: 7 additions & 3 deletions plugin/src/web/rules/RuleDetailsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Reflux from 'reflux';

import { Spinner } from 'components/common';
import { DocumentTitle, Spinner } from 'components/common';

import Rule from './Rule';
import RulesStore from './RulesStore';
Expand Down Expand Up @@ -56,9 +56,13 @@ const RuleDetailsPage = React.createClass({
return pipeline.stages.some(stage => stage.rules.indexOf(this.state.rule.title) !== -1);
});

const pageTitle = (this.props.params.ruleId === 'new' ? 'New pipeline rule' : `Pipeline rule ${this.state.rule.title}`);

return (
<Rule rule={this.state.rule} usedInPipelines={pipelinesUsingRule} create={this.props.params.ruleId === 'new'}
onSave={this._save} validateRule={this._validateRule} history={this.props.history} />
<DocumentTitle title={pageTitle}>
<Rule rule={this.state.rule} usedInPipelines={pipelinesUsingRule} create={this.props.params.ruleId === 'new'}
onSave={this._save} validateRule={this._validateRule} history={this.props.history} />
</DocumentTitle>
);
},
});
Expand Down
56 changes: 29 additions & 27 deletions plugin/src/web/rules/RulesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LinkContainer } from 'react-router-bootstrap';

import Reflux from 'reflux';

import PageHeader from 'components/common/PageHeader';
import { DocumentTitle, PageHeader } from 'components/common';
import DocumentationLink from 'components/support/DocumentationLink';

import DocsHelper from 'util/DocsHelper';
Expand All @@ -25,33 +25,35 @@ const RulesPage = React.createClass({

render() {
return (
<span>
<PageHeader title="Pipeline Rules" experimental>
<span>
Rules are a way of applying changes to messages in Graylog. A rule consists of a condition and a list of actions.
Graylog evaluates the condition against a message and executes the actions if the condition is satisfied.
</span>

<span>
Read more about Graylog pipeline rules in the <DocumentationLink page={DocsHelper.PAGES.PIPELINE_RULES}
text="documentation" />.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
<RulesComponent rules={this.state.rules}/>
</Col>
</Row>
</span>
<DocumentTitle title="Pipeline rules">
<span>
<PageHeader title="Pipeline Rules" experimental>
<span>
Rules are a way of applying changes to messages in Graylog. A rule consists of a condition and a list of actions.
Graylog evaluates the condition against a message and executes the actions if the condition is satisfied.
</span>

<span>
Read more about Graylog pipeline rules in the <DocumentationLink page={DocsHelper.PAGES.PIPELINE_RULES}
text="documentation" />.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
<RulesComponent rules={this.state.rules}/>
</Col>
</Row>
</span>
</DocumentTitle>
);
},
});

export default RulesPage;
export default RulesPage;
54 changes: 28 additions & 26 deletions plugin/src/web/simulator/SimulatorPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Button, Row, Col } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';

import { PageHeader, Spinner } from 'components/common';
import { DocumentTitle, PageHeader, Spinner } from 'components/common';
import DocumentationLink from 'components/support/DocumentationLink';
import ProcessorSimulator from './ProcessorSimulator';

Expand Down Expand Up @@ -38,33 +38,35 @@ const SimulatorPage = React.createClass({
}

return (
<div>
<PageHeader title="Simulate processing" experimental>
<span>
Processing messages can be complex. Use this page to simulate the result of processing an incoming{' '}
message using your current set of pipelines and rules.
</span>
<span>
Read more about Graylog pipelines in the <DocumentationLink page={DocsHelper.PAGES.PIPELINES} text="documentation" />.
</span>
<DocumentTitle title="Simulate processing">
<div>
<PageHeader title="Simulate processing" experimental>
<span>
Processing messages can be complex. Use this page to simulate the result of processing an incoming
message using your current set of pipelines and rules.
</span>
<span>
Read more about Graylog pipelines in the <DocumentationLink page={DocsHelper.PAGES.PIPELINES} text="documentation" />.
</span>

<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
&nbsp;
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>
<span>
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES')}>
<Button bsStyle="info">Manage pipelines</Button>
</LinkContainer>
&nbsp;
<LinkContainer to={Routes.pluginRoute('SYSTEM_PIPELINES_RULES')}>
<Button bsStyle="info">Manage rules</Button>
</LinkContainer>
</span>
</PageHeader>

<Row className="content">
<Col md={12}>
{content}
</Col>
</Row>
</div>
<Row className="content">
<Col md={12}>
{content}
</Col>
</Row>
</div>
</DocumentTitle>
);
},
});
Expand Down

0 comments on commit 9b4c17a

Please sign in to comment.