mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-20 16:07:12 +08:00
[add] MainPage
This commit is contained in:
parent
f10f2fb722
commit
bd566285c0
39
custom_nodes/ComfyUI-React-SDK/app/package-lock.json
generated
39
custom_nodes/ComfyUI-React-SDK/app/package-lock.json
generated
@ -25,6 +25,7 @@
|
|||||||
"framer-motion": "^11.0.14",
|
"framer-motion": "^11.0.14",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
"react-router-dom": "^6.24.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
@ -4977,6 +4978,14 @@
|
|||||||
"url": "https://opencollective.com/popperjs"
|
"url": "https://opencollective.com/popperjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@remix-run/router": {
|
||||||
|
"version": "1.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.17.1.tgz",
|
||||||
|
"integrity": "sha512-mCOMec4BKd6BRGBZeSnGiIgwsbLGp3yhVqAD8H+PxiRNEHgDpZb8J1TnrSDlg97t0ySKMQJTHCWBCmBpSmkF6Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rollup/plugin-babel": {
|
"node_modules/@rollup/plugin-babel": {
|
||||||
"version": "5.3.1",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
||||||
@ -16789,6 +16798,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-router": {
|
||||||
|
"version": "6.24.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.24.1.tgz",
|
||||||
|
"integrity": "sha512-PTXFXGK2pyXpHzVo3rR9H7ip4lSPZZc0bHG5CARmj65fTT6qG7sTngmb6lcYu1gf3y/8KxORoy9yn59pGpCnpg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@remix-run/router": "1.17.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/react-router-dom": {
|
||||||
|
"version": "6.24.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.24.1.tgz",
|
||||||
|
"integrity": "sha512-U19KtXqooqw967Vw0Qcn5cOvrX5Ejo9ORmOtJMzYWtCT4/WOfFLIZGGsVLxcd9UkBO0mSTZtXqhZBsWlHr7+Sg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@remix-run/router": "1.17.1",
|
||||||
|
"react-router": "6.24.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.8",
|
||||||
|
"react-dom": ">=16.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-scripts": {
|
"node_modules/react-scripts": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz",
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
"framer-motion": "^11.0.14",
|
"framer-motion": "^11.0.14",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
"react-router-dom": "^6.24.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
|
|||||||
@ -24,10 +24,9 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>소울엑스AI</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<!--
|
<!--
|
||||||
This HTML file is a template.
|
This HTML file is a template.
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Dashboard from './dashboard/dashboard';
|
import Dashboard from './dashboard/dashboard';
|
||||||
import { ComfyProvider } from './comfy/ComfyProvider';
|
import { ComfyProvider } from './comfy/ComfyProvider';
|
||||||
|
import MainPage from './Pages/MainPage';
|
||||||
|
import ToggleColorMode from './dashboard/ToggleColorMode';
|
||||||
|
|
||||||
interface AppProps {
|
interface AppProps {
|
||||||
colorMode: 'light' | 'dark';
|
colorMode: 'light' | 'dark';
|
||||||
@ -11,7 +14,14 @@ interface AppProps {
|
|||||||
const App: React.FC<AppProps> = ({ colorMode, setColorMode }) => {
|
const App: React.FC<AppProps> = ({ colorMode, setColorMode }) => {
|
||||||
return (
|
return (
|
||||||
<ComfyProvider>
|
<ComfyProvider>
|
||||||
<Dashboard colorMode={colorMode} setColorMode={setColorMode} />
|
<Router>
|
||||||
|
<ToggleColorMode colorMode={colorMode} setColorMode={setColorMode} />
|
||||||
|
<Routes>
|
||||||
|
|
||||||
|
<Route path="/root" element={<MainPage />} /> {/* 새로운 페이지 */}
|
||||||
|
<Route path="/dashboard" element={<Dashboard/>} />
|
||||||
|
</Routes>
|
||||||
|
</Router>
|
||||||
</ComfyProvider>
|
</ComfyProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
48
custom_nodes/ComfyUI-React-SDK/app/src/Pages/MainPage.tsx
Normal file
48
custom_nodes/ComfyUI-React-SDK/app/src/Pages/MainPage.tsx
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Box, Button, Typography, Container, Grid, Paper, useTheme } from '@mui/material';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
const MainPage: React.FC = () => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container maxWidth="md" style={{ textAlign: 'center', marginTop: '5vh' }}>
|
||||||
|
<Typography variant="h2" gutterBottom color="textPrimary">
|
||||||
|
Welcome to Soulx's Homepage
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="h5" paragraph color="textPrimary">
|
||||||
|
This is the main entry point of the application. Explore the features below!
|
||||||
|
</Typography>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
component={Link}
|
||||||
|
to="/dashboard"
|
||||||
|
style={{ margin: '20px' }}
|
||||||
|
>
|
||||||
|
Go to Dashboard
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Grid container spacing={4}>
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<Paper elevation={3} style={{ padding: '20px', backgroundColor: theme.palette.background.paper }}>
|
||||||
|
<Typography variant="h5" color="textPrimary">Feature 1</Typography>
|
||||||
|
<Typography variant="body1" color="textPrimary">
|
||||||
|
Description of Feature 1 goes here. This feature is designed to enhance your experience.
|
||||||
|
</Typography>
|
||||||
|
</Paper>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<Paper elevation={3} style={{ padding: '20px', backgroundColor: theme.palette.background.paper }}>
|
||||||
|
<Typography variant="h5" color="textPrimary">Feature 2</Typography>
|
||||||
|
<Typography variant="body1" color="textPrimary">
|
||||||
|
Description of Feature 2 goes here. This feature is user-friendly and efficient.
|
||||||
|
</Typography>
|
||||||
|
</Paper>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MainPage;
|
||||||
@ -17,15 +17,13 @@ import {
|
|||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { Subscribe, UnSubscribe, WS_MESSAGE_TYPE_EXECUTED, WS_MESSAGE_TYPE_PROGRESS } from '../comfy/api';
|
import { Subscribe, UnSubscribe, WS_MESSAGE_TYPE_EXECUTED, WS_MESSAGE_TYPE_PROGRESS } from '../comfy/api';
|
||||||
import { base } from './image';
|
import { base } from './image';
|
||||||
import ToggleColorMode from './ToggleColorMode';
|
|
||||||
import { Image } from '@mui/icons-material';
|
import { Image } from '@mui/icons-material';
|
||||||
|
|
||||||
interface DashboardProps {
|
interface DashboardProps {
|
||||||
colorMode: 'light' | 'dark';
|
|
||||||
setColorMode: React.Dispatch<React.SetStateAction<'light' | 'dark'>>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Dashboard: React.FC<DashboardProps> = ({ colorMode, setColorMode }) => {
|
const Dashboard: React.FC<DashboardProps> = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { queuePrompt, fetchCheckpoints } = useComfy();
|
const { queuePrompt, fetchCheckpoints } = useComfy();
|
||||||
|
|
||||||
@ -102,7 +100,7 @@ const Dashboard: React.FC<DashboardProps> = ({ colorMode, setColorMode }) => {
|
|||||||
|
|
||||||
<Box flex="1" style={{ padding: '20px' }}>
|
<Box flex="1" style={{ padding: '20px' }}>
|
||||||
<Stack direction="column" spacing={6} style={{ marginTop: '5vh' }}>
|
<Stack direction="column" spacing={6} style={{ marginTop: '5vh' }}>
|
||||||
<ToggleColorMode colorMode={colorMode} setColorMode={setColorMode} />
|
|
||||||
<img src='./SoulxLogo.png'/>
|
<img src='./SoulxLogo.png'/>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<Select value={selectedCheckpoint} onChange={(e) => setSelectedCheckpoint(e.target.value)} displayEmpty>
|
<Select value={selectedCheckpoint} onChange={(e) => setSelectedCheckpoint(e.target.value)} displayEmpty>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user