Copilot commented on code in PR #13204:
URL: https://github.com/apache/cloudstack/pull/13204#discussion_r3281249152


##########
ui/src/views/image/RegisterOrUploadTemplate.vue:
##########
@@ -1124,12 +1157,18 @@ export default {
               duration: 0
             })

Review Comment:
   The file count guard shows an error when `fileList.length > 1` but does not 
return, so the upload flow continues (API call + upload). Return early after 
showing the notification to prevent unintended behavior.
   



##########
ui/src/views/storage/UploadLocalVolume.vue:
##########
@@ -16,13 +16,29 @@
 // under the License.
 
 <template>
-  <div class="form-layout" v-ctrl-enter="handleSubmit">
-    <span v-if="uploadPercentage > 0">
+  <div class="form-layout">
+    <span v-if="uploading">
       <loading-outlined />
       {{ $t('message.upload.file.processing') }}
       <a-progress :percent="uploadPercentage" />
     </span>
-    <a-spin :spinning="loading" v-else>
+    <div v-else-if="ssvmCertUntrusted" class="ssvm-cert-warning">
+      <a-alert
+        type="warning"
+        show-icon
+        :message="$t('message.ssvm.cert.untrusted')"
+        :description="$t('message.ssvm.cert.trust.instructions')" />
+      <div class="action-button" style="margin-top: 16px">
+        <a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
+        <a :href="ssvmOrigin" target="_blank" rel="noopener noreferrer">
+          <a-button>{{ $t('label.ssvm.open.cert.page') }}</a-button>
+        </a>

Review Comment:
   This nests an interactive `<a-button>` inside an `<a>` element, which is 
invalid HTML and can cause accessibility / click/keyboard issues. Prefer using 
the button’s built-in `href`/`target` props (if supported) or handle opening 
the URL in a click handler without nesting interactive elements.
   



##########
ui/src/views/image/RegisterOrUploadTemplate.vue:
##########
@@ -19,11 +19,27 @@
   <div
     :class="'form-layout'"
     @keyup.ctrl.enter="handleSubmit">
-    <span v-if="uploadPercentage > 0">
+    <span v-if="uploading">
       <loading-outlined />
       {{ $t('message.upload.file.processing') }}
       <a-progress :percent="uploadPercentage" />
     </span>
+    <div v-else-if="ssvmCertUntrusted" class="ssvm-cert-warning">
+      <a-alert
+        type="warning"
+        show-icon
+        :message="$t('message.ssvm.cert.untrusted')"
+        :description="$t('message.ssvm.cert.trust.instructions')" />
+      <div class="action-button" style="margin-top: 16px">
+        <a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
+        <a :href="ssvmOrigin" target="_blank" rel="noopener noreferrer">
+          <a-button>{{ $t('label.ssvm.open.cert.page') }}</a-button>
+        </a>

Review Comment:
   This nests an interactive `<a-button>` inside an `<a>` element, which is 
invalid HTML and can cause accessibility / click/keyboard issues. Prefer using 
the button’s built-in `href`/`target` props (if supported) or handle opening 
the URL in a click handler without nesting interactive elements.
   



##########
ui/src/views/image/RegisterOrUploadIso.vue:
##########
@@ -19,11 +19,27 @@
   <div
     class="form-layout"
     @keyup.ctrl.enter="handleSubmit">
-    <span v-if="uploadPercentage > 0">
+    <span v-if="uploading">
       <loading-outlined />
       {{ $t('message.upload.file.processing') }}
       <a-progress :percent="uploadPercentage" />
     </span>
+    <div v-else-if="ssvmCertUntrusted" class="ssvm-cert-warning">
+      <a-alert
+        type="warning"
+        show-icon
+        :message="$t('message.ssvm.cert.untrusted')"
+        :description="$t('message.ssvm.cert.trust.instructions')" />
+      <div class="action-button" style="margin-top: 16px">
+        <a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
+        <a :href="ssvmOrigin" target="_blank" rel="noopener noreferrer">
+          <a-button>{{ $t('label.ssvm.open.cert.page') }}</a-button>
+        </a>

Review Comment:
   This nests an interactive `<a-button>` inside an `<a>` element, which is 
invalid HTML and can cause accessibility / click/keyboard issues. Prefer using 
the button’s built-in `href`/`target` props (if supported) or handle opening 
the URL in a click handler without nesting interactive elements.
   



-- 
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]

Reply via email to