From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../templates/server/status/advisor/index.twig | 39 +++ srcs/phpmyadmin/templates/server/status/base.twig | 39 +++ .../templates/server/status/monitor/index.twig | 268 +++++++++++++++++++++ .../templates/server/status/processes/index.twig | 53 ++++ .../templates/server/status/processes/list.twig | 65 +++++ .../templates/server/status/queries/index.twig | 56 +++++ .../templates/server/status/status/index.twig | 78 ++++++ .../templates/server/status/variables/index.twig | 137 +++++++++++ 8 files changed, 735 insertions(+) create mode 100644 srcs/phpmyadmin/templates/server/status/advisor/index.twig create mode 100644 srcs/phpmyadmin/templates/server/status/base.twig create mode 100644 srcs/phpmyadmin/templates/server/status/monitor/index.twig create mode 100644 srcs/phpmyadmin/templates/server/status/processes/index.twig create mode 100644 srcs/phpmyadmin/templates/server/status/processes/list.twig create mode 100644 srcs/phpmyadmin/templates/server/status/queries/index.twig create mode 100644 srcs/phpmyadmin/templates/server/status/status/index.twig create mode 100644 srcs/phpmyadmin/templates/server/status/variables/index.twig (limited to 'srcs/phpmyadmin/templates/server/status') diff --git a/srcs/phpmyadmin/templates/server/status/advisor/index.twig b/srcs/phpmyadmin/templates/server/status/advisor/index.twig new file mode 100644 index 0000000..b1bc3a9 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/advisor/index.twig @@ -0,0 +1,39 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'advisor' %} + +{% block content %} + + {% if data is not empty %} + {{ get_icon('b_help', 'Instructions'|trans) }} + +
+ +
+

+ {% trans %} + The Advisor system can provide recommendations on server variables by analyzing the server status variables. + {% endtrans %} +

+

+ {% trans %} + Do note however that this system provides recommendations based on simple calculations and by rule of thumb which may not necessarily apply to your system. + {% endtrans %} +

+

+ {% trans %} + Prior to changing any of the configuration, be sure to know what you are changing (by reading the documentation) and how to undo the change. Wrong tuning can have a very negative effect on performance. + {% endtrans %} +

+

+ {% trans %} + The best way to tune your system would be to change only one setting at a time, observe or benchmark your database, and undo the change if there was no clearly measurable improvement. + {% endtrans %} +

+
+ +
{{ data }}
+ {% else %} + {{ 'Not enough privilege to view the advisor.'|trans|error }} + {% endif %} + +{% endblock %} diff --git a/srcs/phpmyadmin/templates/server/status/base.twig b/srcs/phpmyadmin/templates/server/status/base.twig new file mode 100644 index 0000000..66547a8 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/base.twig @@ -0,0 +1,39 @@ +
+ +
+ +
+ {% block content %}{% endblock %} +
+
diff --git a/srcs/phpmyadmin/templates/server/status/monitor/index.twig b/srcs/phpmyadmin/templates/server/status/monitor/index.twig new file mode 100644 index 0000000..c4c7277 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/monitor/index.twig @@ -0,0 +1,268 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'monitor' %} +{% block content %} + + + +
+ + {{ get_image('b_chart') }} + {% trans 'Add chart' %} + + + {{ get_image('b_tblops') }} + {% trans 'Enable charts dragging' %} + +
+ +
+ {% trans 'Refresh rate' %} +
+ +
+
+ +
+ {% trans 'Chart columns' %} +
+ +
+ +
+ {% trans 'Chart arrangement' %} + {{ 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) }} +
+ + {% trans 'Import' %} + - + + {% trans 'Export' %} + - + + {% trans 'Reset to default' %} + +
+
+ +
+

+ {% trans %} + 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%. + {% endtrans %} +

+ {% trans 'Loading…' %} + +
+
+ +
+

{% trans 'Using the monitor:' %}

+

+ {% trans %} + 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. + {% endtrans %} +

+

+ {% trans %} + 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. + {% endtrans %} +

+

+ {{ get_image('s_attention') }} + {% trans 'Please note:' %} +

+

+ {% trans %} + 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. + {% endtrans %} +

+
+
+ +
+
+

+ +

+ + + + +
+ + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + ({% trans 'KiB' %}, + {% trans 'MiB' %}) + +
+ + + + + + + +

+ + {% trans 'Add this series' %} + + + | {% trans 'Clear series' %} + +

+ + {% trans 'Series in chart:' %} +
+ + {% trans 'None' %} + +
+
+
+ +
+

+ {% trans 'Selected time range:' %} + + - + +

+ + + +
+ + + + +

+ {% trans 'Choose from which log you want the statistics to be generated from.' %} +

+

+ {% trans 'Results are grouped by query text.' %} +

+
+ +
+ +
+
+
+ +
+

+ + + +
+ {% for name, value in form %} + + {% endfor %} +
+ +
+ {{ show_mysql_docu('general-thread-states') }} +
+ +
+ {{ show_mysql_docu('explain-output') }} +
+ +{% endblock %} diff --git a/srcs/phpmyadmin/templates/server/status/processes/index.twig b/srcs/phpmyadmin/templates/server/status/processes/index.twig new file mode 100644 index 0000000..bb73156 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/processes/index.twig @@ -0,0 +1,53 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'processes' %} +{% block content %} + +
+ {% trans 'Filters' %} +
+ {{ get_hidden_inputs(url_params) }} + +
+ + +
+
+
+ +{{ server_process_list|raw }} + +{{ 'Note: Enabling the auto refresh here might cause heavy traffic between the web server and the MySQL server.'|trans|notice }} + + + +{% endblock %} diff --git a/srcs/phpmyadmin/templates/server/status/processes/list.twig b/srcs/phpmyadmin/templates/server/status/processes/list.twig new file mode 100644 index 0000000..83561f9 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/processes/list.twig @@ -0,0 +1,65 @@ +
+ + + + + {% for column in columns %} + + {% endfor %} + + + + + {% for row in rows %} + + + + + + + + + + + + {% endfor %} + +
{% trans 'Processes' %} + + {{ column.name }} + {% if column.is_sorted %} + 
+                  {%- trans 'Descending' %} + 
+                  {%- trans 'Ascending' %} + {% endif %} + + {% if column.has_full_query %} + + {% if column.is_full %} + {{ get_image( + 's_partialtext', + 'Truncate shown queries'|trans, + {'class': 'icon_fulltext'} + ) }} + {% else %} + {{ get_image( + 's_fulltext', + 'Show full queries'|trans, + {'class': 'icon_fulltext'} + ) }} + {% endif %} + + {% endif %} +
+ + {% trans 'Kill' %} + + {{ row.id }}{{ row.user }}{{ row.host }} + {% if row.db != '' %} + {{ row.db }} + {% else %} + {% trans 'None' %} + {% endif %} + {{ row.command }}{{ row.time }}{{ row.state }}{{ row.progress }}{{ row.info|raw }}
+
diff --git a/srcs/phpmyadmin/templates/server/status/queries/index.twig b/srcs/phpmyadmin/templates/server/status/queries/index.twig new file mode 100644 index 0000000..be743b9 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/queries/index.twig @@ -0,0 +1,56 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'queries' %} +{% block content %} + +{% if is_data_loaded %} +

+ {% trans %} + Questions since startup: + {% notes %} + Questions is the name of a MySQL Status variable + {% endtrans %} + {{ format_number(stats.total, 0) }} + {{ show_mysql_docu('server-status-variables', false, null, null, 'statvar_Questions') }} +

+ + + + + + + + + + + + + + + + + + + + {% for query in queries %} + + + + + + + {% endfor %} + +
{% trans 'Statements' %}{% trans %}#{% notes %}# = Amount of queries{% endtrans %}ø {% trans 'per hour' %}%
{{ query.name }}{{ format_number(query.value, 5, 0, true) }}{{ format_number(query.per_hour, 4, 1, true) }}{{ format_number(query.percentage, 0, 2) }}
+ +
+{% else %} + {{ 'Not enough privilege to view query statistics.'|trans|error }} +{% endif %} + +{% endblock %} diff --git a/srcs/phpmyadmin/templates/server/status/status/index.twig b/srcs/phpmyadmin/templates/server/status/status/index.twig new file mode 100644 index 0000000..53fd63f --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/status/index.twig @@ -0,0 +1,78 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'status' %} +{% block content %} + +{% if is_data_loaded %} +

{{ 'Network traffic since startup: %s'|trans|format(network_traffic) }}

+

{{ 'This MySQL server has been running for %1$s. It started up on %2$s.'|trans|format(uptime, start_time) }}

+ + + + + + + + + + + + {% for each_traffic in traffic %} + + + + + + {% endfor %} + +
+ {% trans 'Traffic' %} + {{ show_hint('On a busy server, the byte counters may overrun, so those statistics as reported by the MySQL server may be incorrect.'|trans) }} + #ø {% trans 'per hour' %}
{{ each_traffic.name }}{{ each_traffic.number }}{{ each_traffic.per_hour }}
+ + + + + + + + + + + + + {% for connection in connections %} + + + + + + + {% endfor %} + +
{% trans 'Connections' %}#ø {% trans 'per hour' %}%
{{ connection.name }}{{ connection.number }}{{ connection.per_hour }}{{ connection.percentage }}
+ + {% if is_master or is_slave %} +

+ {% if is_master and is_slave %} + {% trans 'This MySQL server works as master and slave in replication process.' %} + {% elseif is_master %} + {% trans 'This MySQL server works as master in replication process.' %} + {% elseif is_slave %} + {% trans 'This MySQL server works as slave in replication process.' %} + {% endif %} +

+ +
+ +

+ {% trans 'Replication status' %} +

+ + {{ replication|raw }} + {% endif %} + +{% else %} + {{ 'Not enough privilege to view server status.'|trans|error }} +{% endif %} + +{% endblock %} diff --git a/srcs/phpmyadmin/templates/server/status/variables/index.twig b/srcs/phpmyadmin/templates/server/status/variables/index.twig new file mode 100644 index 0000000..a5f8724 --- /dev/null +++ b/srcs/phpmyadmin/templates/server/status/variables/index.twig @@ -0,0 +1,137 @@ +{% extends 'server/status/base.twig' %} +{% set active = 'variables' %} +{% block content %} + +{% if is_data_loaded %} +
+ {% trans 'Filters' %} +
+ {{ get_hidden_inputs() }} + + + +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+
+
+ + + +
+ + + + + + + + + + + + + + + {% for variable in variables %} + + + + + + + + {% endfor %} + +
{% trans 'Variable' %}{% trans 'Value' %}{% trans 'Description' %}
+ {{ variable.name|replace({'_': ' '}) }} + {{ variable.doc|raw }} + + + {% if variable.has_alert %} + + {% endif %} + + {% if variable.name ends with '%' %} + {{ format_number(variable.value, 0, 2) }} % + {% elseif 'Uptime' in variable.name %} + {{ timespan_format(variable.value) }} + {% elseif variable.is_numeric and variable.value >= 1000 %} + + {{ format_number(variable.value, 3, 1) }} + + {% elseif variable.is_numeric %} + {{ format_number(variable.value, 3, 1) }} + {% else %} + {{ variable.value }} + {% endif %} + + {% if variable.has_alert %} + + {% endif %} + + + {% if variable.has_alert %} + + {% endif %} + {{ variable.value }} + {% if variable.has_alert %} + + {% endif %} + + + {{ variable.description }} + {% for doc in variable.description_doc %} + {% if doc.name == 'doc' %} + {{ show_mysql_docu(doc.url) }} + {% else %} + {{ doc.name }} + {% endif %} + {% endfor %} +
+
+{% else %} + {{ 'Not enough privilege to view status variables.'|trans|error }} +{% endif %} + +{% endblock %} -- cgit