Skip to content

Commit

Permalink
Route constants (#111)
Browse files Browse the repository at this point in the history
* Route constants

* Fixing conflicts

* Simple Clickthrough without API

Convert to Input

Clickable Skeleton All Steps

Cleanup Yarn

Route constants

Fixing conflicts

* Correct import path

* Changing route object

* Adjust Kinesis setup wording

* Remove the unneeded

* Fixing up rebase artifacts from squash of irrelevant commits
  • Loading branch information
kyleknighted authored and Dan Torrey committed Jul 2, 2019
1 parent 0c81d91 commit 27f54be
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/web/aws-cloudwatch/KinesisStreams.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { Button, Col, Row } from 'react-bootstrap';

import { Input } from 'components/bootstrap';
import FormAdvancedOptions from './FormAdvancedOptions';
import Routes from '../common/Routes';

const KinesisStreams = ({ onChange, onSubmit, values, toggleAdvancedOptions, visibleAdvancedOptions }) => {
return (
<Row>
<Col md={8}>
<form onSubmit={onSubmit}>
<h2>Choose Kinesis Stream</h2>
<p>Below is a list of all the Streams we found configured within Kinesis. Please choose the Stream you would like us to parse, or follow the directions to begin <a href="/aws/cloudwatch/kinesis-setup">setting up your CloudWatch Group</a> to feed into a new Kinesis Stream.</p>
<p>Below is a list of all Kinesis Streams found within the specified AWS account. Please choose the Stream you would like us to read messages from, or follow the directions to begin <a href={Routes.INTEGRATIONS.AWS.CLOUDWATCH.step('kinesis-setup')}>setting up your CloudWatch Log Group</a> to feed messages into a new Kinesis Stream.</p>

<Input id="awsCloudWatchKinesisStream"
type="select"
Expand Down
4 changes: 3 additions & 1 deletion src/web/aws/Services.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';

import Routes from '../common/Routes';

const Services = () => {
return (
<div>
List of Services.

<ul><li><a href="/aws/cloudwatch">CloudWatch</a></li></ul>
<ul><li><a href={Routes.INTEGRATIONS.AWS.CLOUDWATCH.index}>CloudWatch</a></li></ul>
</div>
);
};
Expand Down
13 changes: 13 additions & 0 deletions src/web/common/Routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Routes = {
INTEGRATIONS: {
AWS: {
SERVICES: '/integrations/aws',
CLOUDWATCH: {
index: '/integrations/aws/cloudwatch',
step: step => `/integrations/aws/cloudwatch/${step}`,
},
},
},
};

export default Routes;
9 changes: 6 additions & 3 deletions src/web/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import 'webpack-entry';

import { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin';

import Routes from 'common/Routes.js';

import AWSServices from './aws/Services';
import AWSCloudWatch from './aws-cloudwatch/CloudWatch';

import packageJson from '../../package.json';

const manifest = new PluginManifest(packageJson, {
routes: [
{ path: '/aws', component: AWSServices },
{ path: '/aws/cloudwatch', component: AWSCloudWatch },
{ path: '/aws/cloudwatch/:step', component: AWSCloudWatch },
{ path: Routes.INTEGRATIONS.AWS.SERVICES, component: AWSServices },
{ path: Routes.INTEGRATIONS.AWS.CLOUDWATCH.index, component: AWSCloudWatch },
{ path: Routes.INTEGRATIONS.AWS.CLOUDWATCH.step(':step'), component: AWSCloudWatch },
],
});

Expand Down

0 comments on commit 27f54be

Please sign in to comment.