fix: Enhance Kol Variable Rendering and Management
- Updated the regex for placeholder matching to support more flexible key formats. - Refactored variable storage to allow both ID and key lookups in rendering. - Improved schema validation to check for duplicate keys and enforce non-empty keys. - Added new utility functions for variable value lookup and display name generation. - Enhanced tests to cover new key-based variable scenarios. - Refactored KolPrompt repository to simplify prompt storage and management, including the removal of obsolete revision handling. - Introduced new API endpoints for saving, activating, and archiving prompts. - Added new utility functions for handling Kol placeholders and platform options in the admin web. - Implemented database migrations to simplify prompt storage structure and ensure data integrity.
This commit is contained in:
@@ -190,7 +190,18 @@ const enUS = {
|
||||
publishPackage: "Publish",
|
||||
archivePackage: "Archive",
|
||||
createPrompt: "Create prompt",
|
||||
activatePrompt: "Go live",
|
||||
archivePrompt: "Take offline",
|
||||
platformHint: "Platform",
|
||||
platformHintDefault: "General",
|
||||
status: {
|
||||
draft: "Draft",
|
||||
active: "Live",
|
||||
archived: "Offline",
|
||||
},
|
||||
editor: {
|
||||
basicInfo: "Basic info",
|
||||
saveMeta: "Save basic info",
|
||||
saveDraft: "Save draft",
|
||||
publish: "Publish",
|
||||
preview: "Preview form",
|
||||
|
||||
@@ -168,7 +168,7 @@ const zhCN = {
|
||||
},
|
||||
empty: "暂无已上架的订阅包",
|
||||
subscribers: "{count} 个订阅租户",
|
||||
prompts: "{count} 个 Prompt",
|
||||
prompts: "{count} 个提示词",
|
||||
},
|
||||
package: {
|
||||
subscribe: "申请订阅",
|
||||
@@ -189,8 +189,19 @@ const zhCN = {
|
||||
editPackage: "编辑包",
|
||||
publishPackage: "发布",
|
||||
archivePackage: "归档",
|
||||
createPrompt: "新增 Prompt",
|
||||
createPrompt: "新增提示词",
|
||||
activatePrompt: "上线",
|
||||
archivePrompt: "下线",
|
||||
platformHint: "平台",
|
||||
platformHintDefault: "通用",
|
||||
status: {
|
||||
draft: "草稿",
|
||||
active: "已上线",
|
||||
archived: "已下线",
|
||||
},
|
||||
editor: {
|
||||
basicInfo: "基本信息",
|
||||
saveMeta: "保存基本信息",
|
||||
saveDraft: "保存草稿",
|
||||
publish: "发布",
|
||||
preview: "预览表单",
|
||||
|
||||
Reference in New Issue
Block a user