X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/4bf43ab9d4e6b724836724c1d514760d164df79a..HEAD:/Plugson/www/plugson_persistence.html diff --git a/Plugson/www/plugson_persistence.html b/Plugson/www/plugson_persistence.html index 97c6ce9..37359ab 100644 --- a/Plugson/www/plugson_persistence.html +++ b/Plugson/www/plugson_persistence.html @@ -1,10 +1,12 @@
-
+
  

x

- +
+ +
@@ -108,7 +110,7 @@ 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,14 +158,17 @@ 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) { $(textid).attr("disabled", false); $(textid).val(value); + } else { $(textid).attr("disabled", true); $(textid).val(''); @@ -277,6 +282,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); @@ -350,9 +358,13 @@ backend: call_array, type: type }, function(e) { - list.push(data); - FillPersistenceTable(list); - Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + if (e.result === 'success') { + list.push(data); + FillPersistenceTable(list); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } else if (e.result === 'duplicate') { + Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH); + } }); } @@ -504,7 +516,27 @@ $('#id_tab_persistence a[href="#tab_3"]').click(OnClickMultiModeTab); $('#id_tab_persistence a[href="#tab_4"]').click(OnClickMultiModeTab); $('#id_tab_persistence a[href="#tab_5"]').click(OnClickMultiModeTab); - + function UpdateTabTitleIcon(data) { + CommonUpdateTabTitleIcon(data.exist_persistence, '#id_tab_persistence a[href="#tab_', 'persistence'); + } + $('#id_btn_reset').click(function() { + Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'persistence')}).on(function(e) { + if (e) { + callVtoySync({ + method : 'persistence_del', + index: current_tab_index, + path: g_del_all_path + }, function(data) { + + }); + + m_data_persistence[current_tab_index].length = 0; + VtoyFillCurrentPageItem(m_data_persistence[g_vtoy_data_default_index]); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } + }); + }); + $('#id_tab_persistence a[href="#tab_0"]').tab('show'); VtoyFillCurrentPageItem(m_data_persistence[0]); VtoyPageLanguageChange(g_current_language);