feat(frontend): 启用工作流快捷提示按钮
This commit is contained in:
@@ -965,6 +965,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
function bindPromptTemplateButtons() {
|
||||
document.querySelectorAll("[data-prompt-template]").forEach(function (button) {
|
||||
if (button.dataset.bound === "true") {
|
||||
return;
|
||||
}
|
||||
button.dataset.bound = "true";
|
||||
button.addEventListener("click", function () {
|
||||
if (!promptInput) {
|
||||
return;
|
||||
}
|
||||
var template = button.getAttribute("data-prompt-template") || "";
|
||||
promptInput.value = template;
|
||||
promptInput.focus();
|
||||
if (typeof promptInput.setSelectionRange === "function") {
|
||||
promptInput.setSelectionRange(promptInput.value.length, promptInput.value.length);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function streamChat(event) {
|
||||
event.preventDefault();
|
||||
if (!composer || !promptInput || !sendButton || !chatStage) {
|
||||
@@ -1126,6 +1146,7 @@
|
||||
bindWorkflowBatchCarouselControls();
|
||||
bindConditionConfirmForms();
|
||||
bindRectificationActionButtons();
|
||||
bindPromptTemplateButtons();
|
||||
refreshRunningWorkflowCards();
|
||||
|
||||
if (chatScroll) {
|
||||
|
||||
Reference in New Issue
Block a user