Files
KnowStreaming/console/src/store/controller.ts
zengqiao 229140f067 init
2020-03-19 17:59:34 +08:00

26 lines
511 B
TypeScript

import { observable, action } from 'mobx';
import { getController } from 'lib/api';
export interface IController {
brokerId: number;
controllerTimestamp: number;
controllerVersion: number;
host: string;
}
class Controller {
@observable
public data: IController[] = [];
@action.bound
public setData(data: IController[]) {
this.data = data;
}
public getController(clusterId: number) {
getController(clusterId).then(this.setData);
}
}
export const controller = new Controller();