@@ -32,14 +32,14 @@ if (empty($dopost)) { | |||
exit; | |||
} elseif ($dopost == 'get_articles') { | |||
?> | |||
<table class="table"> | |||
<table class="table table-borderless"> | |||
<?php | |||
$userCatalogSql = ''; | |||
if (count($admin_catalogs) > 0) { | |||
$admin_catalog = join(',', $admin_catalogs); | |||
$userCatalogSql = "AND arc.typeid IN($admin_catalog) "; | |||
} | |||
$query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.mid, arc.pubdate, arc.channel, ch.editcon, tp.typename FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank<>-2 {$userCatalogSql} AND arc.mid={$cuserLogin->getUserID()} ORDER BY arc.id DESC LIMIT 0,13"; | |||
$query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.mid, arc.pubdate, arc.channel, ch.editcon, tp.typename FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank<>-2 {$userCatalogSql} AND arc.mid={$cuserLogin->getUserID()} ORDER BY arc.id DESC LIMIT 0,20"; | |||
$arcArr = array(); | |||
$dsql->Execute('m', $query); | |||
while($row = $dsql->GetArray('m')) | |||
@@ -23,18 +23,32 @@ function ViewDedeBIZ() { | |||
ShowMsg("启动商业组件失败"); | |||
return; | |||
} | |||
ShowMsg(`<table class="table table-borderless w-100"> | |||
ShowMsg(`<table class="table table-borderless"> | |||
<tr> | |||
<td width="120">版本号:</td> | |||
<td>V${dedebizInfo.result.server_version}</td> | |||
<td width="120">服务器系统:</td> | |||
<td>${dedebizInfo.result.server_goos}(${dedebizInfo.result.server_goarch})</td> | |||
</tr> | |||
<tr> | |||
<td>运行时间:</td> | |||
<td>${dedebizInfo.result.server_run_time}</td> | |||
<td>内存占用:</td> | |||
<td>${dedebizInfo.result.server_memory_usage}%</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>版本号</p> | |||
<span>${dedebizInfo.result.server_version}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>服务器系统</p> | |||
<span>${dedebizInfo.result.server_goos}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>运行时间</p> | |||
<span>${dedebizInfo.result.server_run_time}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>内存占用</p> | |||
<span>${dedebizInfo.result.server_memory_usage}%</span> | |||
</div> | |||
</td> | |||
</tr> | |||
</table>`); | |||
} | |||
@@ -50,18 +64,35 @@ function LoadServer() { | |||
let infoStr = `<table class="table table-borderless">`; | |||
if (typeof rsp.result.domain !== "undefined") { | |||
infoStr += `<tr> | |||
<td width="90">授权域名:</td> | |||
<td>${rsp.result.domain}</td> | |||
<td width="90">授权版本:</td> | |||
<td>${rsp.result.auth_version}.x.x(时间:${rsp.result.auth_at})</td> | |||
</tr> | |||
<tr> | |||
<td>站点名称:</td> | |||
<td>${rsp.result.title}(${rsp.result.stype})</td> | |||
<td>站点证书:</td> | |||
<td> | |||
<a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}" target="_blank" class="btn btn-success btn-sm">授权证书</a> | |||
<a href="javascript:ViewDedeBIZ()" class="btn btn-primary btn-sm">组件状态</a> | |||
<td width="20%"> | |||
<div class="web-info"> | |||
<p>授权域名</p> | |||
<span>${rsp.result.domain}</span> | |||
</div> | |||
</td> | |||
<td width="20%"> | |||
<div class="web-info"> | |||
<p>授权版本</p> | |||
<span>${rsp.result.auth_version}.x.x</span> | |||
</div> | |||
</td> | |||
<td width="20%"> | |||
<div class="web-info"> | |||
<p>站点名称</p> | |||
<span>${rsp.result.title}</span> | |||
</div> | |||
</td> | |||
<td width="20%"> | |||
<div class="web-info"> | |||
<p>站点证书</p> | |||
<span><a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}" target="_blank">查看证书</a></span> | |||
</div> | |||
</td> | |||
<td width="20%"> | |||
<div class="web-info"> | |||
<p>商业组件</p> | |||
<span><a href="javascript:ViewDedeBIZ()">组件状态</a></span> | |||
</div> | |||
</td> | |||
</tr>`; | |||
} | |||
@@ -70,10 +101,12 @@ function LoadServer() { | |||
} else { | |||
$("#system-info").html(`<table class="table table-borderless"> | |||
<tr> | |||
<td>${rsp.msg}</td> | |||
</tr> | |||
<tr> | |||
<td>您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息。若授权结果与实际授权存在差异,购买到其它非商业授权,及时与我们取得联系。</td> | |||
<td> | |||
<div class="web-info"> | |||
<p>${rsp.msg}</p> | |||
<span>您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息。</span> | |||
</div> | |||
</td> | |||
</tr> | |||
</table>`); | |||
} | |||
@@ -0,0 +1,132 @@ | |||
var currentStep = 1; | |||
var hasNewVer = false; | |||
//步骤 | |||
function dedeAlter(msg, t = 'info', loading = false) { | |||
let loadingStr = loading ? '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>' : ''; | |||
return `<div class="alert alert-${t}">${loadingStr} | |||
${msg} | |||
</div>`; | |||
} | |||
//显示步骤区域 | |||
function showStepArea(step) { | |||
$(".stepArea").hide(); | |||
$(".btnStep").hide(); | |||
$("#stepArea" + step).show(); | |||
$("#btnStep" + step).show(); | |||
} | |||
function update() { | |||
$.get("api.php?action=update", function (rs) { | |||
if (rs.code === 0) { | |||
$("#_updateMsg").html(rs.msg); | |||
if (rs.data.finish === false) { | |||
setTimeout(() => { | |||
update(); | |||
}, 500); | |||
} else { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
} | |||
} | |||
}) | |||
} | |||
function hasNewVersion() { | |||
$.get("api.php?action=has_new_version", function (rs) { | |||
try { | |||
if (rs.code === 0) { | |||
if (rs.result.HasNew === true) { | |||
hasNewVer = true; | |||
$(".updates-dot").show(); | |||
} else { | |||
hasNewVer = false; | |||
$(".updates-dot").hide(); | |||
} | |||
} else { | |||
$(".updates-dot").hide(); | |||
showStepArea(0); | |||
} | |||
} catch (error) { | |||
console.log("获取软件信息失败") | |||
} | |||
}) | |||
} | |||
$(document).ready(function () { | |||
hasNewVersion(); | |||
$("#btnCancel").click(function () { | |||
currentStep = 1; | |||
$("#_fileList").html(``); | |||
}) | |||
$("#btnBackup").click(function () { | |||
let alertMsg = dedeAlter("正在备份差异文件", 'info', true); | |||
$("#_msgInfo").html(alertMsg); | |||
$("#_msgInfo").show(); | |||
$.get("api.php?action=update_backup", function (rs) { | |||
if (rs.code === 0) { | |||
alertMsg = dedeAlter(`成功备份差异文件,目录:${rs.data.backupdir}`, 'success'); | |||
$("#_msgInfo").html(alertMsg); | |||
} | |||
}) | |||
}) | |||
$("#systemUpdate").click(function () { | |||
if (hasNewVer === false) { | |||
currentStep = 5; | |||
showStepArea(currentStep); | |||
$('#mdlUpdate').modal('show'); | |||
return; | |||
} | |||
$('#mdlUpdate').modal('show'); | |||
showStepArea(currentStep); | |||
currentStep++; | |||
$.get("api.php?action=get_changed_files", function (rs) { | |||
if (rs.code === 0) { | |||
let fstr = '<ul class="list-group list-group-flush">'; | |||
let i = 1; | |||
rs.data.files.forEach(file => { | |||
fstr += `<li class='list-group-item'>第${i}个文件:${file['filename']}</li>`; | |||
i++; | |||
}); | |||
fstr += '</ul>'; | |||
$("#_fileList").html(fstr); | |||
showStepArea(currentStep); | |||
} else { | |||
showStepArea(0); | |||
} | |||
}) | |||
}) | |||
$('#mdlUpdate').on('hidden.bs.modal', function (event) { | |||
currentStep = 1; | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
}) | |||
$("#btnGoStep3").click(function () { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
$.get("api.php?action=get_update_versions", function (rs) { | |||
if (rs.code === 0) { | |||
let fstr = '<ul class="list-group list-group-flush">'; | |||
let i = 1; | |||
rs.result.Versions.forEach(ver => { | |||
fstr += `<li class='list-group-item'>版本号:${ver.ver},发布日期:${ver.r} <a href='https://www.zhelixie.com/DedeBIZ/DedeV6/commits/tag/${ver.ver}' class='btn btn-outline-success float-right' target='_blank'>更新记录</a></li>`; | |||
i++; | |||
}); | |||
fstr += '</ul>'; | |||
$("#_verList").html(fstr); | |||
} else { | |||
showStepArea(0); | |||
} | |||
}) | |||
}) | |||
$("#btnGoStep4").click(function () { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
update(); | |||
}) | |||
$("#btnOK").click(function () { | |||
hasNewVersion(); | |||
}) | |||
}) |
@@ -13,6 +13,7 @@ | |||
<script src="../static/web/js/webajax.js"></script> | |||
<script src="../static/web/js/chart.min.js"></script> | |||
<script src="js/body.js"></script> | |||
<script src="js/update.js"></script> | |||
<script src="js/main.js"></script> | |||
<base target="_self"> | |||
</head> | |||
@@ -35,11 +36,11 @@ | |||
<td width="20%" class="border-top-0">访问次数(VV)</td> | |||
</tr> | |||
<tr> | |||
<td class="today">今日记录</td> | |||
<td class="today" id="today_pv">0</td> | |||
<td class="today" id="today_uv">0</td> | |||
<td class="today" id="today_ip">0</td> | |||
<td class="today" id="today_vv">0</td> | |||
<td>今日记录</td> | |||
<td id="today_pv">0</td> | |||
<td id="today_uv">0</td> | |||
<td id="today_ip">0</td> | |||
<td id="today_vv">0</td> | |||
</tr> | |||
<tr> | |||
<td>昨日记录</td> | |||
@@ -68,37 +69,37 @@ | |||
<div class="card-body"> | |||
<table class="table table-borderless"> | |||
<tr> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>操作系统</p> | |||
<span><?php echo PHP_OS;?></span> | |||
</div> | |||
</td> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>WEB服务器</p> | |||
<span><?php echo GetSimpleServerSoftware();?></span> | |||
</div> | |||
</td> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>IP地址</p> | |||
<span><?php echo gethostbyname($_SERVER['SERVER_NAME']);?></span> | |||
</div> | |||
</td> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>PHP版本</p> | |||
<span><?php echo @phpversion();?></span> | |||
</div> | |||
</td> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>数据库版本</p> | |||
<span><?php echo $dsql->GetVersion();?></span> | |||
</div> | |||
</td> | |||
<td> | |||
<td width="16%"> | |||
<div class="web-info"> | |||
<p>上传限制</p> | |||
<span><?php echo ini_get("post_max_size")?></span> | |||
@@ -192,139 +193,5 @@ | |||
</div> | |||
</div> | |||
</div> | |||
<script> | |||
var currentStep = 1; | |||
var hasNewVer = false; | |||
//步骤 | |||
function dedeAlter(msg, t = 'info', loading = false) { | |||
let loadingStr = loading ? '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>' : ''; | |||
return `<div class="alert alert-${t}">${loadingStr} | |||
${msg} | |||
</div>`; | |||
} | |||
//显示步骤区域 | |||
function showStepArea(step) { | |||
$(".stepArea").hide(); | |||
$(".btnStep").hide(); | |||
$("#stepArea" + step).show(); | |||
$("#btnStep" + step).show(); | |||
} | |||
function update() { | |||
$.get("api.php?action=update", function (rs) { | |||
if (rs.code === 0) { | |||
$("#_updateMsg").html(rs.msg); | |||
if (rs.data.finish === false) { | |||
setTimeout(() => { | |||
update(); | |||
}, 500); | |||
} else { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
} | |||
} | |||
}) | |||
} | |||
function hasNewVersion() { | |||
$.get("api.php?action=has_new_version", function (rs) { | |||
try { | |||
if (rs.code === 0) { | |||
if (rs.result.HasNew === true) { | |||
hasNewVer = true; | |||
$(".updates-dot").show(); | |||
} else { | |||
hasNewVer = false; | |||
$(".updates-dot").hide(); | |||
} | |||
} else { | |||
$(".updates-dot").hide(); | |||
showStepArea(0); | |||
} | |||
} catch (error) { | |||
console.log("获取软件信息失败") | |||
} | |||
}) | |||
} | |||
$(document).ready(function () { | |||
hasNewVersion(); | |||
$("#btnCancel").click(function () { | |||
currentStep = 1; | |||
$("#_fileList").html(``); | |||
}) | |||
$("#btnBackup").click(function () { | |||
let alertMsg = dedeAlter("正在备份差异文件", 'info', true); | |||
$("#_msgInfo").html(alertMsg); | |||
$("#_msgInfo").show(); | |||
$.get("api.php?action=update_backup", function (rs) { | |||
if (rs.code === 0) { | |||
alertMsg = dedeAlter(`成功备份差异文件,目录:${rs.data.backupdir}`, 'success'); | |||
$("#_msgInfo").html(alertMsg); | |||
} | |||
}) | |||
}) | |||
$("#systemUpdate").click(function () { | |||
if (hasNewVer === false) { | |||
currentStep = 5; | |||
showStepArea(currentStep); | |||
$('#mdlUpdate').modal('show'); | |||
return; | |||
} | |||
$('#mdlUpdate').modal('show'); | |||
showStepArea(currentStep); | |||
currentStep++; | |||
$.get("api.php?action=get_changed_files", function (rs) { | |||
if (rs.code === 0) { | |||
let fstr = '<ul class="list-group list-group-flush">'; | |||
let i = 1; | |||
rs.data.files.forEach(file => { | |||
fstr += `<li class='list-group-item'>第${i}个文件:${file['filename']}</li>`; | |||
i++; | |||
}); | |||
fstr += '</ul>'; | |||
$("#_fileList").html(fstr); | |||
showStepArea(currentStep); | |||
} else { | |||
showStepArea(0); | |||
} | |||
}) | |||
}) | |||
$('#mdlUpdate').on('hidden.bs.modal', function (event) { | |||
currentStep = 1; | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
}) | |||
$("#btnGoStep3").click(function () { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
$.get("api.php?action=get_update_versions", function (rs) { | |||
if (rs.code === 0) { | |||
let fstr = '<ul class="list-group list-group-flush">'; | |||
let i = 1; | |||
rs.result.Versions.forEach(ver => { | |||
fstr += `<li class='list-group-item'>版本号:${ver.ver},发布日期:${ver.r} <a href='https://www.zhelixie.com/DedeBIZ/DedeV6/commits/tag/${ver.ver}' class='btn btn-outline-success float-right' target='_blank'>更新记录</a></li>`; | |||
i++; | |||
}); | |||
fstr += '</ul>'; | |||
$("#_verList").html(fstr); | |||
} else { | |||
showStepArea(0); | |||
} | |||
}) | |||
}) | |||
$("#btnGoStep4").click(function () { | |||
currentStep++ | |||
$("#_msgInfo").html(''); | |||
$("#_msgInfo").hide(); | |||
showStepArea(currentStep); | |||
update(); | |||
}) | |||
$("#btnOK").click(function () { | |||
hasNewVersion(); | |||
}) | |||
}) | |||
</script> | |||
</body> | |||
</html> |
@@ -317,6 +317,15 @@ body.hidemenu .body-right { | |||
.card-body { | |||
padding:.65rem | |||
} | |||
.card-height { | |||
height:490px; | |||
overflow:auto | |||
} | |||
.web-info { | |||
padding:10px; | |||
background:#f5f5f5; | |||
white-space:nowrap | |||
} | |||
#fz-0 { | |||
font-size:0 | |||
} | |||
@@ -531,11 +540,6 @@ body.hidemenu .body-right { | |||
.admin-input-xs { | |||
width:60px | |||
} | |||
.web-info { | |||
padding:10px; | |||
background:#f5f5f5; | |||
text-align:center | |||
} | |||
.thumbnail-md { | |||
max-width:200px; | |||
max-height:120px | |||