diff --git a/client/package.json b/client/package.json
index ed1cd8ff..87eafd6d 100644
--- a/client/package.json
+++ b/client/package.json
@@ -20,7 +20,8 @@
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
- "react-i18next": "^4.1.0"
+ "react-i18next": "^4.1.0",
+ "react-router-dom": "^4.1.1"
},
"devDependencies": {
"babel-cli": "^6.24.1",
diff --git a/client/src/namespaces.js b/client/src/namespaces.js
index b379d854..7959d7fe 100644
--- a/client/src/namespaces.js
+++ b/client/src/namespaces.js
@@ -1,122 +1,86 @@
-'use strict';
-
-import ReactDOM from 'react-dom';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import jQuery from 'jquery';
-import '../public/jquery/jquery-ui-1.12.1.min.js';
-import '../public/fancytree/jquery.fancytree-all.min.js';
-import '../public/fancytree/skin-bootstrap/ui.fancytree.min.css';
-
-import { I18nextProvider, translate } from 'react-i18next';
-import i18n from './i18n';
-
-class TestTreeTable extends Component {
- constructor(props) {
- super(props);
-
- this.state = {
- treeData: [
- {title: 'A', key: '1', expanded: true},
- {title: 'B', key: '2', expanded: true, folder: true, children: [
- {title: 'BA', key: '3', expanded: true, folder: true, children: [
- {title: 'BAA', key: '4', expanded: true},
- {title: 'BAB', key: '5', expanded: true}
- ]},
- {title: 'BB', key: '6', expanded: true, folder: true, children: [
- {title: 'BBA', key: '7', expanded: true},
- {title: 'BBB', key: '8', expanded: true}
- ]}
- ]}
- ]
- };
- }
-
- componentDidMount() {
- const glyphOpts = {
- map: {
- expanderClosed: 'glyphicon glyphicon-menu-right',
- expanderLazy: 'glyphicon glyphicon-menu-right', // glyphicon-plus-sign
- expanderOpen: 'glyphicon glyphicon-menu-down', // glyphicon-collapse-down
- }
- };
-
- this.tree = jQuery(this.domTable).fancytree({
- extensions: ['glyph', 'table'],
- glyph: glyphOpts,
- selectMode: 1,
- icon: false,
- autoScroll: true,
- scrollParent: jQuery(this.domTableContainer),
- source: this.state.treeData,
- table: {
- nodeColumnIdx: 0
- }
- });
- }
-
- componentDidUpdate() {
- this.tree.reload(this.state.treeData);
- }
-
- render() {
- const container =
-
{ this.domTableContainer = domElem; }} style={{ height: '100px', overflow: 'auto'}}>
-
{ this.domTable = domElem; }} className="table table-hover table-striped table-condensed">
-
-
- Name |
- B |
-
-
-
-
- |
- |
-
-
-
-
;
-
- return (
- container
- );
- }
-
-}
-
-@translate()
-class Namespaces extends Component {
- render() {
- const t = this.props.t;
-
- return (
-
-
- - {t('Home')}
- - {t('Namespaces')}
-
-
-
-
-
{t('Namespaces')}
-
-
-
-
-
- );
- }
-}
-
-export default function() {
- ReactDOM.render(
- ,
- document.getElementById('root')
- );
-};
-
-
+'use strict';
+
+import ReactDOM from 'react-dom';
+import React, { Component } from 'react';
+import {
+ BrowserRouter as Router,
+ Route,
+ Link
+} from 'react-router-dom'
+
+import { I18nextProvider, translate } from 'react-i18next';
+import i18n from './i18n';
+
+import NamespacesTreeTable from './namespaces/NamespacesTreeTable';
+
+
+@translate()
+class List extends Component {
+ render() {
+ console.log(this.props);
+ console.log(this.props.routes);
+ const t = this.props.t;
+
+ return (
+
+
{t('Namespaces')}
+
+
+
+
+
+ );
+ }
+}
+
+
+@translate()
+class Create extends Component {
+ render() {
+ console.log(this.props);
+ console.log(this.props.routes);
+ const t = this.props.t;
+ return (
+
+
{t('Create Namespace')}
+
+
+
+ );
+ }
+}
+
+
+@translate()
+class Namespaces extends Component {
+ render() {
+ const t = this.props.t;
+
+ return (
+
+
+
+ - {t('Home')}
+ - {t('Namespaces')}
+
+
+
+ {t('Create Namespace')}
+
+
+
+
+
+
+ );
+ }
+}
+
+export default function() {
+ ReactDOM.render(
+ ,
+ document.getElementById('root')
+ );
+};
+
+
diff --git a/client/src/namespaces/NamespacesTreeTable.js b/client/src/namespaces/NamespacesTreeTable.js
new file mode 100644
index 00000000..7de1c471
--- /dev/null
+++ b/client/src/namespaces/NamespacesTreeTable.js
@@ -0,0 +1,86 @@
+'use strict';
+
+import React, { Component } from 'react';
+import { translate } from 'react-i18next';
+
+import jQuery from 'jquery';
+import '../../public/jquery/jquery-ui-1.12.1.min.js';
+import '../../public/fancytree/jquery.fancytree-all.min.js';
+import '../../public/fancytree/skin-bootstrap/ui.fancytree.min.css';
+
+translate();
+class NamespacesTreeTable extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ treeData: [
+ {title: 'A', key: '1', expanded: true},
+ {title: 'B', key: '2', expanded: true, folder: true, children: [
+ {title: 'BA', key: '3', expanded: true, folder: true, children: [
+ {title: 'BAA', key: '4', expanded: true},
+ {title: 'BAB', key: '5', expanded: true}
+ ]},
+ {title: 'BB', key: '6', expanded: true, folder: true, children: [
+ {title: 'BBA', key: '7', expanded: true},
+ {title: 'BBB', key: '8', expanded: true}
+ ]}
+ ]}
+ ]
+ };
+ }
+
+ componentDidMount() {
+ const glyphOpts = {
+ map: {
+ expanderClosed: 'glyphicon glyphicon-menu-right',
+ expanderLazy: 'glyphicon glyphicon-menu-right', // glyphicon-plus-sign
+ expanderOpen: 'glyphicon glyphicon-menu-down', // glyphicon-collapse-down
+ }
+ };
+
+ this.tree = jQuery(this.domTable).fancytree({
+ extensions: ['glyph', 'table'],
+ glyph: glyphOpts,
+ selectMode: 1,
+ icon: false,
+ autoScroll: true,
+ scrollParent: jQuery(this.domTableContainer),
+ source: this.state.treeData,
+ table: {
+ nodeColumnIdx: 0
+ }
+ });
+ }
+
+ componentDidUpdate() {
+ this.tree.reload(this.state.treeData);
+ }
+
+ render() {
+ const container =
+ { this.domTableContainer = domElem; }} style={{ height: '100px', overflow: 'auto'}}>
+
{ this.domTable = domElem; }} className="table table-hover table-striped table-condensed">
+
+
+ Name |
+ B |
+
+
+
+
+ |
+ |
+
+
+
+
;
+
+ return (
+ container
+ );
+ }
+
+}
+
+export default NamespacesTreeTable;
\ No newline at end of file