fleet/frontend/__mocks__/hostMock.ts

78 lines
1.9 KiB
TypeScript
Raw Normal View History

import { IHost } from "interfaces/host";
const DEFAULT_HOST_MOCK: IHost = {
id: 1,
created_at: "2022-01-01T12:00:00Z",
updated_at: "2022-01-02T12:00:00Z",
detail_updated_at: "2022-01-02T12:00:00Z",
label_updated_at: "2022-01-02T12:00:00Z",
policy_updated_at: "2022-01-02T12:00:00Z",
last_enrolled_at: "2022-01-02T12:00:00Z",
seen_time: "2022-04-06T02:11:41Z",
refetch_requested: false,
hostname: "9b20fc72a247",
display_name: "9b20fc72a247",
display_text: "mock host 1",
uuid: "09b244f8-0000-0000-b5cc-791a15f11073",
platform: "ubuntu",
osquery_version: "4.9.0",
os_version: "Ubuntu 18.4.0",
build: "",
platform_like: "debian",
code_name: "",
uptime: 281037000000000,
memory: 6232231936,
cpu_type: "x86_64",
cpu_subtype: "158",
cpu_brand: "Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz",
cpu_physical_cores: 8,
cpu_logical_cores: 8,
hardware_vendor: "",
hardware_model: "",
hardware_version: "",
hardware_serial: "",
computer_name: "9b20fc72a247",
mdm: {
encryption_key_available: false,
enrollment_status: "Off",
server_url: "https://www.example.com/1",
profiles: [],
macos_settings: {
disk_encryption: null,
action_required: null,
},
UI for bootstrap package flows (#11288) relates to #10935 This is the UI for all the flows around adding, removing, downloading, and viewing information about a bootstrap package for fleet mdm. This is pretty comprehensive but includes: ### Backend **Update `Get host/id`** to include bootstrap package name ```json { "macos_setup": { ... "bootstrap_package_name": "test.pkg" } } ``` ### Frontend **UI for ABM not being set up**: ![image](https://user-images.githubusercontent.com/1153709/234018772-3221e27b-50a4-454e-8e9f-b62c9d349010.png) **UIs for uploading, downloading, and deleting bootstrap package**: ![image](https://user-images.githubusercontent.com/1153709/234017915-871f252f-bf80-4282-9acf-5ebea12c6efa.png) ![image](https://user-images.githubusercontent.com/1153709/234018029-322a5f30-dd22-44e3-b9ae-a4af7acb68b4.png) ![image](https://user-images.githubusercontent.com/1153709/234018163-4b84a2ce-a064-4952-a63d-0c8307391052.png) **UIs for seeing bootstrap status aggregate data** ![image](https://user-images.githubusercontent.com/1153709/234018107-455d63ab-5b2c-4727-ad20-eef6b269c336.png) **UIs for filtering hosts by bootstrap status** ![image](https://user-images.githubusercontent.com/1153709/234018334-170fe93a-700e-48eb-b198-2a1cc54d31a7.png) **UIs for seeing package status on host details and my device page**: ![image](https://user-images.githubusercontent.com/1153709/234018488-7b515db4-1248-4be7-8de3-9b74bb5d4795.png) ![image](https://user-images.githubusercontent.com/1153709/234018525-d653cb2d-9ef9-437e-8eba-141e557f4f39.png) - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Roberto Dip <dip.jesusr@gmail.com> Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com> Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2023-04-27 15:10:41 +00:00
macos_setup: {
bootstrap_package_status: "",
details: "",
bootstrap_package_name: "",
},
},
public_ip: "",
primary_ip: "172.23.0.3",
primary_mac: "02:42:ac:17:00:03",
distributed_interval: 10,
config_tls_refresh: 10,
logger_tls_period: 10,
team_id: null,
pack_stats: null,
team_name: null,
gigs_disk_space_available: 100.0,
percent_disk_space_available: 50,
issues: {
total_issues_count: 0,
failing_policies_count: 0,
},
status: "offline",
labels: [],
packs: [],
software: [],
users: [],
policies: [],
};
const createMockHost = (overrides?: Partial<IHost>): IHost => {
return { ...DEFAULT_HOST_MOCK, ...overrides };
};
export default createMockHost;