Update static/frontend.html
Browse files- static/frontend.html +29 -14
static/frontend.html
CHANGED
|
@@ -59,6 +59,8 @@
|
|
| 59 |
font-family: 'Consolas', 'Monaco', monospace;
|
| 60 |
font-size: 0.9em;
|
| 61 |
}
|
|
|
|
|
|
|
| 62 |
</style>
|
| 63 |
</head>
|
| 64 |
<body>
|
|
@@ -66,19 +68,27 @@
|
|
| 66 |
<h1>Code Assistant Agent 🤖</h1>
|
| 67 |
|
| 68 |
<div id="state-info">
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
<
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
</div>
|
| 83 |
|
| 84 |
<div id="chat-window"></div>
|
|
@@ -93,7 +103,8 @@
|
|
| 93 |
let chatHistory = [];
|
| 94 |
let assistantState = {
|
| 95 |
conversationSummary: "",
|
| 96 |
-
language: "Python"
|
|
|
|
| 97 |
};
|
| 98 |
const apiUrl = '/chat';
|
| 99 |
|
|
@@ -162,6 +173,10 @@
|
|
| 162 |
function updateLanguage() {
|
| 163 |
assistantState.language = document.getElementById('current-language').value;
|
| 164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
</script>
|
| 166 |
</body>
|
| 167 |
</html>
|
|
|
|
| 59 |
font-family: 'Consolas', 'Monaco', monospace;
|
| 60 |
font-size: 0.9em;
|
| 61 |
}
|
| 62 |
+
|
| 63 |
+
#controls { display: flex; gap: 15px; align-items: center; }
|
| 64 |
</style>
|
| 65 |
</head>
|
| 66 |
<body>
|
|
|
|
| 68 |
<h1>Code Assistant Agent 🤖</h1>
|
| 69 |
|
| 70 |
<div id="state-info">
|
| 71 |
+
<div id="controls">
|
| 72 |
+
Language:
|
| 73 |
+
<select id="current-language" onchange="updateLanguage()">
|
| 74 |
+
<option value="Python">Python</option>
|
| 75 |
+
<option value="JavaScript">JavaScript</option>
|
| 76 |
+
<option value="Java">Java</option>
|
| 77 |
+
<option value="C++">C++</option>
|
| 78 |
+
<option value="C#">C#</option>
|
| 79 |
+
<option value="Go">Go</option>
|
| 80 |
+
<option value="Ruby">Ruby</option>
|
| 81 |
+
<option value="PHP">PHP</option>
|
| 82 |
+
<option value="TypeScript">TypeScript</option>
|
| 83 |
+
<option value="Swift">Swift</option>
|
| 84 |
+
</select>
|
| 85 |
+
|
| 86 |
+
Mode:
|
| 87 |
+
<select id="current-mode" onchange="updateMode()">
|
| 88 |
+
<option value="teacher">Teacher</option>
|
| 89 |
+
<option value="student">Student</option>
|
| 90 |
+
</select>
|
| 91 |
+
</div>
|
| 92 |
</div>
|
| 93 |
|
| 94 |
<div id="chat-window"></div>
|
|
|
|
| 103 |
let chatHistory = [];
|
| 104 |
let assistantState = {
|
| 105 |
conversationSummary: "",
|
| 106 |
+
language: "Python",
|
| 107 |
+
mode: "teacher"
|
| 108 |
};
|
| 109 |
const apiUrl = '/chat';
|
| 110 |
|
|
|
|
| 173 |
function updateLanguage() {
|
| 174 |
assistantState.language = document.getElementById('current-language').value;
|
| 175 |
}
|
| 176 |
+
|
| 177 |
+
function updateMode() {
|
| 178 |
+
assistantState.mode = document.getElementById('current-mode').value;
|
| 179 |
+
}
|
| 180 |
</script>
|
| 181 |
</body>
|
| 182 |
</html>
|