mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 02:47:52 +01:00
Display existing prompts in instruct migration dialog
This commit is contained in:
parent
ece2684001
commit
9d38878007
@ -73,7 +73,8 @@ export async function checkForSystemPromptInInstructTemplate(name, template) {
|
||||
return;
|
||||
}
|
||||
if ('system_prompt' in template && template.system_prompt) {
|
||||
const html = await renderTemplateAsync('migrateInstructPrompt', { prompt: template.system_prompt });
|
||||
const existingName = system_prompts.find(x => x.content === template.system_prompt)?.name;
|
||||
const html = await renderTemplateAsync('migrateInstructPrompt', { prompt: template.system_prompt, existing: existingName });
|
||||
const confirm = await callGenericPopup(html, POPUP_TYPE.CONFIRM);
|
||||
if (confirm) {
|
||||
const migratedName = `[Migrated] ${name}`;
|
||||
|
@ -1,10 +1,17 @@
|
||||
<h3>
|
||||
This instruct template also contains a system prompt.
|
||||
</h3>
|
||||
<div class="marginBot10">
|
||||
<div>
|
||||
Would you like to migrate the system prompt from the template?
|
||||
</div>
|
||||
<div class="justifyLeft marginBot10">
|
||||
{{#if existing}}
|
||||
<div class="marginTopBot5">
|
||||
<b>Note:</b>
|
||||
<span>you already have this prompt saved as:</span>
|
||||
<span>{{existing}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="justifyLeft marginTop5">
|
||||
<div>
|
||||
<small>
|
||||
<b>"Yes"</b> – The prompt will be imported and selected as a current system prompt.
|
||||
|
Loading…
x
Reference in New Issue
Block a user