Make object cache configurable via the admin UI

This commit is contained in:
Kijin Sung 2016-02-11 13:32:55 +09:00
parent 225f02cac2
commit f3d3122787
10 changed files with 113 additions and 6 deletions

View file

@ -2,6 +2,27 @@ jQuery(function($){
$('.tgContent ul').bind('click', function(){
$('#sitefind_addBtn').css('display','');
});
if ($("#object_cache_type").size()) {
$("#object_cache_type").on("change", function() {
if ($(this).val().match(/memcache|redis/)) {
$("#object_cache_additional_config").show();
if (!$("#object_cache_host").val()) {
$("#object_cache_host").val('127.0.0.1');
}
if (!$("#object_cache_port").val()) {
$("#object_cache_port").val($(this).val().match(/memcache/) ? '11211' : '6379');
}
if ($(this).val().match(/memcache/) && $("#object_cache_port").val() == '6379') {
$("#object_cache_port").val('11211');
}
if ($(this).val().match(/redis/) && $("#object_cache_port").val() == '11211') {
$("#object_cache_port").val('6379');
}
} else {
$("#object_cache_additional_config").hide();
}
}).triggerHandler("change");
}
});
function setStartModule(){