NEZ-2469 feat :endpoint operation增加Metric target按钮

This commit is contained in:
Xiao Bai
2022-12-18 19:46:51 +08:00
parent f5a02a9d57
commit 446ac7127b
4 changed files with 21 additions and 0 deletions

View File

@@ -335,6 +335,21 @@ export default {
} }
this.silenceBoxShow = true this.silenceBoxShow = true
}, },
metricTarget (row, type) {
const protocol = row.configs[0].config.protocol
const host = row.configs[0].config.host
const port = row.configs[0].config.port
const metricsPath = row.configs[0].config.metrics_path
const params = row.configs[0].config.params
let str = ''
if (!lodash.isEmpty(params)) {
for (const key in params) {
str += key + '=' + params[key]
}
}
const linkTarget = protocol + ':' + '//' + host + ':' + port + metricsPath + '?' + str
window.open(linkTarget, 'target')
},
topology (row, type) { topology (row, type) {
const chartInfo = lodash.cloneDeep(defaultData) const chartInfo = lodash.cloneDeep(defaultData)
chartInfo.id = row.id chartInfo.id = row.id

View File

@@ -78,6 +78,10 @@ export default {
this.$emit('topology', row, param) this.$emit('topology', row, param)
break break
} }
case 'metricTarget': {
this.$emit('metricTarget', row, param)
break
}
default: default:
this.$emit(command, row, param) this.$emit(command, row, param)
break break

View File

@@ -197,6 +197,7 @@
<el-dropdown-item v-has="'monitor_endpoint_edit'" :command="['copy', scope.row, 'project']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item> <el-dropdown-item v-has="'monitor_endpoint_edit'" :command="['copy', scope.row, 'project']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'endpoint']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item> <el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'endpoint']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'asset_add'" :command="['topology', scope.row, 'endpoint']"><i class="nz-icon nz-icon-Topology"></i><span class="operation-dropdown-text">{{$t('overall.topology')}}</span></el-dropdown-item> <el-dropdown-item v-has="'asset_add'" :command="['topology', scope.row, 'endpoint']"><i class="nz-icon nz-icon-Topology"></i><span class="operation-dropdown-text">{{$t('overall.topology')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'asset_add'" :command="['metricTarget', scope.row, 'endpoint']" :disabled="scope.row.configs[0].config.protocol !== ('http'||'https')"><span class="operation-dropdown-text">Metric target</span></el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>

View File

@@ -157,6 +157,7 @@
@reload="getTableData" @reload="getTableData"
@addSilence="addSilence" @addSilence="addSilence"
@topology="topology" @topology="topology"
@metricTarget="metricTarget"
@selectionChange="selectionChange" @selectionChange="selectionChange"
@showBottomBox="(targetTab, item) => { $refs.dataList.showBottomBox(targetTab, item) }"></endpoint-table> @showBottomBox="(targetTab, item) => { $refs.dataList.showBottomBox(targetTab, item) }"></endpoint-table>
</template> </template>