index.twig 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. {% extends 'server/status/base.twig' %}
  2. {% set active = 'monitor' %}
  3. {% block content %}
  4. <div class="tabLinks row">
  5. <a href="#pauseCharts">
  6. {{ get_image('play') }}
  7. {% trans 'Start Monitor' %}
  8. </a>
  9. <a href="#settingsPopup" class="popupLink">
  10. {{ get_image('s_cog') }}
  11. {% trans 'Settings' %}
  12. </a>
  13. <a href="#monitorInstructionsDialog">
  14. {{ get_image('b_help') }}
  15. {% trans 'Instructions/Setup' %}
  16. </a>
  17. <a href="#endChartEditMode" class="hide">
  18. {{ get_image('s_okay') }}
  19. {% trans 'Done dragging (rearranging) charts' %}
  20. </a>
  21. </div>
  22. <div class="popupContent settingsPopup">
  23. <a href="#addNewChart">
  24. {{ get_image('b_chart') }}
  25. {% trans 'Add chart' %}
  26. </a>
  27. <a href="#rearrangeCharts">
  28. {{ get_image('b_tblops') }}
  29. {% trans 'Enable charts dragging' %}
  30. </a>
  31. <div class="clearfloat paddingtop"></div>
  32. <div class="floatleft">
  33. {% trans 'Refresh rate' %}
  34. <br>
  35. <select id="id_gridChartRefresh" class="refreshRate" name="gridChartRefresh">
  36. {% for rate in [2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200] %}
  37. <option value="{{ rate }}"{{ rate == 5 ? ' selected' }}>
  38. {% if rate < 60 %}
  39. {% if rate == 1 %}
  40. {{ '%d second'|trans|format(rate) }}
  41. {% else %}
  42. {{ '%d seconds'|trans|format(rate) }}
  43. {% endif %}
  44. {% else %}
  45. {% if rate / 60 == 1 %}
  46. {{ '%d minute'|trans|format(rate / 60) }}
  47. {% else %}
  48. {{ '%d minutes'|trans|format(rate / 60) }}
  49. {% endif %}
  50. {% endif %}
  51. </option>
  52. {% endfor %}
  53. </select>
  54. <br>
  55. </div>
  56. <div class="floatleft">
  57. {% trans 'Chart columns' %}
  58. <br>
  59. <select name="chartColumns">
  60. <option>1</option>
  61. <option>2</option>
  62. <option>3</option>
  63. <option>4</option>
  64. <option>5</option>
  65. <option>6</option>
  66. </select>
  67. </div>
  68. <div class="clearfloat paddingtop">
  69. <strong>{% trans 'Chart arrangement' %}</strong>
  70. {{ show_hint('The arrangement of the charts is stored to the browsers local storage. You may want to export it if you have a complicated set up.'|trans) }}
  71. <br>
  72. <a class="ajax" href="#importMonitorConfig">
  73. {% trans 'Import' %}
  74. </a> -
  75. <a class="disableAjax" href="#exportMonitorConfig">
  76. {% trans 'Export' %}
  77. </a> -
  78. <a href="#clearMonitorConfig">
  79. {% trans 'Reset to default' %}
  80. </a>
  81. </div>
  82. </div>
  83. <div id="monitorInstructionsDialog" title="{% trans 'Monitor Instructions' %}" class="hide">
  84. <p>
  85. {% trans %}
  86. The phpMyAdmin Monitor can assist you in optimizing the server configuration and track down time intensive queries. For the latter you will need to set log_output to 'TABLE' and have either the slow_query_log or general_log enabled. Note however, that the general_log produces a lot of data and increases server load by up to 15%.
  87. {% endtrans %}
  88. </p>
  89. <img class="ajaxIcon" src="{{ image_path }}ajax_clock_small.gif" alt="{% trans 'Loading…' %}">
  90. <div class="ajaxContent"></div>
  91. <br>
  92. <div class="monitorUse hide">
  93. <p><strong>{% trans 'Using the monitor:' %}</strong></p>
  94. <p>
  95. {% trans %}
  96. Your browser will refresh all displayed charts in a regular interval. You may add charts and change the refresh rate under 'Settings', or remove any chart using the cog icon on each respective chart.
  97. {% endtrans %}
  98. </p>
  99. <p>
  100. {% trans %}
  101. To display queries from the logs, select the relevant time span on any chart by holding down the left mouse button and panning over the chart. Once confirmed, this will load a table of grouped queries, there you may click on any occurring SELECT statements to further analyze them.
  102. {% endtrans %}
  103. </p>
  104. <p>
  105. {{ get_image('s_attention') }}
  106. <strong>{% trans 'Please note:' %}</strong>
  107. </p>
  108. <p>
  109. {% trans %}
  110. Enabling the general_log may increase the server load by 5-15%. Also be aware that generating statistics from the logs is a load intensive task, so it is advisable to select only a small time span and to disable the general_log and empty its table once monitoring is not required any more.
  111. {% endtrans %}
  112. </p>
  113. </div>
  114. </div>
  115. <div id="addChartDialog" title="{% trans 'Add chart' %}" class="hide">
  116. <div id="tabGridVariables">
  117. <p>
  118. <input type="text" name="chartTitle" value="{% trans 'Chart Title' %}">
  119. </p>
  120. <input type="radio" name="chartType" value="preset" id="chartPreset">
  121. <label for="chartPreset">{% trans 'Preset chart' %}</label>
  122. <select name="presetCharts"></select>
  123. <br>
  124. <input type="radio" name="chartType" value="variable" id="chartStatusVar" checked="checked">
  125. <label for="chartStatusVar">
  126. {% trans 'Status variable(s)' %}
  127. </label>
  128. <br>
  129. <div id="chartVariableSettings">
  130. <label for="chartSeries">{% trans 'Select series:' %}</label>
  131. <br>
  132. <select id="chartSeries" name="varChartList" size="1">
  133. <option>{% trans 'Commonly monitored' %}</option>
  134. <option>Processes</option>
  135. <option>Questions</option>
  136. <option>Connections</option>
  137. <option>Bytes_sent</option>
  138. <option>Bytes_received</option>
  139. <option>Threads_connected</option>
  140. <option>Created_tmp_disk_tables</option>
  141. <option>Handler_read_first</option>
  142. <option>Innodb_buffer_pool_wait_free</option>
  143. <option>Key_reads</option>
  144. <option>Open_tables</option>
  145. <option>Select_full_join</option>
  146. <option>Slow_queries</option>
  147. </select>
  148. <br>
  149. <label for="variableInput">
  150. {% trans 'or type variable name:' %}
  151. </label>
  152. <input type="text" name="variableInput" id="variableInput">
  153. <br>
  154. <input type="checkbox" name="differentialValue" id="differentialValue" value="differential" checked="checked">
  155. <label for="differentialValue">
  156. {% trans 'Display as differential value' %}
  157. </label>
  158. <br>
  159. <input type="checkbox" id="useDivisor" name="useDivisor" value="1">
  160. <label for="useDivisor">{% trans 'Apply a divisor' %}</label>
  161. <span class="divisorInput hide">
  162. <input type="text" name="valueDivisor" size="4" value="1">
  163. (<a href="#kibDivisor">{% trans 'KiB' %}</a>,
  164. <a href="#mibDivisor">{% trans 'MiB' %}</a>)
  165. </span>
  166. <br>
  167. <input type="checkbox" id="useUnit" name="useUnit" value="1">
  168. <label for="useUnit">
  169. {% trans 'Append unit to data values' %}
  170. </label>
  171. <span class="unitInput hide">
  172. <input type="text" name="valueUnit" size="4" value="">
  173. </span>
  174. <p>
  175. <a href="#submitAddSeries">
  176. <strong>{% trans 'Add this series' %}</strong>
  177. </a>
  178. <span id="clearSeriesLink" class="hide">
  179. | <a href="#submitClearSeries">{% trans 'Clear series' %}</a>
  180. </span>
  181. </p>
  182. {% trans 'Series in chart:' %}
  183. <br>
  184. <span id="seriesPreview">
  185. <em>{% trans 'None' %}</em>
  186. </span>
  187. </div>
  188. </div>
  189. </div>
  190. <div id="logAnalyseDialog" title="{% trans 'Log statistics' %}" class="hide">
  191. <p>
  192. {% trans 'Selected time range:' %}
  193. <input type="text" name="dateStart" class="datetimefield" value="">
  194. -
  195. <input type="text" name="dateEnd" class="datetimefield" value="">
  196. </p>
  197. <input type="checkbox" id="limitTypes" value="1" checked="checked">
  198. <label for="limitTypes">
  199. {% trans 'Only retrieve SELECT,INSERT,UPDATE and DELETE Statements' %}
  200. </label>
  201. <br>
  202. <input type="checkbox" id="removeVariables" value="1" checked="checked">
  203. <label for="removeVariables">
  204. {% trans 'Remove variable data in INSERT statements for better grouping' %}
  205. </label>
  206. <p>
  207. {% trans 'Choose from which log you want the statistics to be generated from.' %}
  208. </p>
  209. <p>
  210. {% trans 'Results are grouped by query text.' %}
  211. </p>
  212. </div>
  213. <div id="queryAnalyzerDialog" title="{% trans 'Query analyzer' %}" class="hide">
  214. <textarea id="sqlquery"></textarea>
  215. <br>
  216. <div class="placeHolder"></div>
  217. </div>
  218. <div class="clearfloat"></div>
  219. <div class="row"><table class="pma-table clearfloat tdblock" id="chartGrid"></table></div>
  220. <div id="logTable"><br></div>
  221. <script type="text/javascript">
  222. var variableNames = [
  223. {% for variable_name in javascript_variable_names %}
  224. "{{ variable_name|e('js') }}",
  225. {% endfor %}
  226. ];
  227. </script>
  228. <form id="js_data" class="hide">
  229. {% for name, value in form %}
  230. <input type="hidden" name="{{ name }}" value="{{ value }}">
  231. {% endfor %}
  232. </form>
  233. <div id="profiling_docu" class="hide">
  234. {{ show_mysql_docu('general-thread-states') }}
  235. </div>
  236. <div id="explain_docu" class="hide">
  237. {{ show_mysql_docu('explain-output') }}
  238. </div>
  239. {% endblock %}