Spaces:
Configuration error
Configuration error
zack
commited on
Commit
β’
aa0a829
1
Parent(s):
740a8bd
:sparkles: Update frontend configurations and components
Browse files- frontend/Dockerfile +2 -21
- frontend/package.json +4 -7
- frontend/pages/_app.js +0 -16
- frontend/pages/index.js +1 -1
- frontend/src/App.js +10 -0
- frontend/{components β src/components}/Edges/Custom.js +0 -0
- frontend/{components β src/components}/Edges/CustomLine.js +0 -0
- frontend/{components β src/components}/Modal/importer.js +0 -0
- frontend/{components β src/components}/Navagation/navbar.js +0 -0
- frontend/{components β src/components}/Nodes/Custom.js +0 -0
- frontend/{components β src/components}/ReactFlow/ReactFlowEnv.js +2 -2
- frontend/src/index.js +18 -0
frontend/Dockerfile
CHANGED
@@ -1,23 +1,4 @@
|
|
1 |
-
|
2 |
-
FROM node:alpine
|
3 |
-
|
4 |
-
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
-
|
7 |
-
# Copy package.json and package-lock.json
|
8 |
COPY package*.json ./
|
9 |
-
|
10 |
-
# Install dependencies
|
11 |
-
RUN npm install
|
12 |
-
|
13 |
-
# Copy the rest of your application code
|
14 |
-
COPY . .
|
15 |
-
|
16 |
-
# Build your Next.js application
|
17 |
-
RUN npm run build
|
18 |
-
|
19 |
-
# Expose the port your app runs on
|
20 |
-
EXPOSE 3000
|
21 |
-
|
22 |
-
# Command to run your app
|
23 |
-
CMD ["npm", "start"]
|
|
|
1 |
+
FROM node:16-alpine3.14
|
|
|
|
|
|
|
2 |
WORKDIR /app
|
|
|
|
|
3 |
COPY package*.json ./
|
4 |
+
RUN npm install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frontend/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
"version": "0.1.0",
|
4 |
"private": true,
|
5 |
"dependencies": {
|
@@ -12,7 +12,6 @@
|
|
12 |
"@types/react-dom": "^18.0.6",
|
13 |
"@use-gesture/react": "^10.2.20",
|
14 |
"axios": "^0.27.2",
|
15 |
-
"next": "^14.1.0",
|
16 |
"react": "^18.2.0",
|
17 |
"react-dom": "^18.2.0",
|
18 |
"react-flow-renderer": "^10.3.8",
|
@@ -22,13 +21,11 @@
|
|
22 |
"semantic-ui-css": "^2.4.1",
|
23 |
"semantic-ui-react": "^2.1.3",
|
24 |
"typescript": "^4.8.2",
|
25 |
-
"web-vitals": "^2.1.4"
|
26 |
-
"next-images": "^1.8.1"
|
27 |
},
|
28 |
"scripts": {
|
29 |
-
"
|
30 |
-
"build": "
|
31 |
-
"start": "next start",
|
32 |
"test": "react-scripts test",
|
33 |
"eject": "react-scripts eject"
|
34 |
},
|
|
|
1 |
{
|
2 |
+
"name": "gradio-board",
|
3 |
"version": "0.1.0",
|
4 |
"private": true,
|
5 |
"dependencies": {
|
|
|
12 |
"@types/react-dom": "^18.0.6",
|
13 |
"@use-gesture/react": "^10.2.20",
|
14 |
"axios": "^0.27.2",
|
|
|
15 |
"react": "^18.2.0",
|
16 |
"react-dom": "^18.2.0",
|
17 |
"react-flow-renderer": "^10.3.8",
|
|
|
21 |
"semantic-ui-css": "^2.4.1",
|
22 |
"semantic-ui-react": "^2.1.3",
|
23 |
"typescript": "^4.8.2",
|
24 |
+
"web-vitals": "^2.1.4"
|
|
|
25 |
},
|
26 |
"scripts": {
|
27 |
+
"start": "react-scripts start",
|
28 |
+
"build": "react-scripts build",
|
|
|
29 |
"test": "react-scripts test",
|
30 |
"eject": "react-scripts eject"
|
31 |
},
|
frontend/pages/_app.js
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
import '../src/css/index.css'
|
2 |
-
import '../src/css/dist/output.css'; // Example of a global CSS file
|
3 |
-
import '../src/css/counter.css';
|
4 |
-
import 'semantic-ui-css/semantic.min.css'; // Assuming you're using Semantic UI
|
5 |
-
|
6 |
-
// Your _app.js content;
|
7 |
-
import ReactEnviorment from '../components/ReactFlow/ReactFlowEnv'
|
8 |
-
|
9 |
-
export default function App() {
|
10 |
-
return(
|
11 |
-
<>
|
12 |
-
<ReactEnviorment/>
|
13 |
-
</>
|
14 |
-
|
15 |
-
)
|
16 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frontend/pages/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import React, { useEffect } from 'react';
|
2 |
import ReactDOM from 'react-dom/client';
|
3 |
-
import App from '
|
4 |
import reportWebVitals from '../src/reportWebVitals';
|
5 |
|
6 |
// Function to render the app only on the client-side
|
|
|
1 |
import React, { useEffect } from 'react';
|
2 |
import ReactDOM from 'react-dom/client';
|
3 |
+
import App from '../src/App';
|
4 |
import reportWebVitals from '../src/reportWebVitals';
|
5 |
|
6 |
// Function to render the app only on the client-side
|
frontend/src/App.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ReactEnviorment from './components/ReactFlow/ReactFlowEnv'
|
2 |
+
|
3 |
+
export default function App() {
|
4 |
+
return(
|
5 |
+
<>
|
6 |
+
<ReactEnviorment/>
|
7 |
+
</>
|
8 |
+
|
9 |
+
)
|
10 |
+
};
|
frontend/{components β src/components}/Edges/Custom.js
RENAMED
File without changes
|
frontend/{components β src/components}/Edges/CustomLine.js
RENAMED
File without changes
|
frontend/{components β src/components}/Modal/importer.js
RENAMED
File without changes
|
frontend/{components β src/components}/Navagation/navbar.js
RENAMED
File without changes
|
frontend/{components β src/components}/Nodes/Custom.js
RENAMED
File without changes
|
frontend/{components β src/components}/ReactFlow/ReactFlowEnv.js
RENAMED
@@ -1,4 +1,5 @@
|
|
1 |
import CustomNodeIframe from "../Nodes/Custom.js";
|
|
|
2 |
import ReactFlow, { Background,
|
3 |
applyNodeChanges,
|
4 |
ReactFlowProvider,
|
@@ -12,7 +13,7 @@ import React ,{ useState, useCallback, useRef, useEffect } from 'react';
|
|
12 |
import Navbar from '../Navagation/navbar';
|
13 |
import CustomEdge from '../Edges/Custom'
|
14 |
import CustomLine from "../Edges/CustomLine.js";
|
15 |
-
import { useThemeDetector } from '../../
|
16 |
import {CgMoreVerticalAlt} from 'react-icons/cg'
|
17 |
import {BsFillEraserFill} from 'react-icons/bs'
|
18 |
import {FaRegSave} from 'react-icons/fa'
|
@@ -179,4 +180,3 @@ export default function ReactEnviorment() {
|
|
179 |
</div>
|
180 |
);
|
181 |
}
|
182 |
-
|
|
|
1 |
import CustomNodeIframe from "../Nodes/Custom.js";
|
2 |
+
import '../../css/dist/output.css'
|
3 |
import ReactFlow, { Background,
|
4 |
applyNodeChanges,
|
5 |
ReactFlowProvider,
|
|
|
13 |
import Navbar from '../Navagation/navbar';
|
14 |
import CustomEdge from '../Edges/Custom'
|
15 |
import CustomLine from "../Edges/CustomLine.js";
|
16 |
+
import { useThemeDetector } from '../../helper/visual'
|
17 |
import {CgMoreVerticalAlt} from 'react-icons/cg'
|
18 |
import {BsFillEraserFill} from 'react-icons/bs'
|
19 |
import {FaRegSave} from 'react-icons/fa'
|
|
|
180 |
</div>
|
181 |
);
|
182 |
}
|
|
frontend/src/index.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import ReactDOM from 'react-dom/client';
|
3 |
+
import './css/index.css';
|
4 |
+
import App from './App';
|
5 |
+
//import Navbar from './Components/Navagation/navbar';
|
6 |
+
import reportWebVitals from './reportWebVitals';
|
7 |
+
|
8 |
+
const root = ReactDOM.createRoot(document.getElementById('Gradio-Flow'));
|
9 |
+
root.render(
|
10 |
+
<React.StrictMode>
|
11 |
+
< App/>
|
12 |
+
</React.StrictMode>
|
13 |
+
);
|
14 |
+
|
15 |
+
// If you want to start measuring performance in your app, pass a function
|
16 |
+
// to log results (for example: reportWebVitals(console.log))
|
17 |
+
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
18 |
+
reportWebVitals();
|