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() {
11 var conf_ignore = "binlog_ignore_db=";
12 var conf_do = "binlog_do_db=";
13 var database_list = $('#db_select option:selected:first').val();
14 $('#db_select option:selected:not(:first)').each(function() {
15 database_list += ',' + $(this).val();
18 if ($('#db_select option:selected').size() == 0) {
19 $('#rep').html(conf_prefix);
20 } else if ($('#db_type option:selected').val() == 'all') {
21 $('#rep').html(conf_prefix + conf_ignore + database_list);
23 $('#rep').html(conf_prefix + conf_do + database_list);
27 $(document).ready(function() {
28 $('#rep').html(conf_prefix);
29 $('#db_type').change(update_config);
30 $('#db_select').change(update_config);
32 $('#master_status_href').click(function() {
33 $('#replication_master_section').toggle();
35 $('#master_slaves_href').click(function() {
36 $('#replication_slaves_section').toggle();
38 $('#slave_status_href').click(function() {
39 $('#replication_slave_section').toggle();
41 $('#slave_control_href').click(function() {
42 $('#slave_control_gui').toggle();
44 $('#slave_errormanagement_href').click(function() {
45 $('#slave_errormanagement_gui').toggle();
47 $('#slave_synchronization_href').click(function() {
48 $('#slave_synchronization_gui').toggle();
50 $('#db_reset_href').click(function() {
51 $('#db_select option:selected').attr('selected', false);