mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 17:54:37 +00:00
Perf: Add Dashboard Items
This commit is contained in:
@@ -86,9 +86,9 @@ export default {
|
|||||||
min-width: 670px;
|
min-width: 670px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.switch-date-wrapper {
|
// .switch-date-wrapper {
|
||||||
margin-bottom: 1.25rem;
|
// margin-bottom: 1.25rem;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.page ::v-deep .page-heading {
|
.page ::v-deep .page-heading {
|
||||||
display: none;
|
display: none;
|
||||||
|
@@ -186,7 +186,7 @@ export default {
|
|||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 12.5rem;
|
height: 14.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -156,8 +156,8 @@ export default {
|
|||||||
distance: 10
|
distance: 10
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#2B937C',
|
color: '#1AB394',
|
||||||
opacity: 0.8,
|
|
||||||
borderRadius: [0, 4, 4, 0]
|
borderRadius: [0, 4, 4, 0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,6 +273,6 @@ export default {
|
|||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400px;
|
height: 16rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -1,16 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="title-section">
|
<div class="card-content">
|
||||||
<Title :config="config" />
|
<div class="left-section">
|
||||||
</div>
|
<div class="title-section">
|
||||||
|
<Title :config="config" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="total-section">
|
<div class="total-section">
|
||||||
<div class="total-account"> {{ config.total }} </div>
|
<div class="total-title">Total accounts</div>
|
||||||
|
<div class="total-account"> {{ config.total }} </div>
|
||||||
<div class="week-add">
|
<div class="week-add">
|
||||||
<div class="week-add-title"> {{ $t('WeekAdd') }} </div>
|
<div class="week-add-title"> {{ $t('WeekAdd') }} </div>
|
||||||
<div class="week-add-value"> + {{ config.weekAdd }} </div>
|
<div class="week-add-value"> + {{ config.weekAdd }} </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div ref="chartRef" class="right-section" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
@@ -31,6 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import * as echarts from 'echarts'
|
||||||
import Title from '../components/Title.vue'
|
import Title from '../components/Title.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -64,6 +71,100 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
chartOption() {
|
||||||
|
return {
|
||||||
|
title: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'cross',
|
||||||
|
label: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: '3%',
|
||||||
|
right: 0,
|
||||||
|
bottom: 0
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'category',
|
||||||
|
boundaryGap: false,
|
||||||
|
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: 'Line 1',
|
||||||
|
type: 'line',
|
||||||
|
stack: 'Total',
|
||||||
|
smooth: true,
|
||||||
|
itemStyle: {
|
||||||
|
color: '#1AB394'
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
width: 2,
|
||||||
|
color: '#1AB394'
|
||||||
|
},
|
||||||
|
showSymbol: false,
|
||||||
|
areaStyle: {
|
||||||
|
opacity: 0.8,
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: 'rgba(26, 179, 148, 0.3)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: 'rgba(26, 179, 148, 0)'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series'
|
||||||
|
},
|
||||||
|
data: [0, 232, 101, 264, 90, 340, 0]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initChart()
|
||||||
|
window.addEventListener('resize', this.resizeChart)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
if (this.chart) {
|
||||||
|
this.chart.dispose()
|
||||||
|
this.chart = null
|
||||||
|
}
|
||||||
|
window.removeEventListener('resize', this.resizeChart)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initChart() {
|
||||||
|
this.chart = echarts.init(this.$refs.chartRef)
|
||||||
|
this.chart.setOption(this.chartOption)
|
||||||
|
},
|
||||||
|
resizeChart() {
|
||||||
|
if (this.chart) {
|
||||||
|
this.chart.resize()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -78,7 +179,7 @@ $text-color: #646A73;
|
|||||||
.card {
|
.card {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1.25rem;
|
gap: 1.37rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
@@ -86,44 +187,67 @@ $text-color: #646A73;
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
|
|
||||||
.total-section {
|
.card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.3rem;
|
|
||||||
|
|
||||||
.sub-title {
|
.left-section {
|
||||||
color: #646A73;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.total-account {
|
|
||||||
color: #1F2329;
|
|
||||||
font-size: 2rem;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 2.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.week-add {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
color: #1F2329;
|
flex: 1;
|
||||||
font-weight: 400;
|
|
||||||
line-height: 1.4rem;
|
|
||||||
|
|
||||||
.week-add-title {
|
.total-section {
|
||||||
font-size: 0.9rem;
|
display: flex;
|
||||||
font-weight: inherit;
|
gap: 0.4rem;
|
||||||
line-height: inherit;
|
flex-direction: column;
|
||||||
}
|
margin-top: 0.5rem;
|
||||||
|
|
||||||
.week-add-value {
|
.total-title {
|
||||||
color: #F54A45;
|
font-size: 0.875rem;
|
||||||
font-size: 0.9rem;
|
color: #646A73;
|
||||||
font-weight: inherit;
|
font-weight: 400;
|
||||||
line-height: inherit;
|
}
|
||||||
|
|
||||||
|
.sub-title {
|
||||||
|
color: #646A73;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-account {
|
||||||
|
color: #1F2329;
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.week-add {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
color: #1F2329;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.4rem;
|
||||||
|
|
||||||
|
.week-add-title {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.week-add-value {
|
||||||
|
color: #F54A45;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right-section {
|
||||||
|
height: 8rem;
|
||||||
|
width: 20rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.metrics-section {
|
.metrics-section {
|
||||||
|
@@ -5,19 +5,19 @@
|
|||||||
|
|
||||||
<div class="summary-container">
|
<div class="summary-container">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="16" :xs="24">
|
<el-col :span="14" :xs="24">
|
||||||
<DataSummary class="data-summery" />
|
<DataSummary class="data-summery" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" :xs="24">
|
<el-col :span="10" :xs="24">
|
||||||
<MissionSummery class="mission-summery" />
|
<MissionSummery class="mission-summery" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="16" :xs="24">
|
<el-col :span="14" :xs="24">
|
||||||
<AccountSecretSummary class="account-secret-summary" />
|
<AccountSecretSummary class="account-secret-summary" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" :xs="24">
|
<el-col :span="10" :xs="24">
|
||||||
<RiskSummary class="risk-summary" />
|
<RiskSummary class="risk-summary" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -83,7 +83,7 @@ export default {
|
|||||||
margin-top: unset;
|
margin-top: unset;
|
||||||
|
|
||||||
::v-deep .echarts {
|
::v-deep .echarts {
|
||||||
height: 25rem;
|
height: 16rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user