Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,259 changes: 437 additions & 1,822 deletions webapp/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-icons": "^5.2.1",
"react-router-dom": "^6.23.1",
"react-terminal": "^1.4.4",
"react-toastify": "^10.0.5",
"react-toastify": "^10.0.6",
"react-toggle-dark-mode": "^1.1.1",
"terminal-in-react": "^4.3.1"
},
Expand Down
3 changes: 3 additions & 0 deletions webapp/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useState, useEffect } from "react";
import { Route, Routes } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import Debug from "./pages/Debug/Debug";
import Threads from "./components/GdbComponents/Threads/Threads";
import LocalVariable from "./components/GdbComponents/LocalVariable/LocalVariable";
Expand Down Expand Up @@ -40,6 +42,7 @@ const App = () => {
{/* You can add more routes here */}
</Routes>
<Footer />
<ToastContainer theme={isDarkMode} />
</div>
);
};
Expand Down
16 changes: 1 addition & 15 deletions webapp/src/components/Breakpoint/Breakpoint.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useState } from "react";
import "./Breakpoint.css";

import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { toast } from "react-toastify";
import axios from "axios";

const Breakpoint = () => {
Expand Down Expand Up @@ -60,18 +58,6 @@ const Breakpoint = () => {
Add
</button>
</div>
<ToastContainer
position="bottom-right"
autoClose={1000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="light"
/>
</div>
);
};
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/components/Functions/Functions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect } from "react";
import { DataState } from "./../../context/DataContext";
import "./Functions.css";
import axios from "axios";
import { toast } from "react-toastify";

const data = [
"sub.KERNEL32.dll_DeleteCritical_231",
Expand All @@ -28,7 +29,7 @@ const Functions = () => {
console.log(data.data.result);
setFunctions(data.data.result);
} catch (error) {
console.log(error);
toast.error("Failed to fetch Functions symbols");
}
};

Expand Down
7 changes: 4 additions & 3 deletions webapp/src/components/Stack/Stack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ import React, { useEffect } from "react";
import { DataState } from "./../../context/DataContext";
import "./Stack.css";
import axios from "axios";
import { toast } from "react-toastify";

const Stack = () => {
const { refresh, stack, setStack } = DataState();
const { refresh, stack, setStack, fileName } = DataState();

const fetStackData = async () => {
try {
console.log("click from stack");
const data = await axios.post("http://127.0.0.1:10000/stack_trace", {
name: "program",
name: fileName || "program",
});
console.log(data.data.result);
setStack(data.data.result);
} catch (error) {
console.log(error);
toast.error("Failed to fetch Stack trace data");
}
};
useEffect(() => {
Expand Down
8 changes: 5 additions & 3 deletions webapp/src/components/Terminal/TerminalComp.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import React, { useState, useEffect, useRef } from "react";
import { ReactTerminal } from "react-terminal";
import { toast } from "react-toastify";
import axios from "axios";
import "./Terminal.css";
import { DataState } from "../../context/DataContext";

const TerminalComp = () => {
const { terminalOutput, commandPress } = DataState();
const { terminalOutput, commandPress, fileName } = DataState();
const [output, setOutput] = useState("");
const terminalRef = useRef("null");
const terminalRef = useRef(null);

const handleCommand = async (command, ...args) => {
const fullCommand = [command, ...args].join(" ");
console.log("Full Command:", fullCommand);
try {
const { data } = await axios.post("http://127.0.0.1:10000/gdb_command", {
command: fullCommand,
name: "program",
name: fileName || "program",
});
return data["result"];
} catch (error) {
toast.error("Terminal command failed");
return "Error executing command";
}
};
Expand Down
11 changes: 3 additions & 8 deletions webapp/src/context/DataContext.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React, {
createContext,
useState,
useEffect,
useCallback,
useContext,
} from "react";
import React, { createContext, useContext, useCallback, useState, useEffect } from "react";
import { toast } from "react-toastify";

export const DataContext = createContext();

Expand All @@ -24,7 +19,7 @@ export const DataProvider = ({ children }) => {
try {
setRefresh(false);
} catch (error) {
console.error("Error fetching data:", error);
toast.error("Failed to establish backend sync");
setRefresh(false);
}
}
Expand Down