structure_table_row.twig 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <tr id="row_tbl_{{ curr }}"{{ table_is_view ? ' class="is_view"' }} data-filter-row="{{ current_table['TABLE_NAME']|upper }}">
  2. <td class="center print_ignore">
  3. <input type="checkbox"
  4. name="selected_tbl[]"
  5. class="{{ input_class }}"
  6. value="{{ current_table['TABLE_NAME'] }}"
  7. id="checkbox_tbl_{{ curr }}">
  8. </td>
  9. <th>
  10. <a href="sql.php{{ tbl_url_query|raw }}&amp;pos=0" title="{{ browse_table_label_title }}">
  11. {{ browse_table_label_truename }}
  12. </a>
  13. {{ tracking_icon|raw }}
  14. </th>
  15. {% if server_slave_status %}
  16. <td class="center">
  17. {{ ignored ? get_image('s_cancel', 'Not replicated'|trans) }}
  18. {{ do ? get_image('s_success', 'Replicated'|trans) }}
  19. </td>
  20. {% endif %}
  21. {# Favorite table anchor #}
  22. {% if num_favorite_tables > 0 %}
  23. <td class="center print_ignore">
  24. {# Check if current table is already in favorite list #}
  25. {% set fav_params = {
  26. 'db': db,
  27. 'ajax_request': true,
  28. 'favorite_table': current_table['TABLE_NAME'],
  29. ((already_favorite ? 'remove' : 'add') ~ '_favorite'): true
  30. } %}
  31. {% include 'database/structure/favorite_anchor.twig' with {
  32. 'table_name_hash': table_name_hash,
  33. 'db_table_name_hash': db_table_name_hash,
  34. 'fav_params': fav_params,
  35. 'already_favorite': already_favorite,
  36. 'titles': titles
  37. } only %}
  38. </td>
  39. {% endif %}
  40. <td class="center print_ignore">
  41. <a href="sql.php{{ tbl_url_query|raw }}&amp;pos=0">
  42. {{ browse_table_title|raw }}
  43. </a>
  44. </td>
  45. <td class="center print_ignore">
  46. <a href="tbl_structure.php{{ tbl_url_query|raw }}">
  47. {{ titles['Structure']|raw }}
  48. </a>
  49. </td>
  50. <td class="center print_ignore">
  51. <a href="tbl_select.php{{ tbl_url_query|raw }}">
  52. {{ search_table_title|raw }}
  53. </a>
  54. </td>
  55. {% if not db_is_system_schema %}
  56. <td class="insert_table center print_ignore">
  57. <a href="tbl_change.php{{ tbl_url_query|raw }}">{{ titles['Insert']|raw }}</a>
  58. </td>
  59. {% if table_is_view %}
  60. <td class="center print_ignore">
  61. <a href="view_create.php{{- get_common({
  62. 'db': db,
  63. 'table': current_table['TABLE_NAME']
  64. }) }}">{{ titles['Edit']|raw }}</a>
  65. </td>
  66. {% else %}
  67. <td class="center print_ignore">
  68. <a class="truncate_table_anchor ajax" href="sql.php" data-post="{{ tbl_url_query|raw }}&amp;sql_query=
  69. {{- empty_table_sql_query }}&amp;message_to_show={{ empty_table_message_to_show }}">
  70. {{ empty_table_title|raw }}
  71. </a>
  72. </td>
  73. {% endif %}
  74. <td class="center print_ignore">
  75. <a class="ajax drop_table_anchor
  76. {{- table_is_view or current_table['ENGINE'] == null ? ' view' }}"
  77. href="sql.php" data-post="{{ tbl_url_query|raw }}&amp;reload=1&amp;purge=1&amp;sql_query=
  78. {{- drop_query|url_encode }}&amp;message_to_show={{ drop_message|url_encode }}">
  79. {{ titles['Drop']|raw }}
  80. </a>
  81. </td>
  82. {% endif %}
  83. {% if current_table['TABLE_ROWS'] is defined
  84. and (current_table['ENGINE'] != null or table_is_view) %}
  85. {# Get the row count #}
  86. {% set row_count = format_number(current_table['TABLE_ROWS'], 0) %}
  87. {# Content to be appended into 'tbl_rows' cell.
  88. If row count is approximate, display it as an anchor to get real count. #}
  89. <td class="value tbl_rows"
  90. data-table="{{ current_table['TABLE_NAME'] }}">
  91. {% if approx_rows %}
  92. <a href="db_structure.php{{ get_common({
  93. 'ajax_request': true,
  94. 'db': db,
  95. 'table': current_table['TABLE_NAME'],
  96. 'real_row_count': 'true'
  97. }) }}" class="ajax real_row_count">
  98. <bdi>
  99. ~{{ row_count }}
  100. </bdi>
  101. </a>
  102. {% else %}
  103. {{ row_count }}
  104. {% endif %}
  105. {{ show_superscript|raw }}
  106. </td>
  107. {% if not (properties_num_columns > 1) %}
  108. <td class="nowrap">
  109. {% if current_table['ENGINE'] is not empty %}
  110. {{ current_table['ENGINE'] }}
  111. {% elseif table_is_view %}
  112. {% trans 'View' %}
  113. {% endif %}
  114. </td>
  115. {% if collation|length > 0 %}
  116. <td class="nowrap">
  117. {{ collation|raw }}
  118. </td>
  119. {% endif %}
  120. {% endif %}
  121. {% if is_show_stats %}
  122. <td class="value tbl_size">
  123. <a href="tbl_structure.php{{ tbl_url_query|raw }}#showusage">
  124. <span>{{ formatted_size }}</span>&nbsp;<span class="unit">{{ unit }}</span>
  125. </a>
  126. </td>
  127. <td class="value tbl_overhead">
  128. {{ overhead|raw }}
  129. </td>
  130. {% endif %}
  131. {% if not (show_charset > 1) %}
  132. {% if charset|length > 0 %}
  133. <td class="nowrap">
  134. {{ charset|raw }}
  135. </td>
  136. {% endif %}
  137. {% endif %}
  138. {% if show_comment %}
  139. {% set comment = current_table['Comment'] %}
  140. <td>
  141. {% if comment|length > limit_chars %}
  142. <abbr title="{{ comment }}">
  143. {{ comment|slice(0, limit_chars) }}
  144. ...
  145. </abbr>
  146. {% else %}
  147. {{ comment }}
  148. {% endif %}
  149. </td>
  150. {% endif %}
  151. {% if show_creation %}
  152. <td class="value tbl_creation">
  153. {{ create_time }}
  154. </td>
  155. {% endif %}
  156. {% if show_last_update %}
  157. <td class="value tbl_last_update">
  158. {{ update_time }}
  159. </td>
  160. {% endif %}
  161. {% if show_last_check %}
  162. <td class="value tbl_last_check">
  163. {{ check_time }}
  164. </td>
  165. {% endif %}
  166. {% elseif table_is_view %}
  167. <td class="value tbl_rows">-</td>
  168. <td class="nowrap">
  169. {% trans 'View' %}
  170. </td>
  171. <td class="nowrap">---</td>
  172. {% if is_show_stats %}
  173. <td class="value tbl_size">-</td>
  174. <td class="value tbl_overhead">-</td>
  175. {% endif %}
  176. {% if show_charset %}
  177. <td></td>
  178. {% endif %}
  179. {% if show_comment %}
  180. <td></td>
  181. {% endif %}
  182. {% if show_creation %}
  183. <td class="value tbl_creation">-</td>
  184. {% endif %}
  185. {% if show_last_update %}
  186. <td class="value tbl_last_update">-</td>
  187. {% endif %}
  188. {% if show_last_check %}
  189. <td class="value tbl_last_check">-</td>
  190. {% endif %}
  191. {% else %}
  192. {% if db_is_system_schema %}
  193. {% set action_colspan = 3 %}
  194. {% else %}
  195. {% set action_colspan = 6 %}
  196. {% endif %}
  197. {% if num_favorite_tables > 0 %}
  198. {% set action_colspan = action_colspan + 1 %}
  199. {% endif %}
  200. {% set colspan_for_structure = action_colspan + 3 %}
  201. <td colspan="{{ colspan_for_structure - db_is_system_schema ? 6 : 9 }}"
  202. class="center">
  203. {% trans 'in use' %}
  204. </td>
  205. {% endif %}
  206. </tr>