Skip to content

Commit 347d3d6

Browse files
committed
added smartstate poc to discover screen
1 parent 15ae20f commit 347d3d6

File tree

6 files changed

+35
-49
lines changed

6 files changed

+35
-49
lines changed

apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { ReportPieChart } from "./ReportPieChart";
3939
export const DiscoveryStep: React.FC = () => {
4040
const discoverSourcesContext = useDiscoverySources();
4141
const { inventory } = discoverSourcesContext.sourceSelected as Source;
42-
const { infra, vms } = inventory!;
42+
const { infra, vms, smartState } = inventory!;
4343
const {
4444
datastores,
4545
networks,
@@ -301,6 +301,24 @@ export const DiscoveryStep: React.FC = () => {
301301
],
302302
};
303303

304+
const smartStateViewData: TreeViewDataItem = {
305+
title: "Smart State POC",
306+
icon: <CogsIcon />,
307+
name: <>This is the collected Smart State data</>,
308+
id: "smarts",
309+
children: [
310+
{
311+
title: "Details",
312+
name: (
313+
<pre style={{ whiteSpace: "pre-wrap", wordBreak: "break-word", maxWidth: "100%" }}>
314+
{smartState ? JSON.stringify(smartState, null, 2) : "No data available"}
315+
</pre>
316+
),
317+
id: "os-details",
318+
},
319+
],
320+
};
321+
304322
const operatingSystemsViewData: TreeViewDataItem = {
305323
title: "Operating systems",
306324
icon: <CogsIcon />,
@@ -330,6 +348,7 @@ export const DiscoveryStep: React.FC = () => {
330348
networksViewData,
331349
storageViewData,
332350
operatingSystemsViewData,
351+
smartStateViewData,
333352
];
334353

335354
return (

apps/demo/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export default defineConfig((_env) => {
1313
server: {
1414
proxy: {
1515
"/planner/api": {
16-
target: "http://172.17.0.3:3443",
16+
target: "http://192.168.122.1:3443",
1717
changeOrigin: true,
1818
rewrite: (path): string => path.replace(/^\/planner/, ""),
1919
},
2020
"/agent/api/v1": {
21-
target: "http://172.17.0.3:3333",
21+
target: "http://192.168.122.1:3333",
2222
changeOrigin: true,
2323
rewrite: (path): string => path.replace(/^\/agent/, ""),
2424
},

openapitools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "7.8.0",
66
"generators": {
77
"api-client": {
8-
"inputSpec": "https://raw.githubusercontent.com/kubev2v/migration-planner/main/api/v1alpha1/openapi.yaml",
8+
"inputSpec": "https://raw.githubusercontent.com/kubev2v/migration-planner/41c138c994c82262aef827a322dbc480f5d840f2/api/v1alpha1/openapi.yaml",
99
"output": "packages/api-client",
1010
"generatorName": "typescript-fetch",
1111
"additionalProperties": {

packages/api-client/src/apis/SourceApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class SourceApi extends runtime.BaseAPI implements SourceApiInterface {
182182
* list sources
183183
*/
184184
async listSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Source>> {
185-
const response = await this.listSourcesRaw(initOverrides);
185+
const response = await this.listSourcesRaw(initOverrides);
186186
return await response.value();
187187
}
188188

packages/api-client/src/models/Inventory.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export interface Inventory {
5656
* @memberof Inventory
5757
*/
5858
infra: Infra;
59+
/**
60+
*
61+
* @type {Array<{ [key: string]: any; }>}
62+
* @memberof Inventory
63+
*/
64+
smartState?: Array<{ [key: string]: any; }>;
5965
}
6066

6167
/**
@@ -81,6 +87,7 @@ export function InventoryFromJSONTyped(json: any, ignoreDiscriminator: boolean):
8187
'vcenter': json['vcenter'],
8288
'vms': json['vms'],
8389
'infra': json['infra'],
90+
'smartState': json['smartState'] == null ? undefined : json['smartState'],
8491
};
8592
}
8693

@@ -93,6 +100,7 @@ export function InventoryToJSON(value?: Inventory | null): any {
93100
'vcenter': value['vcenter'],
94101
'vms': value['vms'],
95102
'infra': value['infra'],
103+
'smartState': value['smartState'],
96104
};
97105
}
98106

packages/api-client/src/models/Source.ts

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ export interface Source {
3838
* @memberof Source
3939
*/
4040
id: string;
41-
/**
42-
*
43-
* @type {string}
44-
* @memberof Source
45-
*/
46-
name: string;
47-
/**
48-
*
49-
* @type {string}
50-
* @memberof Source
51-
*/
52-
status: SourceStatusEnum;
53-
/**
54-
*
55-
* @type {string}
56-
* @memberof Source
57-
*/
58-
statusInfo: string;
5941
/**
6042
*
6143
* @type {Inventory}
@@ -79,7 +61,7 @@ export interface Source {
7961
* @type {string}
8062
* @memberof Source
8163
*/
82-
sshKey?: string;
64+
name?: string;
8365
/**
8466
*
8567
* @type {Array<SourceAgentItem>}
@@ -88,28 +70,11 @@ export interface Source {
8870
agents?: Array<SourceAgentItem>;
8971
}
9072

91-
92-
/**
93-
* @export
94-
*/
95-
export const SourceStatusEnum = {
96-
NotConnected: 'not-connected',
97-
WaitingForCredentials: 'waiting-for-credentials',
98-
Error: 'error',
99-
GatheringInitialInventory: 'gathering-initial-inventory',
100-
UpToDate: 'up-to-date'
101-
} as const;
102-
export type SourceStatusEnum = typeof SourceStatusEnum[keyof typeof SourceStatusEnum];
103-
104-
10573
/**
10674
* Check if a given object implements the Source interface.
10775
*/
10876
export function instanceOfSource(value: object): value is Source {
10977
if (!('id' in value) || value['id'] === undefined) return false;
110-
if (!('name' in value) || value['name'] === undefined) return false;
111-
if (!('status' in value) || value['status'] === undefined) return false;
112-
if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false;
11378
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
11479
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
11580
return true;
@@ -126,13 +91,10 @@ export function SourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): So
12691
return {
12792

12893
'id': json['id'],
129-
'name': json['name'],
130-
'status': json['status'],
131-
'statusInfo': json['statusInfo'],
13294
'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),
13395
'createdAt': (new Date(json['createdAt'])),
13496
'updatedAt': (new Date(json['updatedAt'])),
135-
'sshKey': json['sshKey'] == null ? undefined : json['sshKey'],
97+
'name': json['name'] == null ? undefined : json['name'],
13698
'agents': json['agents'] == null ? undefined : ((json['agents'] as Array<any>).map(SourceAgentItemFromJSON)),
13799
};
138100
}
@@ -144,13 +106,10 @@ export function SourceToJSON(value?: Source | null): any {
144106
return {
145107

146108
'id': value['id'],
147-
'name': value['name'],
148-
'status': value['status'],
149-
'statusInfo': value['statusInfo'],
150109
'inventory': InventoryToJSON(value['inventory']),
151110
'createdAt': ((value['createdAt']).toISOString()),
152111
'updatedAt': ((value['updatedAt']).toISOString()),
153-
'sshKey': value['sshKey'],
112+
'name': value['name'],
154113
'agents': value['agents'] == null ? undefined : ((value['agents'] as Array<any>).map(SourceAgentItemToJSON)),
155114
};
156115
}

0 commit comments

Comments
 (0)