Merge remote-tracking branch 'origin/dev-3.1' into dev-3.2
# Conflicts: # nezha-fronted/src/assets/css/common/rightBoxCommon.scss # nezha-fronted/src/assets/css/components/common/project/topology.scss # nezha-fronted/src/components/common/bottomBox/tabs/chartTempPreview.vue # nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue # nezha-fronted/src/components/common/bottomBox/tabs/terminalLogCMDTab.vue # nezha-fronted/src/components/common/bottomBox/tabs/terminalLogRecordTab.vue # nezha-fronted/src/components/common/bottomBox/tabs/terminalLogTab.vue # nezha-fronted/src/components/common/popBox/selectPanel.vue # nezha-fronted/src/components/common/project/popData/Info.vue # nezha-fronted/src/components/common/project/topologyL5.vue # nezha-fronted/src/components/common/rightBox/alertRuleBox.vue # nezha-fronted/src/components/common/rightBox/setting/globalizationBox.vue # nezha-fronted/src/components/page/config/changePin.vue # nezha-fronted/src/components/page/dashboard/explore/editor.vue # nezha-fronted/src/components/page/dashboard/metricPreview.vue # nezha-fronted/src/components/page/dashboard/panel.vue # nezha-fronted/src/permission.js # nezha-fronted/src/store/user.js
This commit is contained in:
@@ -720,6 +720,10 @@ export const tableSet = {
|
||||
return function (obj1, obj2) {
|
||||
let val1 = obj1[prop]
|
||||
let val2 = obj2[prop]
|
||||
if (prop === 'value') {
|
||||
val1 = obj1.oldValue
|
||||
val2 = obj2.oldValue
|
||||
}
|
||||
if (!isNaN(val1) && !isNaN(val2) && prop === 'value') {
|
||||
val1 = Number(val1)
|
||||
val2 = Number(val2)
|
||||
@@ -754,7 +758,11 @@ export const tableSet = {
|
||||
return function (obj1, obj2) {
|
||||
let val1 = obj1[prop]
|
||||
let val2 = obj2[prop]
|
||||
if (!isNaN(Number(val1)) && !isNaN(Number(val2)) && prop !== 'time') {
|
||||
if (prop === 'value') {
|
||||
val1 = obj1.oldValue
|
||||
val2 = obj2.oldValue
|
||||
}
|
||||
if (!isNaN(Number(val1)) && !isNaN(Number(val2)) && prop === 'value') {
|
||||
val1 = Number(val1)
|
||||
val2 = Number(val2)
|
||||
}
|
||||
@@ -864,3 +872,21 @@ export function formatScientificNotation (value, dot = 2) {
|
||||
return getTdDom(dom.parentElement);
|
||||
}
|
||||
} */
|
||||
/* 处理legend的别名 */
|
||||
export function dealLegendAlias (legend, expression) {
|
||||
if (/\{\{.+\}\}/.test(expression)) {
|
||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||
const reg = new RegExp('\\b' + label + '=".+?"')
|
||||
let value = null
|
||||
if (reg.test(legend)) {
|
||||
const find = legend.match(reg)[0]
|
||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||
}
|
||||
return value || label
|
||||
})
|
||||
return labelValue
|
||||
} else {
|
||||
return expression
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user