mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
fix: support-bundle-expiration can be invalid value 000003333 (#248)
* fix: normalize number input Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> * fix: leverage to other inputs Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> --------- Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { RadioGroup } from '@components/Form/Radio';
|
||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
||||
import { TextAreaAutoGrow } from '@components/Form/TextArea';
|
||||
|
||||
import UnitInput from '@shell/components/form/UnitInput';
|
||||
import CreateEditView from '@shell/mixins/create-edit-view';
|
||||
|
||||
import { HCI_ALLOWED_SETTINGS, HCI_SINGLE_CLUSTER_ALLOWED_SETTING, HCI_SETTING } from '../config/settings';
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
LabeledInput,
|
||||
LabeledSelect,
|
||||
RadioGroup,
|
||||
TextAreaAutoGrow
|
||||
TextAreaAutoGrow,
|
||||
UnitInput
|
||||
},
|
||||
|
||||
mixins: [CreateEditView],
|
||||
@@ -128,6 +129,13 @@ export default {
|
||||
await this.clusterRegistrationUrlTip();
|
||||
}
|
||||
|
||||
// remove any leading zeros (e.g. '0123' becomes 123)
|
||||
if (this.setting.kind === 'number' && this.value.value) {
|
||||
const num = Number(this.value.value);
|
||||
|
||||
this.value.value = isNaN(num) ? 0 : `${ num }`;
|
||||
}
|
||||
|
||||
this.save(done);
|
||||
},
|
||||
|
||||
@@ -238,6 +246,13 @@ export default {
|
||||
:min-height="254"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="setting.kind === 'number'">
|
||||
<LabeledInput
|
||||
v-model:value="value.value"
|
||||
:label="t('advancedSettings.edit.value')"
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<LabeledInput
|
||||
v-model:value="value.value"
|
||||
|
||||
Reference in New Issue
Block a user