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",
|
"build": "./node_modules/.bin/vue-cli-service build",
|
||||||
"clean": "./node_modules/@rancher/shell/scripts/clean",
|
"clean": "./node_modules/@rancher/shell/scripts/clean",
|
||||||
"lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .js,.ts,.vue .",
|
"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",
|
"build-pkg": "./node_modules/@rancher/shell/scripts/build-pkg.sh",
|
||||||
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
|
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
|
||||||
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
|
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
|
||||||
|
|||||||
@ -306,11 +306,11 @@ export default {
|
|||||||
:weight="1"
|
:weight="1"
|
||||||
>
|
>
|
||||||
<div class="row mb-20">
|
<div class="row mb-20">
|
||||||
<div class="col span-6">
|
<div class="col span-12">
|
||||||
<UnitInput
|
<UnitInput
|
||||||
v-model:value="value.spec.httpTimeoutSeconds"
|
v-model:value="value.spec.httpTimeoutSeconds"
|
||||||
:label="t('harvester.addons.vmImport.ova.fields.httpTimeout')"
|
:label="t('harvester.addons.vmImport.ova.fields.httpTimeout')"
|
||||||
placeholder="Default: 600"
|
:placeholder="t('harvester.addons.vmImport.ova.placeholders.httpTimeout')"
|
||||||
suffix="Seconds"
|
suffix="Seconds"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1675,10 +1675,11 @@ harvester:
|
|||||||
datacenter: The exact name of the Datacenter object in vCenter
|
datacenter: The exact name of the Datacenter object in vCenter
|
||||||
ova:
|
ova:
|
||||||
fields:
|
fields:
|
||||||
url: OVA URL
|
url: URL
|
||||||
httpTimeout: HTTP Timeout
|
httpTimeout: HTTP Timeout
|
||||||
placeholders:
|
placeholders:
|
||||||
url: "e.g. https://download.example.com/images/my-vm.ova"
|
url: "e.g. https://download.example.com/images/my-vm.ova"
|
||||||
|
httpTimeout: "Default: 600"
|
||||||
|
|
||||||
rancherVcluster:
|
rancherVcluster:
|
||||||
accessRancher: Access the Rancher Dashboard
|
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