Skip to content

Commit f4431fb

Browse files
authored
Merge pull request #36 from Azure-Samples/m-hietala/ui_update
ui update
2 parents e11f086 + e6548cc commit f4431fb

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

src/api/static/main.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ function initChat() {
99
const chatClient = new ChatClient(chatUI);
1010

1111
const form = document.getElementById("chat-form");
12-
1312
const messageInput = document.getElementById("message");
14-
13+
const targetContainer = document.getElementById("messages");
14+
const placeholderWrapper = document.getElementById("placeholder-wrapper");
1515

1616
form.addEventListener("submit", async function(e) {
1717
e.preventDefault();
18+
19+
// Remove placeholder message if it exists
20+
if (placeholderWrapper) {
21+
placeholderWrapper.remove();
22+
}
23+
1824
await chatClient.sendMessage("/chat", messageInput.value.trim());
1925
messageInput.value = "";
2026
});
@@ -24,4 +30,4 @@ function initChat() {
2430
};
2531
}
2632

27-
document.addEventListener("DOMContentLoaded", initChat);
33+
document.addEventListener("DOMContentLoaded", initChat);

src/api/templates/index.html

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,44 @@
1212
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/cosmo/bootstrap.min.css"
1313
integrity="sha256-axRDISYf7Hht1KhcMnfDV2nq7hD/8Q9Rxa0YlW/o3NU=" crossorigin="anonymous">
1414
<link href="/static/styles.css" rel="stylesheet" type="text/css">
15+
<style>
16+
#messages {
17+
display: flex;
18+
flex-direction: column;
19+
align-items: center;
20+
text-align: center;
21+
}
22+
#placeholder-wrapper {
23+
display: flex;
24+
flex-grow: 1;
25+
justify-content: center;
26+
align-items: center;
27+
width: 100%;
28+
}
29+
#placeholder-message {
30+
color: #6c757d;
31+
}
32+
.header {
33+
font-size: 2em;
34+
font-weight: bold;
35+
margin-bottom: 10px;
36+
}
37+
.message-content {
38+
text-align: left;
39+
}
40+
</style>
1541
</head>
1642
<body>
1743
<div class="container-fluid h-100 d-flex flex-row">
1844
<div class="row flex-grow-1 h-100">
1945
<!-- Chat Section -->
2046
<div class="col-full d-flex flex-column h-100" id="chat-container"> <!-- Full width initially -->
2147
<div id="messages" class="px-4 pb-4 pt-2 flex-grow-1 overflow-y-auto align-items-stretch">
22-
<!-- Message content goes here -->
48+
<div id="placeholder-wrapper">
49+
<div id="placeholder-message" class="text-center text-muted my-3">
50+
<div class="header">Getting Started with Agents Using Azure AI Foundry</div>
51+
Type your message below. You can start casually with something fun like "Tell me a joke," or ask specifically about the Azure Search files, such as "What is Contoso Galaxy Innovations product?" </div>
52+
</div>
2353
</div>
2454

2555
<div id="chat-area" class="text-light px-4 py-2 rounded-top text-dark d-flex flex-column justify-content-center background-user">
@@ -76,4 +106,4 @@ <h5 class="mb-0">Document Viewer</h5>
76106
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
77107
<script type="module" src="/static/main.js"></script>
78108
</body>
79-
</html>
109+
</html>

0 commit comments

Comments
 (0)