Skip to content

Commit 13e7b2e

Browse files
RajRaj
authored andcommitted
Plugson: cap Boot Conf Replace at 2 entries per mode
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
1 parent 6568972 commit 13e7b2e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Plugson/www/plugson_conf_replace.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ <h1 class="box-title" style="font-weight:bold;" id="id_h1_page_title">菜单别
214214
});
215215

216216
$("#id_conf_replace_tbl").on('click', '.ConfReplaceAddBtn', function() {
217+
if (m_data_conf_replace[current_tab_index].length >= 2) {
218+
Message.error(g_vtoy_cur_language.STR_CONF_REPLACE_MAX_ENTRY);
219+
return;
220+
}
221+
217222
if (g_current_language === 'en') {
218223
$('#ConfReplaceForm #ConfReplaceForm_lang_1').text("ISO Path");
219224
$('#ConfReplaceForm #ConfReplaceForm_lang_2').text(" OK");

Plugson/www/static/js/vtoy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ var g_vtoy_cur_language_en =
397397
"STR_INVALID_NUMBER": "Please input valid non-negative integer!",
398398
"STR_INVALID_AUTOSEL": "autosel exceeds the length of the list!",
399399
"STR_INVALID_TIMEOUT": "Please input valid timeout integer!",
400+
"STR_CONF_REPLACE_MAX_ENTRY": "At most 2 entries are allowed for each mode, please delete an existing entry first!",
400401
"STR_INVALID_PERCENT": "Please input integer between 0-100 !",
401402
"STR_INVALID_COLOR": "Please input valid color!",
402403
"STR_SELECT": "Please Select",
@@ -539,6 +540,7 @@ var g_vtoy_cur_language_cn =
539540
"STR_INVALID_NUMBER": "请输入合法的非负整数!",
540541
"STR_INVALID_AUTOSEL": "autosel 的值超过了列表实际长度!",
541542
"STR_INVALID_TIMEOUT": "请输入合法的超时秒数!",
543+
"STR_CONF_REPLACE_MAX_ENTRY": "每种模式最多只能添加2条记录,请先删除已有的记录!",
542544
"STR_INVALID_PERCENT": "请输入 0-100 以内的整数!",
543545
"STR_INVALID_COLOR": "请输入合法的颜色!",
544546
"STR_SELECT": "请选择",

0 commit comments

Comments
 (0)