Add tip in Plugson web page when old ventoy.json contains invalid configuration.

This commit is contained in:
longpanda
2022-02-06 18:00:29 +08:00
parent be0e19fc5b
commit c57717aea2
5 changed files with 31 additions and 1 deletions

View File

@@ -723,7 +723,7 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b id="plugson_build_date">20220108 22:41:02</b>
<b id="plugson_build_date">20220204 16:31:23</b>
</div>
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
</footer>
@@ -777,6 +777,7 @@
//Main process
var m_syntax_error;
var m_invalid_config;
callVtoySync({
method : 'sysinfo'
}, function(data) {
@@ -784,6 +785,7 @@
g_current_dir = data.curdir;
g_current_os = data.os;
m_syntax_error = data.syntax_error;
m_invalid_config = data.invalid_config;
@@ -833,6 +835,14 @@
});
m_syntax_error = 0;
}
if (m_invalid_config === 1 && typeof(Modal) === 'object') {
var title = g_current_language == 'en' ? g_vtoy_cur_language_en.STR_INFO : g_vtoy_cur_language_cn.STR_INFO;
var msg = g_current_language == 'en' ? g_vtoy_cur_language_en.STR_INVALID_CONFIG_TIP : g_vtoy_cur_language_cn.STR_INVALID_CONFIG_TIP;
Modal.alert({title:title,msg:msg}).on(function(e) {
});
m_invalid_config = 0;
}
setTimeout(function() {
ventoy_handshake();

View File

@@ -479,6 +479,7 @@ var g_vtoy_cur_language_en =
"STR_SECURE_BOOT_ENABLE": "Enable",
"STR_SECURE_BOOT_DISABLE": "Disable",
"STR_SYNTAX_ERROR_TIP": "Syntax error detected in ventoy.json, so the configuration is not loaded!",
"STR_INVALID_CONFIG_TIP": "Invalid configuration detected in ventoy.json, so the configuration is not loaded!",
"STR_XXX": "xxx"
};
@@ -613,6 +614,7 @@ var g_vtoy_cur_language_cn =
"STR_SECURE_BOOT_ENABLE": "开启",
"STR_SECURE_BOOT_DISABLE": "未开启",
"STR_SYNTAX_ERROR_TIP": "ventoy.json 文件中存在语法错误,配置未加载!",
"STR_INVALID_CONFIG_TIP": "ventoy.json 文件中存在错误配置,配置未加载!",