fixed targetlist

This commit is contained in:
snoop 2017-08-30 11:42:18 +09:00
parent 0bf9d4c21e
commit 46f9d990f8
2 changed files with 15 additions and 6 deletions

View File

@ -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));

View File

@ -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);
}