Skip to content

Commit 7c187e8

Browse files
authored
fix(vmimport): Add missing list page for ovasource (#714)
... and several small improvements. Signed-off-by: Volker Theile <vtheile@suse.com>
1 parent c2df13a commit 7c187e8

4 files changed

Lines changed: 65 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build": "./node_modules/.bin/vue-cli-service build",
3939
"clean": "./node_modules/@rancher/shell/scripts/clean",
4040
"lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .js,.ts,.vue .",
41+
"lint:fix": "./node_modules/.bin/eslint --fix --max-warnings 0 --ext .js,.ts,.vue .",
4142
"build-pkg": "./node_modules/@rancher/shell/scripts/build-pkg.sh",
4243
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
4344
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",

pkg/harvester/edit/migration.harvesterhci.io.ovasource.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ export default {
306306
:weight="1"
307307
>
308308
<div class="row mb-20">
309-
<div class="col span-6">
309+
<div class="col span-12">
310310
<UnitInput
311311
v-model:value="value.spec.httpTimeoutSeconds"
312312
:label="t('harvester.addons.vmImport.ova.fields.httpTimeout')"
313-
placeholder="Default: 600"
313+
:placeholder="t('harvester.addons.vmImport.ova.placeholders.httpTimeout')"
314314
suffix="Seconds"
315315
:mode="mode"
316316
/>

pkg/harvester/l10n/en-us.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,10 +1675,11 @@ harvester:
16751675
datacenter: The exact name of the Datacenter object in vCenter
16761676
ova:
16771677
fields:
1678-
url: OVA URL
1678+
url: URL
16791679
httpTimeout: HTTP Timeout
16801680
placeholders:
16811681
url: "e.g. https://download.example.com/images/my-vm.ova"
1682+
httpTimeout: "Default: 600"
16821683

16831684
rancherVcluster:
16841685
accessRancher: Access the Rancher Dashboard
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<script>
2+
import ResourceTable from '@shell/components/ResourceTable';
3+
import Loading from '@shell/components/Loading';
4+
import { SCHEMA } from '@shell/config/types';
5+
import { HCI } from '../types';
6+
7+
const schema = {
8+
id: HCI.VMIMPORT_SOURCE_OVA,
9+
type: SCHEMA,
10+
attributes: {
11+
kind: HCI.VMIMPORT_SOURCE_OVA,
12+
namespaced: true
13+
},
14+
metadata: { name: HCI.VMIMPORT_SOURCE_OVA },
15+
};
16+
17+
export default {
18+
name: 'HarvesterVMImportSourceOVA',
19+
components: { ResourceTable, Loading },
20+
inheritAttrs: false,
21+
22+
async fetch() {
23+
const inStore = this.$store.getters['currentProduct'].inStore;
24+
25+
this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.VMIMPORT_SOURCE_OVA });
26+
27+
const configSchema = this.$store.getters[`${ inStore }/schemaFor`](HCI.VMIMPORT_SOURCE_OVA);
28+
29+
if (!configSchema?.collectionMethods.find((x) => x.toLowerCase() === 'post')) {
30+
this.$store.dispatch('type-map/configureType', { match: HCI.VMIMPORT_SOURCE_OVA, isCreatable: false });
31+
}
32+
},
33+
34+
data() {
35+
return { rows: [] };
36+
},
37+
38+
computed: {
39+
schema() {
40+
return schema;
41+
}
42+
},
43+
44+
typeDisplay() {
45+
return this.$store.getters['type-map/labelFor'](schema, 99);
46+
}
47+
};
48+
</script>
49+
50+
<template>
51+
<Loading v-if="$fetchState.pending" />
52+
<ResourceTable
53+
v-else
54+
v-bind="$attrs"
55+
:groupable="true"
56+
:schema="schema"
57+
:rows="rows"
58+
key-field="_key"
59+
/>
60+
</template>

0 commit comments

Comments
 (0)