| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // import { chargeTypeColumn } from '../utils'
- import {
- getEnabledTableColumn,
- getNameDescriptionTableColumn,
- getStatusTableColumn,
- getBrandTableColumn,
- getRegionTableColumn,
- getTimeTableColumn,
- } from '@/utils/common/tableColumn'
- import { sizestr } from '@/utils/utils'
- import i18n from '@/locales'
- export default {
- computed: {
- columns () {
- const columns = [
- getNameDescriptionTableColumn({
- onManager: this.onManager,
- hideField: true,
- edit: false,
- slotCallback: row => {
- return (
- <side-page-trigger onTrigger={ () => this.handleOpenSidepage(row) }>{ row.name }</side-page-trigger>
- )
- },
- }),
- getStatusTableColumn({ title: i18n.t('compute.sku.prepaid_status'), field: 'prepaid_status', statusModule: 'sku' }),
- getStatusTableColumn({ title: i18n.t('compute.sku.postpaid_status'), field: 'postpaid_status', statusModule: 'sku' }),
- {
- field: 'cpu_core_count',
- title: i18n.t('compute.text_1051'),
- width: 100,
- formatter: ({ cellValue }) => {
- return cellValue + i18n.t('compute.text_167')
- },
- },
- {
- field: 'memory_size_mb',
- title: i18n.t('compute.text_1052'),
- width: 100,
- formatter: ({ cellValue }) => {
- return sizestr(cellValue, 'M', 1024)
- },
- },
- {
- field: 'total_guest_count',
- title: this.$t('compute.text_699', [this.$t('dictionary.server')]),
- width: 120,
- slots: {
- default: ({ row }) => {
- if (row.total_guest_count === undefined) return [<data-loading />]
- if (row.total_guest_count <= 0) return row.total_guest_count
- const options = { cloudEnv: this.cloudEnv }
- return [<side-page-trigger name='SkuSidePage' id={row.id} tab='vminstance-list' vm={this} options={ options }>{ row.total_guest_count }</side-page-trigger>]
- },
- },
- },
- getEnabledTableColumn(),
- getBrandTableColumn({ field: 'provider' }),
- getTimeTableColumn(),
- ]
- if (this.cloudEnv === 'public') {
- columns.push(
- getRegionTableColumn(),
- // chargeTypeColumn(),
- )
- }
- return columns
- },
- },
- }
|