X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/76a6b8061c6c4f07a51266c0310b91f684490270..966ed21de7dfd77dddfa26bab5c8b4af8a73c99e:/Plugson/www/plugson_persistence.html diff --git a/Plugson/www/plugson_persistence.html b/Plugson/www/plugson_persistence.html index 60e0134..37359ab 100644 --- a/Plugson/www/plugson_persistence.html +++ b/Plugson/www/plugson_persistence.html @@ -1,10 +1,12 @@
-
+
  

x

- +
+ +
@@ -281,7 +283,7 @@ $('input[type=text]').each(function (){ var id = $(this).attr('id'); if (typeof(id) == 'undefined') { - retunrn; + return; } if (id.startsWith('id_text_timeout_') || id.startsWith('id_text_autosel_')) { @@ -356,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); + } }); } @@ -510,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);