feat bugfix

This commit is contained in:
eilenexuzhe
2020-06-05 18:03:16 +08:00
parent e82437a2db
commit 8ef549de80
6 changed files with 45 additions and 18 deletions

View File

@@ -35,6 +35,7 @@ export interface IBrokerPartition extends IBroker {
leaderCount: number;
partitionCount: number;
notUnderReplicatedPartitionCount: number;
underReplicatedPartitionCount?: number;
regionName: string;
bytesInPerSec: number;
}
@@ -74,6 +75,9 @@ interface IBrokerOption {
}
class Broker {
@observable
public loading: boolean = false;
@observable
public brokerBaseInfo: IBrokerBaseInfo = {} as IBrokerBaseInfo;
@@ -119,6 +123,11 @@ class Broker {
@observable
public BrokerOptions: IValueLabel[] = [{ value: null, label: '请选择Broker' }];
@action.bound
public setLoading(value: boolean) {
this.loading = value;
}
@action.bound
public setBrokerBaseInfo(data: IBrokerBaseInfo) {
data.startTime = moment(data.startTime).format('YYYY-MM-DD HH:mm:ss'),
@@ -216,7 +225,8 @@ class Broker {
}
public getBrokerList(clusterId: number) {
getBrokerList(clusterId).then(this.setBrokerList);
this.setLoading(true);
getBrokerList(clusterId).then(this.setBrokerList).finally(() => this.setLoading(false));
}
public getBrokerNetwork(clusterId: number) {
@@ -224,7 +234,8 @@ class Broker {
}
public getBrokerPartition(clusterId: number) {
getBrokerPartition(clusterId).then(this.setBrokerPartition);
this.setLoading(true);
getBrokerPartition(clusterId).then(this.setBrokerPartition).finally(() => this.setLoading(false));
}
public getOneBrokerNetwork(clusterId: number, brokerId: number) {

View File

@@ -17,7 +17,7 @@ export class Users {
@action.bound
public setUserData(data: []) {
this.userData = data.map((d: any) => {
d.role = this.roleMap[d.role];
d.roleName = this.roleMap[d.role];
return d;
});
}