fix(dns-query, gitattributes-generator): hide dns-query offline, pin commands to the snapshot

dns-query calls Cloudflare DNS over HTTPS and rdap.org, so offline mode
now hides it like dns-queries.

The gitattributes download commands are now built from the URLs the
preview was generated from. When the snapshot was used, they point at the
snapshot commit instead of master, so they reproduce what is shown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sebastian DanielssonandClaude Opus 5.5 authored and sharevb committed 2026-10-25 18:51:17 +01:00
1 parent 8ec559012d
commit 788d4fdded
3 files changed
+10 -5

No files matched your search

+1 -1
View File
@@ -235,7 +235,7 @@ To define the default UI language, add a `default_locale` key to json:
Fonts, editor extensions, the ffmpeg core, the ONNX runtime, the Tesseract OCR engine and its English and Simplified Chinese language data ship with the app, so these never come from a third-party CDN. The large ones are only downloaded when their tool is opened, and are left out of the PWA precache.
On a network without internet access, add `"offline": true` to `tools-settings.json`. Tools that only work with internet are then hidden (my-ip, ip-geo-location, dns-queries, dnsbl-checker, dns-propagation-tester, online-wiktionary, iana-whois-checker), and tools with a bundled fallback switch to it:
On a network without internet access, add `"offline": true` to `tools-settings.json`. Tools that only work with internet are then hidden (my-ip, ip-geo-location, dns-query, dns-queries, dnsbl-checker, dns-propagation-tester, online-wiktionary, iana-whois-checker), and tools with a bundled fallback switch to it:
- gitignore-generator and gitattributes-generator use a template snapshot bundled at build time (also used online when GitHub can't be reached). Refresh it with `pnpm script:update:git-templates`.
- ocr-image offers only the bundled languages.
+1
View File
@@ -28,4 +28,5 @@ export const tool = defineTool({
category: 'Network',
externAccessDescription:
"This tool resolves DNS records for a given domain using Cloudflare's DNS over HTTPS API (https://cloudflare-dns.com). It resolves WhoIs throught RDAP API (https://rdap.org).",
requiresInternet: true,
});
@@ -5,7 +5,6 @@ import { useLocalStorage } from '@vueuse/core';
import {
type GitTemplatesSnapshot,
type GitTemplatesSource,
liveTemplateUrl,
loadTemplate,
loadTemplateNames,
snapshotDay,
@@ -17,6 +16,8 @@ const { t } = useI18n();
const options = useLocalStorage<{ label: string; value: string }[]>('gitattr-gen:opts2', []);
const selected = ref<string[]>([]);
const output = ref<string>('');
// Where each template in `output` came from: the live branch, or the snapshot commit when the snapshot was used
const outputUrls = ref<string[]>([]);
// Timestamp cache to allow refresh after X hours
const lastFetched = useLocalStorage<number>('gitattr-gen:ts', 0);
@@ -55,22 +56,25 @@ async function loadOptions() {
async function generateOutput() {
let gitattributes = '';
const urls: string[] = [];
for (const lang of selected.value) {
const { content, url, snapshot } = await loadTemplate(source, lang, { offline: isOfflineMode });
if (snapshot) {
snapshotDate.value = snapshotDay(snapshot);
}
urls.push(url);
gitattributes += `${gitattributes ? '\n\n' : ''}# === .gitattributes for ${lang} (${url}) ===\n\n${content}`;
}
output.value = gitattributes;
outputUrls.value = urls;
}
// Multi-command generation
// Multi-command generation, downloading the same files as the generated preview
const commands = computed(() => {
if (!selected.value.length) {
if (!outputUrls.value.length) {
return { curl: '', wget: '', powershell: '', cmd: '' };
}
const urls = selected.value.map((lang) => liveTemplateUrl(source, lang)).join(' ');
const urls = outputUrls.value.join(' ');
return {
curl: `curl ${urls} > .gitattributes`,
wget: `wget ${urls} -O .gitattributes`,