mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-07 10:17:43 +02:00
[Haik]: and so it begins
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
.push-button-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
width: 40vw;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.push-button-img {
|
||||
margin-left: 20px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.push-button-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.push-button {
|
||||
background-color: #FFA3A4;
|
||||
color: black;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
font-size: 1.45rem;
|
||||
font-weight: bold; /* Changed from 900 to bold */
|
||||
font-family: 'Consolas', monospace;
|
||||
cursor: pointer;
|
||||
margin: 20px 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.push-button:hover {
|
||||
background-color: #cc8182;
|
||||
}
|
||||
|
||||
.push-button:active {
|
||||
background-color: #a86768;
|
||||
}
|
||||
|
||||
.push-button:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.push-button-container p {
|
||||
color: #FFA3A4;
|
||||
font-family: 'Consolas', monospace;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import axios from 'axios';
|
||||
import pushImg from '../../assets/push.png'; // Adjust the path according to your project structure
|
||||
import './PushButton.css'; // Import the CSS file
|
||||
|
||||
const PushButton = ({ projectStructure, setProjectStructure }) => {
|
||||
const pushStructure = async () => {
|
||||
try {
|
||||
console.log("Pushing project structure to backend: ", projectStructure);
|
||||
const response = await axios.post('http://127.0.0.1:6969/push_structure', {
|
||||
projectStructure // Include the projectStructure in the POST request body
|
||||
});
|
||||
console.log('Project structure pushed:', response.data);
|
||||
setProjectStructure(response.data);
|
||||
} catch (error) {
|
||||
console.error('Error pushing project structure:', error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="push-button-container">
|
||||
<div className="push-button-content">
|
||||
<button className="push-button" onClick={pushStructure}>
|
||||
Push
|
||||
</button>
|
||||
<p>Push debugger config to backend</p>
|
||||
</div>
|
||||
<img src={pushImg} alt="Project Structure" className="push-button-img" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PushButton;
|
||||
Reference in New Issue
Block a user