fix : cortex,loki 页面增加 compactor 接口

This commit is contained in:
likexuan
2023-02-03 10:26:25 +08:00
parent 5cf765905c
commit aafeb5bbf7
5 changed files with 73 additions and 2 deletions

View File

@@ -76,7 +76,7 @@
<div class="col-resize-area"></div>
</template>
<template slot-scope="scope" :column="item">
<span v-if="item.prop === 'name'">{{indexs? $t('cortex.storeGateway'):$t('cortex.ingester')}}</span>
<span v-if="item.prop === 'name'">{{indexs==0?$t('cortex.storeGateway'):(indexs==1?$t('cortex.ingester'):$t('cortex.compactor'))}}</span>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template>

View File

@@ -51,6 +51,39 @@
</el-table-column>
</el-table>
</div>
<div class="cortex-ring">
<div class="cortex-title">{{$t('cortex.ringStatus')}}</div>
<div class="cortex-ingester">
<el-table
:data="ringTableData"
:border='true'
:class="ringTableData.length == 0?'ring-table':''"
:span-method="(param)=>objectSpanMethod(param,ringTableData)"
>
<el-table-column
v-for="(item, index) in ingesterTitle"
:key="`col-${index}`"
:fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:width="`${item.width}`"
class="data-column"
>
<template slot="header">
<span class="data-column__span">{{item.label}}</span>
<div class="col-resize-area"></div>
</template>
<template slot-scope="scope" :column="item" class="123">
<span v-if="item.prop === 'name'">{{$t('cortex.compactor')}}</span>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="cortex-config" :style="configTableData.length < 31 ? `height:${configTableData.length * 27 + 102}px` : 'flex:1;min-height: 436px;'">
<div class="cortex-title">{{$t('overall.configEndpoint')}}</div>
<div class="cortex-config-tab">
@@ -87,7 +120,8 @@ export default {
loading: Boolean,
configMode: String,
configTableData: Array,
servicesTableData: Array
servicesTableData: Array,
ringTableData: Array
},
mixins: [table],
components: {},
@@ -207,6 +241,22 @@ export default {
mounted () {
},
methods: {
// 合并单元格
objectSpanMethod ({ row, column, rowIndex, columnIndex }, items) {
if (columnIndex === 0) {
if (rowIndex % items.length === 0) {
return {
rowspan: items.length,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
configSwitchCheck () {
if (this.configSwitch == 1) {
this.$emit('configval', 'defaults')