Revert initial commit
[phpmyadmin/blinky.git] / js / replication.js
blob1a7c785b03699babcd7e71ecc8d7a09af1e33660
1 /* vim: set expandtab sw=4 ts=4 sts=4: */
2 /**
3  * for server_replication.php 
4  *
5  */
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();
16     });
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);
22     } else {
23         $('#rep').html(conf_prefix + conf_do + database_list);
24     }
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(); 
34         });
35     $('#master_slaves_href').click(function() {
36         $('#replication_slaves_section').toggle(); 
37         });
38     $('#slave_status_href').click(function() {
39         $('#replication_slave_section').toggle(); 
40         });
41     $('#slave_control_href').click(function() {
42         $('#slave_control_gui').toggle(); 
43         });
44     $('#slave_errormanagement_href').click(function() {
45         $('#slave_errormanagement_gui').toggle(); 
46         });
47     $('#slave_synchronization_href').click(function() {
48         $('#slave_synchronization_gui').toggle(); 
49         });
50     $('#db_reset_href').click(function() {
51         $('#db_select option:selected').attr('selected', false); 
52         });
53 });