Skip to content

Commit

Permalink
disable volume size input when isLonghornV2 and edit mode
Browse files Browse the repository at this point in the history
(cherry picked from commit 5f853e8)
  • Loading branch information
a110605 authored and mergify[bot] committed Oct 16, 2024
1 parent 432ca9d commit 85ff3d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/harvester/edit/harvesterhci.io.volume.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import LabeledSelect from '@shell/components/form/LabeledSelect';
import { LabeledInput } from '@components/Form/LabeledInput';
import NameNsDescription from '@shell/components/form/NameNsDescription';
import { Banner } from '@components/Banner';
import { allHash } from '@shell/utils/promise';
import { get } from '@shell/utils/object';
import { HCI, VOLUME_SNAPSHOT } from '../types';
import { STORAGE_CLASS, LONGHORN, PV } from '@shell/config/types';
import { sortBy } from '@shell/utils/sort';
import { saferDump } from '@shell/utils/create-yaml';
import { InterfaceOption, VOLUME_DATA_SOURCE_KIND } from '../config/harvester-map';
import { _CREATE } from '@shell/config/query-params';
import { _CREATE, _EDIT } from '@shell/config/query-params';
import CreateEditView from '@shell/mixins/create-edit-view';
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
import { STATE, NAME, AGE, NAMESPACE } from '@shell/config/table-headers';
Expand Down Expand Up @@ -95,6 +94,10 @@ export default {
return this.source === 'blank';
},
isEdit() {
return this.mode === _EDIT;
},
isVMImage() {
return this.source === 'url';
},
Expand Down Expand Up @@ -346,13 +349,13 @@ export default {
:output-modifier="true"
:increment="1024"
:mode="mode"
:disabled="isLonghornV2"
:disabled="isLonghornV2 && isEdit"
required
class="mb-20"
@input="update"
/>
<Banner v-if="isLonghornV2" color="warning">
<Banner v-if="isLonghornV2 && isEdit" color="warning">
<span>{{ t('harvester.volume.longhorn.disableResize') }}</span>
</Banner>
</Tab>
Expand Down

0 comments on commit 85ff3d1

Please sign in to comment.