WebashalarForML commited on
Commit
63c632b
·
verified ·
1 Parent(s): e585eee

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +47 -1
templates/index.html CHANGED
@@ -122,9 +122,48 @@
122
  .input-area button:hover {
123
  background-color: #0056b3;
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </style>
126
  </head>
127
  <body>
 
 
 
 
 
 
 
 
 
 
 
128
  <div class="container">
129
  <header>
130
  <h1>Agent Chat</h1>
@@ -156,7 +195,14 @@
156
  const logsContainer = document.getElementById("logs");
157
  const sendButton = document.getElementById("send");
158
  const promptTextarea = document.getElementById("prompt");
159
-
 
 
 
 
 
 
 
160
  // Function to add a chat message bubble
161
  function addMessage(sender, text) {
162
  const messageDiv = document.createElement("div");
 
122
  .input-area button:hover {
123
  background-color: #0056b3;
124
  }
125
+
126
+ .alert {
127
+ padding: 10px;
128
+ margin-bottom: 10px;
129
+ border-radius: 5px;
130
+ text-align: center;
131
+ position: absolute;
132
+ position-area: top center;
133
+ top: 30px;
134
+ align-items: center;
135
+ }
136
+
137
+ .alert-error {
138
+ background-color: #D84040;
139
+ color: #ffffff;
140
+ }
141
+
142
+ .alert-success {
143
+ background-color: #D2DE32;
144
+ color: #ffffff;
145
+ }
146
+
147
+ .alert-warning {
148
+ background-color: #FFC700;
149
+ color: #ffffff;
150
+ }
151
+
152
+
153
  </style>
154
  </head>
155
  <body>
156
+
157
+ <div class="container-flash">
158
+ {% with messages = get_flashed_messages(with_categories=true) %}
159
+ {% if messages %}
160
+ <div id="flash-message" class="alert alert-{{ messages[0][0] }}">
161
+ <strong>{{ messages[0][1] }}</strong>
162
+ </div>
163
+ {% endif %}
164
+ {% endwith %}
165
+ </div>
166
+
167
  <div class="container">
168
  <header>
169
  <h1>Agent Chat</h1>
 
195
  const logsContainer = document.getElementById("logs");
196
  const sendButton = document.getElementById("send");
197
  const promptTextarea = document.getElementById("prompt");
198
+ const flashMessage = document.getElementById('flash-message');
199
+ //for flash message
200
+ if (flashMessage) {
201
+ setTimeout(function() {
202
+ flashMessage.style.display = 'none';
203
+ }, 2000); // Hide after 2 seconds
204
+ }
205
+
206
  // Function to add a chat message bubble
207
  function addMessage(sender, text) {
208
  const messageDiv = document.createElement("div");