broker日志配置
This commit is contained in:
@@ -58,6 +58,10 @@ export const KafkaConfigApi = {
|
||||
url: "/config/broker",
|
||||
method: "get",
|
||||
},
|
||||
getBrokerLoggerConfig: {
|
||||
url: "/config/broker/logger",
|
||||
method: "get",
|
||||
},
|
||||
setBrokerConfig: {
|
||||
url: "/config/broker",
|
||||
method: "post",
|
||||
@@ -66,6 +70,14 @@ export const KafkaConfigApi = {
|
||||
url: "/config/broker",
|
||||
method: "delete",
|
||||
},
|
||||
setBrokerLoggerConfig: {
|
||||
url: "/config/broker/logger",
|
||||
method: "post",
|
||||
},
|
||||
deleteBrokerLoggerConfig: {
|
||||
url: "/config/broker/logger",
|
||||
method: "delete",
|
||||
},
|
||||
};
|
||||
|
||||
export const KafkaTopicApi = {
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
:visible="showEditConfigDialog"
|
||||
:record="selectData"
|
||||
:broker-id="id"
|
||||
:is-logger-config="isLoggerConfig"
|
||||
@closeEditConfigDialog="closeEditConfigDialog"
|
||||
></EditConfig>
|
||||
</a-spin>
|
||||
@@ -83,6 +84,10 @@ export default {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
isLoggerConfig: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -107,9 +112,12 @@ export default {
|
||||
methods: {
|
||||
getBrokerConfig() {
|
||||
this.loading = true;
|
||||
const api = this.isLoggerConfig
|
||||
? KafkaConfigApi.getBrokerLoggerConfig
|
||||
: KafkaConfigApi.getBrokerConfig;
|
||||
request({
|
||||
url: KafkaConfigApi.getBrokerConfig.url + "?brokerId=" + this.id,
|
||||
method: KafkaConfigApi.getBrokerConfig.method,
|
||||
url: api.url + "?brokerId=" + this.id,
|
||||
method: api.method,
|
||||
}).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code != 0) {
|
||||
@@ -126,9 +134,12 @@ export default {
|
||||
deleteBrokerConfig(record) {
|
||||
this.selectData = record;
|
||||
this.loading = true;
|
||||
const api = this.isLoggerConfig
|
||||
? KafkaConfigApi.deleteBrokerLoggerConfig
|
||||
: KafkaConfigApi.deleteBrokerConfig;
|
||||
request({
|
||||
url: KafkaConfigApi.deleteBrokerConfig.url,
|
||||
method: KafkaConfigApi.deleteBrokerConfig.method,
|
||||
url: api.url,
|
||||
method: api.method,
|
||||
data: {
|
||||
name: record.name,
|
||||
value: record.value,
|
||||
|
||||
@@ -18,15 +18,23 @@
|
||||
size="small"
|
||||
href="javascript:;"
|
||||
class="operation-btn"
|
||||
@click="openBrokerConfigDialog(record)"
|
||||
@click="openBrokerConfigDialog(record, false)"
|
||||
>属性配置
|
||||
</a-button>
|
||||
<a-button
|
||||
size="small"
|
||||
href="javascript:;"
|
||||
class="operation-btn"
|
||||
@click="openBrokerConfigDialog(record, true)"
|
||||
>日志配置
|
||||
</a-button>
|
||||
</div>
|
||||
</a-table>
|
||||
</div>
|
||||
<BrokerConfig
|
||||
:visible="showBrokerConfigDialog"
|
||||
:id="this.select.idString"
|
||||
:is-logger-config="isLoggerConfig"
|
||||
@closeBrokerConfigDialog="closeBrokerConfigDialog"
|
||||
></BrokerConfig>
|
||||
</a-spin>
|
||||
@@ -49,6 +57,7 @@ export default {
|
||||
clusterId: "",
|
||||
showBrokerConfigDialog: false,
|
||||
select: {},
|
||||
isLoggerConfig: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -63,9 +72,10 @@ export default {
|
||||
this.clusterId = res.data.clusterId;
|
||||
});
|
||||
},
|
||||
openBrokerConfigDialog(record) {
|
||||
openBrokerConfigDialog(record, isLoggerConfig) {
|
||||
this.select = record;
|
||||
this.showBrokerConfigDialog = true;
|
||||
this.isLoggerConfig = isLoggerConfig;
|
||||
},
|
||||
closeBrokerConfigDialog() {
|
||||
this.showBrokerConfigDialog = false;
|
||||
|
||||
@@ -67,6 +67,10 @@ export default {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
isLoggerConfig: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -87,9 +91,12 @@ export default {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.loading = true;
|
||||
const api = this.isLoggerConfig
|
||||
? KafkaConfigApi.setBrokerLoggerConfig
|
||||
: KafkaConfigApi.setBrokerConfig;
|
||||
request({
|
||||
url: KafkaConfigApi.setBrokerConfig.url,
|
||||
method: KafkaConfigApi.setBrokerConfig.method,
|
||||
url: api.url,
|
||||
method: api.method,
|
||||
data: Object.assign({ entity: this.brokerId }, values),
|
||||
}).then((res) => {
|
||||
this.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user