Merge "fix: Fix flavor show for which ram < 1 GB"

This commit is contained in:
Zuul 2021-09-29 10:05:22 +00:00 committed by Gerrit Code Review
commit c6118d915e
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import Base from 'containers/TabDetail';
import { flavorCategoryList, flavorArchitectures } from 'resources/flavor';
import Members from 'pages/compute/containers/Instance';
import { emptyActionConfig } from 'utils/constants';
import { formatSize } from 'utils';
import actionConfigs from '../actions';
import BaseDetail from './BaseDetail';
@ -63,7 +64,7 @@ export class Detail extends Base {
title: t('Memory'),
dataIndex: 'ram',
isHideable: true,
render: (ram) => `${Number.parseInt(ram / 1024, 10)}G`,
render: (ram) => formatSize(ram, 2),
},
{
title: t('Public'),

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { formatSize } from 'utils';
export const cpuPolicyList = {
dedicated: t('Dedicated'),
shared: t('Shared'),
@ -151,7 +153,7 @@ export const getBaseColumns = (self) => [
title: t('Memory'),
dataIndex: 'ram',
isHideable: true,
render: (ram) => `${Number.parseInt(ram / 1024, 10)}G`,
render: (ram) => formatSize(ram, 2),
},
{
title: t('Internal Network Bandwidth(Gbps)'),