pull/205/head
midoks 3 years ago
parent ccc00e8b5d
commit 0b28077e08
  1. 19
      plugins/php/versions/82/install.sh
  2. 15
      plugins/swap/index.html
  3. 38
      plugins/swap/js/swap.js

@ -55,6 +55,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
fi
if [ -f /proc/cpuinfo ];then
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
fi
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
cpuCore="${MEM_INFO}"
fi
else
cpuCore="1"
fi
# ----- cpu end ------
ZIP_OPTION='--with-zip'
libzip_version=`pkg-config libzip --modversion`
if version_lt "$libzip_version" "0.11.0" ;then

@ -3,7 +3,7 @@
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('swap');">服务</p>
<p onclick="pluginInitD('swap');">自启动</p>
<!-- <p onclick="pluginConfig('swap');">配置修改</p> -->
<p onclick="pluginConfig('swap');">配置修改</p>
<p onclick="readme();">说明</p>
</div>
<div class="bt-w-con pd15">
@ -12,14 +12,7 @@
</div>
</div>
<script type="text/javascript">
pluginService('swap');
function readme(){
var readme = '<ul class="help-info-text c7">';
readme += '<li>dd if=/dev/zero of=/www/server/swap/swapfile bs=1M count=2048</li>';
readme += '<li>mkswap /www/server/swap/swapfile</li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}
$.getScript( "/plugins/file?name=swap&f=js/swap.js", function(){
pluginService('swap');
});
</script>

@ -0,0 +1,38 @@
function swapPost(method, version, args,callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
var req_data = {};
req_data['name'] = 'swap';
req_data['func'] = method;
req_data['version'] = version;
if (typeof(args) == 'string'){
req_data['args'] = JSON.stringify(toArrayObject(args));
} else {
req_data['args'] = JSON.stringify(args);
}
$.post('/plugins/run', req_data, function(data) {
layer.close(loadT);
if (!data.status){
//错误展示10S
layer.msg(data.msg,{icon:0,time:2000,shade: [10, '#000']});
return;
}
if(typeof(callback) == 'function'){
callback(data);
}
},'json');
}
function readme(){
var readme = '<ul class="help-info-text c7">';
readme += '<li>dd if=/dev/zero of=/www/server/swap/swapfile bs=1M count=2048</li>';
readme += '<li>mkswap /www/server/swap/swapfile</li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}
Loading…
Cancel
Save