Plugson: cap Boot Conf Replace at 2 entries per mode (#3727)

Ventoy only supports replacing up to 2 config files per mode, but
Plugson's Boot Conf Replace page let users add unlimited entries with
no indication that anything past the 2nd is silently ignored. Block
the add action once 2 entries exist for the current tab and show a
warning instead.

Fixes #3593

Co-authored-by: Raj <raj@Rajs-MacBook-Pro.local>
This commit is contained in:
Prajwal Raj
2026-10-09 11:33:26 +08:00
committed by GitHub
co-authored by Raj
parent 2af829d020
commit ca92070fac
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -214,6 +214,11 @@
});
$("#id_conf_replace_tbl").on('click', '.ConfReplaceAddBtn', function() {
if (m_data_conf_replace[current_tab_index].length >= 2) {
Message.error(g_vtoy_cur_language.STR_CONF_REPLACE_MAX_ENTRY);
return;
}
if (g_current_language === 'en') {
$('#ConfReplaceForm #ConfReplaceForm_lang_1').text("ISO Path");
$('#ConfReplaceForm #ConfReplaceForm_lang_2').text(" OK");
+2
View File
@@ -397,6 +397,7 @@ var g_vtoy_cur_language_en =
"STR_INVALID_NUMBER": "Please input valid non-negative integer!",
"STR_INVALID_AUTOSEL": "autosel exceeds the length of the list!",
"STR_INVALID_TIMEOUT": "Please input valid timeout integer!",
"STR_CONF_REPLACE_MAX_ENTRY": "At most 2 entries are allowed for each mode, please delete an existing entry first!",
"STR_INVALID_PERCENT": "Please input integer between 0-100 !",
"STR_INVALID_COLOR": "Please input valid color!",
"STR_SELECT": "Please Select",
@@ -539,6 +540,7 @@ var g_vtoy_cur_language_cn =
"STR_INVALID_NUMBER": "请输入合法的非负整数!",
"STR_INVALID_AUTOSEL": "autosel 的值超过了列表实际长度!",
"STR_INVALID_TIMEOUT": "请输入合法的超时秒数!",
"STR_CONF_REPLACE_MAX_ENTRY": "每种模式最多只能添加2条记录,请先删除已有的记录!",
"STR_INVALID_PERCENT": "请输入 0-100 以内的整数!",
"STR_INVALID_COLOR": "请输入合法的颜色!",
"STR_SELECT": "请选择",