���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.2
/
@nuxt
/
icon
/
dist
/
runtime
/
server
/
Viewing: api.js
import { basename } from "pathe"; import { getIcons } from "@iconify/utils"; import { consola } from "consola"; import { useAppConfig, defineCachedEventHandler } from "nitropack/runtime"; import { createError, getQuery } from "h3"; import { collections } from "#nuxt-icon-server-bundle"; const warnOnceSet = /* @__PURE__ */ new Set(); const DEFAULT_ENDPOINT = "https://api.iconify.design"; export default defineCachedEventHandler(async (event) => { const url = event.node.req.url; if (!url) return; const options = useAppConfig().icon; const collectionName = event.context.params?.collection?.replace(/\.json$/, ""); const collection = collectionName ? await collections[collectionName]?.() : null; const apiEndPoint = options.iconifyApiEndpoint || DEFAULT_ENDPOINT; const apiUrl = new URL("./" + basename(url), apiEndPoint); const icons = apiUrl.searchParams.get("icons")?.split(","); if (collection) { if (icons?.length) { const data = getIcons( collection, icons ); consola.debug(`[Icon] serving ${(icons || []).map((i) => "`" + collectionName + ":" + i + "`").join(",")} from bundled collection`); return data; } } else if (import.meta.dev) { if (collectionName && !warnOnceSet.has(collectionName) && apiEndPoint === DEFAULT_ENDPOINT) { consola.warn([ `[Icon] Collection \`${collectionName}\` is not found locally`, `We suggest to install it via \`npm i -D @iconify-json/${collectionName}\` to provide the best end-user experience.` ].join("\n")); warnOnceSet.add(collectionName); } } if (options.fallbackToApi) { consola.debug(`[Icon] fetching ${(icons || []).map((i) => "`" + collectionName + ":" + i + "`").join(",")} from iconify api`); if (apiUrl.host !== new URL(apiEndPoint).host) { return createError({ status: 400, message: "Invalid icon request" }); } try { const data = await $fetch(apiUrl.href); return data; } catch (e) { console.error(e); return createError({ status: 404 }); } } return createError({ status: 404 }); }, { group: "nuxt", name: "icon", getKey(event) { const collection = event.context.params?.collection?.replace(/\.json$/, "") || "unknown"; const icons = String(getQuery(event).icons || "").split(","); return `${collection}_${icons.join("_")}`; }, swr: true, maxAge: 60 * 60 * 24 * 7 // 1 week });
Coded With 💗 by
0x6ick Mod By V1rus_Alfa