parent
80544e43af
commit
d50fa8ed22
@ -1,22 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.tool;
|
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* swagger 接口
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("/tool/swagger")
|
|
||||||
public class SwaggerController extends BaseController {
|
|
||||||
@PreAuthorize("@ss.hasPermi('tool:swagger:view')")
|
|
||||||
@GetMapping()
|
|
||||||
public String index() {
|
|
||||||
return redirect("/swagger-ui.html");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询服务器详细
|
|
||||||
export function getServer() {
|
|
||||||
return request({
|
|
||||||
url: '/monitor/server',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,210 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div v-loading="loading" :style="'height:'+ height">
|
||||||
<el-row>
|
<iframe ref="iframe" :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
|
||||||
<el-col :span="12" class="card-box">
|
|
||||||
<el-card>
|
|
||||||
<div slot="header"><span>CPU</span></div>
|
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
|
||||||
<table cellspacing="0" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="is-leaf"><div class="cell">属性</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">值</div></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">核心数</div></td>
|
|
||||||
<td><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">用户使用率</div></td>
|
|
||||||
<td><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">系统使用率</div></td>
|
|
||||||
<td><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">当前空闲率</div></td>
|
|
||||||
<td><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12" class="card-box">
|
|
||||||
<el-card>
|
|
||||||
<div slot="header"><span>内存</span></div>
|
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
|
||||||
<table cellspacing="0" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="is-leaf"><div class="cell">属性</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">内存</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">JVM</div></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">总内存</div></td>
|
|
||||||
<td><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">已用内存</div></td>
|
|
||||||
<td><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">剩余内存</div></td>
|
|
||||||
<td><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">使用率</div></td>
|
|
||||||
<td><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
|
||||||
<el-card>
|
|
||||||
<div slot="header">
|
|
||||||
<span>服务器信息</span>
|
|
||||||
</div>
|
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
|
||||||
<table cellspacing="0" style="width: 100%;">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">服务器名称</div></td>
|
|
||||||
<td><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
|
|
||||||
<td><div class="cell">操作系统</div></td>
|
|
||||||
<td><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">服务器IP</div></td>
|
|
||||||
<td><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
|
|
||||||
<td><div class="cell">系统架构</div></td>
|
|
||||||
<td><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
|
||||||
<el-card>
|
|
||||||
<div slot="header">
|
|
||||||
<span>Java虚拟机信息</span>
|
|
||||||
</div>
|
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
|
||||||
<table cellspacing="0" style="width: 100%;">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">Java名称</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
|
|
||||||
<td><div class="cell">Java版本</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><div class="cell">启动时间</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
|
|
||||||
<td><div class="cell">运行时长</div></td>
|
|
||||||
<td><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="1"><div class="cell">安装路径</div></td>
|
|
||||||
<td colspan="3"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="1"><div class="cell">项目路径</div></td>
|
|
||||||
<td colspan="3"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
|
||||||
<el-card>
|
|
||||||
<div slot="header">
|
|
||||||
<span>磁盘状态</span>
|
|
||||||
</div>
|
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
|
||||||
<table cellspacing="0" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="is-leaf"><div class="cell">盘符路径</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">文件系统</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">盘符类型</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">总大小</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">可用大小</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">已用大小</div></th>
|
|
||||||
<th class="is-leaf"><div class="cell">已用百分比</div></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody v-if="server.sysFiles">
|
|
||||||
<tr v-for="sysFile in server.sysFiles">
|
|
||||||
<td><div class="cell">{{ sysFile.dirName }}</div></td>
|
|
||||||
<td><div class="cell">{{ sysFile.sysTypeName }}</div></td>
|
|
||||||
<td><div class="cell">{{ sysFile.typeName }}</div></td>
|
|
||||||
<td><div class="cell">{{ sysFile.total }}</div></td>
|
|
||||||
<td><div class="cell">{{ sysFile.free }}</div></td>
|
|
||||||
<td><div class="cell">{{ sysFile.used }}</div></td>
|
|
||||||
<td><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getServer } from "@/api/monitor/server";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Server",
|
name: "Server",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 加载层信息
|
src: process.env.VUE_APP_BASE_API + "/admin",
|
||||||
loading: [],
|
height: document.documentElement.clientHeight - 94.5 + "px;",
|
||||||
// 服务器信息
|
loading: true
|
||||||
server: []
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
mounted: function() {
|
||||||
this.getList();
|
const that = this;
|
||||||
this.openLoading();
|
|
||||||
},
|
setTimeout(() => {
|
||||||
methods: {
|
// 模拟点击【应用】菜单
|
||||||
/** 查询服务器信息 */
|
that.$refs["iframe"].contentWindow.document.getElementsByClassName('navbar-item')[2].click();
|
||||||
getList() {
|
// 取消加载中
|
||||||
getServer().then(response => {
|
this.loading = false;
|
||||||
this.server = response.data;
|
}, 230);
|
||||||
this.loading.close();
|
|
||||||
});
|
// 大小变化的监听
|
||||||
},
|
window.onresize = function temp() {
|
||||||
// 打开加载层
|
that.height = document.documentElement.clientHeight - 94.5 + "px;";
|
||||||
openLoading() {
|
};
|
||||||
this.loading = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: "拼命读取中",
|
|
||||||
spinner: "el-icon-loading",
|
|
||||||
background: "rgba(0, 0, 0, 0.7)"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue