rfe #2964518 [interface] Allow to choose servers from configuration for synchronisation.

This commit is contained in:
Michal Čihař
2010-04-16 16:26:13 +02:00
parent 87d19393b3
commit 13b9403d74
3 changed files with 65 additions and 15 deletions

View File

@@ -5,6 +5,24 @@
*/
$(document).ready(function() {
$('.server_selector').change(function() {
$(this).closest('tbody').children('.toggler').toggle();
var server = $('.server_selector').val();
if (server == 'cur') {
$(this).closest('tbody').children('.current-server').css('display', '');
$(this).closest('tbody').children('.remote-server').css('display', 'none');
} else if (server == 'rmt') {
$(this).closest('tbody').children('.current-server').css('display', 'none');
$(this).closest('tbody').children('.remote-server').css('display', '');
} else {
$(this).closest('tbody').children('.current-server').css('display', 'none');
$(this).closest('tbody').children('.remote-server').css('display', '');
var parts = server.split('||||');
$('#src_host').val(parts[0]);
$(this).closest('tbody').find('.server-host').val(parts[0]);
$(this).closest('tbody').find('.server-port').val(parts[1]);
$(this).closest('tbody').find('.server-socket').val(parts[2]);
$(this).closest('tbody').find('.server-user').val(parts[3]);
$(this).closest('tbody').find('.server-pass').val('');
$(this).closest('tbody').find('.server-db').val(parts[4])
}
});
});