Merge pull request #19113 from MauricioFauth/disable-ajax-db-table-pages

Disable Ajax for some links
This commit is contained in:
Maurício Meneghini Fauth 2024-04-19 14:48:09 -03:00 committed by GitHub
commit 9188080e83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 23 deletions

View File

@ -134,18 +134,6 @@ const CreateDatabase = {
}
};
function checkPrivilegesForDatabase () {
var tableRows = $('.server_databases');
$.each(tableRows, function () {
$(this).on('click', function () {
const db = $(this).attr('data');
if (db !== CommonParams.get('db')) {
Navigation.update(CommonParams.setAll({ 'db': db, 'table': '' }));
}
});
});
}
AJAX.registerTeardown('server/databases.js', function () {
$(document).off('submit', '#dbStatsForm');
$(document).off('submit', '#create_database_form.ajax');
@ -154,5 +142,4 @@ AJAX.registerTeardown('server/databases.js', function () {
AJAX.registerOnload('server/databases.js', function () {
$(document).on('submit', '#dbStatsForm', DropDatabases.handleEvent);
$(document).on('submit', '#create_database_form.ajax', CreateDatabase.handleEvent);
checkPrivilegesForDatabase();
});

View File

@ -7,7 +7,7 @@
id="checkbox_tbl_{{ curr }}">
</td>
<th>
<a href="{{ url('/sql', table_url_params|merge({'pos': 0})) }}" title="{{ browse_table_label_title }}">
<a class="disableAjax" href="{{ url('/sql', table_url_params|merge({'pos': 0})) }}" title="{{ browse_table_label_title }}">
{{- browse_table_label_truename -}}
</a>
{{ tracking_icon|raw }}
@ -39,24 +39,24 @@
{% endif %}
<td class="text-center d-print-none">
<a href="{{ url('/sql', table_url_params|merge({'pos': 0})) }}">
<a class="disableAjax" href="{{ url('/sql', table_url_params|merge({'pos': 0})) }}">
{{ may_have_rows ? get_icon('b_browse', 'Browse'|trans) : get_icon('bd_browse', 'Browse'|trans) }}
</a>
</td>
<td class="text-center d-print-none">
<a href="{{ url('/table/structure', table_url_params) }}">
<a class="disableAjax" href="{{ url('/table/structure', table_url_params) }}">
{{ get_icon('b_props', 'Structure'|trans) }}
</a>
</td>
<td class="text-center d-print-none">
<a href="{{ url('/table/search', table_url_params) }}">
<a class="disableAjax" href="{{ url('/table/search', table_url_params) }}">
{{ may_have_rows ? get_icon('b_select', 'Search'|trans) : get_icon('bd_select', 'Search'|trans) }}
</a>
</td>
{% if not db_is_system_schema %}
<td class="insert_table text-center d-print-none">
<a href="{{ url('/table/change', table_url_params) }}">{{ get_icon('b_insrow', 'Insert'|trans) }}</a>
<td class="text-center d-print-none">
<a class="disableAjax" href="{{ url('/table/change', table_url_params) }}">{{ get_icon('b_insrow', 'Insert'|trans) }}</a>
</td>
{% if table_is_view %}
<td class="text-center d-print-none">
@ -131,7 +131,7 @@
{% if is_show_stats %}
<td class="value tbl_size font-monospace text-end">
<a href="{{ url('/table/structure', table_url_params) }}#showusage">
<a class="disableAjax" href="{{ url('/table/structure', table_url_params) }}#showusage">
<span>{{ formatted_size }}</span>&nbsp;<span class="unit">{{ unit }}</span>
</a>
</td>

View File

@ -177,7 +177,7 @@
{% endif %}
<td class="name">
<a href="{{ database.url }}" title="
<a class="disableAjax" href="{{ database.url }}" title="
{{- "Jump to database '%s'"|trans|format(database.name) }}">
{{ database.name }}
</a>
@ -234,8 +234,7 @@
{% endif %}
<td class="tool">
<a class="server_databases" data="
{{- database.name }}" href="{{ url('/database/privileges', {'db': database.name}) }}" title="
<a class="disableAjax" href="{{ url('/database/privileges', {'db': database.name}) }}" title="
{{- 'Check privileges for database "%s".'|trans|format(database.name) }}">
{{ get_icon('s_rights', 'Check privileges'|trans) }}
</a>