Fix the plugson check for conf replace setting. (#3793)

This commit is contained in:
longpanda
2026-12-04 19:10:35 +08:00
parent 9d64f850a7
commit 42b79b3319
3 changed files with 21 additions and 12 deletions
+5 -5
View File
@@ -760,7 +760,7 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b id="plugson_build_date">20260625 19:36:29</b>
<b id="plugson_build_date">20230623 19:05:00</b>
</div>
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
</footer>
@@ -780,10 +780,10 @@
<script src="/static/js/jQuery-2.1.4.min.js"></script>
<!-- jquery validate -->
<script src="/static/js/jquery.validate.min.js"></script>
<script src="/static/js/jquery.validate.vtoymethods.js?v=331"></script>
<script src="/static/js/jquery.validate.vtoymethods.js?v=406"></script>
<script src="/static/js/jquery.vtoy.alert.js?v=331"></script>
<script src="/static/js/vtoy.js?v=331"></script>
<script src="/static/js/jquery.vtoy.alert.js?v=406"></script>
<script src="/static/js/vtoy.js?v=406"></script>
<script src="/static/js/md5.min.js"></script>
<!-- Bootstrap 3.3.5 -->
@@ -921,7 +921,7 @@
setTimeout(function() {
ventoy_handshake();
}, 200);
}, 500);
},
function(xmlHttpRequest, textStatus, errorThrown) {
+14 -5
View File
@@ -155,6 +155,20 @@
m_conf_iso_path = ventoy_replace_slash(m_conf_iso_path);
m_conf_new_path = ventoy_replace_slash(m_conf_new_path);
const path = m_conf_iso_path.substr(g_current_dir.length);
const alldata = m_data_conf_replace[current_tab_index];
let count = 0;
for (let i = 0; i < alldata.length; i++) {
if (alldata[i].path === path) {
count++;
}
}
if (count >= 2) {
Message.error(g_vtoy_cur_language.STR_CONF_REPLACE_MAX_ENTRY);
return;
}
if (!ventoy_common_check_path(m_conf_iso_path)) {
Message.error(g_vtoy_cur_language.STR_INVALID_FILE_PATH);
return;
@@ -214,11 +228,6 @@
});
$("#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 -2
View File
@@ -397,7 +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_CONF_REPLACE_MAX_ENTRY": "At most 2 entries are allowed for each ISO, 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",
@@ -540,7 +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_CONF_REPLACE_MAX_ENTRY": "每个ISO文件最多只能添加2条记录,请先删除已有的记录!",
"STR_INVALID_PERCENT": "请输入 0-100 以内的整数!",
"STR_INVALID_COLOR": "请输入合法的颜色!",
"STR_SELECT": "请选择",