mirror of https://github.com/rancher/dashboard.git
Set container to be the default tab in workload screens. (#6955)
* Set container to be the default tab in workload screens. #6644
This commit is contained in:
parent
d7659cc3c4
commit
cbfaaf7a3c
|
|
@ -148,7 +148,6 @@ export default {
|
|||
},
|
||||
|
||||
data() {
|
||||
let defaultTab;
|
||||
let type = this.$route.params.resource;
|
||||
const createSidecar = !!this.$route.query.sidecar;
|
||||
const isInitContainer = !!this.$route.query.init;
|
||||
|
|
@ -165,18 +164,12 @@ export default {
|
|||
name: `container-0`,
|
||||
}];
|
||||
|
||||
defaultTab = 'container-0';
|
||||
|
||||
const podSpec = { template: { spec: { containers: podContainers, initContainers: [] } } };
|
||||
|
||||
this.$set(this.value, 'spec', podSpec);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mode === _CREATE) {
|
||||
defaultTab = 'container-0';
|
||||
}
|
||||
|
||||
if ((this.mode === _EDIT || this.mode === _VIEW ) && this.value.type === 'pod' ) {
|
||||
const podSpec = { ...this.value.spec };
|
||||
|
||||
|
|
@ -214,7 +207,6 @@ export default {
|
|||
imagePullPolicy: 'Always',
|
||||
name: `container-${ allContainers.length }`,
|
||||
});
|
||||
defaultTab = 'container-0';
|
||||
|
||||
containers = podTemplateSpec.initContainers;
|
||||
}
|
||||
|
|
@ -224,8 +216,6 @@ export default {
|
|||
name: `container-${ allContainers.length }`,
|
||||
};
|
||||
|
||||
defaultTab = 'container-0';
|
||||
|
||||
containers.push(container);
|
||||
} else {
|
||||
container = containers[0];
|
||||
|
|
@ -261,7 +251,6 @@ export default {
|
|||
path: 'image', rootObject: this.container, rules: ['required'], translationKey: 'workload.container.image'
|
||||
}],
|
||||
fvReportedValidationPaths: ['spec'],
|
||||
defaultTab
|
||||
|
||||
};
|
||||
},
|
||||
|
|
@ -271,6 +260,14 @@ export default {
|
|||
return { general: this.fvGetPathErrors(['image'])?.length > 0 };
|
||||
},
|
||||
|
||||
defaultTab() {
|
||||
if (!!this.$route.query.sidecar || this.$route.query.init || this.mode === _CREATE) {
|
||||
return 'container-0';
|
||||
}
|
||||
|
||||
return this.allContainers.length ? this.allContainers[0].name : '';
|
||||
},
|
||||
|
||||
isEdit() {
|
||||
return this.mode === _EDIT;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue