2022-02-14 22:11:12 +00:00
|
|
|
import PropTypes from "prop-types";
|
2016-11-17 17:12:41 +00:00
|
|
|
|
|
|
|
|
export default PropTypes.shape({
|
2021-07-27 22:04:43 +00:00
|
|
|
created_at: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
updated_at: PropTypes.string,
|
2017-01-16 20:59:01 +00:00
|
|
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
2021-07-27 22:04:43 +00:00
|
|
|
name: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
query: PropTypes.string,
|
2021-07-27 22:04:43 +00:00
|
|
|
label_type: PropTypes.string,
|
2021-08-16 14:30:19 +00:00
|
|
|
label_membership_type: PropTypes.string,
|
|
|
|
|
hosts_count: PropTypes.number,
|
|
|
|
|
display_text: PropTypes.string,
|
|
|
|
|
count: PropTypes.number, // seems to be a repeat of hosts_count issue #1618
|
|
|
|
|
host_ids: PropTypes.arrayOf(PropTypes.number),
|
2016-11-17 17:12:41 +00:00
|
|
|
});
|
2021-03-03 16:51:39 +00:00
|
|
|
|
2022-06-10 18:29:45 +00:00
|
|
|
export interface ILabelSummary {
|
2021-03-03 16:51:39 +00:00
|
|
|
id: number | string;
|
2021-07-27 22:04:43 +00:00
|
|
|
name: string;
|
2021-09-30 19:32:06 +00:00
|
|
|
description?: string;
|
2021-09-01 01:02:23 +00:00
|
|
|
label_type: "regular" | "builtin";
|
2022-06-10 18:29:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ILabel extends ILabelSummary {
|
|
|
|
|
created_at: string;
|
|
|
|
|
updated_at: string;
|
|
|
|
|
uuid?: string;
|
|
|
|
|
query: string;
|
2021-08-16 14:30:19 +00:00
|
|
|
label_membership_type: string;
|
|
|
|
|
hosts_count: number;
|
|
|
|
|
display_text: string;
|
|
|
|
|
count: number; // seems to be a repeat of hosts_count issue #1618
|
|
|
|
|
host_ids: number[] | null;
|
2022-02-14 22:11:12 +00:00
|
|
|
type?: "custom" | "platform" | "status" | "all";
|
2021-09-30 19:32:06 +00:00
|
|
|
slug?: string; // e.g., "labels/13" | "online"
|
|
|
|
|
target_type?: string; // e.g., "labels"
|
|
|
|
|
platform: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ILabelFormData {
|
|
|
|
|
name: string;
|
|
|
|
|
query: string;
|
|
|
|
|
description: string;
|
|
|
|
|
platform: string;
|
2021-03-03 16:51:39 +00:00
|
|
|
}
|