feat:更新字体图标库 以及 批量新增endpoint 关不不提示的问题
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "nz-icon"; /* Project id 2030432 */
|
||||
src: url('iconfont.woff2?t=1625712906789') format('woff2'),
|
||||
url('iconfont.woff?t=1625712906789') format('woff'),
|
||||
url('iconfont.ttf?t=1625712906789') format('truetype');
|
||||
src: url('iconfont.woff2?t=1628214250274') format('woff2'),
|
||||
url('iconfont.woff?t=1628214250274') format('woff'),
|
||||
url('iconfont.ttf?t=1628214250274') format('truetype');
|
||||
}
|
||||
|
||||
.nz-icon {
|
||||
@@ -13,6 +13,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.nz-icon-batchadd:before {
|
||||
content: "\e734";
|
||||
}
|
||||
|
||||
.nz-icon-rectangle1:before {
|
||||
content: "\e730";
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "nz-icon"; /* Project id 2030432 */
|
||||
src: url('./font/iconfont.woff2?t=1625712906789') format('woff2'),
|
||||
url('./font/iconfont.woff?t=1625712906789') format('woff'),
|
||||
url('./font/iconfont.ttf?t=1625712906789') format('truetype');
|
||||
src: url('./font/iconfont.woff2?t=1628214250274') format('woff2'),
|
||||
url('./font/iconfont.woff?t=1628214250274') format('woff'),
|
||||
url('./font/iconfont.ttf?t=1628214250274') format('truetype');
|
||||
}
|
||||
|
||||
.nz-icon {
|
||||
@@ -13,6 +13,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.nz-icon-batchadd:before {
|
||||
content: "\e734";
|
||||
}
|
||||
|
||||
.nz-icon-rectangle1:before {
|
||||
content: "\e730";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="right-box right-box-modify-endpoint" v-clickoutside="{obj:endpoint,func:clickOutside}">
|
||||
<div class="right-box right-box-modify-endpoint" v-clickoutside="{obj:batchEndpoint,func:clickOutside}">
|
||||
<div class="right-box__header">
|
||||
<!-- begin--标题-->
|
||||
<div class="header__title">{{$t("overall.batchAddEndpoint")}}</div>
|
||||
@@ -26,7 +26,7 @@
|
||||
title="ChartSearch"
|
||||
key-field="id"
|
||||
show-field="name"
|
||||
v-model="moduleIds"
|
||||
v-model="batchEndpoint.moduleIds"
|
||||
class="form-control"
|
||||
:result-format="resultFormat"
|
||||
></v-selectpage>
|
||||
@@ -44,7 +44,7 @@
|
||||
title="ChartSearch"
|
||||
key-field="id"
|
||||
show-field="name"
|
||||
v-model="assetIds"
|
||||
v-model="batchEndpoint.assetIds"
|
||||
class="form-control"
|
||||
:result-format="resultFormat"
|
||||
></v-selectpage>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="right-box-line"></div>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="batchEndpoint.tableData"
|
||||
:height="'calc(100% - 400px)'"
|
||||
:class="showError?'error' : ''"
|
||||
style="width:calc(100% - 70px);margin-left: 15px;min-height:400px"
|
||||
@@ -130,7 +130,7 @@
|
||||
<button @click="generate" id="ep-generate" class="footer__btn">
|
||||
<span>{{$t('overall.generate')}}</span>
|
||||
</button>
|
||||
<button @click="save" class="footer__btn" id="ep-add" :class="!tableData.length?'nz-btn-disabled':''" :disabled="!tableData.length">
|
||||
<button @click="save" class="footer__btn" id="ep-add" :class="!batchEndpoint.tableData.length?'nz-btn-disabled':''" :disabled="!batchEndpoint.tableData.length">
|
||||
<span>{{$t('overall.save')}}</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -166,8 +166,11 @@ export default {
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
moduleIds: '',
|
||||
assetIds: '',
|
||||
batchEndpoint:{
|
||||
moduleIds: '',
|
||||
assetIds: '',
|
||||
tableData: []
|
||||
},
|
||||
assetDataList: [],
|
||||
moduleList: [],
|
||||
language: localStorage.getItem('nz-language'),
|
||||
@@ -247,7 +250,6 @@ export default {
|
||||
assetLoading: true,
|
||||
rightBox: { show: false, title: this.$t('project.endpoint.createEndpoint'), isEdit: false },
|
||||
optionType: 'batchAdd',
|
||||
tableData: [],
|
||||
endpointTableTitle: [ // 原始table列
|
||||
{
|
||||
label: this.$t('project.endpoint.name'),
|
||||
@@ -312,17 +314,16 @@ export default {
|
||||
})
|
||||
},
|
||||
generate () {
|
||||
if (!this.assetIds || !this.moduleIds) {
|
||||
if (!this.batchEndpoint.assetIds || !this.batchEndpoint.moduleIds) {
|
||||
this.$message.error('Please select module or asset')
|
||||
}
|
||||
this.$post('/monitor/endpoint/render', { moduleIds: this.moduleIds, assetIds: this.assetIds }).then(res => {
|
||||
console.log(res)
|
||||
this.$post('/monitor/endpoint/render', { moduleIds: this.batchEndpoint.moduleIds, assetIds: this.batchEndpoint.assetIds }).then(res => {
|
||||
res.data.list.forEach(item => {
|
||||
item.configs = JSON.parse(item.configs)
|
||||
item.moduleId = item.module.id
|
||||
item.assetId = item.asset.id
|
||||
})
|
||||
this.tableData = res.data.list
|
||||
this.batchEndpoint.tableData = res.data.list
|
||||
})
|
||||
},
|
||||
// 保存endpoint
|
||||
@@ -330,7 +331,7 @@ export default {
|
||||
if (this.prevent_opt.save) { return } ;
|
||||
this.prevent_opt.save = true
|
||||
this.showError = false
|
||||
if (!this.tableData.length) {
|
||||
if (!this.batchEndpoint.tableData.length) {
|
||||
this.prevent_opt.save = false
|
||||
this.showError = true
|
||||
return
|
||||
@@ -338,7 +339,7 @@ export default {
|
||||
// 对endpointList进行处理,避免携带过多无用数据
|
||||
this.$refs.addEndpoint.validate((valid) => {
|
||||
if (valid) {
|
||||
const paramsArr = this.tableData.map(item => {
|
||||
const paramsArr = this.batchEndpoint.tableData.map(item => {
|
||||
const obj = JSON.parse(JSON.stringify(item))
|
||||
obj.configs = JSON.stringify(obj.configs)
|
||||
return {
|
||||
@@ -371,19 +372,18 @@ export default {
|
||||
closeRightBox (isEdit, endpoint, isAll) {
|
||||
this.rightBox.show = false
|
||||
if (!isEdit) { return }
|
||||
this.tableData.forEach((item, index) => {
|
||||
this.batchEndpoint.tableData.forEach((item, index) => {
|
||||
if (item.id === endpoint.id) {
|
||||
this.tableData[index] = { ...endpoint }
|
||||
this.batchEndpoint.tableData[index] = { ...endpoint }
|
||||
}
|
||||
})
|
||||
this.tableData = [...this.tableData]
|
||||
this.batchEndpoint.tableData = [...this.batchEndpoint.tableData]
|
||||
},
|
||||
del (index) {
|
||||
this.tableData.splice(index, 1)
|
||||
this.batchEndpoint.tableData.splice(index, 1)
|
||||
},
|
||||
edit (row) {
|
||||
this.object = row
|
||||
console.log(this.object)
|
||||
// this.object.configs = JSON.parse(this.object.configs)
|
||||
this.object.projectId = this.object.project.id
|
||||
this.object.moduleId = this.object.module.id
|
||||
@@ -447,7 +447,7 @@ export default {
|
||||
this.getAssetList()
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
'batchEndpoint.tableData': {
|
||||
deep: true,
|
||||
handler (n) {
|
||||
this.showError = false
|
||||
|
||||
@@ -767,14 +767,17 @@ export default {
|
||||
setTimeout(() => {
|
||||
this.editEndpoint.configs[0].config.params = this.paramToJson(this.editEndpoint.paramObj)
|
||||
this.editEndpoint.configs[0].config.labels = this.labelsToJson(this.editEndpoint.labelModule)
|
||||
this.editEndpoint.configs[1].config.forEach(item => {
|
||||
const params = JSON.parse(JSON.stringify(this.editEndpoint))
|
||||
params.configs[1].config.forEach(item => {
|
||||
if (item.labelModule) {
|
||||
item.labels = this.labelsToJson(item.labelModule)
|
||||
} else {
|
||||
item.labels = ''
|
||||
}
|
||||
delete item.labelModule
|
||||
})
|
||||
const params = JSON.parse(JSON.stringify(this.editEndpoint))
|
||||
delete params.labelModule
|
||||
delete params.paramObj
|
||||
params.configs[1].config.forEach(item => {
|
||||
item.pipeline && item.pipeline.forEach((pipeline) => {
|
||||
if (pipeline.type === 'labels') {
|
||||
@@ -790,7 +793,6 @@ export default {
|
||||
key = key[0]
|
||||
if (key.indexOf('configs.0') !== -1) {
|
||||
const keyArr = key.split('.')
|
||||
console.log(keyArr)
|
||||
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
||||
this.activeName = 'Auth'
|
||||
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port') {
|
||||
@@ -1152,7 +1154,6 @@ export default {
|
||||
}
|
||||
if (this.editEndpoint.moduleId && this.editEndpoint.assetId) {
|
||||
this.$post('/monitor/endpoint/render', { moduleIds: this.editEndpoint.moduleId, assetIds: this.editEndpoint.assetId }).then(res => {
|
||||
console.log(res)
|
||||
if (JSON.stringify(this.editEndpoint.configs) === JSON.stringify(this.blankObject.configs)) {
|
||||
this.editEndpoint.configs = JSON.parse(res.data.list[0].configs)
|
||||
}
|
||||
|
||||
@@ -745,14 +745,17 @@ export default {
|
||||
setTimeout(() => {
|
||||
this.editModule.configs[0].config.params = this.paramToJson(this.editModule.paramObj)
|
||||
this.editModule.configs[0].config.labels = this.labelsToJson(this.editModule.labelModule)
|
||||
this.editModule.configs[1].config.forEach(item => {
|
||||
const params = JSON.parse(JSON.stringify(this.editModule))
|
||||
params.configs[1].config.forEach(item => {
|
||||
if (item.labelModule) {
|
||||
item.labels = this.labelsToJson(item.labelModule)
|
||||
} else {
|
||||
item.labels = ''
|
||||
}
|
||||
delete item.labelModule
|
||||
})
|
||||
const params = JSON.parse(JSON.stringify(this.editModule))
|
||||
delete params.labelModule
|
||||
delete params.paramObj
|
||||
params.configs[1].config.forEach(item => {
|
||||
item.pipeline && item.pipeline.forEach((pipeline) => {
|
||||
if (pipeline.type === 'labels') {
|
||||
|
||||
@@ -120,7 +120,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
addPipeline (val) {
|
||||
console.log(val)
|
||||
let obj = ''
|
||||
this.pipelineOptionValue = ''
|
||||
if (val === 'regex') {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<delete-button :type="'link'" :title="$t('overall.batchDel')" id="account-list-batch-delete" v-has="'monitor_endpoint_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div id="batch-add" @click="batchAdd"><i class="nz-icon nz-icon-table-edit"></i>{{$t('overall.batchAdd')}}</div>
|
||||
<div id="batch-add" @click="batchAdd"><i class="nz-icon nz-icon-batchadd"></i>{{$t('overall.batchAdd')}}</div>
|
||||
</el-dropdown-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -332,7 +332,6 @@ export default {
|
||||
enable: this.object.configs[1].enable,
|
||||
config: configs
|
||||
}
|
||||
console.log(this.object)
|
||||
this.object.paramObj = []
|
||||
this.object.labelModule = []
|
||||
this.object.configs[1].config.forEach(item => {
|
||||
@@ -396,7 +395,6 @@ export default {
|
||||
}
|
||||
},
|
||||
closeRightBatchAdd (refresh, importResult) {
|
||||
console.log(refresh, importResult)
|
||||
this.rightBox.batchAdd = false
|
||||
this.importResult = importResult
|
||||
if (refresh && importResult) {
|
||||
|
||||
Reference in New Issue
Block a user