Merge branch 'dev-3.4' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.4

This commit is contained in:
likexuan
2022-06-23 16:55:48 +08:00
15 changed files with 53 additions and 27 deletions

View File

@@ -473,6 +473,14 @@ textarea {
.is-disabled{ .is-disabled{
color: $--color-text-disabled !important; color: $--color-text-disabled !important;
} }
.ql-tooltip { .ql-snow .ql-tooltip {
background: $--background-color-empty; background: $--background-color-empty;
border: 1px solid $--select-page-focus-color;
box-shadow: 0px 0px 5px $--scrollbar-background-color;
color: $--color-text-primary;
input[type=text]{
border: 1px solid $--select-page-focus-color;
background: $--background-color-empty;
outline: none;
}
} }

View File

@@ -3,9 +3,8 @@
} }
.my-loading-parent--relative { .my-loading-parent--relative {
position: relative; position: relative;
display: inline-block;
height: 100%; height: 100%;
width: 100%; width: auto;
} }
.panel-chart { .panel-chart {
border: 1px solid $--chart-box-border-color; border: 1px solid $--chart-box-border-color;

View File

@@ -37,7 +37,7 @@
} }
.project-title { .project-title {
background: #eeeeee; background: $--background-color-base;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
border-radius: 0; border-radius: 0;

View File

@@ -60,7 +60,7 @@
} }
} }
.edit-topologyLine{ .edit-topologyLine{
background: rgba(196,196,196,0.4) !important; //background: rgba(196,196,196,0.4) !important;
border-bottom: 1px solid $--explore-border-color-bottom; border-bottom: 1px solid $--explore-border-color-bottom;
} }
.topology-scroll{ .topology-scroll{
@@ -333,10 +333,9 @@
margin-right: 10px; margin-right: 10px;
} }
.project-title { .project-title {
height: 55px; height: 36px;
padding-bottom: 0; padding-bottom: 0;
} }
.drag-header { .drag-header {
cursor: move; cursor: move;
background: #1a1a1a; background: #1a1a1a;
@@ -543,3 +542,12 @@
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
} }
.full.pr10 {
.el-select.el-select--small,.el-input {
background-color: $--background-color-empty;
border: 1px solid $--background-color-empty;
}
}
.el-upload-dragger{
background-color: $--background-color-empty;
}

View File

@@ -38,12 +38,12 @@
} }
.metrics-input-box{ .metrics-input-box{
.input-box .el-textarea .el-textarea__inner { .input-box .el-textarea .el-textarea__inner {
width: calc(100% + 42px); width: 100%;
} }
.metric-selector-input-box{ .metric-selector-input-box{
line-height: 32px; line-height: 32px;
.el-input__count{ .el-input__count{
right: -38px !important; right: 18px !important;
} }
} }
.el-col-24{ .el-col-24{

View File

@@ -58,6 +58,7 @@
} }
.el-cascader-menu { .el-cascader-menu {
width: 200px; width: 200px;
height: 100%;
} }
.metric-btn:hover, .metric-btn:focus { .metric-btn:hover, .metric-btn:focus {
background-image: linear-gradient(180deg, rgb(247, 248, 250) 0%, rgb(247, 248, 250) 100%); background-image: linear-gradient(180deg, rgb(247, 248, 250) 0%, rgb(247, 248, 250) 100%);

View File

@@ -259,6 +259,7 @@
right: 0; right: 0;
width: 1px; width: 1px;
height: 100%; height: 100%;
background: $--border-color-light;
} }
} }

View File

@@ -61,7 +61,7 @@
<div slot="prefix"> <div slot="prefix">
<div class="icon-item" style="width: 100%;padding: 0"> <div class="icon-item" style="width: 100%;padding: 0">
<svg> <svg>
<g fill="none" stroke="black" stroke-width="1"> <g fill="none" :stroke="theme === 'light' ? 'black' : '#BEBEBE'" stroke-width="1">
<path <path
:d="penLineType.find((item,i)=>item.id==lineName).d" :d="penLineType.find((item,i)=>item.id==lineName).d"
> >
@@ -74,7 +74,7 @@
<el-option v-for="(item,index) in penLineType" :value="item.id" :key="index"> <el-option v-for="(item,index) in penLineType" :value="item.id" :key="index">
<div class="icon-item" style="position: relative;width: 100%;padding: 0"> <div class="icon-item" style="position: relative;width: 100%;padding: 0">
<svg> <svg>
<g fill="none" :stroke="(lineName==item.name)?'#ee9d3f':'black'" stroke-width="1"> <g fill="none" :stroke="(lineName==item.name)?'#ee9d3f': item.strokeColor " stroke-width="1">
<path :d="item.d" :stroke-dasharray="item['stroke-dasharray']"></path> <path :d="item.d" :stroke-dasharray="item['stroke-dasharray']"></path>
</g> </g>
</svg> </svg>
@@ -354,7 +354,9 @@ const canvasOptions = {
export default { export default {
name: 'diagram', name: 'diagram',
data () { data () {
const theme = localStorage.getItem(`nz-user-${localStorage.getItem('nz-user-id')}-theme`) || 'light'
return { return {
theme,
title: this.$t('overall.uploadCustomPicture'), title: this.$t('overall.uploadCustomPicture'),
objChange: false, // project 变化 用于判断 init是否执行完成 执行完成 才可以执行下次变化 objChange: false, // project 变化 用于判断 init是否执行完成 执行完成 才可以执行下次变化
chartDataInfo: {}, chartDataInfo: {},
@@ -517,10 +519,10 @@ export default {
chartData: {}, chartData: {},
chartGetData: [], chartGetData: [],
penLineType: [ penLineType: [
{ d: 'M5 19 a50,100 0 0,1 40,0', 'stroke-dasharray': '', name: this.$t('project.topology.curve'), id: 'curve' }, { d: 'M5 19 a50,100 0 0,1 40,0', 'stroke-dasharray': '', name: this.$t('project.topology.curve'), id: 'curve' , strokeColor: theme == 'light' ? 'black' : '#BEBEBE'},
{ d: 'M5 8 l20 0 l0 12 l20 0', 'stroke-dasharray': '', name: this.$t('project.topology.polyline'), id: 'polyline' }, { d: 'M5 8 l20 0 l0 12 l20 0', 'stroke-dasharray': '', name: this.$t('project.topology.polyline'), id: 'polyline' , strokeColor: theme == 'light' ? 'black' : '#BEBEBE'},
{ d: 'M5 14 l40 0', 'stroke-dasharray': '', name: this.$t('project.topology.line'), id: 'line' } { d: 'M5 14 l40 0', 'stroke-dasharray': '', name: this.$t('project.topology.line'), id: 'line' , strokeColor: theme == 'light' ? 'black' : '#BEBEBE'}
// {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind'}, // {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind', strokeColor: theme == 'light' ? 'black' : '#BEBEBE'},
], ],
lineName: 'curve', lineName: 'curve',
cachesIndex: 0, cachesIndex: 0,
@@ -831,8 +833,10 @@ export default {
this.projectAlertShow = true this.projectAlertShow = true
this.saveData = { ...data } this.saveData = { ...data }
this.topologyInfo.name = '' this.topologyInfo.name = ''
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
resolve(data) resolve(data)
} else { } else {
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
if (data.data) { if (data.data) {
this.topologyInfo = { this.topologyInfo = {
fontSize: data.data.fontSize, fontSize: data.data.fontSize,

View File

@@ -638,7 +638,7 @@
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
<div class="alert-label-title">{{ $t("overall.login.name") }}</div> <div class="alert-label-title">{{ $t("profile.username") }}</div>
<div class="alert-label-value"> <div class="alert-label-value">
{{ alertLabelData && alertLabelData.username ? alertLabelData.username : "--" }} {{ alertLabelData && alertLabelData.username ? alertLabelData.username : "--" }}
</div> </div>
@@ -656,13 +656,13 @@
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
<div class="alert-label-title">{{ $t("overall.soure") }}</div> <div class="alert-label-title">{{ $t("profile.source") }}</div>
<div class="alert-label-value"> <div class="alert-label-value">
{{ alertLabelData && alertLabelData.source ? alertLabelData.source : "--" }} {{ alertLabelData && alertLabelData.source ? alertLabelData.source : "--" }}
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
<div class="alert-label-title">{{ $t("config.operationlog.state") }}</div> <div class="alert-label-title">{{ $t("overall.state") }}</div>
<div class="alert-label-value"> <div class="alert-label-value">
<div <div
v-if="alertLabelData" v-if="alertLabelData"

View File

@@ -137,7 +137,7 @@ export default {
width: 120, width: 120,
sortable: 'custom' sortable: 'custom'
}, { }, {
label: this.$t('alert.config.receiver'), label: this.$t('alert.receiver'),
prop: 'receivers', prop: 'receivers',
show: false, show: false,
minWidth: 100 minWidth: 100

View File

@@ -828,9 +828,11 @@ export default {
this.projectAlertShow = true this.projectAlertShow = true
this.saveData = JSON.parse(JSON.stringify(data)) this.saveData = JSON.parse(JSON.stringify(data))
this.topologyInfo.name = this.obj.name this.topologyInfo.name = this.obj.name
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
resolve(data) resolve(data)
data = null data = null
} else { } else {
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
if (data.data) { if (data.data) {
this.topologyInfo = { this.topologyInfo = {
fontSize: data.data.fontSize, fontSize: data.data.fontSize,

View File

@@ -100,7 +100,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<!--unit--> <!--unit-->
<el-form-item v-if="showSnmpTrap" :label="$t('alert.config.unit')" class="half-form-item" prop="unit" :rules="[{ required: this.editAlertRule.type !== 3, message: this.$t('validate.required'), trigger: 'blur' }]"> <el-form-item v-if="showSnmpTrap" :label="$t('dashboard.panel.chartForm.unit')" class="half-form-item" prop="unit" :rules="[{ required: this.editAlertRule.type !== 3, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-cascader id="alert-box-input-unit" v-model="editAlertRule.unit" :options="unitOptions" :props="{ expandTrigger: 'click',emitPath:false }" :show-all-levels="false" filterable <el-cascader id="alert-box-input-unit" v-model="editAlertRule.unit" :options="unitOptions" :props="{ expandTrigger: 'click',emitPath:false }" :show-all-levels="false" filterable
placeholder="" placeholder=""
popper-class="no-style-class dc-dropdown unit-popper-class" popper-class="no-style-class dc-dropdown unit-popper-class"
@@ -290,7 +290,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--receiver--> <!--receiver-->
<el-form-item :label="$t('alert.config.receiver')" prop="receiver" :rules="[{ required: editAlertRule.notifyExpired || editAlertRule.notifyActive, message: this.$t('validate.required'), trigger: 'blur' }]"> <el-form-item :label="$t('alert.receiver')" prop="receiver" :rules="[{ required: editAlertRule.notifyExpired || editAlertRule.notifyActive, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-select <el-select
id="alert-box-input-receiver" id="alert-box-input-receiver"
v-model.trim="editAlertRule.receiverShow" v-model.trim="editAlertRule.receiverShow"

View File

@@ -243,7 +243,7 @@ export default {
width: 120, width: 120,
sortable: 'custom' sortable: 'custom'
}, { }, {
label: this.$t('alert.config.receiver'), label: this.$t('alert.receiver'),
prop: 'receivers', prop: 'receivers',
show: false, show: false,
minWidth: 100 minWidth: 100

View File

@@ -125,7 +125,9 @@ export default {
} }
}, },
data () { data () {
const theme = localStorage.getItem(`nz-user-${localStorage.getItem('nz-user-id')}-theme`) || 'light'
return { return {
theme,
operations: { operations: {
levels: [0, 1, 2, 3, 4, 5, 6], levels: [0, 1, 2, 3, 4, 5, 6],
descending: true descending: true
@@ -262,8 +264,10 @@ export default {
itemHeight: 4, itemHeight: 4,
borderRadius: 3, borderRadius: 3,
textStyle: { textStyle: {
padding: [0, 0, 0, 6] padding: [0, 0, 0, 6],
} color: this.theme == 'light' ? '#666666' : '#BEBEBE',
},
inactiveColor: this.theme == 'light' ? '#BEBEBE' : '#666666' // 字体颜色
}, },
series, series,
xAxis: { xAxis: {

View File

@@ -23,7 +23,6 @@
v-model="cascaderValue" v-model="cascaderValue"
v-clickoutside="closeDropdown" v-clickoutside="closeDropdown"
v-my-loading="tempBoxShowLoading" v-my-loading="tempBoxShowLoading"
:loading="loading"
:options="metricOptions" :options="metricOptions"
v-if="type !== 'log'" v-if="type !== 'log'"
:props="cascaderProps" :props="cascaderProps"
@@ -925,7 +924,7 @@ export default {
let childrenCopy = JSON.parse(JSON.stringify(children)) let childrenCopy = JSON.parse(JSON.stringify(children))
const findChild = this.metricOptions.find(item => item.label === data.parent) const findChild = this.metricOptions.find(item => item.label === data.parent)
if (childrenCopy.length > 100) { if (childrenCopy.length > 100) {
childrenCopy = childrenCopy.splice(findChild.children.length, findChild.children.length + 101) childrenCopy = childrenCopy.splice(findChild.children.length, 100)
findChild.children.splice(findChild.children.length - 1, 1) findChild.children.splice(findChild.children.length - 1, 1)
findChild.children.push(...childrenCopy) findChild.children.push(...childrenCopy)
if (findChild.children.length < children.length - 1) { if (findChild.children.length < children.length - 1) {