更新
This commit is contained in:
parent
effff92797
commit
231289a9e2
@ -8,6 +8,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
};
|
||||
/* 转换内存 */
|
||||
const megaknotsToSize = (limit) => {
|
||||
if (limit < 1024) return parseInt(limit) + ' MB'
|
||||
return parseInt(limit / 1024) + ' GB'
|
||||
}
|
||||
const categories = [];
|
||||
const upSeries = [];
|
||||
const downSeries = [];
|
||||
@ -27,6 +32,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
success(res) {
|
||||
if (!res.status) Qmsg.warning('服务器接口异常!');
|
||||
{
|
||||
$('.joe_census__server-item .count .core').html(`${res.cpu[1]} 核`);
|
||||
$('.joe_census__server-item .count .ram').html(`${megaknotsToSize(res.memory.memTotal)}`);
|
||||
$('.joe_census__server-item .count .up').html(`总发送:${bytesToSize(res.upTotal)}`);
|
||||
$('.joe_census__server-item .count .down').html(`总接收:${bytesToSize(res.downTotal)}`);
|
||||
const stamp = new Date();
|
||||
|
2
assets/js/joe.census.min.js
vendored
2
assets/js/joe.census.min.js
vendored
File diff suppressed because one or more lines are too long
11
census.php
11
census.php
@ -16,7 +16,7 @@
|
||||
<?php $this->need('public/include.php'); ?>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.census.min.css?v=20210524'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.1.1/dist/echarts.min.js"></script>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.census.min.js?v=20210524'); ?>"></script>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/joe.census.min.js?v=202105242137'); ?>"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -86,7 +86,14 @@
|
||||
<?php if ($this->options->JBTPanel && $this->options->JBTKey) : ?>
|
||||
<div class="joe_census__server">
|
||||
<div class="joe_census__server-item">
|
||||
<div class="title">实时负载</div>
|
||||
<div class="title">
|
||||
<span>实时负载</span>
|
||||
<div class="count">
|
||||
<span class="core">0 核</span>
|
||||
<span class="split">/</span>
|
||||
<span class="ram">0 MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div id="work"></div>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* 获取主题当前版本号 */
|
||||
function _getVersion()
|
||||
{
|
||||
return "7.1.1";
|
||||
return "7.1.2";
|
||||
};
|
||||
|
||||
/* 判断是否是手机 */
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "typecho-joe-next",
|
||||
"version": "7.1.1",
|
||||
"version": "7.1.2",
|
||||
"description": "A Theme Of Typecho",
|
||||
"main": "index.php",
|
||||
"keywords": [
|
||||
|
Loading…
Reference in New Issue
Block a user