2018-04-06 11:02:18 +00:00
|
|
|
import { Action } from '@ngrx/store';
|
|
|
|
|
|
|
|
import { RPCClientError } from '@loafer/ng-rpc/protocol';
|
|
|
|
|
|
|
|
import {
|
|
|
|
Zone,
|
|
|
|
Host,
|
|
|
|
Port,
|
|
|
|
Service,
|
2018-04-27 16:46:07 +00:00
|
|
|
DiscoverZone as MDDiscoverZone,
|
|
|
|
DiscoverHost as MDDiscoverHost,
|
|
|
|
DiscoverPort as MDDiscoverPort,
|
|
|
|
DiscoverService as MDiscoverService,
|
2018-04-06 11:02:18 +00:00
|
|
|
} from '../../model';
|
|
|
|
import { Probe } from 'packages/probe/model';
|
|
|
|
|
|
|
|
export enum ActionType {
|
|
|
|
SaveAllTarget = '[@@REGIST] TargetDiscoveryService.saveAllTarget',
|
|
|
|
SaveAllTargetSuccess = '[@@REGIST] TargetDiscoveryService.SaveAllTargetSuccess',
|
|
|
|
SaveAllTargetFailure = '[@@REGIST] TargetDiscoveryService.SaveAllTargetFailure',
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DiscoverySaveAllTarget implements Action {
|
|
|
|
readonly type = ActionType.SaveAllTarget;
|
|
|
|
|
|
|
|
constructor(public payload: {hosts: Host[], probe: Probe}) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DiscoverySaveAllTargetSuccess implements Action {
|
|
|
|
readonly type = ActionType.SaveAllTargetSuccess;
|
|
|
|
|
|
|
|
constructor(public payload: Boolean) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DiscoverySaveAllTargetFailure implements Action {
|
|
|
|
readonly type = ActionType.SaveAllTargetFailure;
|
|
|
|
|
|
|
|
constructor(public payload: RPCClientError) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Actions =
|
|
|
|
| DiscoverySaveAllTarget
|
|
|
|
| DiscoverySaveAllTargetSuccess
|
|
|
|
| DiscoverySaveAllTargetFailure
|
|
|
|
;
|