mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import PropTypes from "prop-types";
|
|
import hostInterface, { IHost } from "interfaces/host";
|
|
import labelInterface, { ILabel, ILabelSummary } from "interfaces/label";
|
|
import teamInterface, { ITeam } from "interfaces/team";
|
|
|
|
export default PropTypes.oneOfType([
|
|
hostInterface,
|
|
labelInterface,
|
|
teamInterface,
|
|
]);
|
|
|
|
export type ITarget = IHost | ILabel | ITeam;
|
|
export interface ITargets {
|
|
hosts: IHost[];
|
|
labels: ILabel[];
|
|
teams: ITeam[];
|
|
}
|
|
|
|
export interface ITargetsAPIResponse {
|
|
targets: ITargets;
|
|
targets_count: number;
|
|
targets_missing_in_action: number;
|
|
targets_offline: number;
|
|
targets_online: number;
|
|
}
|
|
|
|
export interface ISelectHost extends IHost {
|
|
target_type?: string;
|
|
}
|
|
|
|
export interface ISelectLabel extends ILabelSummary {
|
|
target_type?: string;
|
|
}
|
|
|
|
export interface ISelectTeam extends ITeam {
|
|
target_type?: string;
|
|
}
|
|
|
|
export type ISelectTargetsEntity = ISelectHost | ISelectLabel | ISelectTeam;
|
|
|
|
export interface ISelectedTargets {
|
|
hosts: number[];
|
|
labels: number[];
|
|
teams: number[];
|
|
}
|
|
|
|
export interface IPackTargets {
|
|
host_ids: (number | string)[];
|
|
label_ids: (number | string)[];
|
|
team_ids: (number | string)[];
|
|
}
|