X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/4bf43ab9d4e6b724836724c1d514760d164df79a..f7e6bbc70c65db9f6f5da5abc4ae57bd689da91c:/Plugson/www/plugson_auto_install.html diff --git a/Plugson/www/plugson_auto_install.html b/Plugson/www/plugson_auto_install.html index a8137bf..a8e45bc 100644 --- a/Plugson/www/plugson_auto_install.html +++ b/Plugson/www/plugson_auto_install.html @@ -1,10 +1,12 @@
-
+
  

x

- +
+ +
@@ -107,8 +109,8 @@ var id = $(this).attr('id'); var value = $(this).val(); var intval; - - if (id.length <= 16) { + + if (typeof(id) == 'undefined' || id.length <= 16) { return; } @@ -146,7 +148,7 @@ var id = $(this).attr('id'); var checked = $(this).is(':checked'); - if (id.length <= 14) { + if (typeof(id) == 'undefined' || id.length <= 14) { return; } @@ -156,9 +158,11 @@ if (id.startsWith('id_timeout_en_')) { textid = 'input[id=id_text_timeout_' + index + ']'; value = data.timeout; + data.timeouten = checked; } else { textid = 'input[id=id_text_autosel_' + index + ']'; value = data.autosel; + data.autoselen = checked; } if (checked) { @@ -277,7 +281,9 @@ $('input[type=text]').each(function (){ var id = $(this).attr('id'); - + if (typeof(id) == 'undefined') { + return; + } if (id.startsWith('id_text_timeout_') || id.startsWith('id_text_autosel_')) { $(this).change(OnInputTextChange); } @@ -285,6 +291,9 @@ $('input[type=checkbox]').each(function (){ var id = $(this).attr('id'); + if (typeof(id) == 'undefined') { + return; + } if (id.startsWith('id_timeout_en_') || id.startsWith('id_autosel_en_')) { $(this).click(OnCheckBoxChange); } @@ -350,9 +359,13 @@ template: call_array, type: type }, function(e) { - list.push(data); - FillAutoInsTable(list); - Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + if (e.result === 'success') { + list.push(data); + FillAutoInsTable(list); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } else if (e.result === 'duplicate') { + Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH); + } }); } @@ -536,7 +549,27 @@ $('#id_tab_autoins a[href="#tab_3"]').click(OnClickMultiModeTab); $('#id_tab_autoins a[href="#tab_4"]').click(OnClickMultiModeTab); $('#id_tab_autoins a[href="#tab_5"]').click(OnClickMultiModeTab); - + function UpdateTabTitleIcon(data) { + CommonUpdateTabTitleIcon(data.exist_auto_install, '#id_tab_autoins a[href="#tab_', 'auto_install'); + } + $('#id_btn_reset').click(function() { + Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'auto_install')}).on(function(e) { + if (e) { + callVtoySync({ + method : 'auto_install_del', + index: current_tab_index, + path: g_del_all_path + }, function(data) { + + }); + + m_data_autoins[current_tab_index].length = 0; + VtoyFillCurrentPageItem(m_data_autoins[g_vtoy_data_default_index]); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } + }); + }); + $('#id_tab_autoins a[href="#tab_0"]').tab('show'); VtoyFillCurrentPageItem(m_data_autoins[0]); VtoyPageLanguageChange(g_current_language);