From ca92070fac4c4a0b0f84d9617d1b67038ee7b9b9 Mon Sep 17 00:00:00 2001 From: Prajwal Raj Date: Fri, 9 Oct 2026 09:03:26 +0530 Subject: [PATCH] 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 --- Plugson/www/plugson_conf_replace.html | 5 +++++ Plugson/www/static/js/vtoy.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Plugson/www/plugson_conf_replace.html b/Plugson/www/plugson_conf_replace.html index 2e97523b..34f9d0b6 100644 --- a/Plugson/www/plugson_conf_replace.html +++ b/Plugson/www/plugson_conf_replace.html @@ -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"); diff --git a/Plugson/www/static/js/vtoy.js b/Plugson/www/static/js/vtoy.js index 5ff968b6..4c1f45bd 100644 --- a/Plugson/www/static/js/vtoy.js +++ b/Plugson/www/static/js/vtoy.js @@ -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": "请选择",