body_for_table_summary.twig 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <tfoot id="tbl_summary_row" class="thead-light">
  2. <tr>
  3. <th class="d-print-none"></th>
  4. <th class="tbl_num text-nowrap">
  5. {% set num_tables_trans -%}
  6. {% trans %}%s table{% plural num_tables %}%s tables{% endtrans %}
  7. {%- endset %}
  8. {{ num_tables_trans|format(format_number(num_tables, 0)) }}
  9. </th>
  10. {% if server_slave_status %}
  11. <th>{% trans 'Replication' %}</th>
  12. {% endif %}
  13. {% set sum_colspan = db_is_system_schema ? 4 : 7 %}
  14. {% if num_favorite_tables == 0 %}
  15. {% set sum_colspan = sum_colspan - 1 %}
  16. {% endif %}
  17. <th colspan="{{ sum_colspan }}" class="d-print-none">{% trans 'Sum' %}</th>
  18. {% set row_count_sum = format_number(sum_entries, 0) %}
  19. {# If a table shows approximate rows count, display update-all-real-count anchor. #}
  20. {% set row_sum_url = [] %}
  21. {% if approx_rows is defined %}
  22. {% set row_sum_url = {
  23. 'ajax_request': true,
  24. 'db': db,
  25. 'real_row_count_all': 'true'
  26. } %}
  27. {% endif %}
  28. {% if approx_rows %}
  29. {% set cell_text -%}
  30. <a href="{{ url('/database/structure/real-row-count', row_sum_url) }}" class="ajax row_count_sum">~
  31. {{- row_count_sum -}}
  32. </a>
  33. {%- endset %}
  34. {% else %}
  35. {% set cell_text = row_count_sum %}
  36. {% endif %}
  37. <th class="value tbl_rows text-monospace text-right">{{ cell_text }}</th>
  38. {% if not (properties_num_columns > 1) %}
  39. {# MySQL <= 5.5.2 #}
  40. {% set default_engine = dbi.fetchValue('SELECT @@storage_engine;') %}
  41. {% if default_engine is empty %}
  42. {# MySQL >= 5.5.3 #}
  43. {% set default_engine = dbi.fetchValue('SELECT @@default_storage_engine;') %}
  44. {% endif %}
  45. <th class="text-center">
  46. <dfn title="{{ '%s is the default storage engine on this MySQL server.'|trans|format(default_engine) }}">
  47. {{ default_engine }}
  48. </dfn>
  49. </th>
  50. <th>
  51. {% if database_collation is not empty %}
  52. <dfn title="{{ database_collation.description }} ({% trans 'Default' %})">
  53. {{ database_collation.name }}
  54. </dfn>
  55. {% endif %}
  56. </th>
  57. {% endif %}
  58. {% if is_show_stats %}
  59. {% set sum = format_byte_down(sum_size, 3, 1) %}
  60. {% set sum_formatted = sum[0] %}
  61. {% set sum_unit = sum[1] %}
  62. <th class="value tbl_size text-monospace text-right">{{ sum_formatted }} {{ sum_unit }}</th>
  63. {% set overhead = format_byte_down(overhead_size, 3, 1) %}
  64. {% set overhead_formatted = overhead[0] %}
  65. {% set overhead_unit = overhead[1] %}
  66. <th class="value tbl_overhead text-monospace text-right">{{ overhead_formatted }} {{ overhead_unit }}</th>
  67. {% endif %}
  68. {% if show_charset %}
  69. <th>{{ database_charset }}</th>
  70. {% endif %}
  71. {% if show_comment %}
  72. <th></th>
  73. {% endif %}
  74. {% if show_creation %}
  75. <th class="value tbl_creation text-monospace text-right">
  76. {{ create_time_all }}
  77. </th>
  78. {% endif %}
  79. {% if show_last_update %}
  80. <th class="value tbl_last_update text-monospace text-right">
  81. {{ update_time_all }}
  82. </th>
  83. {% endif %}
  84. {% if show_last_check %}
  85. <th class="value tbl_last_check text-monospace text-right">
  86. {{ check_time_all }}
  87. </th>
  88. {% endif %}
  89. </tr>
  90. </tfoot>