import i18n from '@/locales'
import router from '@/router'
export const getTypeTableColumn = () => {
return {
field: 'type',
title: i18n.t('k8s.text_34'),
slots: {
default: ({ row }, h) => {
const typeMap = {
common: i18n.t('k8s.repo.type.common'),
custom: i18n.t('k8s.repo.type.custom'),
harbor: 'Harbor',
}
return typeMap[row.type] || row.type
},
},
}
}
export const getCredentialTableColumn = () => {
return {
field: 'credential_id',
title: i18n.t('k8s.repo.credential'),
minWidth: 100,
slots: {
default: ({ row }, h) => {
if (row.credential_id) {
return [ router.push(`/credentials/?type=container_image&id=${row.credential_id}`)}>{row.credential_id}]
}
return [{i18n.t('k8s.repo.credential.none')}]
},
},
}
}
export const getUrlTableColumn = () => {
return {
field: 'url',
title: i18n.t('k8s.repo.url'),
minWidth: 240,
slots: {
default: ({ row }, h) => {
return [
{row.url}
,
]
},
},
}
}