Implemented Material UI Icons throughout GUI
This commit is contained in:
parent
f9766478b0
commit
feed26da98
@ -26,6 +26,23 @@ import Tooltip from "@mui/material/Tooltip";
|
|||||||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||||
|
|
||||||
|
// Icons for Sidebar Workflow Buttons
|
||||||
|
import SaveIcon from "@mui/icons-material/Save";
|
||||||
|
import FileOpenIcon from "@mui/icons-material/FileOpen";
|
||||||
|
import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
|
||||||
|
|
||||||
|
// Info Icon for About Menu
|
||||||
|
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
|
||||||
|
|
||||||
|
// Node Icon (Left-Side of Each Node in Sidebar Menu)
|
||||||
|
import PolylineIcon from "@mui/icons-material/Polyline";
|
||||||
|
|
||||||
|
// Gitea Project Icon
|
||||||
|
import MergeTypeIcon from "@mui/icons-material/MergeType";
|
||||||
|
|
||||||
|
// Credits Icon
|
||||||
|
import PeopleIcon from "@mui/icons-material/People";
|
||||||
|
|
||||||
import ReactFlow, {
|
import ReactFlow, {
|
||||||
Background,
|
Background,
|
||||||
addEdge,
|
addEdge,
|
||||||
@ -86,7 +103,7 @@ function FlowEditor({ nodes, edges, setNodes, setEdges, nodeTypes }) {
|
|||||||
position,
|
position,
|
||||||
data: {
|
data: {
|
||||||
label: nodeMeta?.label || type,
|
label: nodeMeta?.label || type,
|
||||||
content: nodeMeta?.defaultContent
|
content: nodeMeta?.content
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,6 +204,7 @@ export default function App() {
|
|||||||
const [nodes, setNodes] = useState([]);
|
const [nodes, setNodes] = useState([]);
|
||||||
const [edges, setEdges] = useState([]);
|
const [edges, setEdges] = useState([]);
|
||||||
const [confirmCloseOpen, setConfirmCloseOpen] = useState(false);
|
const [confirmCloseOpen, setConfirmCloseOpen] = useState(false);
|
||||||
|
const [creditsDialogOpen, setCreditsDialogOpen] = useState(false);
|
||||||
const fileInputRef = useRef(null);
|
const fileInputRef = useRef(null);
|
||||||
|
|
||||||
const handleAboutMenuOpen = (event) => setAboutAnchorEl(event.currentTarget);
|
const handleAboutMenuOpen = (event) => setAboutAnchorEl(event.currentTarget);
|
||||||
@ -266,16 +284,34 @@ export default function App() {
|
|||||||
color="inherit"
|
color="inherit"
|
||||||
onClick={handleAboutMenuOpen}
|
onClick={handleAboutMenuOpen}
|
||||||
endIcon={<KeyboardArrowDownIcon />}
|
endIcon={<KeyboardArrowDownIcon />}
|
||||||
|
startIcon={<InfoOutlinedIcon />}
|
||||||
>
|
>
|
||||||
About
|
About
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Menu
|
<Menu
|
||||||
anchorEl={aboutAnchorEl}
|
anchorEl={aboutAnchorEl}
|
||||||
open={Boolean(aboutAnchorEl)}
|
open={Boolean(aboutAnchorEl)}
|
||||||
onClose={handleAboutMenuClose}
|
onClose={handleAboutMenuClose}
|
||||||
>
|
>
|
||||||
<MenuItem onClick={handleAboutMenuClose}>Gitea Project</MenuItem>
|
<MenuItem
|
||||||
<MenuItem onClick={handleAboutMenuClose}>Credits</MenuItem>
|
onClick={() => {
|
||||||
|
handleAboutMenuClose();
|
||||||
|
window.open("https://git.bunny-lab.io/Borealis", "_blank");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MergeTypeIcon sx={{ fontSize: 18, color: "#58a6ff", mr: 1 }} />
|
||||||
|
Gitea Project
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
handleAboutMenuClose();
|
||||||
|
setCreditsDialogOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PeopleIcon sx={{ fontSize: 18, color: "#58a6ff", mr: 1 }} />
|
||||||
|
Credits
|
||||||
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
@ -288,9 +324,15 @@ export default function App() {
|
|||||||
<Typography align="left" sx={{ fontSize: "0.9rem", color: "#0475c2" }}><b>Workflows</b></Typography>
|
<Typography align="left" sx={{ fontSize: "0.9rem", color: "#0475c2" }}><b>Workflows</b></Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails sx={{ p: 0, bgcolor: "#232323" }}>
|
<AccordionDetails sx={{ p: 0, bgcolor: "#232323" }}>
|
||||||
<Button fullWidth sx={sidebarBtnStyle} onClick={handleSaveWorkflow}>SAVE WORKFLOW</Button>
|
<Button fullWidth startIcon={<SaveIcon />} sx={sidebarBtnStyle} onClick={handleSaveWorkflow}>
|
||||||
<Button fullWidth sx={sidebarBtnStyle} onClick={handleOpenWorkflow}>OPEN WORKFLOW</Button>
|
SAVE WORKFLOW
|
||||||
<Button fullWidth sx={sidebarBtnStyle} onClick={handleOpenCloseDialog}>CLOSE WORKFLOW</Button>
|
</Button>
|
||||||
|
<Button fullWidth startIcon={<FileOpenIcon />} sx={sidebarBtnStyle} onClick={handleOpenWorkflow}>
|
||||||
|
OPEN WORKFLOW
|
||||||
|
</Button>
|
||||||
|
<Button fullWidth startIcon={<DeleteForeverIcon />} sx={sidebarBtnStyle} onClick={handleOpenCloseDialog}>
|
||||||
|
CLOSE WORKFLOW
|
||||||
|
</Button>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
@ -335,15 +377,20 @@ export default function App() {
|
|||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
sx={sidebarBtnStyle}
|
sx={{
|
||||||
|
...sidebarBtnStyle,
|
||||||
|
justifyContent: "space-between", // ensures spacing between left icon/label and right icon
|
||||||
|
pr: 1 // optional: tighter padding on right
|
||||||
|
}}
|
||||||
draggable
|
draggable
|
||||||
onDragStart={(event) => {
|
onDragStart={(event) => {
|
||||||
event.dataTransfer.setData("application/reactflow", type);
|
event.dataTransfer.setData("application/reactflow", type);
|
||||||
event.dataTransfer.effectAllowed = "move";
|
event.dataTransfer.effectAllowed = "move";
|
||||||
}}
|
}}
|
||||||
startIcon={<DragIndicatorIcon sx={{ color: "#666" }} />}
|
startIcon={<DragIndicatorIcon sx={{ color: "#666", fontSize: 18 }} />}
|
||||||
>
|
>
|
||||||
{label}
|
<Box component="span" sx={{ flexGrow: 1, textAlign: "left" }}>{label}</Box>
|
||||||
|
<PolylineIcon sx={{ color: "#58a6ff", fontSize: 18, ml: 1 }} />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
@ -384,6 +431,24 @@ export default function App() {
|
|||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
open={creditsDialogOpen}
|
||||||
|
onClose={() => setCreditsDialogOpen(false)}
|
||||||
|
PaperProps={{ sx: { bgcolor: "#121212", color: "#fff" } }}
|
||||||
|
>
|
||||||
|
<DialogTitle>Borealis Workflow Automation Tool</DialogTitle>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogContentText sx={{ color: "#ccc" }}>
|
||||||
|
Designed by Nicole Rappe @ Bunny Lab
|
||||||
|
</DialogContentText>
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={() => setCreditsDialogOpen(false)} sx={{ color: "#58a6ff" }}>
|
||||||
|
Close
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
accept=".json,application/json"
|
accept=".json,application/json"
|
||||||
|
@ -45,12 +45,12 @@ const ExportToCSVNode = ({ data }) => {
|
|||||||
<Handle type="target" position={Position.Left} className="borealis-handle" />
|
<Handle type="target" position={Position.Left} className="borealis-handle" />
|
||||||
|
|
||||||
<div className="borealis-node-header">
|
<div className="borealis-node-header">
|
||||||
{data.label || "Export to CSV"}
|
{data.label}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="borealis-node-content">
|
<div className="borealis-node-content">
|
||||||
<div style={{ marginBottom: "8px" }}>
|
<div style={{ marginBottom: "8px" }}>
|
||||||
{data.content || "Export Input Data to CSV File"}
|
{data.content}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label style={{ fontSize: "9px", display: "block", marginTop: "6px" }}>
|
<label style={{ fontSize: "9px", display: "block", marginTop: "6px" }}>
|
||||||
@ -138,6 +138,6 @@ Inputs:
|
|||||||
Outputs:
|
Outputs:
|
||||||
- None (writes directly to disk in future)
|
- None (writes directly to disk in future)
|
||||||
`.trim(),
|
`.trim(),
|
||||||
defaultContent: "Export Input Data to CSV File",
|
content: "Export Input Data to CSV File",
|
||||||
component: ExportToCSVNode
|
component: ExportToCSVNode
|
||||||
};
|
};
|
||||||
|
@ -135,7 +135,8 @@ Run-Step "Install Material UI Libraries into ReactJS App" {
|
|||||||
|
|
||||||
Run-Step "Build ReactJS App" {
|
Run-Step "Build ReactJS App" {
|
||||||
Push-Location $webUIDestination
|
Push-Location $webUIDestination
|
||||||
npm run build | Out-Null
|
#npm run build | Out-Null
|
||||||
|
npm run build
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user