structure_table_row.twig 7.6 KB

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