mirror of https://github.com/rancher/dashboard.git
clean up
This commit is contained in:
parent
656d13af1b
commit
cdeb02a221
|
|
@ -12,12 +12,6 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'text',
|
default: 'text',
|
||||||
},
|
},
|
||||||
// if true, hide placeholder text until field is focused, then show until field has value
|
|
||||||
// If false, show placeholder text until field is focused
|
|
||||||
hidePlaceholder: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: _EDIT
|
default: _EDIT
|
||||||
|
|
@ -59,20 +53,12 @@ export default {
|
||||||
|
|
||||||
onFocus() {
|
onFocus() {
|
||||||
this.onFocusLabeled();
|
this.onFocusLabeled();
|
||||||
if (this.hidePlaceholder) {
|
this.actualPlaceholder = '';
|
||||||
this.actualPlaceholder = `${ this.placeholder }`;
|
|
||||||
} else {
|
|
||||||
this.actualPlaceholder = '';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onBlur() {
|
onBlur() {
|
||||||
this.onBlurLabeled();
|
this.onBlurLabeled();
|
||||||
if (this.hidePlaceholder) {
|
this.actualPlaceholder = `${ this.placeholder }`;
|
||||||
this.actualPlaceholder = null;
|
|
||||||
} else {
|
|
||||||
this.actualPlaceholder = `${ this.placeholder }`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,32 +16,14 @@ export const NODE_ROLES = {
|
||||||
ETCD: 'node-role.kubernetes.io/etcd',
|
ETCD: 'node-role.kubernetes.io/etcd',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO consult w/ backend about what labels & annotations to hide from editing
|
||||||
export const LABEL_PREFIX_TO_IGNORE = [
|
export const LABEL_PREFIX_TO_IGNORE = [
|
||||||
'io.cattle.lifecycle.',
|
|
||||||
'beta.kubernetes.io/',
|
|
||||||
'failure-domain.beta.kubernetes.io/',
|
|
||||||
'node-role.kubernetes.io/',
|
|
||||||
'kubernetes.io/',
|
|
||||||
'cattle.io/',
|
|
||||||
'authz.management.cattle.io',
|
|
||||||
'rke.cattle.io',
|
|
||||||
'field.cattle.io',
|
|
||||||
'workload.user.cattle.io/',
|
|
||||||
'k3s.io',
|
|
||||||
'node.kubernetes.io',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ANNOTATIONS_TO_IGNORE_CONTAINS = [
|
export const ANNOTATIONS_TO_IGNORE_CONTAINS = [
|
||||||
'coreos.com/',
|
|
||||||
'cattle.io/',
|
|
||||||
'k3s.io',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ANNOTATIONS_TO_IGNORE_PREFIX = [
|
export const ANNOTATIONS_TO_IGNORE_PREFIX = [
|
||||||
'kubernetes.io/',
|
DESCRIPTION
|
||||||
'beta.kubernetes.io/',
|
|
||||||
'node.alpha.kubernetes.io/',
|
|
||||||
'volumes.kubernetes.io/',
|
|
||||||
'k3s.io',
|
|
||||||
]
|
]
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,14 @@ import DetailTop from '@/components/DetailTop';
|
||||||
import SortableTable from '@/components/SortableTable';
|
import SortableTable from '@/components/SortableTable';
|
||||||
import { KEY, VALUE } from '@/config/table-headers';
|
import { KEY, VALUE } from '@/config/table-headers';
|
||||||
import { base64Decode } from '@/utils/crypto';
|
import { base64Decode } from '@/utils/crypto';
|
||||||
|
import CreateEditView from '@/mixins/create-edit-view';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DetailTop,
|
DetailTop,
|
||||||
SortableTable,
|
SortableTable,
|
||||||
},
|
},
|
||||||
|
mixins: [CreateEditView],
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -147,5 +150,29 @@ export default {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<Tabbed default-tab="labels">
|
||||||
|
<Tab name="labels" label="Labels">
|
||||||
|
<KeyValue
|
||||||
|
key="labels"
|
||||||
|
v-model="labels"
|
||||||
|
:mode="mode"
|
||||||
|
title="Labels"
|
||||||
|
:initial-empty-row="true"
|
||||||
|
:pad-left="false"
|
||||||
|
:read-allowed="false"
|
||||||
|
/>
|
||||||
|
</Tab>
|
||||||
|
<Tab name="annotations" label="Annotations">
|
||||||
|
<KeyValue
|
||||||
|
key="annotations"
|
||||||
|
v-model="annotations"
|
||||||
|
:mode="mode"
|
||||||
|
title="Annotations"
|
||||||
|
:initial-empty-row="true"
|
||||||
|
:pad-left="false"
|
||||||
|
:read-allowed="false"
|
||||||
|
/>
|
||||||
|
</Tab>
|
||||||
|
</Tabbed>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,7 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<NameNsDescription
|
<NameNsDescription
|
||||||
v-model="value.metadata"
|
v-model="value"
|
||||||
:description.sync="description"
|
|
||||||
:namespaced="false"
|
:namespaced="false"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
name-label="Name"
|
name-label="Name"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
NameNsDescription,
|
NameNsDescription,
|
||||||
Tabbed,
|
Tabbed,
|
||||||
Tab
|
Tab,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [CreateEditView],
|
mixins: [CreateEditView],
|
||||||
|
|
@ -61,7 +61,6 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
types,
|
types,
|
||||||
// type: this.value._type,
|
|
||||||
isNamespaced,
|
isNamespaced,
|
||||||
registryAddresses,
|
registryAddresses,
|
||||||
newNS: false,
|
newNS: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue