mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-28 13:17:14 +00:00
feat(wizard): label page bot test preview
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
// Read config from script tag data attributes
|
||||
var scriptEl = document.currentScript;
|
||||
var scriptTitle = scriptEl ? scriptEl.getAttribute("data-title") : null;
|
||||
var scriptTestNotice = scriptEl
|
||||
? scriptEl.getAttribute("data-test-notice")
|
||||
: null;
|
||||
|
||||
// ========== i18n ==========
|
||||
var I18N = {
|
||||
@@ -192,6 +195,7 @@
|
||||
.lb-header-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 4px; border-radius: 6px; display: flex; align-items: center; justify-content: center; opacity: 0.8; transition: opacity 0.15s; }\
|
||||
.lb-header-btn:hover { opacity: 1; }\
|
||||
.lb-header-btn svg { width: 18px; height: 18px; fill: currentColor; }\
|
||||
.lb-test-notice { padding: 8px 16px; border-bottom: 1px solid #fde68a; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.5; text-align: center; flex-shrink: 0; }\
|
||||
.lb-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }\
|
||||
.lb-messages::-webkit-scrollbar { width: 6px; }\
|
||||
.lb-messages::-webkit-scrollbar-track { background: transparent; }\
|
||||
@@ -1336,6 +1340,14 @@
|
||||
header.appendChild(headerActions);
|
||||
panel.appendChild(header);
|
||||
|
||||
if (scriptTestNotice) {
|
||||
var testNotice = document.createElement("div");
|
||||
testNotice.className = "lb-test-notice";
|
||||
testNotice.setAttribute("role", "note");
|
||||
testNotice.textContent = scriptTestNotice;
|
||||
panel.appendChild(testNotice);
|
||||
}
|
||||
|
||||
// Messages area
|
||||
var messages = document.createElement("div");
|
||||
messages.className = "lb-messages";
|
||||
|
||||
Reference in New Issue
Block a user