Skip to content

Commit

Permalink
Route constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleknighted committed Jun 25, 2019
1 parent f214bcb commit dcda3b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
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.CLOUDWATCH}>CloudWatch</a></li></ul>
</div>
);
};
Expand Down
10 changes: 10 additions & 0 deletions src/web/common/Routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const ROUTES = {
INTEGRATIONS: {
AWS: {
SERVICES: '/integrations/aws',
CLOUDWATCH: '/integrations/aws/cloudwatch',
},
},
};

export default ROUTES;
8 changes: 5 additions & 3 deletions src/web/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import 'webpack-entry';

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

import ROUTES from 'common/Routes';
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, component: AWSCloudWatch },
],
});

Expand Down

0 comments on commit dcda3b0

Please sign in to comment.