fix: 软件安装kafka增加参数

catl
TangShan_DD 2024-11-08 17:58:14 +08:00
parent f3e2eece29
commit fdc904ef96
1 changed files with 64 additions and 15 deletions

View File

@ -4,16 +4,14 @@
<el-col :span="12"> <el-col :span="12">
<basic-form-item label="软件版本:" prop="version" validate="required"> <basic-form-item label="软件版本:" prop="version" validate="required">
<el-select v-model="itemData.version" placeholder="版本"> <el-select v-model="itemData.version" placeholder="版本">
<el-option v-for="(row,index) in versionData" :key="index" :label="row.name" :value="row.value"> <el-option v-for="(row, index) in versionData" :key="index" :label="row.name" :value="row.value"> </el-option>
</el-option>
</el-select> </el-select>
</basic-form-item> </basic-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<basic-form-item label="scala版本" prop="manage_config.kafka_scala_version" validate="required"> <basic-form-item label="scala版本" prop="manage_config.kafka_scala_version" validate="required">
<el-select v-model="itemData.manage_config.kafka_scala_version" placeholder="版本"> <el-select v-model="itemData.manage_config.kafka_scala_version" placeholder="版本">
<el-option v-for="(row,index) in scalaVersionData" :key="index" :label="row.name" :value="row.value"> <el-option v-for="(row, index) in scalaVersionData" :key="index" :label="row.name" :value="row.value"> </el-option>
</el-option>
</el-select> </el-select>
</basic-form-item> </basic-form-item>
</el-col> </el-col>
@ -28,34 +26,71 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<basic-form-item label="ZK路径" prop="manage_config.kafka_zookeeper_connection_string" validate="required" :rule="rule"> <basic-form-item label="ZK路径" prop="manage_config.kafka_zookeeper_connection_string" validate="required" :rules="rule">
<el-input type="textarea" v-model="itemData.manage_config.kafka_zookeeper_connection_string" placeholder="192.168.1.1:2181,192.168.1.2:2181"></el-input> <el-input type="textarea" v-model="itemData.manage_config.kafka_zookeeper_connection_string" placeholder="192.168.1.1:2181,192.168.1.2:2181"></el-input>
</basic-form-item> </basic-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="24" class="line"></el-col>
<el-col :span="24" class="title">
创建topic
<el-button :disabled="isPreview" class="m-l" type="primary" size="mini" @click="addTopic(itemData.topics)"></el-button>
</el-col>
</el-row>
<div v-for="(item, index) in itemData.topics" :key="index" class="search-container">
<el-button type="text" :disabled="isPreview" class="del_operate" @click="removeItem(itemData.topics, index, 'required')">
<i class="el-icon-delete" />
</el-button>
<el-row>
<el-col :span="12">
<basic-form-item label="复本数:" :prop="'topics.' + index + '.replication'" validate="required" required-message="">
<el-input-number v-model="item.replication" :min="1" :step-strictly="true" :precision="0"></el-input-number>
</basic-form-item>
</el-col>
<el-col :span="12">
<basic-form-item label="分片数:" :prop="'topics.' + index + '.partitions'" validate="required" required-message="">
<el-input-number v-model="item.partitions" :min="1" :step-strictly="true" :precision="0"></el-input-number>
</basic-form-item>
</el-col>
<el-col :span="12">
<basic-form-item label="topic名称" :prop="'topics.' + index + '.topic_name'" validate="required" :rules="topicRule">
<el-input v-model="item.topic_name"></el-input>
</basic-form-item>
</el-col>
</el-row>
</div>
</basic-form> </basic-form>
</template> </template>
<script> <script>
import node from '../../mixins/index'; import node from '../../mixins/index'
import show from '../../mixins/show' import show from '../../mixins/show'
import { getDictChildren } from 'services/system/dictionary' import { getDictChildren } from 'services/system/dictionary'
import software from '../mixins/itemOperate'
export default { export default {
mixins: [node, show], mixins: [node, show, software],
props: { props: {
itemData: { itemData: {
type: Object, type: Object,
default: function () { default: function() {
return { return {
install_jmx_exporter: true, install_jmx_exporter: true,
manage_config: { manage_config: {
kafka_scala_version: '', kafka_scala_version: '',
kafka_zookeeper_connection_string: '' kafka_zookeeper_connection_string: ''
} },
topics: [
{
replication: 1,
partitions: 1,
topic_name: ''
}
]
} }
} }
} }
}, },
data () { data() {
return { return {
versionData: [], versionData: [],
scalaVersionData: [], scalaVersionData: [],
@ -64,21 +99,35 @@ export default {
pattern: /^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]):([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]),?)*$/, pattern: /^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]):([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]),?)*$/,
message: '请按照提示输入正确的格式' message: '请按照提示输入正确的格式'
} }
],
topicRule: [
{
pattern: /^[a-zA-Z-]+$/,
message: '请输入英文和中划线'
}
] ]
} }
}, },
created () { created() {
this.getVersion('KAFKA-VERSION'); this.getVersion('KAFKA-VERSION')
this.getVersion('SCALA-VERSION'); this.getVersion('SCALA-VERSION')
}, },
methods: { methods: {
getVersion (value) { // topic
addTopic(data) {
data.push({
replication: 1,
partitions: 1,
topic_name: ''
})
},
getVersion(value) {
getDictChildren({ value: value }).then(data => { getDictChildren({ value: value }).then(data => {
if (data.success) { if (data.success) {
if (value === 'KAFKA-VERSION') { if (value === 'KAFKA-VERSION') {
this.versionData = data.data this.versionData = data.data
} else { } else {
this.scalaVersionData = data.data; this.scalaVersionData = data.data
} }
} }
}) })