mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-03-21 20:51:45 +00:00
fix(vmimport): Add missing list page for ovasource (#714)
... and several small improvements. Signed-off-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
parent
c2df13ad73
commit
7c187e894d
@ -38,6 +38,7 @@
|
||||
"build": "./node_modules/.bin/vue-cli-service build",
|
||||
"clean": "./node_modules/@rancher/shell/scripts/clean",
|
||||
"lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .js,.ts,.vue .",
|
||||
"lint:fix": "./node_modules/.bin/eslint --fix --max-warnings 0 --ext .js,.ts,.vue .",
|
||||
"build-pkg": "./node_modules/@rancher/shell/scripts/build-pkg.sh",
|
||||
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
|
||||
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
|
||||
|
||||
@ -306,11 +306,11 @@ export default {
|
||||
:weight="1"
|
||||
>
|
||||
<div class="row mb-20">
|
||||
<div class="col span-6">
|
||||
<div class="col span-12">
|
||||
<UnitInput
|
||||
v-model:value="value.spec.httpTimeoutSeconds"
|
||||
:label="t('harvester.addons.vmImport.ova.fields.httpTimeout')"
|
||||
placeholder="Default: 600"
|
||||
:placeholder="t('harvester.addons.vmImport.ova.placeholders.httpTimeout')"
|
||||
suffix="Seconds"
|
||||
:mode="mode"
|
||||
/>
|
||||
|
||||
@ -1675,10 +1675,11 @@ harvester:
|
||||
datacenter: The exact name of the Datacenter object in vCenter
|
||||
ova:
|
||||
fields:
|
||||
url: OVA URL
|
||||
url: URL
|
||||
httpTimeout: HTTP Timeout
|
||||
placeholders:
|
||||
url: "e.g. https://download.example.com/images/my-vm.ova"
|
||||
httpTimeout: "Default: 600"
|
||||
|
||||
rancherVcluster:
|
||||
accessRancher: Access the Rancher Dashboard
|
||||
|
||||
60
pkg/harvester/list/harvesterhci.io.migration.ovasource.vue
Normal file
60
pkg/harvester/list/harvesterhci.io.migration.ovasource.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<script>
|
||||
import ResourceTable from '@shell/components/ResourceTable';
|
||||
import Loading from '@shell/components/Loading';
|
||||
import { SCHEMA } from '@shell/config/types';
|
||||
import { HCI } from '../types';
|
||||
|
||||
const schema = {
|
||||
id: HCI.VMIMPORT_SOURCE_OVA,
|
||||
type: SCHEMA,
|
||||
attributes: {
|
||||
kind: HCI.VMIMPORT_SOURCE_OVA,
|
||||
namespaced: true
|
||||
},
|
||||
metadata: { name: HCI.VMIMPORT_SOURCE_OVA },
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'HarvesterVMImportSourceOVA',
|
||||
components: { ResourceTable, Loading },
|
||||
inheritAttrs: false,
|
||||
|
||||
async fetch() {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
|
||||
this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.VMIMPORT_SOURCE_OVA });
|
||||
|
||||
const configSchema = this.$store.getters[`${ inStore }/schemaFor`](HCI.VMIMPORT_SOURCE_OVA);
|
||||
|
||||
if (!configSchema?.collectionMethods.find((x) => x.toLowerCase() === 'post')) {
|
||||
this.$store.dispatch('type-map/configureType', { match: HCI.VMIMPORT_SOURCE_OVA, isCreatable: false });
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return { rows: [] };
|
||||
},
|
||||
|
||||
computed: {
|
||||
schema() {
|
||||
return schema;
|
||||
}
|
||||
},
|
||||
|
||||
typeDisplay() {
|
||||
return this.$store.getters['type-map/labelFor'](schema, 99);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Loading v-if="$fetchState.pending" />
|
||||
<ResourceTable
|
||||
v-else
|
||||
v-bind="$attrs"
|
||||
:groupable="true"
|
||||
:schema="schema"
|
||||
:rows="rows"
|
||||
key-field="_key"
|
||||
/>
|
||||
</template>
|
||||
Loading…
x
Reference in New Issue
Block a user