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

This commit is contained in:
zyh
2023-11-01 15:38:45 +08:00
11 changed files with 36 additions and 19 deletions

View File

@@ -746,3 +746,23 @@ i.nz-icon-override{
input::placeholder{
text-transform:capitalize;
}
.vue-tags-input {
.ti-tag.ti-valid {
max-width: 100%;
.ti-content {
max-width: 90%;
flex-shrink: 0;
.ti-tag-center {
max-width: 100%;
flex-shrink: 0;
> span {
max-width: 100%;
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
.query-prompt-box {
//width: calc(100% - 10px);
height: 400px;
height: 440px;
background: $--background-color-empty;
box-shadow: 0px 0px 21px 4px $--dropdown-menu-box-shadow-color;
border-radius: 2px;
@@ -9,7 +9,7 @@
//left: 5px;
transform: unset;
z-index: 11;
max-height: 400px;
max-height: 440px;
font-size: 14px;
.explore-history-box-header {
padding-left: 20px;
@@ -32,6 +32,7 @@
}
.query-prompt-log-content {
height: 220px;
flex-shrink: 0;
border: 1px solid $--border-color-light;
border-radius: 2px;
display: flex;

View File

@@ -303,6 +303,7 @@ export default {
oldValue: ''
}
const display = this.globalVariablesReplace(column.display)
console.log(column, display, /\{\{.+\}\}/.test(display), params)
if (/\{\{.+\}\}/.test(display)) {
const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
@@ -312,7 +313,8 @@ export default {
if (label.indexOf('$value') !== -1) {
value = chartDataFormat.getUnit(column.unit ? column.unit : 2).compute(value, null, -1, 2)
}
if (!((typeof value) == 'string' && value.constructor == String)) {
console.log(value)
if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) {
let legend = ''
if (value.__name__) {
legend += `${value.__name__}{`
@@ -339,7 +341,7 @@ export default {
let value = null
if (lodash.get(params, label)) {
value = lodash.get(params, label)
if (!((typeof value) == 'string' && value.constructor == String)) {
if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) {
let legend = ''
if (value.__name__) {
legend += `${value.__name__}{`
@@ -361,6 +363,7 @@ export default {
}
return value || ''
})
console.log(labelValue)
obj[column.title + 'display'] = {
display: labelValue,
oldValue: oldLabelValue
@@ -394,7 +397,7 @@ export default {
if (label.indexOf('$value') !== -1) {
value = chartDataFormat.getUnit(col.unit ? col.unit : 2).compute(value, null, -1, 2)
}
if (!((typeof value) == 'string' && value.constructor == String)) {
if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) {
let legend = ''
if (value.__name__) {
legend += `${value.__name__}{`

View File

@@ -19,7 +19,7 @@
<el-select v-model="state" class="margin-r-10" size="small" value-key="value" :disabled="from === fromRoute.alertSilence" @change="getTableData" popper-class="right-box-select-top right-public-box-dropdown-top" style="width: 110px">
<el-option v-for="item in stateOptions" :key="item.value" :label="$t(item.label)" :value="item.value"></el-option>
</el-select>
<pick-time ref="pickTime" v-model="searchTimeHeader" :default-pick="defaultPick" :refresh-data-func="dateChange" :show-empty="true" :use-chart-unit="false" :use-refresh="false" :sign="sign"></pick-time>
<pick-time ref="pickTime" v-model="searchTimeHeader" :default-pick="defaultPick" :refresh-data-func="dateChange" :show-empty="true" :use-chart-unit="false" :use-refresh="true" :sign="sign"></pick-time>
</template>
<template v-slot>
<alertMessageTable

View File

@@ -363,11 +363,15 @@ export const chart = {
export const intervalList = [
{ value: 0, label: i18n.t('dashboard.dashboard.chartForm.lockList.off') },
{ value: 5, label: '5s' },
{ value: 10, label: '10s' },
{ value: 30, label: '30s' },
{ value: 60, label: '1m' },
{ value: 300, label: '5m' },
{ value: 900, label: '15m' },
{ value: 1800, label: '30m' }
{ value: 1800, label: '30m' },
{ value: 3600, label: '1h' },
{ value: 7200, label: '2h' }
]
export const setting = {

View File

@@ -216,7 +216,6 @@
>
<vue-tags-input
v-model="tag"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="chartConfig.param.tags"
@tags-changed="(newTags)=>{tagsChange(newTags)}"

View File

@@ -188,7 +188,6 @@
>
<vue-tags-input
v-model="tag"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="chartConfig.param.tags"
@tags-changed="(newTags)=>{tagsChange(newTags)}"

View File

@@ -236,7 +236,6 @@
<el-form-item :prop="'paramObj.' + index + '.value'" class="param-box-row-value">
<vue-tags-input
v-model="item.tags"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="item.value"
@tags-changed="(newTags)=>{tagsChange(newTags, index)}"
@@ -296,7 +295,6 @@
]">
<vue-tags-input
v-model="item.tags"
:maxlength="32"
ref="relabelTag"
tabindex="9999"
:placeholder="$t('tagsInput.placeholder')"
@@ -467,7 +465,6 @@
>
<vue-tags-input
v-model="item.namespaces.tags"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="item.namespaces.names"
@tags-changed="(newTags)=>{logsTagsChange(newTags,item)}"
@@ -499,7 +496,6 @@
]">
<vue-tags-input
v-model="subItem.tags"
:maxlength="32"
:ref="'logsRelabelTag'+index+subIndex"
tabindex="9999"
:placeholder="$t('tagsInput.placeholder')"

View File

@@ -187,7 +187,6 @@
<el-form-item :prop="'paramObj.' + index + '.value'" class="param-box-row-value">
<vue-tags-input
v-model="item.tags"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="item.value"
@tags-changed="(newTags)=>{tagsChange(newTags, index)}"
@@ -247,7 +246,6 @@
]">
<vue-tags-input
v-model="item.tags"
:maxlength="32"
ref="relabelTag"
tabindex="9999"
:placeholder="$t('tagsInput.placeholder')"
@@ -420,7 +418,6 @@
>
<vue-tags-input
v-model="item.namespaces.tags"
:maxlength="32"
:placeholder="$t('tagsInput.placeholder')"
:tags="item.namespaces.names"
@tags-changed="(newTags)=>{logsTagsChange(newTags,item)}"
@@ -472,7 +469,6 @@
]">
<vue-tags-input
v-model="subItem.tags"
:maxlength="32"
:ref="'logsRelabelTag'+index+subIndex"
tabindex="9999"
:placeholder="$t('tagsInput.placeholder')"

View File

@@ -15,7 +15,7 @@
<el-select v-model="state" class="margin-r-10" size="small" value-key="value" @change="getTableData" popper-class="right-box-select-top right-public-box-dropdown-top" style="width: 100px">
<el-option v-for="item in stateOptions" :key="item.value" :label="$t(item.label)" :value="item.value"></el-option>
</el-select>
<pick-time ref="pickTime" v-model="searchTime" sign="message" :default-pick="defaultPick" :refresh-data-func="dateChange" :show-empty="true" :use-chart-unit="false" :use-refresh="false"></pick-time>
<pick-time ref="pickTime" v-model="searchTime" sign="message" :default-pick="defaultPick" :refresh-data-func="dateChange" :show-empty="true" :use-chart-unit="false" :use-refresh="true"></pick-time>
<button id="roles-add" v-has="'alertMessage_view'" :title="$t('overall.exportExcel')" class="top-tool-btn margin-r-10" type="button" @click="showExportDialog">
<i class="nz-icon-download1 nz-icon"></i>
</button>

View File

@@ -30,7 +30,6 @@
<el-form-item :label="$t('config.system.monitor.interface_name')" prop="interface_name">
<vue-tags-input
v-model="tag"
:maxlength="32"
:class="monitor.interface_name.length !== 0 ? 'interface-name' : ''"
:placeholder="$t('tagsInput.placeholder')"
:tags="monitor.interface_name"