fixing upgrading tab

This commit is contained in:
Nancy Butler 2020-09-16 14:10:00 -07:00
parent 142a189ae9
commit 2cfc90ca63
4 changed files with 185 additions and 37 deletions

View File

@ -1509,8 +1509,8 @@ workload:
minReadySeconds: minReadySeconds:
label: Minimum Ready label: Minimum Ready
tip: The minimum duration a pod should be ready without containers crashing for it to be considered available. tip: The minimum duration a pod should be ready without containers crashing for it to be considered available.
partition: podManagementPolicy:
label: Partition label: Pod Management Policy
progressDeadlineSeconds: progressDeadlineSeconds:
label: Progress Deadline label: Progress Deadline
tip: The minimum duration to wait for a deployment to progress before marking it failed. tip: The minimum duration to wait for a deployment to progress before marking it failed.

View File

@ -7,6 +7,15 @@ import { _VIEW } from '@/config/query-params';
export default { export default {
components: { KeyValue, Tag }, components: { KeyValue, Tag },
props: {
value: {
type: Object,
default: () => {
return {};
}
}
},
data() { data() {
return { annotationsVisible: false, view: _VIEW }; return { annotationsVisible: false, view: _VIEW };
}, },
@ -88,9 +97,9 @@ export default {
<div class="detail-top row" :class="{empty: isEmpty}"> <div class="detail-top row" :class="{empty: isEmpty}">
<div v-if="hasLeft" class="col left" :class="leftSpan"> <div v-if="hasLeft" class="col left" :class="leftSpan">
<div v-for="detail in details" :key="detail.label || detail.slotName"> <div v-for="detail in details" :key="detail.label || detail.slotName">
<div class="label"> <span class="label">
{{ detail.label }}: {{ detail.label }}:
</div> </span>
<component <component
:is="detail.formatter" :is="detail.formatter"
v-if="detail.formatter" v-if="detail.formatter"

View File

@ -208,20 +208,21 @@ export default {
/> />
</div> </div>
</div> </div>
<template v-if="strategy === 'RollingUpdate'"> <div v-if="isStatefulSet" class="row mb-20">
<div v-if="isStatefulSet" class="row mb-20"> <div class="col span-6">
<div class="col span-6"> <RadioGroup v-model="value.podManagementPolicy" :label="t('workload.upgrading.podManagementPolicy.label')" :options="['OrderedReady', 'Parallel']" />
<UnitInput v-model="partition" :suffix="partition == 1 ? 'Pod' : 'Pods'" :label="t('workload.upgrading.partition.label')" :mode="mode"> <!-- <UnitInput v-model="partition" :suffix="partition == 1 ? 'Pod' : 'Pods'" :label="t('workload.upgrading.partition.label')" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.partition.label') }} {{ t('workload.upgrading.partition.label') }}
<i v-tooltip="t('workload.upgrading.partition.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.partition.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
</template> </template>
</UnitInput> </UnitInput> -->
</div>
</div> </div>
<div v-else-if="isDeployment || isDaemonSet" class="row mb-20"> </div>
<template v-if="strategy === 'RollingUpdate'">
<div v-if="isDeployment || isDaemonSet" class="row mb-20">
<div v-if="isDeployment" class="col span-6"> <div v-if="isDeployment" class="col span-6">
<InputWithSelect <InputWithSelect
:text-value="maxSurge" :text-value="maxSurge"

View File

@ -38,33 +38,171 @@ export default {
}, },
details() { details() {
return [ let out;
{ const type = this._type ? this._type : this.type;
label: 'Image',
content: this.container.image
},
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Config Scale',
content: this.spec?.replicas,
}, switch (type) {
{ case WORKLOAD_TYPES.DEPLOYMENT:
label: 'Ready Scale', out = [
content: this.status?.readyReplicas, {
}, label: 'Type',
/** content: this._type ? this._type : this.type
* TODO: Pod Restarts will require more changes to get working but since workloads is being rewritten those },
* changes can be done at that time if this is still needed. {
* { label: 'Replicas',
* label: 'Pod Restarts', content: this?.spec?.replicas
* content: this.podRestarts, },
* } {
*/ label: 'Available',
]; content: this?.status?.availableReplicas,
},
{
label: 'Unavailable',
content: this?.status?.unavailableReplicas,
},
{
label: 'Ready',
content: this?.status?.readyReplicas,
},
{
label: 'Updated',
content: this?.status?.updatedReplicas,
},
];
break;
case WORKLOAD_TYPES.STATEFUL_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Replicas',
content: this?.spec?.replicas
},
{
label: 'Services',
content: this?.spec?.serviceName
},
];
break;
case WORKLOAD_TYPES.DAEMON_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Number',
content: this.status.currentNumberScheduled / this.status.desiredNumberScheduled
},
{
label: 'Available',
content: this.status.numberAvailable
},
{
label: 'Unavailable',
content: this.status.numberUnavailable
},
{
label: 'Ready',
content: this.status.numberReady
},
{
label: 'Updated',
content: this.status.numberUpdated
},
];
break;
case WORKLOAD_TYPES.REPLICA_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Available',
content: this?.status?.availableReplicas,
},
{
label: 'Fully Labeled',
content: this?.status?.fullyLabeledReplicas,
},
];
break;
case WORKLOAD_TYPES.JOB:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Succeeded',
content: this?.status?.succeeded,
},
{
label: 'Failed',
content: this?.status?.failed,
},
{
label: 'Start Time',
content: this?.status?.startTime,
formatter: 'LiveDate'
},
{
label: 'Completion Time',
content: this?.status?.completionTime,
formatter: 'LiveDate'
},
];
break;
case WORKLOAD_TYPES.CRON_JOB:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Last Scheduled Time',
content: this?.status?.lastScheduleTime,
formatter: 'LiveDate'
},
];
break;
default:
out = [
{
label: 'Image',
content: this.container.image
},
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Config Scale',
content: this.spec?.replicas,
},
{
label: 'Ready Scale',
content: this.status?.readyReplicas,
},
/**
* TODO: Pod Restarts will require more changes to get working but since workloads is being rewritten those
* changes can be done at that time if this is still needed.
* {
* label: 'Pod Restarts',
* content: this.podRestarts,
* }
*/
];
}
return out;
}, },
redeploy() { redeploy() {