mirror of
https://github.com/Cola-Echo/memory-manager-concurrent.git
synced 2026-06-06 12:25:53 +00:00
Add files via upload
This commit is contained in:
22
index.js
22
index.js
@@ -8387,16 +8387,19 @@
|
|||||||
function addExtractTag(tagName) {
|
function addExtractTag(tagName) {
|
||||||
if (!tagName || !tagName.trim()) return;
|
if (!tagName || !tagName.trim()) return;
|
||||||
|
|
||||||
const cleanTag = tagName.trim().replace(/^<|>$/g, "");
|
// 支持逗号分割多个标签(中英文逗号)
|
||||||
if (!cleanTag) return;
|
const tags = tagName.split(/[,,]/).map(t => t.trim().replace(/^<|>$/g, "")).filter(t => t);
|
||||||
|
if (tags.length === 0) return;
|
||||||
|
|
||||||
const config = getTagFilterConfigFromUI();
|
const config = getTagFilterConfigFromUI();
|
||||||
|
|
||||||
|
for (const cleanTag of tags) {
|
||||||
if (config.extractTags.includes(cleanTag)) {
|
if (config.extractTags.includes(cleanTag)) {
|
||||||
return;
|
continue;
|
||||||
|
}
|
||||||
|
config.extractTags.push(cleanTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.extractTags.push(cleanTag);
|
|
||||||
renderExtractTagList(config.extractTags);
|
renderExtractTagList(config.extractTags);
|
||||||
updateGlobalSettings({ contextTagFilter: config });
|
updateGlobalSettings({ contextTagFilter: config });
|
||||||
}
|
}
|
||||||
@@ -8407,16 +8410,19 @@
|
|||||||
function addExcludeTag(tagName) {
|
function addExcludeTag(tagName) {
|
||||||
if (!tagName || !tagName.trim()) return;
|
if (!tagName || !tagName.trim()) return;
|
||||||
|
|
||||||
const cleanTag = tagName.trim().replace(/^<|>$/g, "");
|
// 支持逗号分割多个标签(中英文逗号)
|
||||||
if (!cleanTag) return;
|
const tags = tagName.split(/[,,]/).map(t => t.trim().replace(/^<|>$/g, "")).filter(t => t);
|
||||||
|
if (tags.length === 0) return;
|
||||||
|
|
||||||
const config = getTagFilterConfigFromUI();
|
const config = getTagFilterConfigFromUI();
|
||||||
|
|
||||||
|
for (const cleanTag of tags) {
|
||||||
if (config.excludeTags.includes(cleanTag)) {
|
if (config.excludeTags.includes(cleanTag)) {
|
||||||
return;
|
continue;
|
||||||
|
}
|
||||||
|
config.excludeTags.push(cleanTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.excludeTags.push(cleanTag);
|
|
||||||
renderExcludeTagList(config.excludeTags);
|
renderExcludeTagList(config.excludeTags);
|
||||||
updateGlobalSettings({ contextTagFilter: config });
|
updateGlobalSettings({ contextTagFilter: config });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user