mirror of
https://github.com/harness/drone.git
synced 2025-05-13 23:50:47 +08:00
fix: [AH-492]: show size coming from BE in layers table (#2893)
* fix: [AH-492]: show size coming from BE in layers table
This commit is contained in:
parent
9227b297bb
commit
34bee25c56
@ -16,10 +16,12 @@
|
|||||||
|
|
||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
import { defaultTo } from 'lodash-es'
|
||||||
import type { Column } from 'react-table'
|
import type { Column } from 'react-table'
|
||||||
import { TableV2 } from '@harnessio/uicore'
|
import { TableV2 } from '@harnessio/uicore'
|
||||||
import type { DockerLayerEntry } from '@harnessio/react-har-service-client'
|
import type { DockerLayerEntry } from '@harnessio/react-har-service-client'
|
||||||
|
|
||||||
|
import { DEFAULT_LAYER_SIZE } from '@ar/pages/version-details/utils'
|
||||||
import { LayerActionCell, LayerCodeCell, LayerIndexCell, LayerSizeCell } from './LayersTableCells'
|
import { LayerActionCell, LayerCodeCell, LayerIndexCell, LayerSizeCell } from './LayersTableCells'
|
||||||
import css from './LayersTable.module.scss'
|
import css from './LayersTable.module.scss'
|
||||||
|
|
||||||
@ -56,7 +58,7 @@ export default function LayersTable(props: LayersTableProps): JSX.Element {
|
|||||||
return data.map((each, index) => ({
|
return data.map((each, index) => ({
|
||||||
id: index + 1,
|
id: index + 1,
|
||||||
code: each.command,
|
code: each.command,
|
||||||
size: '0 B'
|
size: defaultTo(each.size, DEFAULT_LAYER_SIZE)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export const DEFAULT_LAYER_SIZE = '0 B'
|
||||||
|
|
||||||
export function prettifyManifestJSON(manifest: string): string {
|
export function prettifyManifestJSON(manifest: string): string {
|
||||||
try {
|
try {
|
||||||
return JSON.stringify(JSON.parse(manifest), null, 2)
|
return JSON.stringify(JSON.parse(manifest), null, 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user