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

This commit is contained in:
zhangyu
2022-07-06 17:52:01 +08:00
16 changed files with 81 additions and 34 deletions

View File

@@ -374,3 +374,13 @@
.meta-option-box {
color: $--color-text-regular;
}
.el-range-input{
background: $--background-color-empty;
}
.ql-toolbar {
line-height: 22px;
.ql-picker-options{
background-color: $--background-color-empty;
color: $--color-text-primary;
}
}

View File

@@ -571,3 +571,11 @@
overflow: auto;
background-color: $--table-body-background-color;
}
.el-checkbox.is-disabled{
line-height: 1;
height: 16px;
}
.el-checkbox__input.is-disabled{
line-height: 1;
height: 16px;
}

View File

@@ -215,16 +215,16 @@
font-weight: 600;
text-transform: Capitalize;
}
.pipeline-option {
i {
color: $--color-text-regular;
}
}
}
.el-input-group__append {
background-color: $--border-color-light;
}
}
.pipeline-option {
i {
color: $--color-text-regular;
}
}
.sub-label {
padding-right: 15px;
font-size: 14px;

View File

@@ -15,7 +15,8 @@ export default {
// labelLoading:{},
that: {},
detailList: Boolean,
alertTableDialog: Boolean
alertTableDialog: Boolean,
isTopoInfo: Boolean
},
data () {
return {
@@ -31,9 +32,10 @@ export default {
const leftOffSetView = this.detailList ? -80 : 10
const leftOffSet = this.detailList ? -80 : 10
const topOffSet = this.detailList ? 60 : 22
const topoOffset = this.isTopoInfo ? 155 : 0
if (position.top + this.heightList > clientHeight) {
return {
left: `${position.left + position.width + leftOffSet}px`,
left: `${position.left + position.width + leftOffSet - topoOffset}px`,
top: `${position.top - this.heightList + topOffSet}px`
}
} else if (this.alertTableDialog) {
@@ -47,7 +49,7 @@ export default {
}
} else {
return {
left: `${position.left + position.width + leftOffSetView}px`,
left: `${position.left + position.width + leftOffSetView - topoOffset}px`,
top: `${position.top}px`
}
}

View File

@@ -150,7 +150,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.inputDateQuery = this.handlerTableData(this.tableData)
this.pageObj.total = this.tableData.length
if (!this.scrollbarWrap) {

View File

@@ -134,7 +134,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -85,7 +85,7 @@ export default {
}, 100)
},
detailViewRightShow (item) {
this.detailViewRightObj = item
this.detailViewRightObj = this.$loadsh.cloneDeep(item)
},
orderDetail (order, orderType) {
if (orderType === 'ascending') {

View File

@@ -15,6 +15,7 @@
<template v-slot:default="slotProps">
<endpoint-table
style="height: 100%"
:isTopoInfo="true"
ref="dataTable"
:orderByFa="orderBy"
v-my-loading="tools.loading"

View File

@@ -153,11 +153,11 @@ export default {
if (valid) {
if (this.editCredential.type === 3) {
if (this.editCredential.config.authProtocol && !this.editCredential.config.privProtocol) {
this.editCredential.securityLevel = 'authNoPriv'
this.editCredential.config.securityLevel = 'authNoPriv'
} else if (this.editCredential.config.authProtocol && this.editCredential.config.privProtocol) {
this.editCredential.securityLevel = 'authPriv'
this.editCredential.config.securityLevel = 'authPriv'
} else {
this.editCredential.securityLevel = 'noAuthNoPriv'
this.editCredential.config.securityLevel = 'noAuthNoPriv'
}
}
const param = JSON.parse(JSON.stringify(this.editCredential))

View File

@@ -146,7 +146,7 @@
<span class="active-icon gray-bg inline-block"></span>
</span>
</span>
<nz-tooltip :that="scope.row.configs[1]" v-if="scope.row.configs[1] && scope.row.configs[1].loading && scope.row.configs[1].state > 1" :type="'configs[1]'">
<nz-tooltip :that="scope.row.configs[1]" v-if="scope.row.configs[1] && scope.row.configs[1].loading && scope.row.configs[1].state > 1" :type="'configs[1]'" :isTopoInfo="isTopoInfo">
<div name="default">
<div v-html="suspendedStr(scope.row.configs[1].state)"></div>
</div>
@@ -220,6 +220,10 @@ export default {
type: Boolean,
default: true
},
isTopoInfo: {
type: Boolean,
default: false
},
endpointTab: Boolean,
loading: Boolean
},

View File

@@ -317,7 +317,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -750,7 +750,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -195,7 +195,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -668,7 +668,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -440,7 +440,7 @@ export default {
} else {
detailViewRightObj = this.tableData[0]
}
this.detailViewRightObj = detailViewRightObj
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -1,11 +1,28 @@
import { getUUID } from './components/common/js/common'
import axios from 'axios'
const CancelToken = axios.CancelToken // 申明CancelToken
export const requestsArr = []
axios.interceptors.request.use(config => {
// 清除掉请求完成的实例 防止占用内存
const removePending = (config) => {
if (!config) {
return false
}
for (const i in requestsArr) {
if (requestsArr[i].id === config.id) {
requestsArr.splice(i, 1)
}
}
}
axios.interceptors.request.use(
config => {
const source = CancelToken.source() // 申明CancelToken,也可new CancelToken.source()实例一个
config.cancelToken = source.token // 实例对象的token赋予该请求
requestsArr.push(source) // 将该实例添加到队列中
config.cancelToken = source.token // 实例对象的token赋予该请求
const id = getUUID() // 添加唯一识别id 在请求完成时清除requestsArr
config.id = id
requestsArr.push({
id,
cancel: source.cancel
}) // 将该实例添加到队列中
const token = localStorage.getItem('nz-token')
if (token) {
config.headers.Authorization = token // 请求头token
@@ -15,8 +32,9 @@ axios.interceptors.request.use(config => {
config.headers.Language = lang // 请求头token
}
return config
},
err => Promise.reject(err)
}, err => {
Promise.reject(err)
}
)
const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等
const licenceErrorCode = [711001]
@@ -66,9 +84,13 @@ axios.interceptors.response.use(
} else {
return response
}
// 请求完成在数组中移除
removePending(response.config)
return response
},
error => {
// 请求完成在数组中移除
removePending(error.config)
return Promise.reject(error)
}
)