2018-04-06 11:02:18 +00:00
|
|
|
import { Action } from '@ngrx/store';
|
|
|
|
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCClientError } from '@loafer/ng-rpc';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
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-05-02 07:23:35 +00:00
|
|
|
} from '@overflow/commons-typescript/model/discovery';
|
|
|
|
import { Probe } from '@overflow/commons-typescript/model/probe';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
;
|