move default service types list to types

This commit is contained in:
Westly Wright 2020-05-14 10:14:42 -07:00
parent d881603d95
commit 435c4204c1
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
3 changed files with 25 additions and 24 deletions

View File

@ -1,6 +1,5 @@
<script>
import { isEmpty } from 'lodash';
// import { escapeHtml } from '@/utils/string';
export default {
props: {

View File

@ -1,26 +1,5 @@
<script>
export const DEFAULT_SERVICE_TYPES = [
{
id: 'ClusterIP',
translationLabel: 'serviceTypes.clusterip'
},
{
id: 'ExternalName',
translationLabel: 'serviceTypes.externalname'
},
{
id: 'Headless',
translationLabel: 'serviceTypes.headless'
},
{
id: 'LoadBalancer',
translationLabel: 'serviceTypes.loadbalancer'
},
{
id: 'NodePort',
translationLabel: 'serviceTypes.nodeport'
},
];
import { DEFAULT_SERVICE_TYPES } from '@/config/types';
export default {
props: {
@ -34,7 +13,7 @@ export default {
const { translationLabel } = match;
let translated;
if (translationLabel) {
if (translationLabel && this.$store.getters['i18n/exists'](translationLabel)) {
translated = this.$store.getters['i18n/t'](translationLabel);
} else {
translated = this.value;

View File

@ -133,3 +133,26 @@ global:
};
export const SYSTEM_PROJECT_LABEL = 'authz.management.cattle.io/system-project';
export const DEFAULT_SERVICE_TYPES = [
{
id: 'ClusterIP',
translationLabel: 'serviceTypes.clusterip'
},
{
id: 'ExternalName',
translationLabel: 'serviceTypes.externalname'
},
{
id: 'Headless',
translationLabel: 'serviceTypes.headless'
},
{
id: 'LoadBalancer',
translationLabel: 'serviceTypes.loadbalancer'
},
{
id: 'NodePort',
translationLabel: 'serviceTypes.nodeport'
},
];