diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 673f6da0ad11..3ba812e0a8a8 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1617,6 +1617,8 @@ "label.offeringid": "Offering ID", "label.offeringtype": "Compute Offering type", "label.ok": "OK", +"label.ssvm.open.cert.page": "Open Certificate Page", +"label.retry.upload": "Retry Upload", "label.only.end.date.and.time": "Only end date and time", "label.only.start.date.and.time": "Only start date and time", "label.open.documentation": "Open documentation", @@ -3667,6 +3669,9 @@ "message.upload.iso.failed.description": "Failed to upload ISO.", "message.upload.template.failed.description": "Failed to upload Template", "message.upload.volume.failed": "Volume upload failed", +"message.ssvm.cert.untrusted": "Unable to reach the upload server.", +"message.ssvm.cert.trust.instructions": "The upload server may be using a self-signed or untrusted certificate. Click 'Open Certificate Page' to open the server in a new browser tab, accept the certificate warning, then return here and click 'Retry Upload'. If the server remains unreachable, contact your administrator.", +"message.ssvm.unreachable.retry": "The upload server is still unreachable. If it uses a self-signed certificate, please accept it in the opened tab and try again.", "message.user.not.permitted.api": "User is not permitted to use the API", "message.validate.equalto": "Please enter the same value again.", "message.validate.max": "Please enter a value less than or equal to {0}.", diff --git a/ui/src/utils/ssvmProbe.js b/ui/src/utils/ssvmProbe.js new file mode 100644 index 000000000000..55690aea8981 --- /dev/null +++ b/ui/src/utils/ssvmProbe.js @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +const SSVM_PROBE_TIMEOUT_MS = 5000 +export async function probeSsvmCert (origin) { + const controller = new AbortController() + const timeoutId = setTimeout(() => controller.abort(), SSVM_PROBE_TIMEOUT_MS) + try { + await fetch(origin, { method: 'HEAD', mode: 'no-cors', signal: controller.signal }) + return true + } catch (e) { + return false + } finally { + clearTimeout(timeoutId) + } +} diff --git a/ui/src/views/image/RegisterOrUploadIso.vue b/ui/src/views/image/RegisterOrUploadIso.vue index 37ae369727fe..3fa2519d5deb 100644 --- a/ui/src/views/image/RegisterOrUploadIso.vue +++ b/ui/src/views/image/RegisterOrUploadIso.vue @@ -19,11 +19,27 @@