// Bad default ident options: normalize revision 14492
This commit is contained in:
@@ -152,40 +152,40 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#testMemcachedServer').click(function() {
|
$('#testMemcachedServer').click(function() {
|
||||||
var host = $('input:text[name=memcachedIp]').val();
|
var host = $('input:text[name=memcachedIp]').val();
|
||||||
var port = $('input:text[name=memcachedPort]').val();
|
var port = $('input:text[name=memcachedPort]').val();
|
||||||
if (host && port)
|
if (host && port)
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'index.php',
|
url: 'index.php',
|
||||||
data:
|
data:
|
||||||
{
|
{
|
||||||
controller: 'adminperformance',
|
controller: 'adminperformance',
|
||||||
token: '{$token}',
|
token: '{$token}',
|
||||||
action: 'test_server',
|
action: 'test_server',
|
||||||
sHost: host,
|
sHost: host,
|
||||||
sPort: port,
|
sPort: port,
|
||||||
ajax: true
|
ajax: true
|
||||||
},
|
},
|
||||||
context: document.body,
|
context: document.body,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
context: this,
|
context: this,
|
||||||
async: false,
|
async: false,
|
||||||
success: function(data)
|
success: function(data)
|
||||||
{
|
{
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
var color = data != 0 ? 'green' : 'red';
|
var color = data != 0 ? 'green' : 'red';
|
||||||
$('#formMemcachedServerStatus').show();
|
$('#formMemcachedServerStatus').show();
|
||||||
$('input:text[name=memcachedIp]').css('background', color);
|
$('input:text[name=memcachedIp]').css('background', color);
|
||||||
$('input:text[name=memcachedPort]').css('background', color);
|
$('input:text[name=memcachedPort]').css('background', color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"]').change(function(){
|
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"]').change(function(){
|
||||||
$('#smarty_up').val(1);
|
$('#smarty_up').val(1);
|
||||||
|
|||||||
@@ -760,28 +760,28 @@ class AdminPerformanceControllerCore extends AdminController
|
|||||||
return parent::postProcess();
|
return parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajaxProcess()
|
public function ajaxProcess()
|
||||||
{
|
{
|
||||||
if (Tools::isSubmit('action') && Tools::getValue('action') == 'test_server')
|
if (Tools::isSubmit('action') && Tools::getValue('action') == 'test_server')
|
||||||
{
|
{
|
||||||
$host = pSQL(Tools::getValue('sHost', ''));
|
$host = pSQL(Tools::getValue('sHost', ''));
|
||||||
$port = (int)Tools::getValue('sPort', 0);
|
$port = (int)Tools::getValue('sPort', 0);
|
||||||
|
|
||||||
if ($host != '' && $port != 0)
|
if ($host != '' && $port != 0)
|
||||||
{
|
{
|
||||||
$res = 0;
|
$res = 0;
|
||||||
|
|
||||||
if (function_exists('memcache_get_server_status') &&
|
if (function_exists('memcache_get_server_status') &&
|
||||||
function_exists('memcache_connect') &&
|
function_exists('memcache_connect') &&
|
||||||
@fsockopen($host, $port))
|
@fsockopen($host, $port))
|
||||||
{
|
{
|
||||||
$memcache = @memcache_connect($host, $port);
|
$memcache = @memcache_connect($host, $port);
|
||||||
$res = @memcache_get_server_status($memcache, $host, $port);
|
$res = @memcache_get_server_status($memcache, $host, $port);
|
||||||
}
|
}
|
||||||
die(Tools::jsonEncode(array($res)));
|
die(Tools::jsonEncode(array($res)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user