国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

326 lines
11KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>仪表盘</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <script>const cfg_biz_dedebizUrl = '<?php echo $cfg_biz_dedebizUrl;?>'; const cfg_webname = '<?php echo $cfg_webname;?>';</script>
  11. <script src="../static/web/js/jquery.min.js"></script>
  12. <script src="../static/web/js/bootstrap.min.js"></script>
  13. <script src="../static/web/js/webajax.js"></script>
  14. <script src="../static/web/js/chart.min.js"></script>
  15. <script src="js/indexbody.js"></script>
  16. <script src="js/main.js"></script>
  17. <base target="_self">
  18. </head>
  19. <body>
  20. <div class="container-fluid">
  21. <div class="row">
  22. <div id="body-tips" class="col-md-12"></div>
  23. <div class="col-md-12 my-3">
  24. <div class="card">
  25. <div class="card-header">
  26. <a href="#statChart"><i class="fa fa-bar-chart"></i> 流量统计表</a>
  27. </div>
  28. <div class="card-body">
  29. <table class="table">
  30. <tbody>
  31. <tr>
  32. <td width="20%" class="border-top-0"></td>
  33. <td width="20%" class="border-top-0">浏览次数(PV)</td>
  34. <td width="20%" class="border-top-0">独立访客(UV)</td>
  35. <td width="20%" class="border-top-0">独立地址(IP)</td>
  36. <td width="20%" class="border-top-0">访问次数(VV)</td>
  37. </tr>
  38. <tr>
  39. <td class="today">今日记录</td>
  40. <td class="today" id="today_pv">0</td>
  41. <td class="today" id="today_uv">0</td>
  42. <td class="today" id="today_ip">0</td>
  43. <td class="today" id="today_vv">0</td>
  44. </tr>
  45. <tr>
  46. <td>昨日记录</td>
  47. <td id="yestoday_pv">0</td>
  48. <td id="yestoday_uv">0</td>
  49. <td id="yestoday_ip">0</td>
  50. <td id="yestoday_vv">0</td>
  51. </tr>
  52. <tr>
  53. <td>历史记录</td>
  54. <td id="total_pv">0</td>
  55. <td id="total_uv">0</td>
  56. <td id="total_ip">0</td>
  57. <td id="total_vv">0</td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="col-md-6 my-3">
  65. <div class="card">
  66. <div class="card-header">
  67. <a href="javascript:Copyinfo()"><i class="fa fa-cogs"></i> 软件信息</a>
  68. <span id="text">软件:<?php echo $cfg_version_detail;?>|操作系统:<?php echo PHP_OS;?>|Web服务器:<?php echo $_SERVER['SERVER_SOFTWARE'];?>|PHP:<?php echo @phpversion();?>|数据库:<?php echo $dsql->GetVersion();?></span>
  69. </div>
  70. <div class="card-body">
  71. <table class="table table-borderless">
  72. <tr>
  73. <td width="20%">
  74. <div class="web-info">
  75. <p>操作系统</p>
  76. <span><?php echo PHP_OS;?></span>
  77. </div>
  78. </td>
  79. <td width="20%">
  80. <div class="web-info">
  81. <p>WEB服务器</p>
  82. <span><?php echo GetSimpleServerSoftware();?></span>
  83. </div>
  84. </td>
  85. <td width="20%">
  86. <div class="web-info">
  87. <p>IP地址</p>
  88. <span><?php echo gethostbyname($_SERVER['SERVER_NAME']);?></span>
  89. </div>
  90. </td>
  91. <td width="20%">
  92. <div class="web-info">
  93. <p>PHP版本</p>
  94. <span><?php echo @phpversion();?></span>
  95. </div>
  96. </td>
  97. <td width="20%">
  98. <div class="web-info">
  99. <p>数据库版本</p>
  100. <span><?php echo $dsql->GetVersion();?></span>
  101. </div>
  102. </td>
  103. </tr>
  104. </table>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="col-md-6 my-3">
  109. <div class="card">
  110. <div class="card-header">
  111. <span><i class="fa fa-shield"></i> 版本授权</span>
  112. <a href="javascript:;" id="systemUpdate" class="float-right">软件更新<span class="updates-dot"></span></a>
  113. </div>
  114. <div class="card-body" id="system-info">正在加载</div>
  115. </div>
  116. </div>
  117. <div class="col-md-6 my-3">
  118. <div class="card">
  119. <div class="card-header">
  120. <a name="statChart"><i class="fa fa-line-chart"></i> 流量统计图</a>
  121. </div>
  122. <div class="card-body">
  123. <canvas id="statChart"></canvas>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="col-md-6 my-3">
  128. <div class="card">
  129. <div class="card-header">
  130. <span><i class="fa fa-file-word-o"></i> 最新文档</span>
  131. </div>
  132. <div class="card-body" id="system-word">正在加载</div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div id="mdlUpdate" class="modal fade" tabindex="-1" aria-hidden="true">
  138. <div class="modal-dialog modal-xl">
  139. <div class="modal-content">
  140. <div class="modal-header">
  141. <h5 class="modal-title">软件更新</h5>
  142. <button type="button" class="update-close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i></button>
  143. </div>
  144. <div class="modal-body">
  145. <div id="stepArea0" class="stepArea">
  146. <span>获取服务器版本资源失败,无法正常升级,请联系DedeBIZ官方团队。</span>
  147. </div>
  148. <div id="stepArea1" class="stepArea">
  149. <span class="spinner-border text-success" role="status"></span>
  150. <span id="step1Msg">对比版本更改的文件</span>
  151. </div>
  152. <div id="stepArea2" class="stepArea">
  153. <p>本更新提供了重要的安全性更新,建议所有会员升级,软件更新覆盖以下文件,请做好备份。</p>
  154. <div id="_fileList">正在加载</div>
  155. </div>
  156. <div id="stepArea3" class="stepArea">
  157. <p>发下以下版本的更新文件</p>
  158. <div id="_verList">正在加载</div>
  159. </div>
  160. <div id="stepArea4" class="stepArea">
  161. <p>
  162. <span class="spinner-border text-success" role="status"></span>
  163. <span>正在进行以下操作,耐心等待...</span>
  164. </p>
  165. <div id="_updateMsg">正在加载</div>
  166. </div>
  167. <div id="stepArea5" class="stepArea">已是最新软件版本。</div>
  168. <div id="_msgInfo" class="mt-3"></div>
  169. </div>
  170. <div class="modal-footer">
  171. <div id="btnStep0" class="btnStep">
  172. <button id="btnCancel" type="button" class="btn btn-secondary" data-dismiss="modal">知道了</button>
  173. </div>
  174. <div id="btnStep1" class="btnStep"></div>
  175. <div id="btnStep2" class="btnStep">
  176. <button id="btnCancel" type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  177. <button id="btnBackup" type="button" class="btn btn-outline-success">备份</button>
  178. <button id="btnGoStep3" type="button" class="btn btn-success">下一步</button>
  179. </div>
  180. <div id="btnStep3" class="btnStep">
  181. <button id="btnCancel" type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  182. <button id="btnGoStep4" type="button" class="btn btn-success">下载</button>
  183. </div>
  184. <div id="btnStep5" class="btnStep">
  185. <button id="btnOK" type="button" class="btn btn-success" data-dismiss="modal">完成</button>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <script>
  192. var currentStep = 1;
  193. var hasNewVer = false;
  194. //步骤
  195. function dedeAlter(msg, t = 'info', loading = false) {
  196. let loadingStr = loading ? '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>' : '';
  197. return `<div class="alert alert-${t}">${loadingStr}
  198. ${msg}
  199. </div>`;
  200. }
  201. //显示步骤区域
  202. function showStepArea(step) {
  203. $(".stepArea").hide();
  204. $(".btnStep").hide();
  205. $("#stepArea" + step).show();
  206. $("#btnStep" + step).show();
  207. }
  208. function update() {
  209. $.get("api.php?action=update", function (rs) {
  210. if (rs.code === 0) {
  211. $("#_updateMsg").html(rs.msg);
  212. if (rs.data.finish === false) {
  213. setTimeout(() => {
  214. update();
  215. }, 500);
  216. } else {
  217. currentStep++
  218. $("#_msgInfo").html('');
  219. $("#_msgInfo").hide();
  220. showStepArea(currentStep);
  221. }
  222. }
  223. })
  224. }
  225. function hasNewVersion() {
  226. $.get("api.php?action=has_new_version", function (rs) {
  227. try {
  228. if (rs.code === 0) {
  229. if (rs.result.HasNew === true) {
  230. hasNewVer = true;
  231. $(".updates-dot").show();
  232. } else {
  233. hasNewVer = false;
  234. $(".updates-dot").hide();
  235. }
  236. } else {
  237. $(".updates-dot").hide();
  238. showStepArea(0);
  239. }
  240. } catch (error) {
  241. console.log("获取软件信息失败")
  242. }
  243. })
  244. }
  245. $(document).ready(function () {
  246. hasNewVersion();
  247. $("#btnCancel").click(function () {
  248. currentStep = 1;
  249. $("#_fileList").html(``);
  250. })
  251. $("#btnBackup").click(function () {
  252. let alertMsg = dedeAlter("正在备份差异文件", 'info', true);
  253. $("#_msgInfo").html(alertMsg);
  254. $("#_msgInfo").show();
  255. $.get("api.php?action=update_backup", function (rs) {
  256. if (rs.code === 0) {
  257. alertMsg = dedeAlter(`成功备份差异文件,目录:${rs.data.backupdir}`, 'success');
  258. $("#_msgInfo").html(alertMsg);
  259. }
  260. })
  261. })
  262. $("#systemUpdate").click(function () {
  263. if (hasNewVer === false) {
  264. currentStep = 5;
  265. showStepArea(currentStep);
  266. $('#mdlUpdate').modal('show');
  267. return;
  268. }
  269. $('#mdlUpdate').modal('show');
  270. showStepArea(currentStep);
  271. currentStep++;
  272. $.get("api.php?action=get_changed_files", function (rs) {
  273. if (rs.code === 0) {
  274. let fstr = '<ul class="list-group list-group-flush">';
  275. let i = 1;
  276. rs.data.files.forEach(file => {
  277. fstr += `<li class='list-group-item'>第${i}个文件:${file['filename']}</li>`;
  278. i++;
  279. });
  280. fstr += '</ul>';
  281. $("#_fileList").html(fstr);
  282. showStepArea(currentStep);
  283. } else {
  284. showStepArea(0);
  285. }
  286. })
  287. })
  288. $('#mdlUpdate').on('hidden.bs.modal', function (event) {
  289. currentStep = 1;
  290. $("#_msgInfo").html('');
  291. $("#_msgInfo").hide();
  292. })
  293. $("#btnGoStep3").click(function () {
  294. currentStep++
  295. $("#_msgInfo").html('');
  296. $("#_msgInfo").hide();
  297. showStepArea(currentStep);
  298. $.get("api.php?action=get_update_versions", function (rs) {
  299. if (rs.code === 0) {
  300. let fstr = '<ul class="list-group list-group-flush">';
  301. let i = 1;
  302. rs.result.Versions.forEach(ver => {
  303. fstr += `<li class='list-group-item'>版本号:${ver.ver},发布日期:${ver.r} <a href='https://www.zhelixie.com/DedeBIZ/DedeCMSV6/commits/tag/${ver.ver}' class='btn btn-outline-success float-right' target='_blank'>更新记录</a></li>`;
  304. i++;
  305. });
  306. fstr += '</ul>';
  307. $("#_verList").html(fstr);
  308. } else {
  309. showStepArea(0);
  310. }
  311. })
  312. })
  313. $("#btnGoStep4").click(function () {
  314. currentStep++
  315. $("#_msgInfo").html('');
  316. $("#_msgInfo").hide();
  317. showStepArea(currentStep);
  318. update();
  319. })
  320. $("#btnOK").click(function () {
  321. hasNewVersion();
  322. })
  323. })
  324. </script>
  325. </body>
  326. </html>