mirror of
https://github.com/jason5ng32/MyIP.git
synced 2026-11-04 08:55:47 +00:00
Every way into a tool — the homepage cards, the nav dropdown and mobile sheet, the keyboard shortcuts, ASN Info's profile link, the banners — navigates to /tools/<slug>; the bottom drawer, its full-screen toggle and the ?tool= query it was driven by are gone from Advanced.vue. The pages stay alive (App.vue / ToolPage.vue), so browser back and forward move between tools and the homepage, each restored as it was left. Legacy /?tool=<slug> links redirect to the page in a router beforeEach (utils/legacy-tool-link.js: known slug → its page with the remaining query, unknown → the homepage). Persona Check drops noStandalone: with the homepage kept alive its dependency commands stay registered, so the page dispatches them in place and only a direct visit navigates home first. The four sign-in tools no longer close a drawer before opening the usage dialog, which PageHeader's User hosts. Changelog entries in the six full locales; frontend/AGENTS.md describes the page model. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GbLTGMZ45MV78qd2tHoco
18 lines
848 B
JavaScript
18 lines
848 B
JavaScript
// Deployment gates for the Advanced Tools registry (data/tools.js): decides
|
|
// whether a tool is listed in the card grid, the nav and the tools menu. A
|
|
// tool can require the original site (`requiresOriginalSite`) and/or one
|
|
// `/api/configs` flag (`requiresConfig`). Configs arrive asynchronously (`{}` until the fetch
|
|
// lands), so a gated tool reads as unavailable until then. A /tools/:slug
|
|
// link is not gated.
|
|
//
|
|
// listedTools() applies the gates to a whole registry for a menu.
|
|
|
|
export const isToolAvailable = (tool, configs) => {
|
|
if (!tool) return false;
|
|
if (tool.requiresOriginalSite && !configs?.originalSite) return false;
|
|
if (tool.requiresConfig && !configs?.[tool.requiresConfig]) return false;
|
|
return true;
|
|
};
|
|
|
|
export const listedTools = (tools, configs) => tools.filter((tool) => isToolAvailable(tool, configs));
|