NEZ-2469 feat :endpoint operation增加Metric target按钮
This commit is contained in:
@@ -335,6 +335,21 @@ export default {
|
||||
}
|
||||
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) {
|
||||
const chartInfo = lodash.cloneDeep(defaultData)
|
||||
chartInfo.id = row.id
|
||||
|
||||
@@ -78,6 +78,10 @@ export default {
|
||||
this.$emit('topology', row, param)
|
||||
break
|
||||
}
|
||||
case 'metricTarget': {
|
||||
this.$emit('metricTarget', row, param)
|
||||
break
|
||||
}
|
||||
default:
|
||||
this.$emit(command, row, param)
|
||||
break
|
||||
|
||||
@@ -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="'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="['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>
|
||||
</div>
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
@reload="getTableData"
|
||||
@addSilence="addSilence"
|
||||
@topology="topology"
|
||||
@metricTarget="metricTarget"
|
||||
@selectionChange="selectionChange"
|
||||
@showBottomBox="(targetTab, item) => { $refs.dataList.showBottomBox(targetTab, item) }"></endpoint-table>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user