display.twig 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <div id="pma_console_container">
  2. <div id="pma_console">
  3. {# Console toolbar #}
  4. {% include 'console/toolbar.twig' with {
  5. 'parent_div_classes': 'collapsed',
  6. 'content_array': [
  7. {0: 'switch_button console_switch', 1: 'Console'|trans, 'image': image},
  8. ['button clear', 'Clear'|trans],
  9. ['button history', 'History'|trans],
  10. ['button options', 'Options'|trans],
  11. cfg_bookmark is defined ? ['button bookmarks', 'Bookmarks'|trans] : null,
  12. ['button debug hide', 'Debug SQL'|trans]
  13. ]
  14. } only %}
  15. {# Console messages #}
  16. <div class="content">
  17. <div class="console_message_container">
  18. <div class="message welcome">
  19. <span id="instructions-0">
  20. {% trans 'Press Ctrl+Enter to execute query' %}
  21. </span>
  22. <span class="hide" id="instructions-1">
  23. {% trans 'Press Enter to execute query' %}
  24. </span>
  25. </div>
  26. {% if sql_history is not empty %}
  27. {% for record in sql_history|reverse %}
  28. <div class="message history collapsed hide
  29. {{- record['sqlquery'] matches '@^SELECT[[:space:]]+@i' ? ' select' }}"
  30. targetdb="{{ record['db'] }}" targettable="{{ record['table'] }}">
  31. {% include 'console/query_action.twig' with {
  32. 'parent_div_classes': 'action_content',
  33. 'content_array': [
  34. ['action collapse', 'Collapse'|trans],
  35. ['action expand', 'Expand'|trans],
  36. ['action requery', 'Requery'|trans],
  37. ['action edit', 'Edit'|trans],
  38. ['action explain', 'Explain'|trans],
  39. ['action profiling', 'Profiling'|trans],
  40. cfg_bookmark is defined ? ['action bookmark', 'Bookmark'|trans] : null,
  41. ['text failed', 'Query failed'|trans],
  42. {0: 'text targetdb', 1: 'Database'|trans, 'extraSpan': record['db']},
  43. {
  44. 0: 'text query_time',
  45. 1: 'Queried time'|trans,
  46. 'extraSpan': record['timevalue'] is defined ?
  47. record['timevalue'] : 'During current session'|trans
  48. }
  49. ]
  50. } only %}
  51. <span class="query">{{ record['sqlquery'] }}</span>
  52. </div>
  53. {% endfor %}
  54. {% endif %}
  55. </div><!-- console_message_container -->
  56. <div class="query_input">
  57. <span class="console_query_input"></span>
  58. </div>
  59. </div><!-- message end -->
  60. {# Drak the console with other cards over it #}
  61. <div class="mid_layer"></div>
  62. {# Debug SQL card #}
  63. <div class="card" id="debug_console">
  64. {% include 'console/toolbar.twig' with {
  65. 'parent_div_classes': '',
  66. 'content_array': [
  67. ['button order order_asc', 'ascending'|trans],
  68. ['button order order_desc', 'descending'|trans],
  69. ['text', 'Order:'|trans],
  70. ['switch_button', 'Debug SQL'|trans],
  71. ['button order_by sort_count', 'Count'|trans],
  72. ['button order_by sort_exec', 'Execution order'|trans],
  73. ['button order_by sort_time', 'Time taken'|trans],
  74. ['text', 'Order by:'|trans],
  75. ['button group_queries', 'Group queries'|trans],
  76. ['button ungroup_queries', 'Ungroup queries'|trans]
  77. ]
  78. } only %}
  79. <div class="content debug">
  80. <div class="message welcome"></div>
  81. <div class="debugLog"></div>
  82. </div> <!-- Content -->
  83. <div class="templates">
  84. {% include 'console/query_action.twig' with {
  85. 'parent_div_classes': 'debug_query action_content',
  86. 'content_array': [
  87. ['action collapse', 'Collapse'|trans],
  88. ['action expand', 'Expand'|trans],
  89. ['action dbg_show_trace', 'Show trace'|trans],
  90. ['action dbg_hide_trace', 'Hide trace'|trans],
  91. ['text count hide', 'Count'|trans],
  92. ['text time', 'Time taken'|trans]
  93. ]
  94. } only %}
  95. </div> <!-- Template -->
  96. </div> <!-- Debug SQL card -->
  97. {% if cfg_bookmark %}
  98. <div class="card" id="pma_bookmarks">
  99. {% include 'console/toolbar.twig' with {
  100. 'parent_div_classes': '',
  101. 'content_array': [
  102. ['switch_button', 'Bookmarks'|trans],
  103. ['button refresh', 'Refresh'|trans],
  104. ['button add', 'Add'|trans]
  105. ]
  106. } only %}
  107. <div class="content bookmark">
  108. {{ bookmark_content|raw }}
  109. </div>
  110. <div class="mid_layer"></div>
  111. <div class="card add">
  112. {% include 'console/toolbar.twig' with {
  113. 'parent_div_classes': '',
  114. 'content_array': [
  115. ['switch_button', 'Add bookmark'|trans]
  116. ]
  117. } only %}
  118. <div class="content add_bookmark">
  119. <div class="options">
  120. <label>
  121. {% trans 'Label' %}: <input type="text" name="label">
  122. </label>
  123. <label>
  124. {% trans 'Target database' %}: <input type="text" name="targetdb">
  125. </label>
  126. <label>
  127. <input type="checkbox" name="shared">{% trans 'Share this bookmark' %}
  128. </label>
  129. <button type="submit" name="submit">{% trans 'OK' %}</button>
  130. </div> <!-- options -->
  131. <div class="query_input">
  132. <span class="bookmark_add_input"></span>
  133. </div>
  134. </div>
  135. </div> <!-- Add bookmark card -->
  136. </div> <!-- Bookmarks card -->
  137. {% endif %}
  138. {# Options card #}
  139. <div class="card" id="pma_console_options">
  140. {% include 'console/toolbar.twig' with {
  141. 'parent_div_classes': '',
  142. 'content_array': [
  143. ['switch_button', 'Options'|trans],
  144. ['button default', 'Set default'|trans]
  145. ]
  146. } only %}
  147. <div class="content">
  148. <label>
  149. <input type="checkbox" name="always_expand">{% trans 'Always expand query messages' %}
  150. </label>
  151. <br>
  152. <label>
  153. <input type="checkbox" name="start_history">{% trans 'Show query history at start' %}
  154. </label>
  155. <br>
  156. <label>
  157. <input type="checkbox" name="current_query">{% trans 'Show current browsing query' %}
  158. </label>
  159. <br>
  160. <label>
  161. <input type="checkbox" name="enter_executes">
  162. {% trans %}
  163. Execute queries on Enter and insert new line with Shift + Enter. To make this permanent, view settings.
  164. {% endtrans %}
  165. </label>
  166. <br>
  167. <label>
  168. <input type="checkbox" name="dark_theme">{% trans 'Switch to dark theme' %}
  169. </label>
  170. <br>
  171. </div>
  172. </div> <!-- Options card -->
  173. <div class="templates">
  174. {# Templates for console message actions #}
  175. {% include 'console/query_action.twig' with {
  176. 'parent_div_classes': 'query_actions',
  177. 'content_array': [
  178. ['action collapse', 'Collapse'|trans],
  179. ['action expand', 'Expand'|trans],
  180. ['action requery', 'Requery'|trans],
  181. ['action edit', 'Edit'|trans],
  182. ['action explain', 'Explain'|trans],
  183. ['action profiling', 'Profiling'|trans],
  184. cfg_bookmark is defined ? ['action bookmark', 'Bookmark'|trans] : null,
  185. ['text failed', 'Query failed'|trans],
  186. {0: 'text targetdb', 1: 'Database'|trans, 'extraSpan': ''},
  187. {0: 'text query_time', 1: 'Queried time'|trans, 'extraSpan': ''}
  188. ]
  189. } only %}
  190. </div>
  191. </div> <!-- #console end -->
  192. </div> <!-- #console_container end -->