Create templates/chat.html
Browse files- templates/chat.html +86 -0
templates/chat.html
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>AI Project Chat</title>
|
5 |
+
<style>
|
6 |
+
body {
|
7 |
+
font-family: Arial, sans-serif;
|
8 |
+
padding: 20px;
|
9 |
+
background-color: #fafafa;
|
10 |
+
}
|
11 |
+
h1 {
|
12 |
+
color: #333;
|
13 |
+
}
|
14 |
+
ul {
|
15 |
+
list-style-type: none;
|
16 |
+
padding: 0;
|
17 |
+
}
|
18 |
+
li {
|
19 |
+
background: #e7e7e7;
|
20 |
+
margin: 5px 0;
|
21 |
+
padding: 8px;
|
22 |
+
border-radius: 4px;
|
23 |
+
}
|
24 |
+
textarea {
|
25 |
+
width: 100%;
|
26 |
+
padding: 10px;
|
27 |
+
font-size: 14px;
|
28 |
+
margin-top: 10px;
|
29 |
+
}
|
30 |
+
input[type="submit"] {
|
31 |
+
padding: 10px 20px;
|
32 |
+
background-color: #2196F3;
|
33 |
+
color: white;
|
34 |
+
border: none;
|
35 |
+
cursor: pointer;
|
36 |
+
margin-top: 10px;
|
37 |
+
}
|
38 |
+
input[type="submit"]:hover {
|
39 |
+
background-color: #0b7dda;
|
40 |
+
}
|
41 |
+
pre {
|
42 |
+
background: #f1f1f1;
|
43 |
+
padding: 10px;
|
44 |
+
border-radius: 4px;
|
45 |
+
overflow-x: auto;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
<script>
|
49 |
+
function showLoading() {
|
50 |
+
document.getElementById("loading").style.display = "block";
|
51 |
+
}
|
52 |
+
</script>
|
53 |
+
</head>
|
54 |
+
<body>
|
55 |
+
<h1>AI Project Chat</h1>
|
56 |
+
|
57 |
+
<h3>Project Files:</h3>
|
58 |
+
<ul>
|
59 |
+
{% for file in project_tree %}
|
60 |
+
<li>{{ file }}</li>
|
61 |
+
{% endfor %}
|
62 |
+
</ul>
|
63 |
+
|
64 |
+
<h3>Chat:</h3>
|
65 |
+
<div style="border:1px solid #ccc; padding:10px;">
|
66 |
+
{% for chat in chat_history %}
|
67 |
+
<b>User:</b> {{ chat.user }}<br>
|
68 |
+
<b>AI:</b> <pre>{{ chat.ai }}</pre><br>
|
69 |
+
<hr>
|
70 |
+
{% endfor %}
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<h3>Send new instruction:</h3>
|
74 |
+
<form method="POST" onsubmit="showLoading()">
|
75 |
+
<textarea name="user_message" rows="4" placeholder="Example: Refactor app.py"></textarea><br>
|
76 |
+
<input type="submit" value="Send to AI">
|
77 |
+
</form>
|
78 |
+
|
79 |
+
<div id="loading" style="display:none; margin-top:20px;">
|
80 |
+
<p>Loading... Please wait while AI is generating response.</p>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<br>
|
84 |
+
<a href="/download_project">Download full project ZIP</a>
|
85 |
+
</body>
|
86 |
+
</html>
|