mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Add disk_info table to chromeos (#12344)
This commit is contained in:
parent
044935b02f
commit
519982990c
@ -4,6 +4,7 @@ import * as SQLite from "wa-sqlite";
|
||||
// Alphabetical order
|
||||
import Table from "./tables/Table";
|
||||
import TableChromeExtensions from "./tables/chrome_extensions";
|
||||
import TableDiskInfo from "./tables/disk_info";
|
||||
import TableGeolocation from "./tables/geolocation";
|
||||
import TableNetworkInterfaces from "./tables/network_interfaces";
|
||||
import TableOsqueryInfo from "./tables/osquery_info";
|
||||
@ -28,6 +29,7 @@ export default class VirtualDatabase {
|
||||
db,
|
||||
new TableChromeExtensions(sqlite3, db)
|
||||
);
|
||||
VirtualDatabase.register(sqlite3, db, new TableDiskInfo(sqlite3, db));
|
||||
VirtualDatabase.register(sqlite3, db, new TableGeolocation(sqlite3, db));
|
||||
VirtualDatabase.register(
|
||||
sqlite3,
|
||||
|
20
ee/fleetd-chrome/src/tables/disk_info.ts
Normal file
20
ee/fleetd-chrome/src/tables/disk_info.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import Table from "./Table";
|
||||
|
||||
export default class TableDiskInfo extends Table {
|
||||
name = "disk_info";
|
||||
columns = ["capacity", "id", "name", "type"];
|
||||
|
||||
async generate() {
|
||||
let rows = [];
|
||||
const disks = (await chrome.system.storage.getInfo()) as chrome.system.storage.StorageUnitInfo[];
|
||||
for (let d of disks) {
|
||||
rows.push({
|
||||
capacity: d.capacity,
|
||||
id: d.id,
|
||||
name: d.name,
|
||||
type: d.type,
|
||||
});
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
48
schema/tables/disk_info.yml
Normal file
48
schema/tables/disk_info.yml
Normal file
@ -0,0 +1,48 @@
|
||||
name: disk_info
|
||||
platforms:
|
||||
- windows
|
||||
- chrome
|
||||
description: Retrieve basic information about the physical disks of a system.
|
||||
examples: >-
|
||||
```
|
||||
SELECT * FROM disk_info;
|
||||
```
|
||||
columns:
|
||||
- name: disk_size
|
||||
type: bigint
|
||||
description: Size of the disk.
|
||||
required: false
|
||||
- name: id
|
||||
type: text
|
||||
description: The unique identifier of the drive on the system.
|
||||
required: false
|
||||
- name: name
|
||||
type: text
|
||||
description: The label of the disk object.
|
||||
required: false
|
||||
- name: type
|
||||
type: text
|
||||
description: The interface type of the disk.
|
||||
required: false
|
||||
- name: partitions
|
||||
platforms:
|
||||
- windows
|
||||
- name: disk_index
|
||||
platforms:
|
||||
- windows
|
||||
- name: pnp_device_id
|
||||
platforms:
|
||||
- windows
|
||||
- name: manufacturer
|
||||
platforms:
|
||||
- windows
|
||||
- name: hardware_model
|
||||
platforms:
|
||||
- windows
|
||||
- name: serial
|
||||
platforms:
|
||||
- windows
|
||||
- name: description
|
||||
platforms:
|
||||
- windows
|
||||
evented: false
|
Loading…
Reference in New Issue
Block a user