Browse Source
# Conflicts: # README.md # pom.xml # ruoyi-ui/package.json # ruoyi-ui/src/views/index.vue # ruoyi-ui/vue.config.jsmaster
76 changed files with 1325 additions and 1120 deletions
File diff suppressed because one or more lines are too long
@ -1,173 +1,170 @@ |
|||||
<template> |
<template> |
||||
<el-color-picker |
<el-color-picker |
||||
v-model="theme" |
v-model="theme" |
||||
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]" |
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]" |
||||
class="theme-picker" |
class="theme-picker" |
||||
popper-class="theme-picker-dropdown" |
popper-class="theme-picker-dropdown" |
||||
/> |
/> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
const version = require('element-ui/package.json').version // element-ui version from node_modules |
const ORIGINAL_THEME = '#409EFF' // default color |
||||
const ORIGINAL_THEME = '#409EFF' // default color |
|
||||
|
export default { |
||||
export default { |
data() { |
||||
data() { |
return { |
||||
return { |
chalk: '', // content of theme-chalk css |
||||
chalk: '', // content of theme-chalk css |
theme: '' |
||||
theme: '' |
} |
||||
} |
}, |
||||
}, |
computed: { |
||||
computed: { |
defaultTheme() { |
||||
defaultTheme() { |
return this.$store.state.settings.theme |
||||
return this.$store.state.settings.theme |
} |
||||
} |
}, |
||||
}, |
watch: { |
||||
watch: { |
defaultTheme: { |
||||
defaultTheme: { |
handler: function(val, oldVal) { |
||||
handler: function(val, oldVal) { |
this.theme = val |
||||
this.theme = val |
}, |
||||
}, |
immediate: true |
||||
immediate: true |
}, |
||||
}, |
async theme(val) { |
||||
async theme(val) { |
await this.setTheme(val) |
||||
await this.setTheme(val) |
} |
||||
} |
}, |
||||
}, |
created() { |
||||
created() { |
if(this.defaultTheme !== ORIGINAL_THEME) { |
||||
if(this.defaultTheme !== ORIGINAL_THEME) { |
this.setTheme(this.defaultTheme) |
||||
this.setTheme(this.defaultTheme) |
} |
||||
} |
}, |
||||
}, |
methods: { |
||||
|
async setTheme(val) { |
||||
methods: { |
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME |
||||
async setTheme(val) { |
if (typeof val !== 'string') return |
||||
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME |
const themeCluster = this.getThemeCluster(val.replace('#', '')) |
||||
if (typeof val !== 'string') return |
const originalCluster = this.getThemeCluster(oldVal.replace('#', '')) |
||||
const themeCluster = this.getThemeCluster(val.replace('#', '')) |
|
||||
const originalCluster = this.getThemeCluster(oldVal.replace('#', '')) |
const getHandler = (variable, id) => { |
||||
|
return () => { |
||||
const getHandler = (variable, id) => { |
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', '')) |
||||
return () => { |
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster) |
||||
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', '')) |
|
||||
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster) |
let styleTag = document.getElementById(id) |
||||
|
if (!styleTag) { |
||||
let styleTag = document.getElementById(id) |
styleTag = document.createElement('style') |
||||
if (!styleTag) { |
styleTag.setAttribute('id', id) |
||||
styleTag = document.createElement('style') |
document.head.appendChild(styleTag) |
||||
styleTag.setAttribute('id', id) |
} |
||||
document.head.appendChild(styleTag) |
styleTag.innerText = newStyle |
||||
} |
} |
||||
styleTag.innerText = newStyle |
} |
||||
} |
|
||||
} |
if (!this.chalk) { |
||||
|
const url = `/styles/theme-chalk/index.css` |
||||
if (!this.chalk) { |
await this.getCSSString(url, 'chalk') |
||||
const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css` |
} |
||||
await this.getCSSString(url, 'chalk') |
|
||||
} |
const chalkHandler = getHandler('chalk', 'chalk-style') |
||||
|
chalkHandler() |
||||
const chalkHandler = getHandler('chalk', 'chalk-style') |
|
||||
|
const styles = [].slice.call(document.querySelectorAll('style')) |
||||
chalkHandler() |
.filter(style => { |
||||
|
const text = style.innerText |
||||
const styles = [].slice.call(document.querySelectorAll('style')) |
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text) |
||||
.filter(style => { |
}) |
||||
const text = style.innerText |
styles.forEach(style => { |
||||
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text) |
const { innerText } = style |
||||
}) |
if (typeof innerText !== 'string') return |
||||
styles.forEach(style => { |
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster) |
||||
const { innerText } = style |
}) |
||||
if (typeof innerText !== 'string') return |
|
||||
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster) |
this.$emit('change', val) |
||||
}) |
}, |
||||
|
|
||||
this.$emit('change', val) |
updateStyle(style, oldCluster, newCluster) { |
||||
}, |
let newStyle = style |
||||
|
oldCluster.forEach((color, index) => { |
||||
updateStyle(style, oldCluster, newCluster) { |
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index]) |
||||
let newStyle = style |
}) |
||||
oldCluster.forEach((color, index) => { |
return newStyle |
||||
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index]) |
}, |
||||
}) |
|
||||
return newStyle |
getCSSString(url, variable) { |
||||
}, |
return new Promise(resolve => { |
||||
|
const xhr = new XMLHttpRequest() |
||||
getCSSString(url, variable) { |
xhr.onreadystatechange = () => { |
||||
return new Promise(resolve => { |
if (xhr.readyState === 4 && xhr.status === 200) { |
||||
const xhr = new XMLHttpRequest() |
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '') |
||||
xhr.onreadystatechange = () => { |
resolve() |
||||
if (xhr.readyState === 4 && xhr.status === 200) { |
} |
||||
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '') |
} |
||||
resolve() |
xhr.open('GET', url) |
||||
} |
xhr.send() |
||||
} |
}) |
||||
xhr.open('GET', url) |
}, |
||||
xhr.send() |
|
||||
}) |
getThemeCluster(theme) { |
||||
}, |
const tintColor = (color, tint) => { |
||||
|
let red = parseInt(color.slice(0, 2), 16) |
||||
getThemeCluster(theme) { |
let green = parseInt(color.slice(2, 4), 16) |
||||
const tintColor = (color, tint) => { |
let blue = parseInt(color.slice(4, 6), 16) |
||||
let red = parseInt(color.slice(0, 2), 16) |
|
||||
let green = parseInt(color.slice(2, 4), 16) |
if (tint === 0) { // when primary color is in its rgb space |
||||
let blue = parseInt(color.slice(4, 6), 16) |
return [red, green, blue].join(',') |
||||
|
} else { |
||||
if (tint === 0) { // when primary color is in its rgb space |
red += Math.round(tint * (255 - red)) |
||||
return [red, green, blue].join(',') |
green += Math.round(tint * (255 - green)) |
||||
} else { |
blue += Math.round(tint * (255 - blue)) |
||||
red += Math.round(tint * (255 - red)) |
|
||||
green += Math.round(tint * (255 - green)) |
red = red.toString(16) |
||||
blue += Math.round(tint * (255 - blue)) |
green = green.toString(16) |
||||
|
blue = blue.toString(16) |
||||
red = red.toString(16) |
|
||||
green = green.toString(16) |
return `#${red}${green}${blue}` |
||||
blue = blue.toString(16) |
} |
||||
|
} |
||||
return `#${red}${green}${blue}` |
|
||||
} |
const shadeColor = (color, shade) => { |
||||
} |
let red = parseInt(color.slice(0, 2), 16) |
||||
|
let green = parseInt(color.slice(2, 4), 16) |
||||
const shadeColor = (color, shade) => { |
let blue = parseInt(color.slice(4, 6), 16) |
||||
let red = parseInt(color.slice(0, 2), 16) |
|
||||
let green = parseInt(color.slice(2, 4), 16) |
red = Math.round((1 - shade) * red) |
||||
let blue = parseInt(color.slice(4, 6), 16) |
green = Math.round((1 - shade) * green) |
||||
|
blue = Math.round((1 - shade) * blue) |
||||
red = Math.round((1 - shade) * red) |
|
||||
green = Math.round((1 - shade) * green) |
red = red.toString(16) |
||||
blue = Math.round((1 - shade) * blue) |
green = green.toString(16) |
||||
|
blue = blue.toString(16) |
||||
red = red.toString(16) |
|
||||
green = green.toString(16) |
return `#${red}${green}${blue}` |
||||
blue = blue.toString(16) |
} |
||||
|
|
||||
return `#${red}${green}${blue}` |
const clusters = [theme] |
||||
} |
for (let i = 0; i <= 9; i++) { |
||||
|
clusters.push(tintColor(theme, Number((i / 10).toFixed(2)))) |
||||
const clusters = [theme] |
} |
||||
for (let i = 0; i <= 9; i++) { |
clusters.push(shadeColor(theme, 0.1)) |
||||
clusters.push(tintColor(theme, Number((i / 10).toFixed(2)))) |
return clusters |
||||
} |
} |
||||
clusters.push(shadeColor(theme, 0.1)) |
} |
||||
return clusters |
} |
||||
} |
</script> |
||||
} |
|
||||
} |
<style> |
||||
</script> |
.theme-message, |
||||
|
.theme-picker-dropdown { |
||||
<style> |
z-index: 99999 !important; |
||||
.theme-message, |
} |
||||
.theme-picker-dropdown { |
|
||||
z-index: 99999 !important; |
.theme-picker .el-color-picker__trigger { |
||||
} |
height: 26px !important; |
||||
|
width: 26px !important; |
||||
.theme-picker .el-color-picker__trigger { |
padding: 2px; |
||||
height: 26px !important; |
} |
||||
width: 26px !important; |
|
||||
padding: 2px; |
.theme-picker-dropdown .el-color-dropdown__link-btn { |
||||
} |
display: none; |
||||
|
} |
||||
.theme-picker-dropdown .el-color-dropdown__link-btn { |
</style> |
||||
display: none; |
|
||||
} |
|
||||
</style> |
|
||||
|
|||||
@ -1,148 +1,148 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<el-row> |
<el-row :gutter="10"> |
||||
<el-col :span="24" class="card-box"> |
<el-col :span="24" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div> |
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%"> |
<table cellspacing="0" style="width: 100%"> |
||||
<tbody> |
<tbody> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="12" class="card-box"> |
<el-col :span="12" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div> |
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<div ref="commandstats" style="height: 420px" /> |
<div ref="commandstats" style="height: 420px" /> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="12" class="card-box"> |
<el-col :span="12" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div> |
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<div ref="usedmemory" style="height: 420px" /> |
<div ref="usedmemory" style="height: 420px" /> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
</el-row> |
</el-row> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getCache } from "@/api/monitor/cache"; |
import { getCache } from "@/api/monitor/cache"; |
||||
import * as echarts from "echarts"; |
import * as echarts from "echarts"; |
||||
|
|
||||
export default { |
export default { |
||||
name: "Cache", |
name: "Cache", |
||||
data() { |
data() { |
||||
return { |
return { |
||||
// 统计命令信息 |
// 统计命令信息 |
||||
commandstats: null, |
commandstats: null, |
||||
// 使用内存 |
// 使用内存 |
||||
usedmemory: null, |
usedmemory: null, |
||||
// cache信息 |
// cache信息 |
||||
cache: [] |
cache: [] |
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
this.getList(); |
this.getList(); |
||||
this.openLoading(); |
this.openLoading(); |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
/** 查缓存询信息 */ |
/** 查缓存询信息 */ |
||||
getList() { |
getList() { |
||||
getCache().then((response) => { |
getCache().then((response) => { |
||||
this.cache = response.data; |
this.cache = response.data; |
||||
this.$modal.closeLoading(); |
this.$modal.closeLoading(); |
||||
|
|
||||
this.commandstats = echarts.init(this.$refs.commandstats, "macarons"); |
this.commandstats = echarts.init(this.$refs.commandstats, "macarons"); |
||||
this.commandstats.setOption({ |
this.commandstats.setOption({ |
||||
tooltip: { |
tooltip: { |
||||
trigger: "item", |
trigger: "item", |
||||
formatter: "{a} <br/>{b} : {c} ({d}%)", |
formatter: "{a} <br/>{b} : {c} ({d}%)", |
||||
}, |
}, |
||||
series: [ |
series: [ |
||||
{ |
{ |
||||
name: "命令", |
name: "命令", |
||||
type: "pie", |
type: "pie", |
||||
roseType: "radius", |
roseType: "radius", |
||||
radius: [15, 95], |
radius: [15, 95], |
||||
center: ["50%", "38%"], |
center: ["50%", "38%"], |
||||
data: response.data.commandStats, |
data: response.data.commandStats, |
||||
animationEasing: "cubicInOut", |
animationEasing: "cubicInOut", |
||||
animationDuration: 1000, |
animationDuration: 1000, |
||||
} |
} |
||||
] |
] |
||||
}); |
}); |
||||
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons"); |
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons"); |
||||
this.usedmemory.setOption({ |
this.usedmemory.setOption({ |
||||
tooltip: { |
tooltip: { |
||||
formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human, |
formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human, |
||||
}, |
}, |
||||
series: [ |
series: [ |
||||
{ |
{ |
||||
name: "峰值", |
name: "峰值", |
||||
type: "gauge", |
type: "gauge", |
||||
min: 0, |
min: 0, |
||||
max: 1000, |
max: 1000, |
||||
detail: { |
detail: { |
||||
formatter: this.cache.info.used_memory_human, |
formatter: this.cache.info.used_memory_human, |
||||
}, |
}, |
||||
data: [ |
data: [ |
||||
{ |
{ |
||||
value: parseFloat(this.cache.info.used_memory_human), |
value: parseFloat(this.cache.info.used_memory_human), |
||||
name: "内存消耗", |
name: "内存消耗", |
||||
} |
} |
||||
] |
] |
||||
} |
} |
||||
] |
] |
||||
}); |
}); |
||||
window.addEventListener("resize", () => { |
window.addEventListener("resize", () => { |
||||
this.commandstats.resize(); |
this.commandstats.resize(); |
||||
this.usedmemory.resize(); |
this.usedmemory.resize(); |
||||
}); |
}); |
||||
}); |
}); |
||||
}, |
}, |
||||
// 打开加载层 |
// 打开加载层 |
||||
openLoading() { |
openLoading() { |
||||
this.$modal.loading("正在加载缓存监控数据,请稍候!"); |
this.$modal.loading("正在加载缓存监控数据,请稍候!"); |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
</script> |
</script> |
||||
|
|||||
@ -1,207 +1,207 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<el-row> |
<el-row :gutter="10"> |
||||
<el-col :span="12" class="card-box"> |
<el-col :span="12" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div> |
<div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%;"> |
<table cellspacing="0" style="width: 100%;"> |
||||
<thead> |
<thead> |
||||
<tr> |
<tr> |
||||
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">值</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">值</div></th> |
||||
</tr> |
</tr> |
||||
</thead> |
</thead> |
||||
<tbody> |
<tbody> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">核心数</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">核心数</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="12" class="card-box"> |
<el-col :span="12" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div> |
<div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%;"> |
<table cellspacing="0" style="width: 100%;"> |
||||
<thead> |
<thead> |
||||
<tr> |
<tr> |
||||
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">内存</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">内存</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">JVM</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">JVM</div></th> |
||||
</tr> |
</tr> |
||||
</thead> |
</thead> |
||||
<tbody> |
<tbody> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">总内存</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">总内存</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">使用率</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">使用率</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="24" class="card-box"> |
<el-col :span="24" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"> |
<div slot="header"> |
||||
<span><i class="el-icon-monitor"></i> 服务器信息</span> |
<span><i class="el-icon-monitor"></i> 服务器信息</span> |
||||
</div> |
</div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%;"> |
<table cellspacing="0" style="width: 100%;"> |
||||
<tbody> |
<tbody> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="24" class="card-box"> |
<el-col :span="24" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"> |
<div slot="header"> |
||||
<span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span> |
<span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span> |
||||
</div> |
</div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%;table-layout:fixed;"> |
<table cellspacing="0" style="width: 100%;table-layout:fixed;"> |
||||
<tbody> |
<tbody> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td> |
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td> |
||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td> |
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td> |
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td> |
||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td> |
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td> |
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td> |
||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td> |
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="24" class="card-box"> |
<el-col :span="24" class="card-box"> |
||||
<el-card> |
<el-card> |
||||
<div slot="header"> |
<div slot="header"> |
||||
<span><i class="el-icon-receiving"></i> 磁盘状态</span> |
<span><i class="el-icon-receiving"></i> 磁盘状态</span> |
||||
</div> |
</div> |
||||
<div class="el-table el-table--enable-row-hover el-table--medium"> |
<div class="el-table el-table--enable-row-hover el-table--medium"> |
||||
<table cellspacing="0" style="width: 100%;"> |
<table cellspacing="0" style="width: 100%;"> |
||||
<thead> |
<thead> |
||||
<tr> |
<tr> |
||||
<th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th> |
<th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">总大小</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">总大小</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th> |
||||
<th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th> |
<th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th> |
||||
</tr> |
</tr> |
||||
</thead> |
</thead> |
||||
<tbody v-if="server.sysFiles"> |
<tbody v-if="server.sysFiles"> |
||||
<tr v-for="(sysFile, index) in server.sysFiles" :key="index"> |
<tr v-for="(sysFile, index) in server.sysFiles" :key="index"> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td> |
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td> |
||||
<td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td> |
<td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td> |
||||
</tr> |
</tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</el-col> |
</el-col> |
||||
</el-row> |
</el-row> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getServer } from "@/api/monitor/server"; |
import { getServer } from "@/api/monitor/server"; |
||||
|
|
||||
export default { |
export default { |
||||
name: "Server", |
name: "Server", |
||||
data() { |
data() { |
||||
return { |
return { |
||||
// 服务器信息 |
// 服务器信息 |
||||
server: [] |
server: [] |
||||
}; |
}; |
||||
}, |
}, |
||||
created() { |
created() { |
||||
this.getList(); |
this.getList(); |
||||
this.openLoading(); |
this.openLoading(); |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
/** 查询服务器信息 */ |
/** 查询服务器信息 */ |
||||
getList() { |
getList() { |
||||
getServer().then(response => { |
getServer().then(response => { |
||||
this.server = response.data; |
this.server = response.data; |
||||
this.$modal.closeLoading(); |
this.$modal.closeLoading(); |
||||
}); |
}); |
||||
}, |
}, |
||||
// 打开加载层 |
// 打开加载层 |
||||
openLoading() { |
openLoading() { |
||||
this.$modal.loading("正在加载服务监控数据,请稍候!"); |
this.$modal.loading("正在加载服务监控数据,请稍候!"); |
||||
} |
} |
||||
} |
} |
||||
}; |
}; |
||||
</script> |
</script> |
||||
|
|||||
Loading…
Reference in new issue