From 3af8e4a4cdba868515472096128c83de172802a1 Mon Sep 17 00:00:00 2001 From: Sebastian Danielsson Date: Sun, 4 Oct 2026 18:24:23 +0200 Subject: [PATCH] feat(json-viewer, yaml-viewer, currency-converter, geo-coordinates-converter): support intranet mirrors Add json-schemas.catalog-url, currency-converter.url and geo-coordinates-converter.tile-url. Offline without a mirror, schema validation offers custom schemas only, the map is not shown and the currency converter is hidden. Show the external-access badge on the YAML viewer and the coordinates converter. Refs sharevb/it-tools#571 Co-Authored-By: Claude Opus 5.5 (1M context) --- .../currency-converter/currency-converter.vue | 17 +++++----- .../currency-converter/currency-rates.test.ts | 31 +++++++++++++++++ .../currency-converter/currency-rates.ts | 26 +++++++++++++++ src/tools/currency-converter/index.ts | 2 ++ .../geo-coordinates-converter.vue | 33 ++++++++++++------- src/tools/geo-coordinates-converter/index.ts | 2 +- src/tools/json-editor/json-editor.vue | 7 +++- src/tools/json-linter/json-linter.vue | 7 +++- src/tools/json-viewer/json-viewer.vue | 7 +++- src/tools/json-viewer/schema-catalog.test.ts | 23 +++++++++++++ src/tools/json-viewer/schema-catalog.ts | 29 ++++++++++++++++ .../json-viewer/useJsonSchemaValidation.ts | 20 +++++------ src/tools/yaml-viewer/index.ts | 1 + .../yaml-viewer/useYamlSchemaValidation.ts | 20 +++++------ src/tools/yaml-viewer/yaml-viewer.vue | 7 +++- 15 files changed, 183 insertions(+), 49 deletions(-) create mode 100644 src/tools/currency-converter/currency-rates.test.ts create mode 100644 src/tools/currency-converter/currency-rates.ts create mode 100644 src/tools/json-viewer/schema-catalog.test.ts create mode 100644 src/tools/json-viewer/schema-catalog.ts diff --git a/src/tools/currency-converter/currency-converter.vue b/src/tools/currency-converter/currency-converter.vue index ac8d0941..1b6ae429 100644 --- a/src/tools/currency-converter/currency-converter.vue +++ b/src/tools/currency-converter/currency-converter.vue @@ -1,9 +1,10 @@ @@ -359,7 +370,7 @@ function updateMarker() { -
+
diff --git a/src/tools/geo-coordinates-converter/index.ts b/src/tools/geo-coordinates-converter/index.ts index 2f23bc29..7d4b0a0a 100644 --- a/src/tools/geo-coordinates-converter/index.ts +++ b/src/tools/geo-coordinates-converter/index.ts @@ -10,5 +10,5 @@ export const tool = defineTool({ icon: defineAsyncComponent(() => import('@tabler/icons-vue/dist/esm/icons/IconWorldPin.mjs')), createdAt: new Date('2026-01-09'), category: 'Converters', - externAccessDescription: 'This tool access OpenStreetMap to display the World map using the Leaflet library.', + externAccessDescription: t('tools.geo-coordinates-converter.externalAccess'), }); diff --git a/src/tools/json-editor/json-editor.vue b/src/tools/json-editor/json-editor.vue index 513c903d..e55f3685 100644 --- a/src/tools/json-editor/json-editor.vue +++ b/src/tools/json-editor/json-editor.vue @@ -54,7 +54,11 @@ const schemaUrl = useQueryParamOrStorage({ storageName: 'json-editor:schema', defaultValue: '', }); -const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: jsonText, schemaUrl, schemaData }); +const { + schemas, + errors: validationErrors, + catalogAvailable, +} = useJsonSchemaValidation({ json: jsonText, schemaUrl, schemaData }); function tryAutoRepair() { try { @@ -128,6 +132,7 @@ const formattedJson = computed(() => { ...schemas.map((s) => ({ label: `${s.name} / ${s.description}`, value: s.url })), ]" filterable + :tag="!catalogAvailable" mb-4 /> diff --git a/src/tools/json-linter/json-linter.vue b/src/tools/json-linter/json-linter.vue index 3ac2b12c..21e08909 100644 --- a/src/tools/json-linter/json-linter.vue +++ b/src/tools/json-linter/json-linter.vue @@ -37,7 +37,11 @@ const schemaUrl = useQueryParamOrStorage({ storageName: 'json-linter:schema', defaultValue: '', }); -const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: jsonContent, schemaUrl, schemaData }); +const { + schemas, + errors: validationErrors, + catalogAvailable, +} = useJsonSchemaValidation({ json: jsonContent, schemaUrl, schemaData }); const indentSize = useITStorage('json-linter:indent-size', 3); const autoRepair = useITStorage('json-linter:repair', true); @@ -88,6 +92,7 @@ const cleanJson = computed(() => { ...schemas.map((s) => ({ label: `${s.name} / ${s.description}`, value: s.url })), ]" filterable + :tag="!catalogAvailable" mb-4 /> diff --git a/src/tools/json-viewer/json-viewer.vue b/src/tools/json-viewer/json-viewer.vue index 0b42ae5a..bbd01195 100644 --- a/src/tools/json-viewer/json-viewer.vue +++ b/src/tools/json-viewer/json-viewer.vue @@ -50,7 +50,11 @@ const schemaUrl = useQueryParamOrStorage({ storageName: 'json-prettify:schema', defaultValue: '', }); -const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: rawJson, schemaUrl, schemaData }); +const { + schemas, + errors: validationErrors, + catalogAvailable, +} = useJsonSchemaValidation({ json: rawJson, schemaUrl, schemaData });