Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6123 from gnehapk/disk-list
Added disk list for BM/Attached devices OCS install
- Loading branch information
Showing
12 changed files
with
266 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...e-plugin/src/components/ocs-install/attached-devices/create-sc/wizard-pages/disk-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import * as React from 'react'; | ||
import * as cx from 'classnames'; | ||
import { Table, TableRow, TableData, RowFunction } from '@console/internal/components/factory'; | ||
import { sortable, SortByDirection } from '@patternfly/react-table'; | ||
import { Button, Modal } from '@patternfly/react-core'; | ||
import { humanizeBinaryBytes } from '@console/internal/components/utils'; | ||
import { Discoveries, State, Action } from '../state'; | ||
|
||
const tableColumnClasses = [ | ||
'', | ||
'', | ||
cx('pf-m-hidden', 'pf-m-visible-on-xl'), | ||
cx('pf-m-hidden', 'pf-m-visible-on-2xl'), | ||
cx('pf-m-hidden', 'pf-m-visible-on-lg'), | ||
]; | ||
|
||
export const DiskHeader = () => { | ||
return [ | ||
{ | ||
title: 'Name', | ||
sortField: 'path', | ||
transforms: [sortable], | ||
props: { className: tableColumnClasses[0] }, | ||
}, | ||
{ | ||
title: 'Node', | ||
sortField: 'node', | ||
transforms: [sortable], | ||
props: { className: tableColumnClasses[1] }, | ||
}, | ||
{ | ||
title: 'Type', | ||
sortField: 'type', | ||
transforms: [sortable], | ||
props: { className: tableColumnClasses[2] }, | ||
}, | ||
{ | ||
title: 'Model', | ||
sortField: 'model', | ||
transforms: [sortable], | ||
props: { className: tableColumnClasses[3] }, | ||
}, | ||
{ | ||
title: 'Capacity', | ||
sortField: 'size', | ||
transforms: [sortable], | ||
props: { className: tableColumnClasses[4] }, | ||
}, | ||
]; | ||
}; | ||
|
||
const DiskRow: RowFunction<Discoveries> = ({ obj, index, key, style }) => { | ||
return ( | ||
<TableRow id={obj.deviceID} index={index} trKey={key} style={style}> | ||
<TableData className={tableColumnClasses[0]}>{obj.path}</TableData> | ||
<TableData className={tableColumnClasses[1]}>{obj.node}</TableData> | ||
<TableData className={tableColumnClasses[2]}>{obj.type || '-'}</TableData> | ||
<TableData className={cx(tableColumnClasses[3], 'co-break-word')}> | ||
{obj.model || '-'} | ||
</TableData> | ||
<TableData className={tableColumnClasses[4]}> | ||
{humanizeBinaryBytes(obj.size).string || '-'} | ||
</TableData> | ||
</TableRow> | ||
); | ||
}; | ||
|
||
export const DiskListModal: React.FC<DiskListModalProps> = ({ state, dispatch }) => { | ||
const cancel = () => { | ||
dispatch({ type: 'setShowDiskList', value: false }); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
title="Selected Disks" | ||
isOpen={state.showDiskList} | ||
onClose={cancel} | ||
className="ceph-ocs-install__disks-modal" | ||
actions={[ | ||
<Button key="confirm" variant="primary" onClick={cancel}> | ||
Close | ||
</Button>, | ||
]} | ||
> | ||
<Table | ||
data={state.filteredDiscoveries} | ||
defaultSortField="node" | ||
defaultSortOrder={SortByDirection.asc} | ||
aria-label="Disk List" | ||
Header={DiskHeader} | ||
Row={DiskRow} | ||
loaded={!!state.filteredDiscoveries} | ||
virtualize | ||
/> | ||
</Modal> | ||
); | ||
}; | ||
|
||
type DiskListModalProps = { | ||
state: State; | ||
dispatch: React.Dispatch<Action>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
frontend/packages/local-storage-operator-plugin/src/components/auto-detect-volume/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { MatchExpression } from '@console/internal/module/k8s'; | ||
|
||
export type NodeAffinityTerm = { | ||
matchExpressions?: MatchExpression[]; | ||
}; |
Oops, something went wrong.