mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 13:16:05 +08:00
Add pkg/harvester components + shell portings - 1
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
import UnitInput from '@shell/components/form/UnitInput';
|
||||
|
||||
export default {
|
||||
name: 'HarvesterReserved',
|
||||
components: { UnitInput },
|
||||
|
||||
props: {
|
||||
reservedMemory: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'create',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return { memory: this.reservedMemory };
|
||||
},
|
||||
|
||||
watch: {
|
||||
reservedMemory(memory) {
|
||||
this.memory = memory;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
change() {
|
||||
const { memory } = this;
|
||||
|
||||
this.$emit('updateReserved', { memory });
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UnitInput
|
||||
v-model="memory"
|
||||
v-int-number
|
||||
:label="t('harvester.virtualMachine.input.reservedMemory')"
|
||||
:mode="mode"
|
||||
:input-exponent="2"
|
||||
:increment="1024"
|
||||
:output-modifier="true"
|
||||
@input="change"
|
||||
/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user