mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update index.js
This commit is contained in:
+2
-63
@@ -1,10 +1,3 @@
|
||||
//检测是否安装环境
|
||||
$.post("/plugins/check_installed", function(rdata) {
|
||||
if (rdata == false) {
|
||||
RecInstall();
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$(".mem-release").hover(function() {
|
||||
$(this).addClass("shine_green");
|
||||
@@ -131,11 +124,8 @@ function GetPercent(num, total) {
|
||||
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function GetDiskInfo() {
|
||||
$.get('/system/disknfo', function(rdata) {
|
||||
$.get('/system/disk_info', function(rdata) {
|
||||
var dBody
|
||||
for (var i = 0; i < rdata.length; i++) {
|
||||
if (rdata[i].path == '/' || rdata[i].path == '/www') {
|
||||
@@ -821,55 +811,6 @@ function WarningTo(to_url, def) {
|
||||
if (rdata.status && def) setTimeout(function() { location.reload(); }, 1000);
|
||||
});
|
||||
}
|
||||
//企业运维版
|
||||
function IsYunwei() {
|
||||
$.get("/plugin?action=a&name=safelogin&s=GetServerInfo", function(rdata) {
|
||||
$.get("/plugin?action=a&name=safelogin&s=get_ssh_errorlogin", function(tdata) {
|
||||
var html = ''
|
||||
if (rdata.status) {
|
||||
var endtime = getLocalTime(rdata.data.timeout).split(" ")[0];
|
||||
html = '<div class="btvip">\
|
||||
<span class="t2">企业运维版</span>\
|
||||
<p><span class="price">98</span>元/月</p>\
|
||||
<button class="btn btn-success btn-sm" onclick="window.open(\'https://www.bt.cn/admin/index.html\')">续费</button>\
|
||||
</div><div class="btvip-r"><div class="btvipinfo">';
|
||||
if (rdata.data.timeout < rdata.data.time && tdata.intrusion_total != undefined) {
|
||||
html += '<p>到期时间:' + endtime + '</p>\
|
||||
<p>黑客爆破次数 <span>' + tdata.intrusion_total + '</span></p>\
|
||||
<p>安全隔离服务已到期</p>\
|
||||
</div></div>';
|
||||
} else {
|
||||
html += '<p>到期时间:' + endtime + '</p>\
|
||||
<p>已拦截 <span>' + tdata.defense_total + '</span> 次爆破</p>\
|
||||
<p>当前安全隔离保护中</p>\
|
||||
</div></div>';
|
||||
}
|
||||
} else {
|
||||
html = '<div class="btvip">\
|
||||
<span class="t2">企业运维版</span>\
|
||||
<p><span class="price">98</span>元/月</p>\
|
||||
<button class="btn btn-success btn-sm" onclick="window.open(\'https://www.bt.cn/admin/index.html\')">购买</button>\
|
||||
</div>\
|
||||
<div class="btvip-r"><div class="btvipinfo">\
|
||||
<p>1、一对一运维人员对接</p>\
|
||||
<p>2、提供每月3次运维服务</p>\
|
||||
<p>3、双重安全隔离登录</p>\
|
||||
</div></div>';
|
||||
GetWarning();
|
||||
if (tdata.intrusion_total != undefined && tdata.intrusion_total > 1000 && tdata.ssh.status !== false && tdata.ssh.port == '22' && getCookie('safeMsg') != '1') {
|
||||
var dangerhtmltable = '';
|
||||
var dangerhtml = '<p id="safeMsg"><span class="glyphicon glyphicon-alert" style="color: #ff4040; margin-right: 10px;"></span>检测到 <font style="font-weight:bold">' + tdata.intrusion_total + '</font> 次失败的登陆,您的服务器可能存在暴破风险 <a class="btlink" style="margin-right: 5px;" href="javascript:SetSafeHide();">[暂时忽略] </a> <a class="btlink" href="javascript:showDanger(\'' + tdata.intrusion_total + '\',\'' + tdata.ssh.port + '\');">[查看]</a></p>';
|
||||
$("#messageError").append(dangerhtml).show();
|
||||
for (var i = 0; i < tdata.intrusion.length; i++) {
|
||||
dangerhtmltable += '<tr><td>' + tdata.intrusion[i].address + '</td><td>' + tdata.intrusion[i].user + '</td><td class="text-right">' + tdata.intrusion[i].date + '</td></tr>';
|
||||
}
|
||||
$("body").append("<table id='dangerhtmltable' style='display:none'><tbody>" + dangerhtmltable + "</tbody></table>");
|
||||
}
|
||||
}
|
||||
$(".btvipbox").html(html);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function SetSafeHide() {
|
||||
setCookie('safeMsg', '1');
|
||||
@@ -911,6 +852,4 @@ function showDangerIP() {
|
||||
shift: 5,
|
||||
content: '<div class="pd15 divtable" style="height:430px;overflow:auto"><table class="table table-hover"><thead><tr><th>源IP地址</th><th>用户</th><th style="text-align: right;">时间</th></tr></thead>' + body + '</table></div><p style="color:red;padding-left:12px">*以上记录来源于本服务器日志,查看命令:cat /var/log/secure</p>'
|
||||
});
|
||||
}
|
||||
|
||||
IsYunwei();
|
||||
}
|
||||
Reference in New Issue
Block a user