Add DB number to redis cache settings, and set the default to 1

This commit is contained in:
Kijin Sung 2016-05-12 00:46:41 +09:00
parent 503a332f9b
commit 8f9eacee64
8 changed files with 23 additions and 6 deletions

View file

@ -80,6 +80,7 @@
<div id="object_cache_additional_config" class="x_inline" style="display:none;margin-left:16px">
<label for="object_cache_host" class="x_inline">{$lang->cache_host}: <input type="text" name="object_cache_host" id="object_cache_host" value="{$object_cache_host}" /></label>
<label for="object_cache_port" class="x_inline">{$lang->cache_port}: <input type="number" name="object_cache_port" id="object_cache_port" size="5" style="min-width:70px" value="{$object_cache_port}" /></label>
<label for="object_cache_dbnum" class="x_inline">{$lang->cache_dbnum}: <input type="number" name="object_cache_dbnum" id="object_cache_dbnum" size="3" style="min-width:70px" value="{$object_cache_dbnum}" /></label>
</div>
</div>
</div>

View file

@ -12,11 +12,17 @@ jQuery(function($){
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(/memcache/)) {
if ($("#object_cache_port").val() == '6379') {
$("#object_cache_port").val('11211');
}
$("#object_cache_dbnum").parents("label").hide();
}
if ($(this).val().match(/redis/) && $("#object_cache_port").val() == '11211') {
$("#object_cache_port").val('6379');
if ($(this).val().match(/redis/)) {
if ($("#object_cache_port").val() == '11211') {
$("#object_cache_port").val('6379');
}
$("#object_cache_dbnum").parents("label").show();
}
} else {
$("#object_cache_additional_config").hide();