2019-12-18 17:00:44 +08:00
|
|
|
|
<template>
|
2021-01-18 18:58:57 +08:00
|
|
|
|
<div class="right-box right-box-module" v-clickoutside="{obj:editModule,func:clickOutside}">
|
2021-04-23 11:47:38 +08:00
|
|
|
|
<div class="right-box__header">
|
|
|
|
|
|
<!-- begin--标题-->
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<div class="header__title">{{editModule.id ? $t("project.module.editModule") : $t("project.module.createModule")}}</div>
|
2021-04-23 11:47:38 +08:00
|
|
|
|
<!-- end--标题-->
|
2021-04-25 14:58:03 +08:00
|
|
|
|
<div class="header__operation">
|
|
|
|
|
|
<span v-cancel="{obj: editModule, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
|
2021-04-23 11:47:38 +08:00
|
|
|
|
</div>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- begin--表单-->
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<div class="right-box__container">
|
|
|
|
|
|
<div class="container__form">
|
|
|
|
|
|
<el-form ref="moduleForm" :model="editModule" :rules="rules" label-position="top" label-width="120px">
|
|
|
|
|
|
<!--name-->
|
|
|
|
|
|
<el-form-item :label='$t("project.module.moduleName")' label-width="125px" prop="name">
|
|
|
|
|
|
<el-input id="module-box-input-name" v-model="editModule.name" maxlength="64" placeholder="" show-word-limit size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--project-->
|
|
|
|
|
|
<el-form-item :label='$t("project.project.projectName")' prop="projectId">
|
|
|
|
|
|
<el-select id="module-box-input-project" v-model="editModule.projectId" :disabled="!!editModule.id" class="right-box__select" placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id">
|
|
|
|
|
|
<el-option v-for="item in projectList" :id="'module-project-'+item.id" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--remark-->
|
2021-06-07 18:28:07 +08:00
|
|
|
|
<el-form-item :label='$t("overall.remark")' prop="remark">
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
id="module-box-input-remark"
|
|
|
|
|
|
v-model="editModule.remark"
|
|
|
|
|
|
:autosize="{ minRows: 1, maxRows: 6}"
|
|
|
|
|
|
class="not-fixed-height no-resize"
|
2021-05-28 10:43:41 +08:00
|
|
|
|
maxlength="256"
|
|
|
|
|
|
show-word-limit
|
2021-05-21 19:28:50 +08:00
|
|
|
|
placeholder=""
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="textarea"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--Enpoint template-->
|
|
|
|
|
|
<div class="right-box-sub-title">{{ $t("overall.endpointTemplate") }}
|
|
|
|
|
|
<el-tooltip effect="light" placement="top">
|
|
|
|
|
|
<div slot="content">
|
|
|
|
|
|
{{$t('project.module.tip.defaultEndpointSet')}}
|
|
|
|
|
|
<div></div>
|
|
|
|
|
|
{{$t('project.module.tip.relation')}}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
</div>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<i class="nz-icon nz-icon-info-normal"></i>
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box-line"></div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<!--name pattern-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.pattern")' prop="pattern">
|
|
|
|
|
|
<!-- <el-input placeholder="" v-model=""></el-input>-->
|
|
|
|
|
|
<el-autocomplete
|
|
|
|
|
|
id="module-box-input-pattern"
|
|
|
|
|
|
v-model="editModule.endpointNameTmpl"
|
|
|
|
|
|
:fetch-suggestions="querySearch"
|
|
|
|
|
|
:placeholder="$t('overall.placeHolder')"
|
|
|
|
|
|
class="inline-input"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
></el-autocomplete>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- ChartTemplate -->
|
|
|
|
|
|
<el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate">
|
|
|
|
|
|
<v-selectpage
|
|
|
|
|
|
:data="chartTempList"
|
2021-08-03 14:12:14 +08:00
|
|
|
|
:tb-columns="ChartSearchShowFields"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:params="{
|
|
|
|
|
|
varType: 2, panelId: 0,
|
|
|
|
|
|
returnChildren:0,groupId:0,
|
|
|
|
|
|
}"
|
2021-08-03 14:12:14 +08:00
|
|
|
|
:multiple="true"
|
|
|
|
|
|
:language="language"
|
|
|
|
|
|
title="ChartSearch"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
key-field="id"
|
|
|
|
|
|
show-field="name"
|
2021-08-03 14:12:14 +08:00
|
|
|
|
v-model="editModule.chartIds"
|
|
|
|
|
|
class="form-control"
|
|
|
|
|
|
:result-format="resultFormat"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
></v-selectpage>
|
|
|
|
|
|
</el-form-item>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<div class="endpoint-title">
|
|
|
|
|
|
<span class="endpoint-title-content">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<i class="nz-icon nz-icon-arrow-down" :class="metricsShow?'':'is-active'" @click="metricsShow = !metricsShow"></i>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
Metrics
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<el-switch v-model="editModule.configs[0].enable" active-color="#ee9d3f" size="small" :active-value="1" :inactive-value="0"></el-switch>
|
|
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<transition name="el-zoom-in-top">
|
2021-08-05 14:50:29 +08:00
|
|
|
|
<el-tabs v-model="activeName" v-show="metricsShow" v-if="editModule.configs[0].enable">
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<el-tab-pane label="Basic" name="Basic">
|
|
|
|
|
|
<!--path-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.path")' class="half-form-item" prop="configs.metrics_path">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-path" v-model="editModule.configs[0].config.metrics_path" placeholder="" size="small"></el-input>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--port-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item :label='$t("project.endpoint.port")' class="half-form-item" prop="configs.0.config.port" :rules="[
|
|
|
|
|
|
{ validator: port, trigger: 'blur' },
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
|
|
|
|
]">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-port" v-model.number="editModule.configs[0].config.port" placeholder="" size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--type-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.type")' class="half-form-item" prop="type">
|
|
|
|
|
|
<el-select id="module-box-input-type" v-model="editModule.configs[0].config.protocol" :disabled="!!editModule.id" class="right-box__select" placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id" @change="changeAuthType">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-option v-for="item in typeList" :id="'module-type-'+item.id" :key="item.value" :label="item.name" :value="item.value"></el-option>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</el-select>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--host-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item :label='$t("project.endpoint.host")' class="half-form-item" prop="configs.0.config.host" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-host" v-model="editModule.configs[0].config.host" placeholder="" size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- snmp表单 -->
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<div v-if="editModule.configs[0].config.protocol && editModule.configs[0].config.protocol == 'snmp'" class="">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="6">
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<div class="sub-label sub-label-required" style="padding-left: 0">{{$t('project.module.walk')}}</div>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item prop="configs.0.config.walk" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<select-walk ref="selectWalk" :currentWalk="editModule.configs[0].config.walk" :expandedWalk="expandedWalkData" :placement="'bottom-start'" :walkData="walkData" @selectWalk="selectWalk">
|
|
|
|
|
|
<template v-slot:trigger>
|
|
|
|
|
|
<div class="el-cascader">
|
|
|
|
|
|
<div class="el-input">
|
|
|
|
|
|
<input aria-expanded="false" autocomplete="off" class="el-input__inner" readonly="readonly" type="text">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="el-cascader__tags">
|
|
|
|
|
|
<div ref="walkScrollbar" style="height: 100%; overflow: auto;">
|
|
|
|
|
|
<span v-for="(item, index) in editModule.configs[0].config.walk" :key="index" class="el-tag el-tag--info el-tag--small el-tag--light">
|
|
|
|
|
|
<span v-html="mibName(item)"></span>
|
|
|
|
|
|
<div class="walk-close-box" @click.stop="removeWalk(item)">
|
|
|
|
|
|
<i class="el-tag__close nz-icon nz-icon-close walk-close"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</select-walk>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<!--credentials-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.credentials")' prop="credentials">
|
|
|
|
|
|
<el-select id="module-box-input-credentials" v-model="editModule.configs[0].config.snmpCredentialsId" class="right-box__select" placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id">
|
|
|
|
|
|
<el-option v-for="item in credentialList" :id="'module-type-'+item.id" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
2021-08-04 16:55:11 +08:00
|
|
|
|
</div>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<transition name="el-zoom-in-top">
|
|
|
|
|
|
<div v-show="showAllBasicOption" >
|
|
|
|
|
|
<!--scrape_interval-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item :label='$t("project.endpoint.scrape_interval")' class="half-form-item" prop="configs.0.config.scrape_interval">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-scrape_interval" v-model.number="editModule.configs[0].config.scrape_interval" :placeholder='$t("project.endpoint.scrape_interval_placeholder")' size="small">
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<template slot="append">s</template>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--scrape_timeout-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item :label='$t("project.endpoint.scrape_timeout")' class="half-form-item" prop="configs.0.config.scrape_timeout">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-scrape_timeout" v-model.number="editModule.configs[0].config.scrape_timeout" :placeholder='$t("project.endpoint.scrape_timeout_placeholder")' size="small">
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<template slot="append">s</template>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</transition>
|
2021-04-22 10:36:29 +08:00
|
|
|
|
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
|
<span class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" style="border: none" @click="showAllBasicOption=!showAllBasicOption">
|
|
|
|
|
|
{{$t('overall.moreOption')}}
|
|
|
|
|
|
<i :class="showAllBasicOption?'is-active':''" class="nz-icon nz-icon-arrow-down need-rotate" ></i>
|
|
|
|
|
|
</span>
|
2021-04-14 15:38:37 +08:00
|
|
|
|
</div>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="Parameter" name="Parameter">
|
|
|
|
|
|
<div id="module-box-params" ref="labelBoxScrollbar" style="height: 100%; overflow: auto;">
|
|
|
|
|
|
<div v-for="(item, index) in editModule.paramObj" :key="index" class="param-box-row">
|
|
|
|
|
|
<el-form-item :prop="'paramObj.' + index + '.key'" class="param-box-row-key">
|
|
|
|
|
|
<el-input v-model="item.key" placeholder="key" size="mini" ></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span class="param-box-row-eq">=</span>
|
|
|
|
|
|
<el-form-item :prop="'paramObj.' + index + '.value'" class="param-box-row-value">
|
|
|
|
|
|
<vue-tags-input
|
|
|
|
|
|
v-model="item.tags"
|
|
|
|
|
|
:maxlength="32"
|
|
|
|
|
|
:placeholder="'add parameter'"
|
|
|
|
|
|
:tags="item.value"
|
|
|
|
|
|
@tags-changed="(newTags)=>{tagsChange(newTags, index)}"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span :id="'moduel-remove-param-'+index" class="param-box-row-symbol" @click="removeParam(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>
|
|
|
|
|
|
</div>
|
2021-04-14 15:38:37 +08:00
|
|
|
|
</div>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
|
<span id="module-add-param" class="right-box-form-add module-add-label" type="button" @click="addParam">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<span><i class="nz-icon nz-icon-plus" style="font-size: 16px;"></i></span>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="Labels" name="Labels">
|
|
|
|
|
|
<div id="module-box-labels" ref="labelBoxScrollbar" style="height: 100%; overflow: auto;">
|
|
|
|
|
|
<div v-for="(item, index) in editModule.labelModule" :key="index" class="param-box-row">
|
|
|
|
|
|
<el-form-item :prop="'labelModule.' + index + '.key'" :rules="[{ pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: $t('validate.key') ,trigger: 'blur'}]" class="param-box-row-key">
|
|
|
|
|
|
<el-input v-model="item.key" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span class="param-box-row-eq">=</span>
|
|
|
|
|
|
<el-form-item :prop="'labelModule.' + index + '.value'" class="param-box-row-value">
|
|
|
|
|
|
<el-input v-model="item.value" placeholder="value" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span :id="'moduel-remove-label-'+index" class="param-box-row-symbol" @click="removeLabel(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
|
<span id="module-add-label" class="right-box-form-add module-add-label" type="button" @click="addLabel">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<span><i class="nz-icon nz-icon-plus" style="font-size: 16px;"></i></span>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-tab-pane v-if="editModule.configs[0].config.protocol !== 'snmp'" label="Auth" name="Auth">
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<!--authtype-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.type")' prop="authtype">
|
|
|
|
|
|
<el-select id="module-box-input-auth-type" v-model="authType" class="right-box__select" placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id" @change="changeAuthType">
|
|
|
|
|
|
<el-option v-for="item in authTypeList" :id="'module-type-'+item.id" :key="item.value" :label="item.name" :value="item.value"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2021-04-13 19:06:34 +08:00
|
|
|
|
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<!--authtype 1-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.username")' class="half-form-item" prop="configs.0.config.basic_auth.username" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-uername" v-model.number="editModule.configs[0].config.basic_auth.username" placeholder='' size="small"></el-input>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
2021-04-13 19:06:34 +08:00
|
|
|
|
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-input id="module-box-input-password" v-model.number="editModule.configs[0].config.basic_auth.pin" placeholder='' size="small"></el-input>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
2021-04-13 19:06:34 +08:00
|
|
|
|
|
2021-05-21 19:28:50 +08:00
|
|
|
|
<!--authtype 2-->
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item v-if="authType === 2" :label='$t("project.endpoint.bearer_token")' prop="configs.0.config.bearer_token" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
|
|
|
|
|
<el-input id="module-box-input-bearer_token" v-model.number="editModule.configs[0].config.bearer_token" placeholder='' size="small"></el-input>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-form-item>
|
2021-04-13 19:06:34 +08:00
|
|
|
|
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</transition>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<div class="endpoint-title" style="margin-top: 10px">
|
|
|
|
|
|
<span class="endpoint-title-content">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<i class="nz-icon nz-icon-arrow-down" :class="logsShow?'':'is-active'" @click="logsShow = !logsShow"></i>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
Logs
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<el-switch v-model="editModule.configs[1].enable" active-color="#ee9d3f" size="small" :active-value="1" :inactive-value="0"></el-switch>
|
|
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<transition name="el-zoom-in-top">
|
2021-08-05 14:50:29 +08:00
|
|
|
|
<div v-show="logsShow" v-if="editModule.configs[1].enable">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<div v-for="(item, index) in editModule.configs[1].config" :key="index" style="position: relative">
|
|
|
|
|
|
<el-tabs v-model="activeNameLogs[index]" class="special-tabs" @tab-click="()=>{tabClick(index)}" :ref="'logsTabs' + index">
|
|
|
|
|
|
<el-tab-pane label="Basic" name="Basic">
|
|
|
|
|
|
<!--type-->
|
|
|
|
|
|
<el-form-item :label='$t("project.endpoint.type")' class="half-form-item">
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<el-select id="module-box-input-type" v-model="item.type" class="right-box__select" placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" @change="logsBasicTypeChange(index)">
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-option v-for="item in logsBasicList" :id="'module-type-'+item.id" :key="item.value" :label="item.name" :value="item.value"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
2021-08-04 16:55:11 +08:00
|
|
|
|
v-if='item.type === "file"'
|
|
|
|
|
|
:label='item.type === "file" ? $t("project.endpoint.basicTypeFile"):( item.type === "journal" ? $t("project.endpoint.basicTypeJournal") : $t("project.endpoint.basicTypeSyslog"))' class="half-form-item"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.fileName'"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:rules="[ { required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<el-input v-if='item.type === "file"' v-model="item.fileName" :id="'module-box-basic-value' +index" placeholder='' size="small"></el-input>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
2021-08-04 16:55:11 +08:00
|
|
|
|
v-if='item.type === "journal"'
|
|
|
|
|
|
:label='item.type === "file" ? $t("project.endpoint.basicTypeFile"):( item.type === "journal" ? $t("project.endpoint.basicTypeJournal") : $t("project.endpoint.basicTypeSyslog"))' class="half-form-item"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.unit'"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:rules="[ { required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<el-input v-if='item.type === "journal"' v-model="item.unit" :id="'module-box-basic-value' +index" placeholder='' size="small"></el-input>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
2021-08-04 16:55:11 +08:00
|
|
|
|
v-if='item.type === "syslog"'
|
|
|
|
|
|
:label='item.type === "file" ? $t("project.endpoint.basicTypeFile"):( item.type === "journal" ? $t("project.endpoint.basicTypeJournal") : $t("project.endpoint.basicTypeSyslog"))' class="half-form-item"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.listenAddress'"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:rules="[ { required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<el-input v-if='item.type === "syslog"' v-model="item.listenAddress" :id="'module-box-basic-value' +index" placeholder='' size="small"></el-input>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
2021-08-04 16:55:11 +08:00
|
|
|
|
v-if="item.type === 'syslog'"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:label=' $t("project.endpoint.basicAppName")'
|
|
|
|
|
|
class="half-form-item"
|
2021-08-04 16:55:11 +08:00
|
|
|
|
:prop="'configs.1.config.'+ index +'.appName'"
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:rules="[ { required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-04 16:55:11 +08:00
|
|
|
|
<el-input v-model="item.appName" :id="'module-box-basic-appName' +index" placeholder='' size="small"></el-input>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="Labels" name="Labels">
|
|
|
|
|
|
<div id="module-box-logs-labels" ref="labelBoxScrollbar" style="height: 100%; overflow: auto;">
|
|
|
|
|
|
<div v-for="(item1, i) in item.labelModule" :key="i" class="param-box-row">
|
|
|
|
|
|
<el-form-item :prop="'configs.1.config.'+ index +'.labelModule.' + i + '.key'" :rules="[{ pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: $t('validate.key') ,trigger: 'blur'}]" class="param-box-row-key">
|
|
|
|
|
|
<el-input v-model="item1.key" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span class="param-box-row-eq">=</span>
|
|
|
|
|
|
<el-form-item class="param-box-row-value">
|
|
|
|
|
|
<el-input v-model="item1.value" placeholder="value" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span :id="'moduel-remove-label-'+i" class="param-box-row-symbol" @click="removeLogsLabel(index, i)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>
|
|
|
|
|
|
</div>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<div style="text-align: center">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<span id="module-add-logs-label" class="right-box-form-add module-add-label" type="button" @click="addLogsLabel(index)">
|
|
|
|
|
|
<span><i class="nz-icon nz-icon-plus" style="font-size: 16px;"></i></span>
|
|
|
|
|
|
</span>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="Pipeline" name="Pipeline">
|
|
|
|
|
|
<div v-for="(item2, index2) in item.pipeline" :key="index2">
|
|
|
|
|
|
<div class="pipeline-box">
|
|
|
|
|
|
<span class="pipeline-title">{{item2.type}}</span>
|
|
|
|
|
|
<span class="pipeline-option">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<pipelineSelect :index="index2" :father-pipeline="item.pipeline" @addPipeline="(pipelineIndex,obj)=>{addPipeline(obj,index,pipelineIndex,'splice')}" :type="'splice'"/>
|
|
|
|
|
|
<i class="nz-icon nz-icon-shanchu1" @click="delPipeline(index,index2)"></i>
|
|
|
|
|
|
</span>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item2.type === 'regex'">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-form-item
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:label="'Expression'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.expression'"
|
2021-08-02 11:47:34 +08:00
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-input v-model="item2.expression" placeholder="key" size="mini"></el-input>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</el-form-item>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="'Source'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.source'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.source" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item2.type === 'json'">
|
|
|
|
|
|
<label style="padding-bottom: 6px;font-size: 14px;line-height: 16px;color: #666;">Expressions</label>
|
|
|
|
|
|
<div v-for="(expressions, eindex) in item2.expressions" :key="eindex" style="display: flex;justify-content: space-around;align-items: center;margin-bottom: 16px">
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.expressions.'+eindex"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
style="width: 90%;margin: 0"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.expressions[eindex]" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span style="display: inline-block;width: 10%">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<i class="nz-icon nz-icon-plus" @click="addPipelineItem(index, index2)"></i>
|
|
|
|
|
|
<i class="nz-icon nz-icon-shanchu1" @click="delPipelineItem((index, index2, eindex))"></i>
|
|
|
|
|
|
</span>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="'Source'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.source'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.source" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<div v-if="item2.type === 'template'">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<el-form-item
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:label="'Source'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.source'"
|
2021-08-02 11:47:34 +08:00
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-input v-model="item2.source" placeholder="key" size="mini"></el-input>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
2021-08-03 10:14:37 +08:00
|
|
|
|
:label="'Template'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.template'"
|
2021-08-02 11:47:34 +08:00
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<el-input v-model="item2.template" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item2.type === 'timestamp'">
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="'Source'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.source'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.source" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="'Timestamp'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.timestamp'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.timestamp" placeholder="key" size="mini"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item2.type === 'labels'">
|
|
|
|
|
|
<label style="padding-bottom: 6px;font-size: 14px;line-height: 16px;color: #666;">Key/value</label>
|
|
|
|
|
|
<div v-for="(expressions, eindex) in item2.labels" :key="eindex" style="display: flex;justify-content: space-around;align-items: center;margin-bottom: 16px">
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.labels.'+eindex+'.key'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
style="width: 45%;margin: 0"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.labels[eindex].key" placeholder="key" size="mini" ></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
=
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.labels.'+eindex+'.value'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
style="width: 45%;margin: 0"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.labels[eindex].value" placeholder="key" size="mini" ></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<i class="nz-icon nz-icon-plus" @click="addPipelineItem(index, index2)"></i>
|
|
|
|
|
|
<i class="nz-icon nz-icon-shanchu1" @click="delPipelineItem((index, index2, eindex))"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item2.type === 'output'">
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="'Source'"
|
|
|
|
|
|
:prop="'configs.1.config.'+ index +'.pipeline.' + index2 + '.source'"
|
|
|
|
|
|
:rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input v-model="item2.source" placeholder="key" size="mini"></el-input>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
|
<div class="value-mapping-add" style="text-align: center;width: 25px;display: inline-block;margin-right: 44px">
|
|
|
|
|
|
<pipelineSelect :index="item.pipeline.length - 1" :father-pipeline="item.pipeline" @addPipeline="(pipelineIndex,obj)=>{addPipeline(obj,index,pipelineIndex,'push')}" :type="'push'"/>
|
|
|
|
|
|
</div>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<!-- <el-tab-pane label="Preview" name="Preview">-->
|
|
|
|
|
|
<!-- <div id="module-box-logs-preview" ref="previewBoxScrollbar" class="configs-copy-value" style="height: 100%; overflow: auto;">-->
|
|
|
|
|
|
<!-- <span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyLogsValue(index)"></i></span>-->
|
|
|
|
|
|
<!-- <pre style="overflow-y: auto;height:100%;width: 97%;">{{logsCopyValue[index]}}</pre>-->
|
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
<!-- </el-tab-pane>-->
|
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
<span class="nz-icon-minus-medium">
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<i class="nz-icon nz-icon-minus" @click="removeLogsArr(index)"></i>
|
|
|
|
|
|
</span>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="value-mapping-add" style="text-align: center;margin: 10px 180px 10px 144px;" @click="logsLogsArrAdd()">
|
|
|
|
|
|
<i class="nz-icon nz-icon-plus"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</transition>
|
|
|
|
|
|
|
|
|
|
|
|
<!--Preview-->
|
|
|
|
|
|
<div class="right-box-sub-title" :style="`margin-top:${logsShow&&editModule.configs[1].enable?'0':'10px'}`">
|
|
|
|
|
|
{{$t('overall.preview')}}
|
2021-08-02 11:47:34 +08:00
|
|
|
|
</div>
|
2021-08-03 10:14:37 +08:00
|
|
|
|
<div class="right-box-line"></div>
|
|
|
|
|
|
<div id="module-box-preview" ref="previewBoxScrollbar" class="configs-copy-value" style="overflow: auto;">
|
|
|
|
|
|
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue"></i></span>
|
|
|
|
|
|
<pre style="overflow-y: auto;height:100%">{{configsCopyValue}}</pre>
|
2021-05-21 19:28:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
2020-12-14 20:25:24 +08:00
|
|
|
|
</div>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
|
|
|
|
|
|
<!--底部按钮-->
|
2021-05-11 10:37:58 +08:00
|
|
|
|
<div class="right-box__footer">
|
|
|
|
|
|
<button v-cancel="{obj:editModule,func:esc}" id="module-box-esc" class="footer__btn footer__btn--light">
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<span>{{$t('overall.cancel')}}</span>
|
|
|
|
|
|
</button>
|
2021-05-11 10:37:58 +08:00
|
|
|
|
<button :class="{'nz-btn-disabled':prevent_opt.save}" v-has="'monitor_module_add'" :disabled="prevent_opt.save" @click="save" class="footer__btn" id="module-box-save">
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<span>{{$t('overall.save')}}</span>
|
|
|
|
|
|
</button>
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</div>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
</div>
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-03-19 18:52:19 +08:00
|
|
|
|
import { noSpecialChar, port, nzNumber } from '../js/validate'
|
|
|
|
|
|
import selectWalk from '../popBox/selectWalk'
|
2021-07-05 14:43:47 +08:00
|
|
|
|
import editRigthBox from '../mixin/editRigthBox'
|
2021-08-02 11:47:34 +08:00
|
|
|
|
import pipelineSelect from './pipelineSelect'
|
2021-04-22 10:36:29 +08:00
|
|
|
|
import VueTagsInput from '@johmun/vue-tags-input'
|
2021-03-19 18:52:19 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'moduleBox',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
module: Object,
|
|
|
|
|
|
currentProject: Object
|
|
|
|
|
|
},
|
|
|
|
|
|
components: {
|
2021-04-22 10:36:29 +08:00
|
|
|
|
'select-walk': selectWalk,
|
2021-08-02 11:47:34 +08:00
|
|
|
|
VueTagsInput,
|
|
|
|
|
|
pipelineSelect
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
2021-07-05 14:43:47 +08:00
|
|
|
|
mixins: [editRigthBox],
|
2021-03-19 18:52:19 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
walkData: [],
|
2021-08-03 10:14:37 +08:00
|
|
|
|
chartTempList: [],
|
2021-04-13 19:06:34 +08:00
|
|
|
|
activeName: 'Basic',
|
2021-08-02 11:47:34 +08:00
|
|
|
|
activeNameLogs: ['Basic'],
|
|
|
|
|
|
pipelineOptionValue: '',
|
2021-03-19 18:52:19 +08:00
|
|
|
|
expandedWalkData: [],
|
2021-04-13 19:06:34 +08:00
|
|
|
|
radio: 'password',
|
2021-03-19 18:52:19 +08:00
|
|
|
|
editModule: {},
|
2021-04-13 19:06:34 +08:00
|
|
|
|
restaurants: [
|
|
|
|
|
|
{ value: '{{module.name}}-{{asset.name}}' },
|
|
|
|
|
|
{ value: '{{module.name}}-{{asset.manageIp}}' }
|
|
|
|
|
|
],
|
2021-05-20 14:07:58 +08:00
|
|
|
|
ChartSearchShowFields: [ // ChartSearch 下拉搜索表头
|
|
|
|
|
|
{ title: 'ID', data: 'id' },
|
2021-08-05 14:50:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('config.model.titleName'),
|
|
|
|
|
|
data: function (row) {
|
|
|
|
|
|
if (row.name.length > 15) {
|
|
|
|
|
|
return row.name.substring(0, 12) + '...'
|
|
|
|
|
|
}
|
|
|
|
|
|
return row.name
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-05-20 14:07:58 +08:00
|
|
|
|
{ title: this.$t('config.model.titleType'), data: 'type' },
|
2021-08-05 14:50:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('overall.remark'),
|
|
|
|
|
|
data: function (row) {
|
|
|
|
|
|
if (row.remark && row.remark.length > 15) {
|
|
|
|
|
|
return row.remark.substring(0, 12) + '...'
|
|
|
|
|
|
}
|
|
|
|
|
|
return row.remark
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-05-20 14:07:58 +08:00
|
|
|
|
],
|
|
|
|
|
|
language: localStorage.getItem('nz-language'),
|
2021-04-13 19:06:34 +08:00
|
|
|
|
showAllBasicOption: false,
|
2021-03-19 18:52:19 +08:00
|
|
|
|
rules: {
|
|
|
|
|
|
name: [
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
|
|
|
|
|
{ validator: noSpecialChar, trigger: 'change' }
|
|
|
|
|
|
],
|
2021-04-13 19:06:34 +08:00
|
|
|
|
projectId: [
|
2021-03-19 18:52:19 +08:00
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
|
|
|
|
|
],
|
|
|
|
|
|
walk: [
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
username: [
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
|
|
|
|
],
|
2021-04-27 20:31:54 +08:00
|
|
|
|
pin: [
|
2021-03-19 18:52:19 +08:00
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
|
|
|
|
],
|
2021-04-27 20:31:54 +08:00
|
|
|
|
priv_pin: [
|
2021-03-19 18:52:19 +08:00
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
max_repetitions: [
|
|
|
|
|
|
{ validator: nzNumber, trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
retries: [
|
|
|
|
|
|
{ validator: nzNumber, trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
timeout: [
|
|
|
|
|
|
{ validator: nzNumber, trigger: 'blur' }
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2021-04-13 19:06:34 +08:00
|
|
|
|
projectList: [],
|
|
|
|
|
|
credentialList: [],
|
2021-08-03 10:14:37 +08:00
|
|
|
|
typeList: [
|
2021-04-13 19:06:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
value: 'http',
|
|
|
|
|
|
name: 'HTTP'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'snmp',
|
|
|
|
|
|
name: 'SNMP'
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2021-08-02 11:47:34 +08:00
|
|
|
|
logsBasicList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'file',
|
|
|
|
|
|
name: 'File'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'journal',
|
|
|
|
|
|
name: 'Journal'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'syslog',
|
|
|
|
|
|
name: 'Syslog'
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2021-04-13 19:06:34 +08:00
|
|
|
|
authType: 0,
|
|
|
|
|
|
authTypeList: [
|
|
|
|
|
|
{ name: this.$t('project.endpoint.authTypeNull'), value: 0 },
|
|
|
|
|
|
{ name: this.$t('project.endpoint.authTypeWord'), value: 1 },
|
|
|
|
|
|
{ name: this.$t('project.endpoint.authTypeToken'), value: 2 }
|
2021-04-14 15:38:37 +08:00
|
|
|
|
],
|
2021-08-02 11:47:34 +08:00
|
|
|
|
configsCopyValue: '',
|
|
|
|
|
|
logsCopyValue: [],
|
|
|
|
|
|
pipelineOption: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'Parsing stages',
|
|
|
|
|
|
pipelineOption: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'regex',
|
|
|
|
|
|
label: 'Regex'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'json',
|
|
|
|
|
|
label: 'Json'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'Transform stages',
|
|
|
|
|
|
pipelineOption: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'template',
|
|
|
|
|
|
label: 'Template'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'Action stages',
|
|
|
|
|
|
pipelineOption: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'timestamp',
|
|
|
|
|
|
label: 'Timestamp'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'labels',
|
|
|
|
|
|
label: 'Labels'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'output',
|
|
|
|
|
|
label: 'Output'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2021-08-03 10:14:37 +08:00
|
|
|
|
}],
|
|
|
|
|
|
metricsShow: true,
|
|
|
|
|
|
logsShow: true
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2021-08-02 11:47:34 +08:00
|
|
|
|
port: port,
|
2021-03-19 18:52:19 +08:00
|
|
|
|
selectWalk (walk) {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
if (this.editModule.configs[0].config.walk.indexOf(walk) != -1) {
|
|
|
|
|
|
this.editModule.configs[0].config.walk.splice(this.editModule.configs[0].config.walk.indexOf(walk), 1)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
this.editModule.configs[0].config.walk.push(walk)
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 从mibData里取得oid对应的mib名称
|
|
|
|
|
|
getMibName (walkData, walk) {
|
|
|
|
|
|
let mibName = ''
|
|
|
|
|
|
let objectName = ''
|
|
|
|
|
|
walkData.forEach((item, index) => {
|
|
|
|
|
|
if (!mibName && item.subTree && item.subTree.length > 0) {
|
|
|
|
|
|
item.subTree.forEach((item2, index2) => {
|
|
|
|
|
|
if (!mibName && getMibName(item2, walk)) {
|
|
|
|
|
|
mibName = item.name
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2020-04-04 21:10:52 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
function getMibName (tree, oid) {
|
|
|
|
|
|
if (oid.indexOf(tree.objectID) > -1) {
|
|
|
|
|
|
if (tree.objectID == oid) {
|
|
|
|
|
|
objectName = tree.name
|
|
|
|
|
|
return true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (tree.subTree && tree.subTree.length > 0) {
|
|
|
|
|
|
let result = false
|
|
|
|
|
|
for (let i = 0; i < tree.subTree.length; i++) {
|
|
|
|
|
|
if (getMibName(tree.subTree[i], oid)) {
|
|
|
|
|
|
result = true
|
|
|
|
|
|
break
|
2020-04-06 13:06:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
return result
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false
|
2020-04-06 13:06:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
return false
|
2020-04-06 13:06:15 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!objectName) {
|
|
|
|
|
|
objectName = walk
|
|
|
|
|
|
}
|
|
|
|
|
|
objectName = "<span style='font-weight:bold'>" + objectName + '</span>'
|
|
|
|
|
|
return mibName ? mibName + ':' + objectName : objectName
|
|
|
|
|
|
},
|
2020-04-04 21:10:52 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
removeWalk (walk) {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
this.editModule.configs[0].config.walk.splice(this.editModule.configs[0].config.walk.indexOf(walk), 1)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.$refs.selectWalk.$refs.walkTree.setChecked(walk, false)
|
|
|
|
|
|
},
|
2020-04-02 20:23:52 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
initWalk () {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
if (this.$refs.selectWalk) {
|
|
|
|
|
|
this.$refs.selectWalk.show()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2020-04-02 20:23:52 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
getWalkData () {
|
|
|
|
|
|
this.$get('mib/tree', { pageSize: -1, pageNo: 1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
const obj = JSON.parse(response.data)
|
|
|
|
|
|
this.walkData = []
|
|
|
|
|
|
for (const item in obj) {
|
|
|
|
|
|
setAttr(obj[item], 'detailShow', false)
|
|
|
|
|
|
this.walkData.push({ name: item, detailShow: false, subTree: obj[item] })
|
2020-04-02 20:23:52 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
function setAttr (tree, name, value) {
|
|
|
|
|
|
if (tree && tree.length > 0) {
|
|
|
|
|
|
for (let i = 0; i < tree.length; i++) {
|
|
|
|
|
|
tree[i][name] = value
|
|
|
|
|
|
if (tree[i].subTree && tree[i].subTree.length > 0) {
|
|
|
|
|
|
setAttr(tree[i].subTree, name, value)
|
2020-04-06 22:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-04-02 20:23:52 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
/* 关闭弹框 */
|
|
|
|
|
|
esc (refresh) {
|
|
|
|
|
|
this.$emit('close', refresh)
|
|
|
|
|
|
},
|
2019-12-18 17:00:44 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
clickOutside () {
|
|
|
|
|
|
this.esc(false)
|
|
|
|
|
|
},
|
|
|
|
|
|
changeType (type) {
|
|
|
|
|
|
if (this.editModule.id) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
this.editModule.type = type
|
2021-05-21 22:15:40 +08:00
|
|
|
|
if (type !== 'http') {
|
|
|
|
|
|
this.$refs.selectWalk.show()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 保存 */
|
|
|
|
|
|
save () {
|
2021-07-05 17:14:53 +08:00
|
|
|
|
setTimeout(() => {
|
2021-08-02 11:47:34 +08:00
|
|
|
|
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 => {
|
2021-08-03 14:12:14 +08:00
|
|
|
|
if (item.labelModule) {
|
|
|
|
|
|
item.labels = this.labelsToJson(item.labelModule)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
item.labels = ''
|
2021-08-02 11:47:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-08-03 14:12:14 +08:00
|
|
|
|
const params = JSON.parse(JSON.stringify(this.editModule))
|
|
|
|
|
|
params.configs[1].config.forEach(item => {
|
|
|
|
|
|
item.pipeline && item.pipeline.forEach((pipeline) => {
|
|
|
|
|
|
if (pipeline.type === 'labels') {
|
|
|
|
|
|
pipeline.labels = this.labelsToJson(pipeline.labels)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
params.configs = JSON.stringify(params.configs)
|
2021-08-03 10:14:37 +08:00
|
|
|
|
this.$refs.moduleForm.validate((valid, errorKey) => {
|
|
|
|
|
|
let key = Object.keys(errorKey)
|
|
|
|
|
|
if (key.length) {
|
|
|
|
|
|
key = key[0]
|
|
|
|
|
|
if (key.indexOf('configs.0') !== -1) {
|
|
|
|
|
|
const keyArr = key.split('.')
|
|
|
|
|
|
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
|
|
|
|
|
this.activeName = 'Auth'
|
|
|
|
|
|
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port') {
|
|
|
|
|
|
this.activeName = 'Basic'
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (key.indexOf('configs.1') !== -1) {
|
|
|
|
|
|
const keyArr = key.split('.')
|
|
|
|
|
|
this.activeNameLogs[keyArr[3]] = keyArr[4].trim().toLowerCase().replace(keyArr[4][0], keyArr[4][0].toUpperCase())
|
|
|
|
|
|
this.activeNameLogs = [...this.activeNameLogs]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-07-05 17:14:53 +08:00
|
|
|
|
if (valid) {
|
|
|
|
|
|
this.prevent_opt.save = true
|
|
|
|
|
|
if (this.editModule.id) {
|
|
|
|
|
|
this.$put('monitor/module', params).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
|
|
|
|
|
this.$store.commit('setReloadFacade')
|
|
|
|
|
|
this.esc(true)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
this.prevent_opt.save = false
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$post('monitor/module', params).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
|
|
|
|
|
this.$store.commit('setReloadFacade')
|
|
|
|
|
|
this.esc(true)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
this.prevent_opt.save = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.prevent_opt.save = false
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}, 10)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
/* 删除 */
|
|
|
|
|
|
del () {
|
|
|
|
|
|
this.$confirm(this.$t('tip.confirmDelete'), {
|
|
|
|
|
|
confirmButtonText: this.$t('tip.yes'),
|
|
|
|
|
|
cancelButtonText: this.$t('tip.no'),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}).then(() => {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.$delete('monitor/module?ids=' + this.editModule.id).then(response => {
|
2019-12-18 17:00:44 +08:00
|
|
|
|
if (response.code === 200) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
|
|
|
|
|
this.$store.commit('setReloadFacade')
|
|
|
|
|
|
this.esc(true)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg)
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2019-12-18 17:00:44 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
/* 获取project列表 */
|
|
|
|
|
|
getProjectList () {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.$get('monitor/project', { pageSize: -1, pageNo: 1 }).then(response => {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.projectList = response.data.list
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
2019-12-18 17:00:44 +08:00
|
|
|
|
},
|
2021-04-13 19:06:34 +08:00
|
|
|
|
// get snmp
|
|
|
|
|
|
getCredential () {
|
|
|
|
|
|
this.$get('/snmp/credential', { pageSize: -1, pageNo: 1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.credentialList = response.data.list
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 清除param
|
|
|
|
|
|
clearAllParam () {
|
2021-04-14 15:38:37 +08:00
|
|
|
|
this.editModule.paramObj = []
|
2020-04-02 20:23:52 +08:00
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 新增param
|
|
|
|
|
|
addParam () {
|
2021-04-15 11:47:44 +08:00
|
|
|
|
this.editModule.paramObj.push({ key: '', value: [], showList: false })
|
2019-12-18 17:00:44 +08:00
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 移除单个param
|
|
|
|
|
|
removeParam (index) {
|
2021-04-16 15:02:40 +08:00
|
|
|
|
if (this.editModule.paramObj.length === 1) {
|
|
|
|
|
|
this.editModule.paramObj = [{ key: '', value: [] }]
|
|
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
this.editModule.paramObj.splice(index, 1)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 新增label
|
|
|
|
|
|
addLabel () {
|
2021-04-14 15:38:37 +08:00
|
|
|
|
this.editModule.labelModule.push({ key: '', value: '' })
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
2021-08-02 11:47:34 +08:00
|
|
|
|
addLogsLabel (index) {
|
|
|
|
|
|
this.editModule.configs[1].config[index].labelModule.push({ key: '', value: '' })
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 移除单个Label
|
|
|
|
|
|
removeLabel (index) {
|
2021-04-14 15:38:37 +08:00
|
|
|
|
if (this.editModule.labelModule.length === 1) {
|
2021-04-16 15:02:40 +08:00
|
|
|
|
this.editModule.labelModule = [{ key: '', value: '' }]
|
2021-08-02 11:47:34 +08:00
|
|
|
|
return
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.editModule.labelModule.splice(index, 1)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
2021-08-02 11:47:34 +08:00
|
|
|
|
removeLogsLabel (logsIndex, i) {
|
|
|
|
|
|
if (this.editModule.configs[1].config[logsIndex].labelModule.length === 1) {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].labelModule = [{ key: '', value: '' }]
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].labelModule.splice(i, 1)
|
|
|
|
|
|
},
|
2021-04-22 10:36:29 +08:00
|
|
|
|
tagsChange (newTags, index) {
|
|
|
|
|
|
this.editModule.paramObj[index].value = newTags.map(item => item.text)
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 将param转为json字符串格式
|
|
|
|
|
|
paramToJson (param) {
|
|
|
|
|
|
const tempParam = {}
|
|
|
|
|
|
for (let i = 0; i < param.length; i++) {
|
2021-04-14 15:38:37 +08:00
|
|
|
|
if (!param[i].key || !param[i].value.length) {
|
|
|
|
|
|
continue
|
|
|
|
|
|
}
|
|
|
|
|
|
tempParam[param[i].key] = param[i].value
|
2020-04-06 13:06:15 +08:00
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
return tempParam
|
2019-12-31 19:02:58 +08:00
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
// 将labels转为json字符串格式
|
|
|
|
|
|
labelsToJson (param) {
|
|
|
|
|
|
const tempParam = {}
|
|
|
|
|
|
for (let i = 0; i < param.length; i++) {
|
2021-04-14 15:38:37 +08:00
|
|
|
|
if (!param[i].key || !param[i].value) {
|
|
|
|
|
|
continue
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
eval('tempParam["' + param[i].key + '"]="' + param[i].value + '"')
|
|
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
return tempParam
|
2021-04-13 19:06:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 输入建议
|
|
|
|
|
|
querySearch (queryString, cb) {
|
|
|
|
|
|
const restaurants = this.restaurants
|
|
|
|
|
|
const results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
|
|
|
|
|
|
// 调用 callback 返回建议列表的数据
|
|
|
|
|
|
cb(results)
|
|
|
|
|
|
},
|
|
|
|
|
|
createFilter (queryString) {
|
|
|
|
|
|
return (restaurant) => {
|
|
|
|
|
|
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
changeAuthType () {
|
2021-08-02 11:47:34 +08:00
|
|
|
|
this.editModule.configs[0].config.bearer_token = ''
|
|
|
|
|
|
this.editModule.configs[0].config.basic_auth = {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
username: '',
|
2021-04-27 20:31:54 +08:00
|
|
|
|
pin: ''
|
2021-04-13 19:06:34 +08:00
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
},
|
2021-08-02 11:47:34 +08:00
|
|
|
|
logsLogsArrAdd () {
|
|
|
|
|
|
this.activeNameLogs.push('Basic')
|
|
|
|
|
|
this.logsCopyValue.push('')
|
|
|
|
|
|
this.editModule.configs[1].config.push({
|
2021-08-04 16:55:11 +08:00
|
|
|
|
type: 'file',
|
|
|
|
|
|
fileName: '',
|
2021-08-02 11:47:34 +08:00
|
|
|
|
labels: '',
|
|
|
|
|
|
labelModule: [{ key: '', value: '' }],
|
|
|
|
|
|
pipeline: []
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
removeLogsArr (index) {
|
|
|
|
|
|
if (this.editModule.configs[1].config.length !== 1) {
|
|
|
|
|
|
this.editModule.configs[1].config.splice(index, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
logsBasicTypeChange (i) {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
const type = this.editModule.configs[1].config[i].type
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (type === 'file') {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
this.editModule.configs[1].config[i].fileName = ''
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].unit
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].appName
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].listenAddress
|
2021-08-03 10:14:37 +08:00
|
|
|
|
} else if (type === 'journal') {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
delete this.editModule.configs[1].config[i].fileName
|
|
|
|
|
|
this.editModule.configs[1].config[i].unit = ''
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].appName
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].listenAddress
|
2021-08-03 10:14:37 +08:00
|
|
|
|
} else if (type === 'syslog') {
|
2021-08-04 16:55:11 +08:00
|
|
|
|
delete this.editModule.configs[1].config[i].fileName
|
|
|
|
|
|
delete this.editModule.configs[1].config[i].unit
|
|
|
|
|
|
this.editModule.configs[1].config[i].appName = ''
|
|
|
|
|
|
this.editModule.configs[1].config[i].listenAddress = ''
|
2021-08-03 10:14:37 +08:00
|
|
|
|
}
|
2021-08-02 11:47:34 +08:00
|
|
|
|
},
|
2021-04-14 15:38:37 +08:00
|
|
|
|
copyValue () {
|
|
|
|
|
|
const domUrl = document.createElement('input')
|
|
|
|
|
|
domUrl.value = this.configsCopyValue
|
|
|
|
|
|
domUrl.id = 'creatDom'
|
|
|
|
|
|
document.body.appendChild(domUrl)
|
|
|
|
|
|
domUrl.select() // 选择对象
|
|
|
|
|
|
document.execCommand('Copy') // 执行浏览器复制命令
|
|
|
|
|
|
const creatDom = document.getElementById('creatDom')
|
|
|
|
|
|
creatDom.parentNode.removeChild(creatDom)
|
2021-04-21 16:35:48 +08:00
|
|
|
|
this.$message.success(this.$t('overall.copySuccess'))
|
2021-04-14 15:38:37 +08:00
|
|
|
|
},
|
2021-08-02 11:47:34 +08:00
|
|
|
|
copyLogsValue (index) {
|
|
|
|
|
|
const domUrl = document.createElement('input')
|
|
|
|
|
|
domUrl.value = this.logsCopyValue[index]
|
|
|
|
|
|
domUrl.id = 'creatDom'
|
|
|
|
|
|
document.body.appendChild(domUrl)
|
|
|
|
|
|
domUrl.select() // 选择对象
|
|
|
|
|
|
document.execCommand('Copy') // 执行浏览器复制命令
|
|
|
|
|
|
const creatDom = document.getElementById('creatDom')
|
|
|
|
|
|
creatDom.parentNode.removeChild(creatDom)
|
|
|
|
|
|
this.$message.success(this.$t('overall.copySuccess'))
|
|
|
|
|
|
},
|
|
|
|
|
|
tabClick (index) {
|
|
|
|
|
|
if (this.activeNameLogs[index] === 'Preview') {
|
|
|
|
|
|
const params = JSON.parse(JSON.stringify(this.editModule.configs[1].config[index]))
|
|
|
|
|
|
params.labels = this.labelsToJson(params.labelModule)
|
|
|
|
|
|
delete params.labelModule
|
|
|
|
|
|
Object.keys(params).forEach(key => {
|
|
|
|
|
|
if (!params[key]) {
|
|
|
|
|
|
delete params[key]
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Array.isArray(params[key]) && !params[key].length) {
|
|
|
|
|
|
delete params[key]
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if (params.labels && !Object.keys(params.labels).length) {
|
|
|
|
|
|
delete params.labels
|
|
|
|
|
|
}
|
|
|
|
|
|
Object.keys(params.basic).forEach(key => {
|
|
|
|
|
|
if (!params.basic[key]) {
|
|
|
|
|
|
delete params.basic[key]
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
params.pipeline && params.pipeline.forEach(item => {
|
|
|
|
|
|
if (item.type === 'labels') {
|
|
|
|
|
|
item.labels = this.labelsToJson(item.labels)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.logsCopyValue[index] = JSON.stringify(params, null, 2)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-14 15:38:37 +08:00
|
|
|
|
syntaxHighlight (json) {
|
|
|
|
|
|
if (typeof json != 'string') {
|
|
|
|
|
|
json = JSON.stringify(json, undefined, 2)
|
|
|
|
|
|
}
|
|
|
|
|
|
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
|
|
|
|
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
|
|
|
|
|
|
function (match) {
|
|
|
|
|
|
let cls = 'number'
|
|
|
|
|
|
if (/^"/.test(match)) {
|
|
|
|
|
|
if (/:$/.test(match)) {
|
|
|
|
|
|
cls = 'key'
|
|
|
|
|
|
} else {
|
|
|
|
|
|
cls = 'string'
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (/true|false/.test(match)) {
|
|
|
|
|
|
cls = 'boolean'
|
|
|
|
|
|
} else if (/null/.test(match)) {
|
|
|
|
|
|
cls = 'null'
|
|
|
|
|
|
}
|
|
|
|
|
|
return '<span class="' + cls + '">' + match + '</span>'
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2021-04-21 19:29:28 +08:00
|
|
|
|
},
|
|
|
|
|
|
paramObjchange (val, index) {
|
|
|
|
|
|
this.editModule.paramObj[index].value = val.filter(item => item.trim())
|
2021-05-20 14:07:58 +08:00
|
|
|
|
},
|
|
|
|
|
|
resultFormat (resp) {
|
|
|
|
|
|
if (resp && resp.data) {
|
|
|
|
|
|
const assetData = {}
|
|
|
|
|
|
assetData.list = resp.data.list
|
|
|
|
|
|
assetData.totalRow = resp.data.total
|
|
|
|
|
|
return assetData
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 获取chart列表数据 */
|
|
|
|
|
|
ChartTemplateList () {
|
2021-05-25 14:21:14 +08:00
|
|
|
|
this.$get('visual/panel/chart', { pageSize: -1, varType: 2, panelId: 0, returnChildren: 0, groupId: 0 }).then(res => {
|
2021-08-03 10:14:37 +08:00
|
|
|
|
this.chartTempList = res.data.list
|
2021-05-20 14:07:58 +08:00
|
|
|
|
})
|
2021-08-02 11:47:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 添加pipeline
|
|
|
|
|
|
addPipeline (obj, logsIndex, pipeLineIndex, type) {
|
|
|
|
|
|
if (type == 'splice') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline.splice(pipeLineIndex, 0, obj)
|
|
|
|
|
|
}
|
|
|
|
|
|
if (type == 'push') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline.push(obj)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 删除pipeline
|
|
|
|
|
|
delPipeline (logsIndex, pipeLineIndex) {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline.splice(pipeLineIndex, 1)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 添加pipelineItem
|
|
|
|
|
|
addPipelineItem (logsIndex, pipelineIndex) {
|
|
|
|
|
|
const val = this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].type
|
|
|
|
|
|
if (val === 'regex') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expression.push('')
|
|
|
|
|
|
} else if (val === 'json') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.push('')
|
|
|
|
|
|
} else if (val === 'template') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.push('')
|
|
|
|
|
|
} else if (val === 'timestamp') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.push('')
|
|
|
|
|
|
} else if (val === 'labels') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.push({
|
|
|
|
|
|
key: '',
|
|
|
|
|
|
value: ''
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (val === 'output') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.push('')
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
delPipelineItem (logsIndex, pipelineIndex, itemIndex) {
|
|
|
|
|
|
const val = this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].type
|
|
|
|
|
|
if (val === 'json') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.splice(itemIndex, 1)
|
|
|
|
|
|
} else if (val === 'labels') {
|
|
|
|
|
|
this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.splice(itemIndex, 1)
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
2021-08-03 14:12:14 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
created () {
|
|
|
|
|
|
this.getProjectList()
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.getCredential()
|
2021-08-03 14:12:14 +08:00
|
|
|
|
this.getWalkData()
|
|
|
|
|
|
this.ChartTemplateList()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
mibName () {
|
|
|
|
|
|
return (value) => {
|
|
|
|
|
|
return this.getMibName(this.walkData, value)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
module: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2021-07-15 11:56:25 +08:00
|
|
|
|
this.isEdit = true
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.editModule = JSON.parse(JSON.stringify(n))
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.activeName = 'Basic'
|
2021-08-02 11:47:34 +08:00
|
|
|
|
this.activeNameLogs = this.editModule.configs[1].config.map(() => 'Basic')
|
|
|
|
|
|
this.logsCopyValue = this.editModule.configs[1].config.map(() => '')
|
|
|
|
|
|
if (this.editModule.configs[0].config.bearer_token) {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.authType = 2
|
2021-08-02 11:47:34 +08:00
|
|
|
|
} else if (this.editModule.configs[0].config.basic_auth.username) {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.authType = 1
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
2021-04-13 19:06:34 +08:00
|
|
|
|
this.authType = 0
|
|
|
|
|
|
}
|
|
|
|
|
|
if (n.type && n.type.toLowerCase() == 'snmp') {
|
|
|
|
|
|
this.$refs.selectWalk.show()
|
2021-08-04 16:55:11 +08:00
|
|
|
|
for (let i = 0; i < this.editModule.configs[0].config.walk.length; i++) {
|
2021-08-02 11:47:34 +08:00
|
|
|
|
this.expandedWalkData.push(this.editModule.configs[0].config.walk[i].substring(0, this.editModule.configs[0].config.walk[i].lastIndexOf('.')))
|
2020-08-05 20:58:24 +08:00
|
|
|
|
}
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
editModule: {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
if (n && n.configs) {
|
2021-08-03 10:14:37 +08:00
|
|
|
|
const params = JSON.parse(JSON.stringify(n.configs))
|
|
|
|
|
|
params[0].config.params = this.paramToJson(this.editModule.paramObj)
|
|
|
|
|
|
params[0].config.labels = this.labelsToJson(this.editModule.labelModule)
|
|
|
|
|
|
Object.keys(params[0].config).forEach(key => {
|
|
|
|
|
|
if (!params[0].config[key]) {
|
|
|
|
|
|
delete params[0].config[key]
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (Array.isArray(params[0].config[key]) && !params[0].config[key].length) {
|
|
|
|
|
|
delete params[0].config[key]
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (params[0].config.basic_auth && !params[0].config.basic_auth.username) {
|
|
|
|
|
|
delete params[0].config.basic_auth
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (params[0].config.basic_auth && !params[0].config.basic_auth.pin) {
|
|
|
|
|
|
delete params[0].config.basic_auth
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (params[0].config.param && !Object.keys(params[0].config.param).length) {
|
|
|
|
|
|
delete params[0].config.param
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-08-03 10:14:37 +08:00
|
|
|
|
if (params[0].config.labels && !Object.keys(params[0].config.labels).length) {
|
|
|
|
|
|
delete params[0].config.labels
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-08-03 10:14:37 +08:00
|
|
|
|
params[1].config.forEach(item => {
|
|
|
|
|
|
if (item.labelModule) {
|
|
|
|
|
|
item.labels = this.labelsToJson(item.labelModule)
|
|
|
|
|
|
delete item.labelModule
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-04-14 15:38:37 +08:00
|
|
|
|
this.configsCopyValue = JSON.stringify(params, null, 2)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</script>
|
2021-08-02 11:47:34 +08:00
|
|
|
|
<style scoped lang="scss">
|
2020-04-02 20:23:52 +08:00
|
|
|
|
.module-walk-box {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
min-height: 32px;
|
|
|
|
|
|
margin-bottom: 22px;
|
|
|
|
|
|
padding: 3px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.module-walk-box i {
|
|
|
|
|
|
color: #C0C4CC;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-box-item {
|
|
|
|
|
|
padding: 5px 15px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-box-item-txt {
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-box-item-op span:first-of-type {
|
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-box-item-op span {
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-box-op {
|
|
|
|
|
|
width: 18px;
|
|
|
|
|
|
margin: 5px 0 5px 15px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2020-04-04 21:10:52 +08:00
|
|
|
|
.el-cascader {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
.el-cascader__tags {
|
|
|
|
|
|
height: calc(100% - 10px);
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
.right-box-module .el-cascader .el-input__inner {
|
|
|
|
|
|
height: 150px;
|
|
|
|
|
|
}
|
2020-10-15 14:27:46 +08:00
|
|
|
|
.right-box-form-tip{
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
line-height: 21px;
|
|
|
|
|
|
}
|
2021-04-13 19:06:34 +08:00
|
|
|
|
.half-form-item {
|
2021-04-22 15:52:32 +08:00
|
|
|
|
width: calc(50% - 21px);
|
2021-04-13 19:06:34 +08:00
|
|
|
|
display: inline-block;
|
2021-06-01 17:24:57 +08:00
|
|
|
|
padding: 0 0px 0 0px;
|
2021-04-13 19:06:34 +08:00
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
.half-form-item:nth-child(even){
|
|
|
|
|
|
padding-left: 0;
|
|
|
|
|
|
}
|
2021-04-13 19:06:34 +08:00
|
|
|
|
/deep/ .el-tabs__item{
|
|
|
|
|
|
width: 90px;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .el-tabs__item.is-active{
|
|
|
|
|
|
color: #FA901C
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .el-tabs__active-bar{
|
|
|
|
|
|
background-color: #FA901C
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .el-radio-group{
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .el-radio{
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .el-autocomplete{
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
/deep/ .el-tabs__content{
|
2021-08-02 11:47:34 +08:00
|
|
|
|
/*padding-left: 18px;*/
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
2021-04-21 19:29:28 +08:00
|
|
|
|
.need-rotate.nz-icon-arrow-down{
|
2021-04-13 19:06:34 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
|
transition: transform .3s;
|
|
|
|
|
|
}
|
2021-04-21 19:29:28 +08:00
|
|
|
|
.need-rotate.nz-icon-arrow-down.is-active{
|
2021-04-13 19:06:34 +08:00
|
|
|
|
transform: rotate(
|
|
|
|
|
|
-180deg
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
.module-add-label{
|
|
|
|
|
|
display: inline-block;
|
2021-08-02 11:47:34 +08:00
|
|
|
|
width: 16px;
|
2021-04-14 15:38:37 +08:00
|
|
|
|
height: 18px;
|
2021-08-02 11:47:34 +08:00
|
|
|
|
background: rgba(250,144,28,0.1);
|
2021-04-14 15:38:37 +08:00
|
|
|
|
border: 1px solid #FFE0BD;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 18px;
|
2021-08-02 11:47:34 +08:00
|
|
|
|
margin-right: 55px;
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
.configs-copy-value{
|
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
|
background: #F6F8FA;
|
|
|
|
|
|
border: 1px solid #E7EAED;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
height: 140px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
margin-top: 10px;
|
2021-04-15 11:47:44 +08:00
|
|
|
|
padding: 10px 0px 10px 15px;
|
2021-08-02 11:47:34 +08:00
|
|
|
|
width:100%;
|
|
|
|
|
|
margin-left: 0px;
|
|
|
|
|
|
pre{
|
|
|
|
|
|
max-height: 300px;
|
|
|
|
|
|
min-height: 100px;
|
|
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
.configs-copy-value .copy-value-content{
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 20px;
|
|
|
|
|
|
top: 14px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2021-04-22 10:36:29 +08:00
|
|
|
|
/deep/ .ti-input{
|
|
|
|
|
|
min-height: 30px;
|
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
|
border-radius: 2px;
|
2021-05-06 21:40:56 +08:00
|
|
|
|
padding: 0 !important;
|
2021-04-22 10:36:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
/deep/ .ti-tag{
|
2021-04-22 15:52:32 +08:00
|
|
|
|
background-color: #f4f4f5;
|
|
|
|
|
|
border-color: #e9e9eb;
|
|
|
|
|
|
color: #909399;
|
2021-05-06 21:40:56 +08:00
|
|
|
|
padding: 2px 4px!important;;
|
2021-04-22 10:36:29 +08:00
|
|
|
|
}
|
2021-07-22 14:25:14 +08:00
|
|
|
|
/deep/ .el-form-item__content .el-input-group {
|
|
|
|
|
|
vertical-align: unset;
|
|
|
|
|
|
}
|
2021-08-02 11:47:34 +08:00
|
|
|
|
/deep/ .special-tabs.el-tabs.el-tabs--top{
|
|
|
|
|
|
border: 1px dashed #D8D9DA;
|
|
|
|
|
|
padding: 7px 10px;
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nz-icon-minus-medium {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 20px;
|
|
|
|
|
|
top: 15px;
|
|
|
|
|
|
background: rgba(236,127,102,0.1);
|
|
|
|
|
|
padding: 2px 6px;
|
|
|
|
|
|
color: #EC7F66;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-title{
|
|
|
|
|
|
border: 1px solid #E7EAED;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
padding: 8px 10px;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-title .endpoint-title-content{
|
|
|
|
|
|
font-family: Roboto-Medium;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
font-weight: 500;
|
2021-08-03 10:14:37 +08:00
|
|
|
|
.nz-icon-arrow-down{
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
transition: transform .3s;
|
2021-08-04 16:55:11 +08:00
|
|
|
|
color: #BDBDBD;
|
|
|
|
|
|
font-size: 12px;
|
2021-08-03 10:14:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
.nz-icon-arrow-down.is-active{
|
|
|
|
|
|
transform: rotate(
|
|
|
|
|
|
-90deg
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2021-08-02 11:47:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
.value-mapping-add {
|
|
|
|
|
|
background: rgba(250,144,28,0.1);
|
|
|
|
|
|
border: 1px solid #FFE0BD;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
line-height: 24px;
|
|
|
|
|
|
color: #FA901C;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
.pipeline-box{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
border-bottom: 1px solid #E7EAED;
|
|
|
|
|
|
padding-bottom: 3px;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
.pipeline-title{
|
|
|
|
|
|
font-family: Roboto-Medium;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #FA901C;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
text-transform: Capitalize;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-04-02 20:23:52 +08:00
|
|
|
|
</style>
|
2020-04-01 21:21:42 +08:00
|
|
|
|
<style>
|
|
|
|
|
|
.sub-label {
|
|
|
|
|
|
padding-right: 15px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #666;
|
2021-02-09 15:14:19 +08:00
|
|
|
|
text-align: left;
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
padding-left: 15px;
|
|
|
|
|
|
font-weight: bold;
|
2020-04-01 21:21:42 +08:00
|
|
|
|
}
|
2021-02-09 15:14:19 +08:00
|
|
|
|
.sub-label-required::after {
|
2020-04-01 21:21:42 +08:00
|
|
|
|
content: '*';
|
|
|
|
|
|
color: #F56C6C;
|
2021-02-09 15:14:19 +08:00
|
|
|
|
margin-left: 4px;
|
2020-04-01 21:21:42 +08:00
|
|
|
|
}
|
2020-04-02 14:33:46 +08:00
|
|
|
|
.module-box-type {
|
|
|
|
|
|
margin: 25px 0 10px -15px;
|
|
|
|
|
|
}
|
2020-04-06 22:11:25 +08:00
|
|
|
|
.walk-close-box {
|
|
|
|
|
|
margin-left: 6px;
|
|
|
|
|
|
width: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.walk-close {
|
2020-12-16 18:41:29 +08:00
|
|
|
|
font-size: 12px;
|
2020-04-06 22:11:25 +08:00
|
|
|
|
}
|
2021-04-14 15:38:37 +08:00
|
|
|
|
.config-dropdown.hide-element{
|
|
|
|
|
|
border: none!important;
|
|
|
|
|
|
}
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</style>
|