fixed targetlist
This commit is contained in:
parent
0bf9d4c21e
commit
46f9d990f8
|
@ -18,7 +18,7 @@ import * as RegistActions from '../redux/action/regist';
|
|||
import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest';
|
||||
import * as targetListActions from '@overflow/target/redux/action/read_all_by_probe';
|
||||
import * as readActionType from '@overflow/infra/redux/action/read';
|
||||
|
||||
import PageParams from '@overflow/commons/api/model/PageParams';
|
||||
// FIXME::....
|
||||
|
||||
export function mapStateToProps(state: any, props: any): SensorConfigurationStateProps {
|
||||
|
@ -31,9 +31,11 @@ export function mapStateToProps(state: any, props: any): SensorConfigurationStat
|
|||
|
||||
export function mapDispatchToProps(dispatch: Dispatch<any>): SensorConfigurationDispatchProps {
|
||||
return {
|
||||
onReadAllTargetByDomain: (domain: Domain) => {
|
||||
dispatch(asyncRequestActions.request('InfraService', 'readAllByDomain',
|
||||
targetListActions.REQUEST, JSON.stringify(domain), '0', '10'));
|
||||
onReadAllTargetByDomain: (domain: Domain, pageParams: PageParams) => {
|
||||
// dispatch(asyncRequestActions.request('InfraService', 'readAllByDomain',
|
||||
// targetListActions.REQUEST, JSON.stringify(domain), '0', '10'));
|
||||
dispatch(asyncRequestActions.request('InfraService', 'readAllByDomain', targetListActions.REQUEST,
|
||||
JSON.stringify(domain), JSON.stringify(pageParams)));
|
||||
},
|
||||
onReadInfra: (infraId: number) => {
|
||||
dispatch(asyncRequestActions.request('InfraService', 'read', readActionType.REQUEST, infraId));
|
||||
|
|
|
@ -33,6 +33,7 @@ import SensorItemTree from '@overflow/meta/react/SensorItemTree';
|
|||
import CrawlerSelectorContainer from '@overflow/meta/react/CrawlerSelector';
|
||||
|
||||
import SensorConfigStepperContainer from '../SensorConfigStepper';
|
||||
import PageParams from '@overflow/commons/api/model/PageParams';
|
||||
|
||||
export interface SensorConfigurationStateProps {
|
||||
infraId?: number;
|
||||
|
@ -41,7 +42,7 @@ export interface SensorConfigurationStateProps {
|
|||
}
|
||||
|
||||
export interface SensorConfigurationDispatchProps {
|
||||
onReadAllTargetByDomain?(domain: Domain): void;
|
||||
onReadAllTargetByDomain?(domain: Domain, pageParams: PageParams): void;
|
||||
onReadInfra?(infraId: number): void;
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,13 @@ export class SensorConfiguration extends React.Component<SensorConfigurationProp
|
|||
|
||||
public componentWillMount(): void {
|
||||
if (this.props.infraId === undefined) {
|
||||
this.props.onReadAllTargetByDomain({ id: 1 });
|
||||
const pageParams: PageParams = {
|
||||
pageNo: '0',
|
||||
countPerPage: '999',
|
||||
sortCol: 'id',
|
||||
sortDirection: 'descending',
|
||||
};
|
||||
this.props.onReadAllTargetByDomain({ id: 1 }, pageParams);
|
||||
} else {
|
||||
this.props.onReadInfra(this.props.infraId);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user