diff --git a/src/ts/@overflow/noauthprobe/react/NoauthProbeList.tsx b/src/ts/@overflow/noauthprobe/react/NoauthProbeList.tsx index a9901cf..38ad8b6 100644 --- a/src/ts/@overflow/noauthprobe/react/NoauthProbeList.tsx +++ b/src/ts/@overflow/noauthprobe/react/NoauthProbeList.tsx @@ -22,15 +22,15 @@ export function mapDispatchToProps(dispatch: Dispatch): NoAuthProbeListDisp onReadAllByDomain: (domain: Domain) => { dispatch(asyncRequestActions.request('NoAuthProbeService', 'readAllByDomain', noauthListActions.REQUEST, JSON.stringify(domain))); }, - acceptNoAuthProbe: (noauthProbes: NoAuthProbe[]) => { + acceptNoAuthProbe: (noauthProbe: NoAuthProbe) => { dispatch( asyncRequestActions.request( - 'NoAuthProbeService', 'acceptNoAuthProbes', acceptActions.REQUEST, JSON.stringify(noauthProbes))); + 'NoAuthProbeService', 'acceptNoAuthProbe', acceptActions.REQUEST, JSON.stringify(noauthProbe))); }, - denyNoAuthProbe: (noauthProbes: NoAuthProbe[]) => { + denyNoAuthProbe: (noauthProbe: NoAuthProbe) => { dispatch( asyncRequestActions.request( - 'NoAuthProbeService', 'denyNoauthProbes', denyActions.REQUEST, JSON.stringify(noauthProbes))); + 'NoAuthProbeService', 'denyNoauthProbe', denyActions.REQUEST, JSON.stringify(noauthProbe))); }, }; } diff --git a/src/ts/@overflow/noauthprobe/react/components/NoauthProbeList.tsx b/src/ts/@overflow/noauthprobe/react/components/NoauthProbeList.tsx index d8f3c8d..397f1eb 100644 --- a/src/ts/@overflow/noauthprobe/react/components/NoauthProbeList.tsx +++ b/src/ts/@overflow/noauthprobe/react/components/NoauthProbeList.tsx @@ -21,14 +21,14 @@ export interface StateProps { export interface DispatchProps { onReadAllByDomain?(domain: Domain): void; - acceptNoAuthProbe?(noauthProbe: NoAuthProbe[]): void; - denyNoAuthProbe?(noauthProbe: NoAuthProbe[]): void; + acceptNoAuthProbe?(noauthProbe: NoAuthProbe): void; + denyNoAuthProbe?(noauthProbe: NoAuthProbe): void; } export type Props = StateProps & DispatchProps; export interface State { - selected: NoAuthProbe[]; + selected: NoAuthProbe; modalVisible: boolean; actionDisabled: boolean; isDeny: boolean; @@ -37,17 +37,15 @@ export interface State { export class NoauthProbeList extends React.Component { private data: any; - private selectedIds: NoAuthProbe[]; constructor(props: Props, context: State) { super(props, context); this.state = { - selected: [], + selected: null, modalVisible: false, actionDisabled: true, isDeny: false, }; - this.selectedIds = new Array(); } public componentWillMount(): void { @@ -58,14 +56,14 @@ export class NoauthProbeList extends React.Component { } public handleSelect(probe: NoAuthProbe): void { - let idx = this.selectedIds.indexOf(probe); - if (idx === -1) { - this.selectedIds.push(probe); - } else { - this.selectedIds.splice(idx, 1); - } + // let idx = this.selectedIds.indexOf(probe); + // if (idx === -1) { + // this.selectedIds.push(probe); + // } else { + // this.selectedIds.splice(idx, 1); + // } this.setState({ - selected: this.selectedIds, + selected: probe, }); } @@ -73,18 +71,15 @@ export class NoauthProbeList extends React.Component { public handleSearch = (result: any[]): void => { } - public checkExist(probe: NoAuthProbe): boolean { - if (this.state.selected.indexOf(probe) === -1) { - return false; - } - return true; - } + // public checkExist(probe: NoAuthProbe): boolean { + // if (this.state.selected.indexOf(probe) === -1) { + // return false; + // } + // return true; + // } public handleActionDisable(): boolean { - if (this.state.selected === null || this.state.selected === undefined) { - return true; - } - if (this.state.selected.length === 0) { + if (this.state.selected === null) { return true; } return false; @@ -111,40 +106,19 @@ export class NoauthProbeList extends React.Component { } public handleRowActive(probe: NoAuthProbe): boolean { - if (this.state.selected.indexOf(probe) === -1) { - return false; + if (this.state.selected === probe) { + return true; } - return true; - } - public showList(): JSX.Element[] { - - let elem: Array = new Array(); - - this.state.selected.map((probe: NoAuthProbe, index: number) => { - - let map: any = JSON.parse(probe.description); - - elem.push( -
- {map.network.address} -
, - ); - }); - - return elem; + return false; } public render(): JSX.Element { let noauth = - +
- No. - {/*Host IP - Host Mac - Host Name*/} Description Created At API Key @@ -171,7 +145,6 @@ export class NoauthProbeList extends React.Component {
Are you sure? - {this.showList()}