Update website

This commit is contained in:
Guilhem Lavaux 2024-11-23 20:45:29 +01:00
parent 41ce1aa076
commit ea0eb1c6e0
4222 changed files with 721797 additions and 14 deletions

View file

@ -0,0 +1,35 @@
<form method="post" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs('', '') }}
<fieldset class="pma-fieldset" id="fieldset_add_user_login">
<legend>
{% trans 'Replica configuration' %} -
{% trans 'Change or reconfigure primary server' %}
</legend>
<p>
{% trans 'Make sure you have a unique server-id in your configuration file (my.cnf). If not, please add the following line into [mysqld] section:' %}
</p>
<pre>server-id={{ server_id }}</pre>
<div class="item">
<label for="text_username">{% trans 'User name:' %}</label>
<input id="text_username" name="username" type="text" maxlength="{{ username_length }}" title="{% trans 'User name' %}" required>
</div>
<div class="item">
<label for="text_pma_pw">{% trans 'Password:' %}</label>
<input id="text_pma_pw" name="pma_pw" type="password" spellcheck="false" title="{% trans 'Password' %}" required>
</div>
<div class="item">
<label for="text_hostname">{% trans 'Host:' %}</label>
<input id="text_hostname" name="hostname" type="text" maxlength="{{ hostname_length }}" value="" required>
</div>
<div class="item">
<label for="text_port">{% trans 'Port:' %}</label>
<input id="text_port" name="text_port" type="number" maxlength="6" value="3306" required>
</div>
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="pma-fieldset tblFooters">
<input type="hidden" name="sr_take_action" value="true">
<input type="hidden" name="{{ submit_name }}" value="1">
<input class="btn btn-primary" type="submit" id="confreplica_submit" value="{% trans 'Go' %}">
</fieldset>
</form>

View file

@ -0,0 +1,9 @@
<select class="width96 resize-vertical" id="db_select" name="db_select[]" size="6" multiple>
{% for database in databases %}
<option value="{{ database }}">{{ database }}</option>
{% endfor %}
</select>
<p>
<a href="#" id="db_select_href">{% trans 'Select all' %}</a> /
<a href="#" id="db_reset_href">{% trans 'Unselect all' %}</a>
</p>

View file

@ -0,0 +1,44 @@
<div class="container-fluid">
<div class="row">
<h2>
{{ get_image('s_replication') }}
{% trans 'Replication' %}
</h2>
</div>
{% if is_super_user %}
<div class="row">
<div id="replication" class="container-fluid">
{{ error_messages|raw }}
{% if is_primary %}
{{ primary_replication_html|raw }}
{% elseif primary_configure is null and clear_screen is null %}
<div class="card mb-2">
<div class="card-header">{% trans 'Primary replication' %}</div>
<div class="card-body">
{% apply format('<a href="' ~ url('/server/replication') ~ '" data-post="' ~ get_common(url_params|merge({'primary_configure': true}), '', false) ~ '">', '</a>')|raw %}
{% trans %}
This server is not configured as primary in a replication process. Would you like to %sconfigure%s it?
{% endtrans %}
{% endapply %}
</div>
</div>
{% endif %}
{% if primary_configure is not null %}
{{ primary_configuration_html|raw }}
{% else %}
{% if clear_screen is null %}
{{ replica_configuration_html|raw }}
{% endif %}
{% if replica_configure is not null %}
{{ change_primary_html|raw }}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% else %}
{{ 'No privileges'|trans|error }}
{% endif %}

View file

@ -0,0 +1,84 @@
<div id="primary_addreplicauser_gui">
<form action="{{ url('/server/privileges') }}" method="post" autocomplete="off" id="addUsersForm">
{{ get_hidden_inputs('', '') }}
<fieldset class="pma-fieldset" id="fieldset_add_user_login">
<legend>{% trans 'Add replica replication user' %}</legend>
<input type="hidden" name="grant_count" value="25">
<input type="hidden" name="createdb" id="createdb_0" value="0">
{# Needed for the replication replicas. #}
<input type="hidden" name="Repl_slave_priv" id="checkbox_Repl_slave_priv" value="Y">
<input type="hidden" name="sr_take_action" value="true">
<div class="item">
<label for="select_pred_username">
{% trans 'User name:' %}
</label>
<span class="options">
<select name="pred_username" id="select_pred_username" title="{% trans 'User name' %}">
<option value="any"{{ predefined_username == 'any' ? ' selected' }}>{% trans 'Any user' %}</option>
<option value="userdefined"{{ predefined_username == 'userdefined' ? ' selected' }}>{% trans 'Use text field:' %}</option>
</select>
</span>
<input type="text" name="username" id="pma_username" maxlength="{{ username_length }}" title="{% trans 'User name' %}" value="{{ username }}" spellcheck="false">
</div>
<div class="item">
<label for="select_pred_hostname">
{% trans 'Host:' %}
</label>
<span class="options">
<select name="pred_hostname" id="select_pred_hostname" title="{% trans 'Host' %}"
{%- if this_host is not null %} data-thishost="{{ this_host }}"{% endif %}>
<option value="any"{{ predefined_hostname == 'any' ? ' selected' }}>{% trans 'Any host' %}</option>
<option value="localhost"{{ predefined_hostname == 'localhost' ? ' selected' }}>{% trans 'Local' %}</option>
{% if this_host is not null %}
<option value="thishost"{{ predefined_hostname == 'thishost' ? ' selected' }}>{% trans 'This host' %}</option>
{% endif %}
<option value="hosttable"{{ predefined_hostname == 'hosttable' ? ' selected' }}>{% trans 'Use host table' %}</option>
<option value="userdefined"{{ predefined_hostname == 'userdefined' ? ' selected' }}>{% trans 'Use text field:' %}</option>
</select>
</span>
<input type="text" name="hostname" id="pma_hostname" maxlength="{{ hostname_length }}" title="{% trans 'Host' %}" value="{{ hostname }}">
{{ show_hint('When Host table is used, this field is ignored and values stored in Host table are used instead.'|trans) }}
</div>
<div class="item">
<label for="select_pred_password">
{% trans 'Password:' %}
</label>
<span class="options">
<select name="pred_password" id="select_pred_password" title="{% trans 'Password' %}">
<option value="none"{{ has_username ? ' selected' }}>{% trans 'No password' %}</option>
<option value="userdefined"{{ not has_username ? ' selected' }}>{% trans 'Use text field:' %}</option>
</select>
</span>
<input type="password" id="text_pma_pw" name="pma_pw" title="{% trans 'Password' %}" spellcheck="false">
</div>
<div class="item">
<label for="text_pma_pw2">
{% trans 'Re-type:' %}
</label>
<span class="options"></span>
<input type="password" id="text_pma_pw2" name="pma_pw2" title="{% trans 'Re-type' %}" spellcheck="false">
</div>
<div class="item">
<label for="button_generate_password">
{% trans 'Generate password:' %}
</label>
<span class="options">
<input type="button" class="btn btn-secondary button" id="button_generate_password" value="{% trans 'Generate' %}">
</span>
<input type="text" name="generated_pw" id="generated_pw">
</div>
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="pma-fieldset tblFooters">
<input type="hidden" name="adduser_submit" value="1">
<input class="btn btn-primary" type="submit" id="adduser_submit" value="{% trans 'Go' %}">
</fieldset>
</form>
</div>

View file

@ -0,0 +1,32 @@
<fieldset class="pma-fieldset">
<legend>{% trans 'Primary configuration' %}</legend>
<p>
{% trans %}
This server is not configured as a primary server in a replication process. You can choose from either replicating all databases and ignoring some of them (useful if you want to replicate a majority of the databases) or you can choose to ignore all databases by default and allow only certain databases to be replicated. Please select the mode:
{% endtrans %}
</p>
<select name="db_type" id="db_type">
<option value="all">{% trans 'Replicate all databases; Ignore:' %}</option>
<option value="ign">{% trans 'Ignore all databases; Replicate:' %}</option>
</select>
<p>{% trans 'Please select databases:' %}</p>
{{ database_multibox|raw }}
<p>
{% trans %}
Now, add the following lines at the end of [mysqld] section in your my.cnf and please restart the MySQL server afterwards.
{% endtrans %}
</p>
<pre id="rep"></pre>
<p>
{% trans %}
Once you restarted MySQL server, please click on Go button. Afterwards, you should see a message informing you, that this server <strong>is</strong> configured as primary.
{% endtrans %}
</p>
</fieldset>
<fieldset class="pma-fieldset tblFooters">
<form method="post" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs('', '') }}
<input id="goButton" class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
</form>
</fieldset>

View file

@ -0,0 +1,54 @@
{% if not clear_screen %}
<div class="card mb-2">
<div class="card-header">{% trans 'Primary replication' %}</div>
<div class="card-body">
{% trans 'This server is configured as primary in a replication process.' %}
<ul>
<li>
<a href="#primary_status_href" id="primary_status_href">
{% trans 'Show primary status' %}
</a>
{{ primary_status_table|raw }}
</li>
<li>
<p>
<a href="#primary_replicas_href" id="primary_replicas_href">
{% trans 'Show connected replicas' %}
</a>
</p>
<div id="replication_replicas_section" style="display: none;">
<table class="table w-auto">
<thead>
<tr>
<th>{% trans 'Server ID' %}</th>
<th>{% trans 'Host' %}</th>
</tr>
</thead>
<tbody>
{% for replica in replicas %}
<tr>
<td class="text-end font-monospace">{{ replica['Server_id'] }}</td>
<td class="text-end font-monospace">{{ replica['Host'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
{{ 'Only replicas started with the --report-host=host_name option are visible in this list.'|trans|notice }}
<br>
</div>
</li>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ get_common(url_params, '') }}" id="primary_addreplicauser_href">
{% trans 'Add replica replication user' %}
</a>
</li>
{% endif %}
{% if primary_add_user %}
{{ primary_add_replica_user|raw }}
{% elseif not clear_screen %}
</ul>
</div>
</div>
{% endif %}

View file

@ -0,0 +1,111 @@
<div class="card">
<div class="card-header">{% trans 'Replica replication' %}</div>
<div class="card-body">
{% if server_replica_multi_replication %}
{% trans 'Primary connection:' %}
<form method="get" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs(url_params) }}
<select name="primary_connection">
<option value="">{% trans 'Default' %}</option>
{% for server in server_replica_multi_replication %}
<option value="{{ server['Connection_name'] }}"{{ primary_connection == server['Connection_name'] ? ' selected' }}>
{{ server['Connection_name'] }}
</option>
{% endfor %}
</select>
<input id="goButton" class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
</form>
<br>
<br>
{% endif %}
{% if server_replica_status %}
<div id="replica_configuration_gui">
{% if not replica_sql_running %}
{{ 'Replica SQL Thread not running!'|trans|error }}
{% endif %}
{% if not replica_io_running %}
{{ 'Replica IO Thread not running!'|trans|error }}
{% endif %}
<p>{% trans 'Server is configured as replica in a replication process. Would you like to:' %}</p>
<ul>
<li>
<a href="#replica_status_href" id="replica_status_href">{% trans 'See replica status table' %}</a>
{{ replica_status_table|raw }}
</li>
<li>
<a href="#replica_control_href" id="replica_control_href">{% trans 'Control replica:' %}</a>
<div id="replica_control_gui" class="hide">
<ul>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_control_full_link|raw }}">
{{ not replica_io_running or not replica_sql_running ? 'Full start' : 'Full stop' }}
</a>
</li>
<li>
<a class="ajax" id="reset_replica" href="{{ url('/server/replication') }}" data-post="{{ replica_control_reset_link|raw }}">
{% trans 'Reset replica' %}
</a>
</li>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_control_sql_link|raw }}">
{% if not replica_sql_running %}
{% trans 'Start SQL Thread only' %}
{% else %}
{% trans 'Stop SQL Thread only' %}
{% endif %}
</a>
</li>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_control_io_link|raw }}">
{% if not replica_io_running %}
{% trans 'Start IO Thread only' %}
{% else %}
{% trans 'Stop IO Thread only' %}
{% endif %}
</a>
</li>
</ul>
</div>
</li>
<li>
<a href="#replica_errormanagement_href" id="replica_errormanagement_href">
{% trans 'Error management:' %}
</a>
<div id="replica_errormanagement_gui" class="hide">
{{ 'Skipping errors might lead into unsynchronized primary and replica!'|trans|error }}
<ul>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_skip_error_link|raw }}">
{% trans 'Skip current error' %}
</a>
</li>
<li>
<form method="post" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs('', '') }}
{{ 'Skip next %s errors.'|trans|format('<input type="text" name="sr_skip_errors_count" value="1" class="repl_gui_skip_err_cnt">')|raw }}
<input class="btn btn-primary" type="submit" name="sr_replica_skip_error" value="{% trans 'Go' %}">
<input type="hidden" name="sr_take_action" value="1">
</form>
</li>
</ul>
</div>
</li>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ reconfigure_primary_link|raw }}">
{% trans 'Change or reconfigure primary server' %}
</a>
</li>
</ul>
</div>
{% elseif not has_replica_configure %}
{% apply format('<a href="' ~ url('/server/replication') ~ '" data-post="' ~ get_common(url_params|merge({
'replica_configure': true,
'repl_clear_scr': true
})) ~ '">', '</a>')|raw %}
{% trans 'This server is not configured as replica in a replication process. Would you like to %sconfigure%s it?' %}
{% endapply %}
{% endif %}
</div>
</div>

View file

@ -0,0 +1,34 @@
<div id="replication_{{ type }}_section"{{ is_hidden ? ' style="display: none;"' }}>
{% if has_title %}
<h4>
<a id="replication_{{ type }}"></a>
{% if type == 'primary' %}
{% trans 'Primary status' %}
{% else %}
{% trans 'Replica status' %}
{% endif %}
</h4>
{% endif %}
<table id="server{{ type }}replicationsummary" class="table w-auto">
<thead>
<tr>
<th>{% trans 'Variable' %}</th>
<th>{% trans 'Value' %}</th>
</tr>
</thead>
<tbody>
{% for variable in variables %}
<tr>
<td>{{ variable.name }}</td>
<td class="text-end font-monospace">
<span{% if variable.status == 'text-danger' %} class="text-danger"{% elseif variable.status == 'text-success' %} class="text-success"{% endif %}>
{{ variable.value }}
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>