CH-J Toolsการจัดการเซิร์ฟเวอร์ผ่าน SSH
เมนู
ซอร์สที่เผยแพร่

CH-J Tools

เรียกดูไดเรกทอรีและไฟล์ของรุ่นแอปพลิเคชันที่ระบุ

ดาวน์โหลด ZIP ของซอร์ส
CH-J / Server Manager 406 ไฟล์
core-20261024T135205Z-7c487d719de2 วันที่เพิ่ม: · วันที่บิลด์:
navIcons.test.js วันที่เพิ่ม: ไม่ได้บันทึกวันที่ 1.8 KB · 27 บรรทัด
โค้ด ดาวน์โหลดไฟล์
1"use strict";
3// Navigation icons: one mapping by stable IDs for all sidebar modes and the plugin taskbar.
4const test = require("node:test");
5const assert = require("node:assert/strict");
6const fs = require("node:fs");
7const path = require("node:path");
8const icons = require("../src/renderer/vendor/lucide/icons");
9const { ICON_BY_KEY, FALLBACK, iconName } = require("../src/renderer/navIcons");
10const { PluginRegistry } = require("../src/main/plugins/pluginRegistry");
12test("every core view and bundled plugin has its own existing icon; unknown plugins fall back to puzzle", () => {
13 const html = fs.readFileSync(path.join(__dirname, "../src/renderer/index.html"), "utf8");
14 const views = [...html.matchAll(/class="nav-button[^"]*" data-view="([a-z]+)"/g)].map((match) => match[1]);
15 assert.ok(views.length >= 7);
16 const registry = new PluginRegistry(fs.mkdtempSync(path.join(require("node:os").tmpdir(), "chj-icons-")), null, { bundledRoot: path.join(__dirname, "../src/main/firstPartyPlugins") });
17 const keys = [...views, ...registry.listInstalled().map((plugin) => `plugin:${plugin.id}`)];
18 const names = keys.map((key) => iconName(key));
19 for (const [index, key] of keys.entries()) {
20 assert.notEqual(names[index], FALLBACK, `${key} has a specific icon`);
21 assert.ok(icons[names[index]]?.length, `${names[index]} exists in the vendored set`);
22 }
23 assert.equal(new Set(names).size, names.length, "no two known modules share an icon");
24 assert.equal(iconName("plugin:example.unknown"), "puzzle"); assert.ok(icons.puzzle.length);
25 for (const name of Object.values(ICON_BY_KEY)) assert.ok(icons[name], `mapped icon ${name} is vendored`);
26 assert.ok(fs.readFileSync(path.join(__dirname, "../src/renderer/vendor/lucide/LICENSE.txt"), "utf8").startsWith("ISC License"));
27});
SHA-256c26ada9bf7870bc06ba8acc661c9151fad41d60550343bac2d6bfcbc48707d7b

CH-J Proprietary Software License 1.14 · ซอร์สโค้ดนี้ให้ไว้ภายใต้ CH-J Proprietary Software License 1.14 การเปิดให้เข้าถึงไม่ได้เปลี่ยนแปลงเงื่อนไขของสัญญาอนุญาตหรือให้สิทธิ์เพิ่มเติม

SHA-256 ของไฟล์บีบอัด476ed8aef0f1e96a5acdf223127b6692acdf4492eeaf5d0816b6e2a634fbbda6
ไฟล์