Initial commit
This commit is contained in:
35
pma/templates/server/replication/change_master.twig
Normal file
35
pma/templates/server/replication/change_master.twig
Normal file
@ -0,0 +1,35 @@
|
||||
<form method="post" action="{{ url('/server/replication') }}">
|
||||
{{ get_hidden_inputs('', '') }}
|
||||
<fieldset id="fieldset_add_user_login">
|
||||
<legend>
|
||||
{% trans 'Slave configuration' %} -
|
||||
{% trans 'Change or reconfigure master 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" 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="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="confslave_submit" value="{% trans 'Go' %}">
|
||||
</fieldset>
|
||||
</form>
|
9
pma/templates/server/replication/database_multibox.twig
Normal file
9
pma/templates/server/replication/database_multibox.twig
Normal file
@ -0,0 +1,9 @@
|
||||
<select id="db_select" class="width96" 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>
|
44
pma/templates/server/replication/index.twig
Normal file
44
pma/templates/server/replication/index.twig
Normal 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_master %}
|
||||
{{ master_replication_html|raw }}
|
||||
{% elseif master_configure is null and clear_screen is null %}
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">{% trans 'Master replication' %}</div>
|
||||
<div class="card-body">
|
||||
{% apply format('<a href="' ~ url('/server/replication') ~ '" data-post="' ~ get_common(url_params|merge({'mr_configure': true}), '') ~ '">', '</a>')|raw %}
|
||||
{% trans %}
|
||||
This server is not configured as master in a replication process. Would you like to %sconfigure%s it?
|
||||
{% endtrans %}
|
||||
{% endapply %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if master_configure is not null %}
|
||||
{{ master_configuration_html|raw }}
|
||||
{% else %}
|
||||
{% if clear_screen is null %}
|
||||
{{ slave_configuration_html|raw }}
|
||||
{% endif %}
|
||||
{% if slave_configure is not null %}
|
||||
{{ change_master_html|raw }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ 'No privileges'|trans|error }}
|
||||
{% endif %}
|
84
pma/templates/server/replication/master_add_slave_user.twig
Normal file
84
pma/templates/server/replication/master_add_slave_user.twig
Normal file
@ -0,0 +1,84 @@
|
||||
<div id="master_addslaveuser_gui">
|
||||
<form action="{{ url('/server/privileges') }}" method="post" autocomplete="off" id="addUsersForm">
|
||||
{{ get_hidden_inputs('', '') }}
|
||||
|
||||
<fieldset id="fieldset_add_user_login">
|
||||
<legend>{% trans 'Add slave 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 slaves. #}
|
||||
<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 }}">
|
||||
</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' %}">
|
||||
</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' %}">
|
||||
</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="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>
|
32
pma/templates/server/replication/master_configuration.twig
Normal file
32
pma/templates/server/replication/master_configuration.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<fieldset>
|
||||
<legend>{% trans 'Master configuration' %}</legend>
|
||||
<p>
|
||||
{% trans %}
|
||||
This server is not configured as a master 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 master.
|
||||
{% endtrans %}
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="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>
|
54
pma/templates/server/replication/master_replication.twig
Normal file
54
pma/templates/server/replication/master_replication.twig
Normal file
@ -0,0 +1,54 @@
|
||||
{% if not clear_screen %}
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">{% trans 'Master replication' %}</div>
|
||||
<div class="card-body">
|
||||
{% trans 'This server is configured as master in a replication process.' %}
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#master_status_href" id="master_status_href">
|
||||
{% trans 'Show master status' %}
|
||||
</a>
|
||||
{{ master_status_table|raw }}
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="#master_slaves_href" id="master_slaves_href">
|
||||
{% trans 'Show connected slaves' %}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div id="replication_slaves_section" style="display: none;">
|
||||
<table class="pma-table data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Server ID' %}</th>
|
||||
<th>{% trans 'Host' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for slave in slaves %}
|
||||
<tr>
|
||||
<td class="value">{{ slave['Server_id'] }}</td>
|
||||
<td class="value">{{ slave['Host'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
{{ 'Only slaves 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="master_addslaveuser_href">
|
||||
{% trans 'Add slave replication user' %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if master_add_user %}
|
||||
{{ master_add_slave_user|raw }}
|
||||
{% elseif not clear_screen %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
111
pma/templates/server/replication/slave_configuration.twig
Normal file
111
pma/templates/server/replication/slave_configuration.twig
Normal file
@ -0,0 +1,111 @@
|
||||
<div class="card">
|
||||
<div class="card-header">{% trans 'Slave replication' %}</div>
|
||||
<div class="card-body">
|
||||
{% if server_slave_multi_replication %}
|
||||
{% trans 'Master connection:' %}
|
||||
<form method="get" action="{{ url('/server/replication') }}">
|
||||
{{ get_hidden_inputs(url_params) }}
|
||||
<select name="master_connection">
|
||||
<option value="">{% trans 'Default' %}</option>
|
||||
{% for server in server_slave_multi_replication %}
|
||||
<option value="{{ server['Connection_name'] }}"{{ master_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_slave_status %}
|
||||
<div id="slave_configuration_gui">
|
||||
{% if not slave_sql_running %}
|
||||
{{ 'Slave SQL Thread not running!'|trans|error }}
|
||||
{% endif %}
|
||||
{% if not slave_io_running %}
|
||||
{{ 'Slave IO Thread not running!'|trans|error }}
|
||||
{% endif %}
|
||||
|
||||
<p>{% trans 'Server is configured as slave in a replication process. Would you like to:' %}</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#slave_status_href" id="slave_status_href">{% trans 'See slave status table' %}</a>
|
||||
{{ slave_status_table|raw }}
|
||||
</li>
|
||||
<li>
|
||||
<a href="#slave_control_href" id="slave_control_href">{% trans 'Control slave:' %}</a>
|
||||
<div id="slave_control_gui" class="hide">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ url('/server/replication') }}" data-post="{{ slave_control_full_link|raw }}">
|
||||
{{ not slave_io_running or not slave_sql_running ? 'Full start' : 'Full stop' }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="ajax" id="reset_slave" href="{{ url('/server/replication') }}" data-post="{{ slave_control_reset_link|raw }}">
|
||||
{% trans 'Reset slave' %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url('/server/replication') }}" data-post="{{ slave_control_sql_link|raw }}">
|
||||
{% if not slave_sql_running %}
|
||||
{% trans 'Start SQL Thread only' %}
|
||||
{% else %}
|
||||
{% trans 'Stop SQL Thread only' %}
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url('/server/replication') }}" data-post="{{ slave_control_io_link|raw }}">
|
||||
{% if not slave_io_running %}
|
||||
{% trans 'Start IO Thread only' %}
|
||||
{% else %}
|
||||
{% trans 'Stop IO Thread only' %}
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#slave_errormanagement_href" id="slave_errormanagement_href">
|
||||
{% trans 'Error management:' %}
|
||||
</a>
|
||||
<div id="slave_errormanagement_gui" class="hide">
|
||||
{{ 'Skipping errors might lead into unsynchronized master and slave!'|trans|error }}
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ url('/server/replication') }}" data-post="{{ slave_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_slave_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_master_link|raw }}">
|
||||
{% trans 'Change or reconfigure master server' %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% elseif not has_slave_configure %}
|
||||
{% apply format('<a href="' ~ url('/server/replication') ~ '" data-post="' ~ get_common(url_params|merge({
|
||||
'sl_configure': true,
|
||||
'repl_clear_scr': true
|
||||
})) ~ '">', '</a>')|raw %}
|
||||
{% trans 'This server is not configured as slave in a replication process. Would you like to %sconfigure%s it?' %}
|
||||
{% endapply %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
34
pma/templates/server/replication/status_table.twig
Normal file
34
pma/templates/server/replication/status_table.twig
Normal 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 == 'master' %}
|
||||
{% trans 'Master status' %}
|
||||
{% else %}
|
||||
{% trans 'Slave status' %}
|
||||
{% endif %}
|
||||
</h4>
|
||||
{% endif %}
|
||||
|
||||
<table id="server{{ type }}replicationsummary" class="pma-table data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Variable' %}</th>
|
||||
<th>{% trans 'Value' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for variable in variables %}
|
||||
<tr>
|
||||
<td class="name">{{ variable.name }}</td>
|
||||
<td class="value">
|
||||
<span{% if variable.status == 'attention' %} class="attention"{% elseif variable.status == 'allfine' %} class="allfine"{% endif %}>
|
||||
{{ variable.value }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
Reference in New Issue
Block a user