1 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 * for server_replication.php
7 var random_server_id = Math.floor(Math.random() * 10000000);
8 var conf_prefix = "server-id=" + random_server_id + "<br />log-bin=mysql-bin<br />log-error=mysql-bin.err<br />";
10 function update_config()
12 var conf_ignore = "binlog_ignore_db=";
13 var conf_do = "binlog_do_db=";
14 var database_list = $('#db_select option:selected:first').val();
15 $('#db_select option:selected:not(:first)').each(function() {
16 database_list += ',' + $(this).val();
19 if ($('#db_select option:selected').size() == 0) {
20 $('#rep').html(conf_prefix);
21 } else if ($('#db_type option:selected').val() == 'all') {
22 $('#rep').html(conf_prefix + conf_ignore + database_list);
24 $('#rep').html(conf_prefix + conf_do + database_list);
28 $(document).ready(function() {
29 $('#rep').html(conf_prefix);
30 $('#db_type').change(update_config);
31 $('#db_select').change(update_config);
33 $('#master_status_href').click(function() {
34 $('#replication_master_section').toggle();
36 $('#master_slaves_href').click(function() {
37 $('#replication_slaves_section').toggle();
39 $('#slave_status_href').click(function() {
40 $('#replication_slave_section').toggle();
42 $('#slave_control_href').click(function() {
43 $('#slave_control_gui').toggle();
45 $('#slave_errormanagement_href').click(function() {
46 $('#slave_errormanagement_gui').toggle();
48 $('#slave_synchronization_href').click(function() {
49 $('#slave_synchronization_gui').toggle();
51 $('#db_reset_href').click(function() {
52 $('#db_select option:selected').attr('selected', false);