Update RestarVMDialog in edit VM page; fix slots-template issue

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2024-09-24 19:20:27 +02:00
parent 6a232be450
commit dad5b5d890
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
2 changed files with 37 additions and 34 deletions

View File

@ -4,10 +4,13 @@ import AsyncButton from '@shell/components/AsyncButton';
import { Card } from '@components/Card';
import { Banner } from '@components/Banner';
import { exceptionToErrorsArray } from '@shell/utils/error';
import AppModal from '@shell/components/AppModal';
export default {
emits: ['close'],
components: {
AppModal,
Card,
AsyncButton,
Banner,
@ -31,7 +34,6 @@ export default {
try {
this.vm.doActionGrowl('restart', {});
buttonDone(true);
this.resolve();
this.close();
} catch (err) {
console.error(err); // eslint-disable-line
@ -56,44 +58,41 @@ export default {
class="prompt-restart"
:show-highlight-border="false"
>
<h4
slot="title"
v-clean-html="t('harvester.modal.restart.title')"
class="text-default-text"
/>
<template slot="body">
<slot name="body">
<div
v-clean-html="t('harvester.modal.restart.tip')"
class="pl-10 pr-10"
>
</div>
</slot>
<template #title>
<h4
v-clean-html="t('harvester.modal.restart.title')"
class="text-default-text"
/>
</template>
<div
slot="actions"
class="bottom"
>
<Banner
v-for="(err, i) in errors" :key="i" color="error"
:label="err"
<template #body>
<div
v-clean-html="t('harvester.modal.restart.tip')"
class="pl-10 pr-10"
/>
<div class="buttons">
<button
class="btn role-secondary mr-10"
@click="close"
>
{{ t('harvester.modal.restart.cancel') }}
</button>
</template>
<AsyncButton
mode="restart"
@click="apply"
<template #actions>
<div class="bottom">
<Banner
v-for="(err, i) in errors" :key="i" color="error"
:label="err"
/>
<div class="buttons">
<button
class="btn role-secondary mr-10"
@click="close"
>
{{ t('harvester.modal.restart.cancel') }}
</button>
<AsyncButton
mode="restart"
@click="apply"
/>
</div>
</div>
</div>
</template>
</Card>
</app-modal>
</template>

View File

@ -413,7 +413,10 @@ export default {
return new Promise((resolve) => {
this.isOpen = true;
this.$refs.restartDialog.resolve = resolve;
this.$nextTick(() => {
this.$refs.restartDialog.resolve = resolve;
});
});
},
@ -854,6 +857,7 @@ export default {
<RestartVMDialog
v-if="isOpen"
ref="restartDialog"
:vm="value"
/>
</CruResource>