mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-13 18:31:16 +08:00
fix: 允许删除内置块,仅保护兼容块
- 删除按钮 disabled 条件从 non-custom 改为 legacyPrompt - 后端守卫同步更新,内置块可删除,兼容块禁止删除
This commit is contained in:
6
panel.js
6
panel.js
@@ -2206,7 +2206,7 @@ function _renderTaskBlockListItem(block, index, state) {
|
|||||||
data-task-action="delete-block"
|
data-task-action="delete-block"
|
||||||
data-block-id="${_escHtml(block.id)}"
|
data-block-id="${_escHtml(block.id)}"
|
||||||
type="button"
|
type="button"
|
||||||
${block.type === "custom" ? "" : "disabled"}
|
${block.type === "legacyPrompt" ? "disabled" : ""}
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
@@ -2661,8 +2661,8 @@ function _deleteTaskBlock(blockId) {
|
|||||||
const index = blocks.findIndex((item) => item.id === blockId);
|
const index = blocks.findIndex((item) => item.id === blockId);
|
||||||
if (index < 0) return null;
|
if (index < 0) return null;
|
||||||
const block = blocks[index];
|
const block = blocks[index];
|
||||||
if (block.type !== "custom") {
|
if (block.type === "legacyPrompt") {
|
||||||
toastr.info("只有自定义块可以删除", "ST-BME");
|
toastr.info("兼容块不可删除", "ST-BME");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
blocks.splice(index, 1);
|
blocks.splice(index, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user