-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
replica_configuration.twig
109 lines (107 loc) · 4.53 KB
/
replica_configuration.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<div class="card">
<div class="card-header">{{ t('Replica replication') }}</div>
<div class="card-body">
{% if server_replica_multi_replication %}
{{ t('Primary connection:') }}
<form method="get" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs(url_params) }}
<select name="primary_connection">
<option value="">{{ t('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="{{ t('Go') }}">
</form>
<br>
<br>
{% endif %}
{% if server_replica_status %}
<div id="replica_configuration_gui">
{% if not replica_sql_running %}
{{ t('Replica SQL Thread not running!')|error }}
{% endif %}
{% if not replica_io_running %}
{{ t('Replica IO Thread not running!')|error }}
{% endif %}
<p>{{ t('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">{{ t('See replica status table') }}</a>
{{ replica_status_table|raw }}
</li>
<li>
<a href="#replica_control_href" id="replica_control_href">{{ t('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 }}">
{{ t('Reset replica') }}
</a>
</li>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_control_sql_link|raw }}">
{% if not replica_sql_running %}
{{ t('Start SQL Thread only') }}
{% else %}
{{ t('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 %}
{{ t('Start IO Thread only') }}
{% else %}
{{ t('Stop IO Thread only') }}
{% endif %}
</a>
</li>
</ul>
</div>
</li>
<li>
<a href="#replica_errormanagement_href" id="replica_errormanagement_href">
{{ t('Error management:') }}
</a>
<div id="replica_errormanagement_gui" class="hide">
{{ t('Skipping errors might lead into unsynchronized primary and replica!')|error }}
<ul>
<li>
<a href="{{ url('/server/replication') }}" data-post="{{ replica_skip_error_link|raw }}">
{{ t('Skip current error') }}
</a>
</li>
<li>
<form method="post" action="{{ url('/server/replication') }}">
{{ get_hidden_inputs('', '') }}
{{ t('Skip next %s errors.')|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="{{ t('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 }}">
{{ t('Change or reconfigure primary server') }}
</a>
</li>
</ul>
</div>
{% elseif not has_replica_configure %}
{{ t('This server is not configured as replica in a replication process. Would you like to %sconfigure%s it?')|format('<a href="' ~ url('/server/replication') ~ '" data-post="' ~ get_common(url_params|merge({
'replica_configure': true,
'replica_clear_screen': true
})) ~ '">', '</a>')|raw }}
{% endif %}
</div>
</div>