X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0c9db5b63420bab25e970c75dfd9169b9c7db139..f8207f94af84bfab4f506a8fa4229f8bcb926ae8:/services/workbench2/src/views/instance-types-panel/instance-types-panel.tsx diff --git a/services/workbench2/src/views/instance-types-panel/instance-types-panel.tsx b/services/workbench2/src/views/instance-types-panel/instance-types-panel.tsx index 006a119797..0aa287e24e 100644 --- a/services/workbench2/src/views/instance-types-panel/instance-types-panel.tsx +++ b/services/workbench2/src/views/instance-types-panel/instance-types-panel.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Typography, Grid } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; -import { InstanceTypeIcon } from 'components/icon/icon'; +import { ResourceIcon } from 'components/icon/icon'; import { RootState } from 'store/store'; import { connect } from 'react-redux'; import { ClusterConfigJSON } from 'common/config'; @@ -41,7 +41,16 @@ export const InstanceTypesPanel = withStyles(styles)(connect(mapStateToProps)( {Object.keys(instances).length > 0 ? - Object.keys(instances).map((instanceKey) => { + Object.keys(instances).sort((a, b) => { + const typeA = instances[a]; + const typeB = instances[b]; + + if (typeA.Price !== typeB.Price) { + return typeA.Price - typeB.Price; + } else { + return typeA.ProviderType.localeCompare(typeB.ProviderType); + } + }).map((instanceKey) => { const instanceType = instances[instanceKey]; const diskRequest = instanceType.IncludedScratch; const ramRequest = instanceType.RAM - config.Containers.ReserveExtraRAM; @@ -88,7 +97,7 @@ export const InstanceTypesPanel = withStyles(styles)(connect(mapStateToProps)( }) : }