CH-J Toolsgestión de servidores a través de SSH
Menú
Fuente publicada

CH-J Tools

Busque directorios y archivos para obtener una versión de aplicación específica.

Descargar fuente ZIP
CH-J / Server Manager 1704 archivos
0.1.2-beta Añadido: · Construido:
navIcons.js Añadido: Fecha no registrada 3,8 KB · 89 líneas
Código Descargar archivo
1"use strict";
3// One source of navigation icons for every sidebar mode (full/compact/split) and the minimized-plugin taskbar.
4// Keys are stable IDs (core view names, "plugin:<id>"), never translated labels, so icons do not depend on the
5// language. Unknown or catalog plugins get the neutral "puzzle" icon.
6(function (root) {
7 const ICON_BY_KEY = Object.freeze({
8 overview: "layout-dashboard",
9 terminal: "terminal",
10 profiles: "server",
11 updates: "refresh-cw",
12 plugins: "blocks",
13 diagnostics: "chj-web-diagnostics",
14 settings: "settings",
15 "plugin:chj.hash-checksum": "hash",
16 "plugin:chj.disks": "hard-drive",
17 "plugin:chj.file-manager": "folder-open",
18 "plugin:chj.key-generator": "key-round",
19 "keychain": "key-round",
20 "plugin:chj.log-viewer": "scroll-text",
21 "plugin:chj.nginx-manager": "chj-nginx",
22 "plugin:chj.apache-manager": "chj-apache",
23 "plugin:chj.rsync-manager": "chj-rsync",
24 "plugin:chj.network-manager": "network",
25 "plugin:chj.system-monitor": "chart-no-axes-combined",
26 "plugin:chj.users": "users"
27 });
28 const FALLBACK = "puzzle";
29 // Own icons on the same 24-unit grid and stroke as the Lucide set. The NGINX one is a plain hexagon with an N,
30 // not the NGINX logo; the mark belongs to F5, Inc.
31 const OWN_ICONS = Object.freeze({
32 "chj-nginx": [
33 ["path", { d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" }],
34 ["path", { d: "M9 16V8l6 8V8" }]
35 ],
36 "chj-rsync": [
37 ["path", { d: "M3 12a9 9 0 0 1 15-6.7L21 8" }],
38 ["path", { d: "M21 3v5h-5" }],
39 ["path", { d: "M21 12a9 9 0 0 1-15 6.7L3 16" }],
40 ["path", { d: "M8 16H3v5" }]
41 ],
42 "chj-apache": [
43 ["path", { d: "M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z" }],
44 ["path", { d: "M16 8 2 22" }],
45 ["path", { d: "M17.5 15H9" }]
46 ],
47 "chj-web-diagnostics": [
48 ["path", { d: "M11.5 19.99A9 9 0 1 1 19.99 11.5" }],
49 ["path", { d: "M2 11h18" }],
50 ["path", { d: "M11 2a13.5 13.5 0 0 0 0 18" }],
51 ["path", { d: "M11 2a13.5 13.5 0 0 1 3.6 9" }],
52 ["circle", { cx: "17.5", cy: "17.5", r: "4" }],
53 ["path", { d: "m20.5 20.5 2 2" }]
54 ]
55 });
56 const SVG_NS = "http://www.w3.org/2000/svg";
58 function iconName(key) {
59 return ICON_BY_KEY[String(key || "")] || FALLBACK;
60 }
62 // Builds the SVG from vendored element nodes (createElementNS, no markup parsing). Sizing comes from CSS
63 // (.nav-icon), the viewBox keeps the 24-unit Lucide grid so strokes stay sharp at any size.
64 function createIcon(key, className = "nav-icon") {
65 const icons = { ...(root.chjLucideIcons || {}), ...OWN_ICONS };
66 const name = icons[iconName(key)] ? iconName(key) : FALLBACK;
67 const svg = document.createElementNS(SVG_NS, "svg");
68 svg.setAttribute("class", className);
69 svg.setAttribute("viewBox", "0 0 24 24");
70 svg.setAttribute("fill", "none");
71 svg.setAttribute("stroke", "currentColor");
72 svg.setAttribute("stroke-width", "2");
73 svg.setAttribute("stroke-linecap", "round");
74 svg.setAttribute("stroke-linejoin", "round");
75 svg.setAttribute("aria-hidden", "true");
76 svg.setAttribute("focusable", "false");
77 svg.dataset.icon = name;
78 for (const [tag, attributes] of icons[name] || []) {
79 const element = document.createElementNS(SVG_NS, tag);
80 for (const [attribute, value] of Object.entries(attributes)) element.setAttribute(attribute, value);
81 svg.append(element);
82 }
83 return svg;
84 }
86 const exported = Object.freeze({ ICON_BY_KEY, FALLBACK, iconName, createIcon });
87 if (typeof module === "object" && module.exports) module.exports = exported;
88 else root.chjNavIcons = exported;
89})(typeof window === "object" ? window : globalThis);
SHA-256943a725b6145da06a2f71410e6977ca91e388fb57d14f995c161227c5b008334

CH-J Proprietary Software License 1.14 · La fuente se proporciona en el CH-J Proprietary Software License 1.14. Su disponibilidad no cambia los términos de la licencia ni otorga derechos adicionales.

Archivo SHA-256ac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
Archivos