datajunction-ui 0.0.1-rc.6 → 0.0.1-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/app/index.tsx
CHANGED
|
@@ -12,13 +12,10 @@ import { NodePage } from './pages/NodePage/Loadable';
|
|
|
12
12
|
import { NotFoundPage } from './pages/NotFoundPage/Loadable';
|
|
13
13
|
import { Root } from './pages/Root/Loadable';
|
|
14
14
|
import { ListNamespacesPage } from './pages/ListNamespacesPage';
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
const DJClientContext = React.createContext({ DataJunctionAPI });
|
|
15
|
+
import DJClientContext from './providers/djclient';
|
|
16
|
+
import {DataJunctionAPI} from "./services/DJService";
|
|
18
17
|
|
|
19
18
|
export function App() {
|
|
20
|
-
const DJClient = React.useContext(DJClientContext);
|
|
21
|
-
|
|
22
19
|
return (
|
|
23
20
|
<BrowserRouter>
|
|
24
21
|
<Helmet
|
|
@@ -30,31 +27,31 @@ export function App() {
|
|
|
30
27
|
content="DataJunction serves as a semantic layer to help manage metrics"
|
|
31
28
|
/>
|
|
32
29
|
</Helmet>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<Route path="
|
|
41
|
-
|
|
30
|
+
<DJClientContext.Provider value={{ DataJunctionAPI }}>
|
|
31
|
+
<Routes>
|
|
32
|
+
<Route
|
|
33
|
+
path="/"
|
|
34
|
+
element={<Root />}
|
|
35
|
+
children={
|
|
36
|
+
<>
|
|
37
|
+
<Route path="nodes" key="nodes">
|
|
38
|
+
<Route path=":name" element={<NodePage />} />
|
|
39
|
+
</Route>
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
<Route path="/" element={<ListNamespacesPage />} key="index" />
|
|
42
|
+
<Route path="namespaces">
|
|
43
|
+
<Route
|
|
44
|
+
path=":namespace"
|
|
45
|
+
element={<NamespacePage />}
|
|
46
|
+
key="namespaces"
|
|
47
|
+
/>
|
|
48
|
+
</Route>
|
|
49
|
+
</>
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
<Route path="*" element={<NotFoundPage />} />
|
|
53
|
+
</Routes>
|
|
54
|
+
</DJClientContext.Provider>
|
|
56
55
|
</BrowserRouter>
|
|
57
56
|
);
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
export { DJClientContext };
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useContext, useEffect, useState } from 'react';
|
|
3
3
|
import NamespaceHeader from '../../components/NamespaceHeader';
|
|
4
4
|
import { DataJunctionAPI } from '../../services/DJService';
|
|
5
|
+
import DJClientContext from '../../providers/djclient';
|
|
5
6
|
// const datajunction = require('datajunction');
|
|
6
7
|
// const dj = new datajunction.DJClient('http://localhost:8000');
|
|
7
8
|
|
|
8
|
-
export function ListNamespacesPage(
|
|
9
|
+
export function ListNamespacesPage() {
|
|
10
|
+
const djClient = useContext(DJClientContext).DataJunctionAPI;
|
|
9
11
|
const [state, setState] = useState({
|
|
10
12
|
namespaces: [],
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
useEffect(() => {
|
|
14
16
|
const fetchData = async () => {
|
|
15
|
-
const namespaces = await djClient.namespaces.get();
|
|
17
|
+
// const namespaces = await djClient.namespaces.get();
|
|
18
|
+
console.log(djClient);
|
|
19
|
+
const namespaces = await djClient.namespaces();
|
|
16
20
|
setState({
|
|
17
21
|
namespaces: namespaces,
|
|
18
22
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useParams } from 'react-router-dom';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { DataJunctionAPI } from '../../services/DJService';
|
|
3
|
+
import { useContext, useEffect, useState } from 'react';
|
|
5
4
|
import NamespaceHeader from '../../components/NamespaceHeader';
|
|
6
5
|
import NodeStatus from '../NodePage/NodeStatus';
|
|
6
|
+
import DJClientContext from '../../providers/djclient';
|
|
7
7
|
|
|
8
|
-
export function NamespacePage(
|
|
8
|
+
export function NamespacePage() {
|
|
9
|
+
const djClient = useContext(DJClientContext).DataJunctionAPI;
|
|
9
10
|
const { namespace } = useParams();
|
|
10
11
|
|
|
11
12
|
const [state, setState] = useState({
|
|
@@ -68,13 +69,15 @@ export function NamespacePage({ djClient = DataJunctionAPI }) {
|
|
|
68
69
|
<div className="table-responsive">
|
|
69
70
|
<table className="card-table table">
|
|
70
71
|
<thead>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
<tr>
|
|
73
|
+
<th>Namespace</th>
|
|
74
|
+
<th>Name</th>
|
|
75
|
+
<th>Type</th>
|
|
76
|
+
<th>Status</th>
|
|
77
|
+
<th>Mode</th>
|
|
78
|
+
</tr>
|
|
76
79
|
</thead>
|
|
77
|
-
{nodesList}
|
|
80
|
+
<tbody>{nodesList}</tbody>
|
|
78
81
|
</table>
|
|
79
82
|
</div>
|
|
80
83
|
</div>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useParams } from 'react-router-dom';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useContext, useEffect, useState } from 'react';
|
|
4
4
|
import Tab from '../../components/Tab';
|
|
5
5
|
import NamespaceHeader from '../../components/NamespaceHeader';
|
|
6
6
|
import NodeInfoTab from './NodeInfoTab';
|
|
7
7
|
import NodeColumnTab from './NodeColumnTab';
|
|
8
8
|
import NodeLineage from './NodeGraphTab';
|
|
9
|
-
import
|
|
9
|
+
import DJClientContext from '../../providers/djclient';
|
|
10
10
|
|
|
11
|
-
export function NodePage(
|
|
11
|
+
export function NodePage() {
|
|
12
|
+
const djClient = useContext(DJClientContext).DataJunctionAPI;
|
|
12
13
|
const [state, setState] = useState({
|
|
13
14
|
selectedTab: 0,
|
|
14
15
|
});
|