From 1d25bb3a7fb4b3fdf2dd076692f77f70a8ed73cc Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Tue, 16 Dec 2025 18:17:50 +1300 Subject: [PATCH 1/2] Improve detection of webprotocol --- src/components/SimulationVuer.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/SimulationVuer.vue b/src/components/SimulationVuer.vue index 20aa52c..5bc311c 100644 --- a/src/components/SimulationVuer.vue +++ b/src/components/SimulationVuer.vue @@ -75,6 +75,17 @@ const IdType = Object.freeze({ RAW_COMBINE_ARCHIVE: 'raw_combine_archive', }); +function isWebProtocol(urlString) { + try { + const url = new URL(urlString); + // protocol property includes the colon, e.g., "https:" + return url.protocol === "http:" || url.protocol === "https:"; + } catch (err) { + // string was not a valid URL + return false; + } +} + /** * SimulationVuer */ @@ -117,7 +128,7 @@ export default { idType = IdType.DATASET_ID; } else if (this.id instanceof Uint8Array) { idType = IdType.RAW_COMBINE_ARCHIVE; - } else if (this.id.startsWith("https://")) { + } else if (isWebProtocol(this.id)) { idType = IdType.DATASET_URL; } else { idType = IdType.PMR_PATH; From 7ee2ba6f09769cfba648cdd7d10fc3545c33430c Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 19 Dec 2025 12:17:29 +1300 Subject: [PATCH 2/2] Mock API for getting data from SimulationVuer. --- src/components/SimulationVuer.vue | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/components/SimulationVuer.vue b/src/components/SimulationVuer.vue index adef742..e59be6a 100644 --- a/src/components/SimulationVuer.vue +++ b/src/components/SimulationVuer.vue @@ -53,6 +53,65 @@ + +