Skip to content

Commit a3e1382

Browse files
committed
web: Update and relocate system.ts types definition
1 parent def09e7 commit a3e1382

File tree

2 files changed

+60
-27
lines changed

2 files changed

+60
-27
lines changed
Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,7 @@
55
* and run json-schema-to-typescript to regenerate this file.
66
*/
77

8-
export type FilesystemType =
9-
| "bcachefs"
10-
| "btrfs"
11-
| "exfat"
12-
| "ext2"
13-
| "ext3"
14-
| "ext4"
15-
| "f2fs"
16-
| "jfs"
17-
| "nfs"
18-
| "nilfs2"
19-
| "ntfs"
20-
| "reiserfs"
21-
| "swap"
22-
| "tmpfs"
23-
| "vfat"
24-
| "xfs";
258
export type MDLevel = "raid0" | "raid1" | "raid5" | "raid6" | "raid10";
26-
export type PtableType = "gpt" | "msdos" | "dasd";
279

2810
/**
2911
* API description of the system
@@ -32,7 +14,7 @@ export interface System {
3214
/**
3315
* All relevant devices on the system
3416
*/
35-
devices?: Device[];
17+
devices?: StorageDevice[];
3618
/**
3719
* SIDs of the available drives
3820
*/
@@ -63,7 +45,10 @@ export interface System {
6345
volumeTemplates?: Volume[];
6446
issues?: Issue[];
6547
}
66-
export interface Device {
48+
/**
49+
* Schema to describe a device both in 'system' and 'proposal'.
50+
*/
51+
export interface StorageDevice {
6752
sid: number;
6853
name: string;
6954
description?: string;
@@ -74,9 +59,9 @@ export interface Device {
7459
multipath?: Multipath;
7560
partitionTable?: PartitionTable;
7661
partition?: Partition;
77-
partitions?: Device[];
62+
partitions?: StorageDevice[];
7863
volumeGroup?: VolumeGroup;
79-
logicalVolumes?: Device[];
64+
logicalVolumes?: StorageDevice[];
8065
}
8166
export interface Block {
8267
start: number;
@@ -110,7 +95,23 @@ export interface DriveInfo {
11095
}
11196
export interface Filesystem {
11297
sid: number;
113-
type: FilesystemType;
98+
type:
99+
| "bcachefs"
100+
| "btrfs"
101+
| "exfat"
102+
| "ext2"
103+
| "ext3"
104+
| "ext4"
105+
| "f2fs"
106+
| "jfs"
107+
| "nfs"
108+
| "nilfs2"
109+
| "ntfs"
110+
| "reiserfs"
111+
| "swap"
112+
| "tmpfs"
113+
| "vfat"
114+
| "xfs";
114115
mountPath?: string;
115116
label?: string;
116117
}
@@ -123,7 +124,7 @@ export interface Multipath {
123124
wireNames: string[];
124125
}
125126
export interface PartitionTable {
126-
type: PtableType;
127+
type: "gpt" | "msdos" | "dasd";
127128
unusedSlots: number[][];
128129
}
129130
export interface Partition {
@@ -136,7 +137,23 @@ export interface VolumeGroup {
136137
export interface Volume {
137138
mountPath: string;
138139
mountOptions?: string[];
139-
fsType?: FilesystemType;
140+
fsType?:
141+
| "bcachefs"
142+
| "btrfs"
143+
| "exfat"
144+
| "ext2"
145+
| "ext3"
146+
| "ext4"
147+
| "f2fs"
148+
| "jfs"
149+
| "nfs"
150+
| "nilfs2"
151+
| "ntfs"
152+
| "reiserfs"
153+
| "swap"
154+
| "tmpfs"
155+
| "vfat"
156+
| "xfs";
140157
autoSize: boolean;
141158
minSize: number;
142159
maxSize?: number;
@@ -147,7 +164,24 @@ export interface Volume {
147164
export interface VolumeOutline {
148165
required: boolean;
149166
supportAutoSize: boolean;
150-
fsTypes?: FilesystemType[];
167+
fsTypes?: (
168+
| "bcachefs"
169+
| "btrfs"
170+
| "exfat"
171+
| "ext2"
172+
| "ext3"
173+
| "ext4"
174+
| "f2fs"
175+
| "jfs"
176+
| "nfs"
177+
| "nilfs2"
178+
| "ntfs"
179+
| "reiserfs"
180+
| "swap"
181+
| "tmpfs"
182+
| "vfat"
183+
| "xfs"
184+
)[];
151185
adjustByRam?: boolean;
152186
snapshotsConfigurable?: boolean;
153187
snapshotsAffectSizes?: boolean;

web/src/api/storage/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@
2323
export * from "./types/openapi";
2424
export * as config from "./types/config";
2525
export * as apiModel from "./types/model";
26-
export * as system from "./types/system";

0 commit comments

Comments
 (0)