From 0ab5e57335286379a523bc68b9e95654f5ef030b Mon Sep 17 00:00:00 2001 From: Thalia Jackson Date: Fri, 28 Jun 2024 15:18:56 -0400 Subject: [PATCH 1/3] Adding in basic frontend --- backend/PSoft-Tools-Backend/CFG/metrinome | 1 + psoft-tools/src/components/JavaEditor.tsx | 4 ++ psoft-tools/src/components/Navbar.tsx | 3 ++ psoft-tools/src/pages/CFGgen.tsx | 51 +++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 160000 backend/PSoft-Tools-Backend/CFG/metrinome create mode 100644 psoft-tools/src/components/JavaEditor.tsx create mode 100644 psoft-tools/src/pages/CFGgen.tsx diff --git a/backend/PSoft-Tools-Backend/CFG/metrinome b/backend/PSoft-Tools-Backend/CFG/metrinome new file mode 160000 index 0000000..17d1484 --- /dev/null +++ b/backend/PSoft-Tools-Backend/CFG/metrinome @@ -0,0 +1 @@ +Subproject commit 17d1484c7c368244f45d7d8f22e86ae3fb739b54 diff --git a/psoft-tools/src/components/JavaEditor.tsx b/psoft-tools/src/components/JavaEditor.tsx new file mode 100644 index 0000000..ae5c82e --- /dev/null +++ b/psoft-tools/src/components/JavaEditor.tsx @@ -0,0 +1,4 @@ +import { EditorProps, useMonaco } from "@monaco-editor/react"; +import { useEffect } from "react"; +import { Editor } from "@monaco-editor/react"; + diff --git a/psoft-tools/src/components/Navbar.tsx b/psoft-tools/src/components/Navbar.tsx index f428f8e..6c39eeb 100644 --- a/psoft-tools/src/components/Navbar.tsx +++ b/psoft-tools/src/components/Navbar.tsx @@ -39,6 +39,9 @@ export default function Navbar() { + + +
diff --git a/psoft-tools/src/pages/CFGgen.tsx b/psoft-tools/src/pages/CFGgen.tsx new file mode 100644 index 0000000..2c2dec6 --- /dev/null +++ b/psoft-tools/src/pages/CFGgen.tsx @@ -0,0 +1,51 @@ +import Navbar from "../components/Navbar"; +//import { useState } from "react"; +//import { post } from "../lib/api"; +//import { ThreeDots } from "react-loader-spinner"; +import DafnyEditor from "../components/DafnyEditor"; + +export default function CFGgen() { + /* + const [code, setCode] = useState("// Please enter Java code below and delete this comment!"); + const handleEditorChange = (value: string | undefined) => { + if (value) { + //console.log(value); + setCode(value); + //console.log(code); + } + }; + const handleCFGGen=()=>{ + //setLoading(true); + //post("http://localhost:3000/createCFG", code).then((response) => { + + } + //setLoading(false); + //setData(response); + }) + } + */ + return( + <> + +
+ + +
+ +
+
+ + +
+
+ + + ) +} From 5fcc69c58995718aac4098559c0f2e3e1861917e Mon Sep 17 00:00:00 2001 From: Thalia Jackson Date: Sun, 4 Aug 2024 15:13:16 -0400 Subject: [PATCH 2/3] updating frontend CFG --- psoft-tools/src/CFGgen.css | 89 ++++++++++++++++++++++++++ psoft-tools/src/pages/CFGgen.tsx | 105 +++++++++++++++++-------------- 2 files changed, 147 insertions(+), 47 deletions(-) create mode 100644 psoft-tools/src/CFGgen.css diff --git a/psoft-tools/src/CFGgen.css b/psoft-tools/src/CFGgen.css new file mode 100644 index 0000000..2f66051 --- /dev/null +++ b/psoft-tools/src/CFGgen.css @@ -0,0 +1,89 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 100%; + min-height: 100%; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +.navbar button{ + background-color: black; + color: white; +} + +.navbar button:hover{ + border-color: black; +} + +.screen{ + display: flex; +} +.flex{ + flex-grow: 1; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/psoft-tools/src/pages/CFGgen.tsx b/psoft-tools/src/pages/CFGgen.tsx index 2c2dec6..a66ad72 100644 --- a/psoft-tools/src/pages/CFGgen.tsx +++ b/psoft-tools/src/pages/CFGgen.tsx @@ -1,51 +1,62 @@ +import { Editor } from "@monaco-editor/react"; import Navbar from "../components/Navbar"; -//import { useState } from "react"; -//import { post } from "../lib/api"; -//import { ThreeDots } from "react-loader-spinner"; -import DafnyEditor from "../components/DafnyEditor"; +import { useState } from "react"; +import { post } from "../lib/api"; +import { ThreeDots } from "react-loader-spinner"; -export default function CFGgen() { - /* - const [code, setCode] = useState("// Please enter Java code below and delete this comment!"); - const handleEditorChange = (value: string | undefined) => { - if (value) { - //console.log(value); - setCode(value); - //console.log(code); - } - }; - const handleCFGGen=()=>{ - //setLoading(true); - //post("http://localhost:3000/createCFG", code).then((response) => { - - } - //setLoading(false); - //setData(response); - }) - } - */ - return( - <> - -
- - -
- -
-
+//Create Routing File +interface ErrorObject { + fileName: string; + line: number; + column: number; + errorMessage: string; +} - -
-
- +export default function CFGGen() { + const [code, setCode] = useState("int main(){}"); + const [loading, setLoading] = useState(false); - ) -} + const handleGen = () => { + setLoading(true); + post("http://localhost:3000/fetchImage/CFG.jpeg", code); + setLoading(false); + }; + + const handleEditorChange = (value: string | undefined) => { + if (value) { + //console.log(value); + setCode(value); + //console.log(code); + } + }; + //CFG image here + return ( +
+
+ +
+
+
+ + +
+
+
+ {loading ? ( + + ) : ( + CFG image here + )} +
+
+ +
+
+
+
+ ); +} \ No newline at end of file From 09823b75f803f15949556f816db6ff575488cfff Mon Sep 17 00:00:00 2001 From: Thalia Jackson Date: Fri, 9 Aug 2024 23:06:58 -0400 Subject: [PATCH 3/3] fixing --- backend/PSoft-Tools-Backend/CFG/metrinome | 1 - 1 file changed, 1 deletion(-) delete mode 160000 backend/PSoft-Tools-Backend/CFG/metrinome diff --git a/backend/PSoft-Tools-Backend/CFG/metrinome b/backend/PSoft-Tools-Backend/CFG/metrinome deleted file mode 160000 index 17d1484..0000000 --- a/backend/PSoft-Tools-Backend/CFG/metrinome +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 17d1484c7c368244f45d7d8f22e86ae3fb739b54