//检测是否安装环境
$.post("/ajax?action=CheckInstalled",function(rdata){
if(rdata == false){
RecInstall();
}
});
$(function(){
$(".mem-release").hover(function(){
$(this).addClass("shine_green");
if(!($(this).hasClass("mem-action"))){
$(this).find(".mem-re-min").hide();
$(this).find(".mask").css({"color":"#d2edd8"});
$(this).find(".mem-re-con").css({"display":"block"});
$(this).find(".mem-re-con").animate({"top":"0",opacity:1});
$("#memory").text(lan.index.memre);
}
},function(){
if(!($(this).hasClass("mem-action"))){
$(this).find(".mem-re-min").show();
}
else{
$(this).find(".mem-re-min").hide();
}
$(this).removeClass("shine_green");
$(this).find(".mask").css({"color":"#20a53a"});
$(this).find(".mem-re-con").css({"top":"15px",opacity:1,"display":"none"});
$("#memory").text(getCookie("mem-before"));
}).click(function(){
$(this).find(".mem-re-min").hide();
if(!($(this).hasClass("mem-action"))){
ReMemory();
var btlen = $(".mem-release").find(".mask span").text();
$(this).addClass("mem-action");
$(this).find(".mask").css({"color":"#20a53a"});
$(this).find(".mem-re-con").animate({"top":"-400px",opacity:0});
$(this).find(".pie_right .right").css({"transform":"rotate(3deg)"});
for(var i=0;i');
$.post('/system?action=ReMemory','',function(rdata){
var percent = GetPercent(rdata.memRealUsed,rdata.memTotal);
var memText = rdata.memRealUsed+"/"+rdata.memTotal + " (MB)";
percent = Math.round(percent);
$(".mem-release").find('.mask').css({'color':'#20a53a','font-size':'14px'}).html(" "+lan.index.memre_ok);
setCookie("mem-before",memText);
var memNull = getCookie("memRealUsed") - rdata.memRealUsed;
setTimeout(function(){
if(memNull > 0){
$(".mem-release").find('.mask').css({'color':'#20a53a','font-size':'14px','line-height':'22px','padding-top':'22px'}).html(" "+lan.index.memre_ok_1+"
"+memNull+"MB");
}
else{
$(".mem-release").find('.mask').css({'color':'#20a53a','font-size':'14px'}).html(" "+lan.index.memre_ok_2);
}
$(".mem-release").removeClass("mem-action");
$("#memory").text(memText);
setCookie("memRealUsed",rdata.memRealUsed);
},1000);
setTimeout(function(){
$(".mem-release").find('.mask').removeAttr("style").html(""+percent+"%");
$(".mem-release").find(".mem-re-min").show();
},2000)
});
},2000);
}
function GetPercent(num, total){
num = parseFloat(num);
total = parseFloat(total);
if (isNaN(num) || isNaN(total)) {
return "-";
}
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00);
}
function GetDiskInfo(){
$.get('/system?action=GetDiskInfo',function(rdata){
var dBody
for(var i=0;i
分区['+rdata[i].path+']当前Inode使用率超过'+ipre+'%,当使用率满100%时将无法在此分区创建文件,请及时清理![清理垃圾]
'); } } var LoadColor = setcolor(parseInt(rdata[i].size[3].replace('%','')),false,75,90,95); dBody = ''+lan.index.mem_warning+'
') } if(info.isuser > 0){ $("#messageError").show(); $("#messageError").append(''+lan.index.user_warning+' [不可忽略] [立即修改]
') } setImg(); }); } function setcolor(pre,s,s1,s2,s3){ var LoadColor; if(pre <= s1){ LoadColor = '#20a53a'; }else if(pre <= s2){ LoadColor = '#6ea520'; }else if(pre <= s3){ LoadColor = '#ff9900'; }else{ LoadColor = '#dd2f00'; } if(s == false){ return LoadColor; } var co = $(s).parent('.mask'); co.css("color",LoadColor); co.parent('.circle').css("background",LoadColor); } function getNet(){ var up; var down; $.ajax({ type:"get", url:"/system?action=GetNetWork", async:true, success:function(net){ $("#InterfaceSpeed").html(lan.index.interfacespeed+": 1.0Gbps"); $("#upSpeed").html(net.up+' KB'); $("#downSpeed").html(net.down+' KB'); $("#downAll").html(ToSize(net.downTotal)); $("#downAll").attr('title',lan.index.package+':'+net.downPackets) $("#upAll").html(ToSize(net.upTotal)); $("#upAll").attr('title',lan.index.package+':'+net.upPackets) $("#core").html(net.cpu[1] + " "+lan.index.cpu_core); $("#state").html(net.cpu[0]); setcolor(net.cpu[0],"#state",30,70,90); setCookie("upNet",net.up); setCookie("downNet",net.down); getLoad(net.load); setImg(); } }); } //网络Io function NetImg(){ var myChartNetwork = echarts.init(document.getElementById('NetImg')); var xData = []; var yData = []; var zData = []; function getTime(){ var now = new Date(); var hour=now.getHours(); var minute=now.getMinutes(); var second=now.getSeconds(); if(minute<10){ minute = "0"+minute; } if(second<10){ second = "0"+second; } var nowdate = hour+":"+minute+":"+second; return nowdate; } function ts(m){return m<10?'0'+m:m } function format(sjc){ var time = new Date(sjc); var h = time.getHours(); var mm = time.getMinutes(); var s = time.getSeconds(); return ts(h)+':'+ts(mm)+':'+ts(s); } function addData(shift) { xData.push(getTime()); yData.push(getCookie("upNet")); zData.push(getCookie("downNet")); if (shift) { xData.shift(); yData.shift(); zData.shift(); } } for (var i = 8; i >= 0; i--){ var time = (new Date()).getTime(); xData.push(format(time - (i * 3 * 1000))); yData.push(0); zData.push(0); } // 指定图表的配置项和数据 var option = { title: { text: lan.index.interface_net, left: 'center', textStyle:{ color:'#888888', fontStyle: 'normal', fontFamily: lan.index.net_font, fontSize: 16, } }, tooltip: { trigger: 'axis' }, legend: { data:[lan.index.net_up,lan.index.net_down], bottom:'2%' }, xAxis: { type: 'category', boundaryGap: false, data: xData, axisLine:{ lineStyle:{ color:"#666" } } }, yAxis: { name: lan.index.unit+'KB/s', splitLine:{ lineStyle:{ color:"#eee" } }, axisLine:{ lineStyle:{ color:"#666" } } }, series: [{ name: lan.index.net_up, type: 'line', data: yData, smooth:true, showSymbol: false, symbol: 'circle', symbolSize: 6, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(255, 140, 0,0.5)' }, { offset: 1, color: 'rgba(255, 140, 0,0.8)' }], false) } }, itemStyle: { normal: { color: '#f7b851' } }, lineStyle: { normal: { width: 1 } } },{ name: lan.index.net_down, type: 'line', data: zData, smooth:true, showSymbol: false, symbol: 'circle', symbolSize: 6, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(30, 144, 255,0.5)' }, { offset: 1, color: 'rgba(30, 144, 255,0.8)' }], false) } }, itemStyle: { normal: { color: '#52a9ff' } }, lineStyle: { normal: { width: 1 } } }] }; setInterval(function () { getNet(); addData(true); myChartNetwork.setOption({ xAxis: { data: xData }, series: [{ name:lan.index.net_up, data: yData },{ name:lan.index.net_down, data: zData }] }); }, 3000); // 使用刚指定的配置项和数据显示图表。 myChartNetwork.setOption(option); window.addEventListener("resize",function(){ myChartNetwork.resize(); }); } NetImg(); function setImg() { $('.circle').each(function(index, el) { var num = $(this).find('span').text() * 3.6; if (num <= 180) { $(this).find('.left').css('transform', "rotate(0deg)"); $(this).find('.right').css('transform', "rotate(" + num + "deg)"); } else { $(this).find('.right').css('transform', "rotate(180deg)"); $(this).find('.left').css('transform', "rotate(" + (num - 180) + "deg)"); }; }); $('.diskbox .mask').hover(function(){ layer.closeAll('tips'); var that = this; var conterError = $(this).attr("data"); layer.tips(conterError, that,{time:0,tips:[1,'#999']}); },function(){ layer.closeAll('tips'); }); } setImg(); //检查更新 setTimeout(function(){ $.get('/ajax?action=UpdatePanel',function(rdata){ if(rdata.status == false) return; if(rdata.version != undefined){ $("#toUpdate").html(''+lan.index.update_go+''); return; } $.get('/system?action=ReWeb',function(){}); layer.msg(rdata.msg,{icon:1}); setTimeout(function(){ window.location.reload(); },3000); }).error(function(){ $.get('/system?action=ReWeb',function(){}); setTimeout(function(){ window.location.reload(); },3000); }); },3000); //检查更新 function checkUpdate(){ var loadT = layer.msg(lan.index.update_get,{icon:16,time:0,shade: [0.3, '#000']}); $.get('/ajax?action=UpdatePanel&check=true',function(rdata){ layer.close(loadT); if(rdata.status === false){ layer.confirm(rdata.msg,{title:lan.index.update_check,icon:1,closeBtn: 2,btn: [lan.public.know,lan.public.close]}); return; } layer.msg(rdata.msg,{icon:1}); if(rdata.version != undefined) updateMsg(); }); } function updateMsg(){ window.open("http://www.bt.cn/bbs/thread-1186-1-1.html"); $.get('/ajax?action=UpdatePanel',function(rdata){ layer.open({ type:1, title:lan.index.update_to+'['+rdata.version+']', area: '400px', shadeClose:false, closeBtn:2, content:''+rdata.updateMsg+'
' +''+rdata[i].body+'
\"+lan.index.reboot_warning+"
\"+lan.index.reboot_ps+"
\"+lan.index.reboot_ps_1+"
\"+lan.index.reboot_ps_2+"
\"+lan.index.reboot_ps_3+"
\"+lan.index.reboot_ps_4+"
\"+lan.index.reboot_msg_1+"
"); $.post('/system?action=ServiceAdmin',data,function(r1){ data = "name=mysqld&type=stop"; $(".SafeRestartCode").html(""+lan.index.reboot_msg_1+"
"+lan.index.reboot_msg_2+"...
"); $.post('/system?action=ServiceAdmin',data,function(r2){ $(".SafeRestartCode").html("正在停止"+serverType+"服务
"+lan.index.reboot_msg_2+"
"+lan.index.reboot_msg_3+"...
"); $.post('/system?action=RestartServer','',function(rdata){ $(".SafeRestartCode").html(""+lan.index.reboot_msg_1+"
"+lan.index.reboot_msg_2+"
"+lan.index.reboot_msg_3+"
"+lan.index.reboot_msg_4+"...
"); var sEver = setInterval(function(){ $.get("/system?action=GetSystemTotal", function(info) { clearInterval(sEver); $(".SafeRestartCode").html(""+lan.index.reboot_msg_1+"
"+lan.index.reboot_msg_2+"
"+lan.index.reboot_msg_3+"
"+lan.index.reboot_msg_4+"
"+lan.index.reboot_msg_5+"
"); setTimeout(function(){ layer.closeAll(); },3000); }).error(function(){ }); },3000); }).error(function(){ $(".SafeRestartCode").html(""+lan.index.reboot_msg_1+"
"+lan.index.reboot_msg_2+"
"+lan.index.reboot_msg_3+"
"+lan.index.reboot_msg_4+"...
"); var sEver = setInterval(function(){ $.get("/system?action=GetSystemTotal", function(info) { clearInterval(sEver); $(".SafeRestartCode").html(""+lan.index.reboot_msg_1+"
"+lan.index.reboot_msg_2+"
"+lan.index.reboot_msg_3+"
"+lan.index.reboot_msg_4+"
"+lan.index.reboot_msg_5+"
"); setTimeout(function(){ layer.closeAll(); window.location.reload(); },3000); }).error(function(){ }); },3000); }); }); }); $(".layui-layer-close").unbind("click"); } function reWeb(){ layer.confirm(lan.index.panel_reboot_msg,{title:lan.index.panel_reboot_title,closeBtn:2,icon:3},function(){ var loadT = layer.msg(lan.index.panel_reboot_to,{icon:16,time:0,shade: [0.3, '#000']}); $.get('/system?action=ReWeb',function(rdata){ layer.close(loadT); layer.msg(rdata.msg,{icon:5}); }).error(function(){ layer.close(loadT); layer.msg(lan.index.panel_reboot_ok,{icon:1}); setTimeout(function(){ window.location.reload(); },3000) }); }); } //查看网络状态 function GetNetWorkList(rflush){ var loadT = layer.msg(lan.public.the_get,{icon:16,time:0,shade: [0.3, '#000']}); $.post('/ajax?action=GetNetWorkList','',function(rdata){ layer.close(loadT); var tbody = "" for(var i=0;i"+lan.index.net_protocol+" | \"+lan.index.net_address_dst+" | \"+lan.index.net_address_src+" | \"+lan.index.net_address_status+" | \"+lan.index.net_process+" | \"+lan.index.net_process_pid+" | \
---|
"+lan.index.process_pid+" | \"+lan.index.process_name+" | \"+lan.index.process_cpu+" | \"+lan.index.process_mem+" | \"+lan.index.process_disk+" | \"+lan.index.process_status+" | \"+lan.index.process_thread+" | \"+lan.index.process_user+" | \"+lan.index.process_act+" | \
---|
'+wlist.data[i].body + btns +'
98元/月
\ \到期时间:'+endtime+'
\黑客爆破次数 '+tdata.intrusion_total+'
\安全隔离服务已到期
\到期时间:'+endtime+'
\已拦截 '+tdata.defense_total+' 次爆破
\当前安全隔离保护中
\ '; } } else{ html='98元/月
\ \1、一对一运维人员对接
\2、提供每月3次运维服务
\3、双重安全隔离登录
\检测到 '+tdata.intrusion_total+' 次失败的登陆,您的服务器可能存在暴破风险 [暂时忽略] [查看]
'; $("#messageError").append(dangerhtml).show(); for(var i=0; i风险类型: | 暴力破解 说明 |
累计遭遇攻击总数: | '+num+' 详细(数据直接来源本服务器日志) |
风险等级: | 较高风险 |
风险描述: | '+atxt+' |
可参考解决方案: | 方案一:修改SSH默认端口,修改SSH验证方式为数字证书,清除近期登陆日志。 方案二:购买宝塔企业运维版,一键部署安全隔离服务,高效且方便。 |
源IP地址 | 用户 | 时间 |
---|
*以上记录来源于本服务器日志,查看命令:cat /var/log/secure
' }); } IsYunwei();