shwstppr commented on code in PR #11754:
URL: https://github.com/apache/cloudstack/pull/11754#discussion_r2418895613
##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -379,7 +383,14 @@ public Map<String, String>
getBackupDetailsFromVM(VirtualMachine vm) {
ServiceOffering serviceOffering =
serviceOfferingDao.findById(vm.getServiceOfferingId());
details.put(ApiConstants.SERVICE_OFFERING_ID,
serviceOffering.getUuid());
VirtualMachineTemplate template =
vmTemplateDao.findById(vm.getTemplateId());
- details.put(ApiConstants.TEMPLATE_ID, template.getUuid());
+ if (template != null) {
+ long guestOSId = template.getGuestOSId();
+ details.put(ApiConstants.TEMPLATE_ID, template.getUuid());
+ GuestOSVO guestOS = _guestOSDao.findById(guestOSId);
+ if (guestOS != null) {
+ details.put(ApiConstants.OS_TYPE_ID, guestOS.getUuid());
Review Comment:
why not add displayname here itself?
##########
ui/src/components/view/DeployVMFromBackup.vue:
##########
@@ -1700,6 +1727,13 @@ export default {
this.tabKey = 'isoid'
this.form.isoid = value
this.form.templateid = null
+ for (const key in this.options.isos) {
Review Comment:
Using showOsTypeWarning as computed variable may have made things easier
##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -2102,6 +2113,12 @@ Map<String, String> getDetailsFromBackupDetails(Long
backupId) {
details.put(ApiConstants.IS_ISO,
String.valueOf(template.getFormat().equals(Storage.ImageFormat.ISO)));
}
}
+ if (details.containsKey(ApiConstants.OS_TYPE_ID)) {
+ GuestOSVO guestOS =
_guestOSDao.findByUuid(details.get(ApiConstants.OS_TYPE_ID));
+ if (guestOS != null) {
+ details.put(ApiConstants.OS_NAME, guestOS.getDisplayName());
+ }
Review Comment:
get from details?
##########
ui/src/components/view/DeployVMFromBackup.vue:
##########
@@ -168,6 +168,22 @@
:tabList="tabList"
:activeTabKey="tabKey"
@tabChange="key => onTabChange(key, 'tabKey')">
+ <a-alert v-if="showOsTypeWarning">
+ <template #message>
+ <div v-if="selectedTemplateIso &&
dataPreFill.ostypename">
+ {{ selectedTemplateIso.message }}<br>
+ {{ selectedTemplateIso.label }} :
+ <router-link :to="{ path: '/guestos/' +
selectedTemplateIso.item.ostypeid }">
+ {{ selectedTemplateIso.item.ostypename }}
+ </router-link><br>
+ {{ $t('label.backup') }} :
+ <router-link :to="{ path: '/guestos/' +
dataPreFill.ostypeid }">
+ {{ dataPreFill.ostypename }}
+ </router-link>
+ </div>
+ </template>
+ </a-alert>
+ <br v-if="showOsTypeWarning"/>
Review Comment:
use margin for a-alert?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]