diff --git a/ui/src/sources/components/InfluxTable.js b/ui/src/sources/components/InfluxTable.js
new file mode 100644
index 000000000..8f24d7f03
--- /dev/null
+++ b/ui/src/sources/components/InfluxTable.js
@@ -0,0 +1,81 @@
+import React, {PropTypes} from 'react'
+import {Link} from 'react-router'
+
+const InfluxTable = ({
+ sources,
+ source,
+ handleDeleteSource,
+ kapacitors,
+ location,
+}) => (
+
+
+
+
+
+
InfluxDB Sources
+ Add New Source
+
+
+
+
+
+
+ Name |
+ Host |
+ Kapacitor |
+ |
+
+
+
+ {
+ sources.map((s) => {
+ const kapacitorName = kapacitors[s.id] ? kapacitors[s.id].name : ''
+ return (
+
+ {s.name}{s.default ? Default : null} |
+ {s.url} |
+ {kapacitorName ? kapacitorName : "--"} |
+
+
+ Connect
+
+ |
+
+ )
+ })
+ }
+
+
+
+
+
+
+
+)
+
+const {
+ array,
+ func,
+ object,
+ shape,
+ string,
+} = PropTypes
+
+InfluxTable.propTypes = {
+ sources: array.isRequired,
+ kapacitors: object,
+ location: shape({
+ pathname: string.isRequired,
+ }).isRequired,
+ handleDeleteSource: func.isRequired,
+ source: shape({
+ id: string.isRequired,
+ links: shape({
+ proxy: string.isRequired,
+ self: string.isRequired,
+ }),
+ }),
+}
+
+export default InfluxTable
diff --git a/ui/src/sources/containers/ManageSources.js b/ui/src/sources/containers/ManageSources.js
index 715afb06f..d5108c964 100644
--- a/ui/src/sources/containers/ManageSources.js
+++ b/ui/src/sources/containers/ManageSources.js
@@ -1,9 +1,11 @@
import React, {PropTypes} from 'react'
-import {withRouter, Link} from 'react-router'
+import {withRouter} from 'react-router'
import {getKapacitor} from 'shared/apis'
import {removeAndLoadSources} from 'src/shared/actions/sources'
import {connect} from 'react-redux'
+import InfluxTable from '../components/InfluxTable'
+
const {
array,
func,
@@ -59,67 +61,28 @@ export const ManageSources = React.createClass({
},
render() {
+ // probably should move kapacitors to props and use redux store
const {kapacitors} = this.state
- const {sources} = this.props
- const {pathname} = this.props.location
- const numSources = sources.length
- const sourcesTitle = `${numSources} ${numSources === 1 ? 'Source' : 'Sources'}`
+ const {sources, source, location} = this.props
return (
-
InfluxDB Sources
+ Configuration
-
-
-
-
-
-
{sourcesTitle}
- Add New Source
-
-
-
-
-
-
- Name |
- Host |
- Kapacitor |
- |
-
-
-
- {
- sources.map((source) => {
- const kapacitorName = kapacitors[source.id] ? kapacitors[source.id].name : ''
- return (
-
- {source.name}{source.default ? Default : null} |
- {source.url} |
- {kapacitorName ? kapacitorName : "--"} |
-
-
- Connect
-
- |
-
- )
- })
- }
-
-
-
-
-
-
-
+