ascript 1.3.27__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ascript/__init__.py +8 -0
- ascript/hooks/__init__.py +0 -0
- ascript/hooks/hook-ascript.py +2 -0
- ascript/windows/__init__.py +29 -0
- ascript/windows/daos/__init__.py +0 -0
- ascript/windows/daos/screen.py +143 -0
- ascript/windows/hardware/__init__.py +5 -0
- ascript/windows/hardware/keyboard.py +279 -0
- ascript/windows/hardware/logitech_driver.py +179 -0
- ascript/windows/hardware/mouse.py +308 -0
- ascript/windows/license/__init__.py +16 -0
- ascript/windows/license/achttp.cp310-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp311-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp312-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp313-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp314-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp38-win_amd64.pyd +0 -0
- ascript/windows/license/achttp.cp39-win_amd64.pyd +0 -0
- ascript/windows/media/__init__.py +0 -0
- ascript/windows/resources/__init__.py +0 -0
- ascript/windows/resources/libs/logitech/x64/LogitechGkeyEnginesWrapper.dll +0 -0
- ascript/windows/resources/libs/logitech/x86/LogitechGkeyEnginesWrapper.dll +0 -0
- ascript/windows/resources/templates/__init__.py +0 -0
- ascript/windows/resources/templates/__init__py.win.template +51 -0
- ascript/windows/resources/templates/build.as.win.template +14 -0
- ascript/windows/resources/templates/build.py +71 -0
- ascript/windows/resources/templates/logo_windows.ico +0 -0
- ascript/windows/resources/templates/windows/main.py +50 -0
- ascript/windows/resources/templates/windows/pyproject.toml +44 -0
- ascript/windows/resources/templates/windows/res/img/logo.ico +0 -0
- ascript/windows/screen/__init__.py +13 -0
- ascript/windows/screen/as_cv.py +382 -0
- ascript/windows/screen/canny.py +128 -0
- ascript/windows/screen/code_scanner.py +72 -0
- ascript/windows/screen/color_algorithms.py +277 -0
- ascript/windows/screen/find_colors.py +251 -0
- ascript/windows/screen/find_images.py +217 -0
- ascript/windows/screen/ocr/__init__.py +4 -0
- ascript/windows/screen/ocr/ocr.py +223 -0
- ascript/windows/screen/ocr/rapidocr_hook.py +301 -0
- ascript/windows/screen/ocrx.py +169 -0
- ascript/windows/screen/screen_core.py +139 -0
- ascript/windows/store/__init__.py +21 -0
- ascript/windows/system/__init__.py +8 -0
- ascript/windows/system/device.py +355 -0
- ascript/windows/system/easy_print.py +115 -0
- ascript/windows/system/env.py +492 -0
- ascript/windows/system/exception/__init__.py +1 -0
- ascript/windows/system/key_value.py +145 -0
- ascript/windows/system/pip.py +175 -0
- ascript/windows/system/r.py +165 -0
- ascript/windows/system/runtime.py +62 -0
- ascript/windows/tools/__init__.py +27 -0
- ascript/windows/tools/__main__.py +21 -0
- ascript/windows/tools/action.json +33 -0
- ascript/windows/tools/action.py +168 -0
- ascript/windows/tools/colors_tool.py +391 -0
- ascript/windows/tools/config.py +26 -0
- ascript/windows/tools/dumptool.py +18 -0
- ascript/windows/tools/eel_api.py +495 -0
- ascript/windows/tools/gpplug/__init__.py +0 -0
- ascript/windows/tools/gpplug/plug.py +70 -0
- ascript/windows/tools/mouse_catch.py +168 -0
- ascript/windows/tools/plug_manager.py +38 -0
- ascript/windows/tools/tool_api.py +906 -0
- ascript/windows/tools/tool_window.py +56 -0
- ascript/windows/tools/uia_worker.py +365 -0
- ascript/windows/tools/web/app_store_window.html +481 -0
- ascript/windows/tools/web/colors.html +532 -0
- ascript/windows/tools/web/css/screen.css +1342 -0
- ascript/windows/tools/web/css/viewtree.css +357 -0
- ascript/windows/tools/web/flot_control.html +195 -0
- ascript/windows/tools/web/img/ico/favicon.png +0 -0
- ascript/windows/tools/web/img/ico/paintpalette.png +0 -0
- ascript/windows/tools/web/img/svg/find_colors.svg +1 -0
- ascript/windows/tools/web/img/svg/find_images.svg +1 -0
- ascript/windows/tools/web/img/svg/illustration-6.svg +89 -0
- ascript/windows/tools/web/img/svg/img_default.svg +1 -0
- ascript/windows/tools/web/img/svg/ocr.svg +1 -0
- ascript/windows/tools/web/js/screen/colors.js +466 -0
- ascript/windows/tools/web/js/screen/gp_plug.js +108 -0
- ascript/windows/tools/web/js/screen/image_mouse.js +464 -0
- ascript/windows/tools/web/js/screen/img_view.js +558 -0
- ascript/windows/tools/web/js/screen/plug.js +246 -0
- ascript/windows/tools/web/js/screen/screen.js +690 -0
- ascript/windows/tools/web/js/screen/screen_api.js +778 -0
- ascript/windows/tools/web/js/screen/screen_maker.js +10 -0
- ascript/windows/tools/web/js/utils/map.js +73 -0
- ascript/windows/tools/web/js/utils/upload.js +157 -0
- ascript/windows/tools/web/js/viewtree/niv_js.js +27 -0
- ascript/windows/tools/web/js/viewtree/vtree.js +1510 -0
- ascript/windows/tools/web/libs/bootstrap/css/bootstrap.min.css +6 -0
- ascript/windows/tools/web/libs/bootstrap/js/bootstrap.bundle.min.js +7 -0
- ascript/windows/tools/web/libs/bootstrap-icons/0-circle.svg +4 -0
- ascript/windows/tools/web/libs/bootstrap-icons/0-square.svg +4 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.css +2078 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.json +2052 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.min.css +5 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.scss +2090 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff +0 -0
- ascript/windows/tools/web/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff2 +0 -0
- ascript/windows/tools/web/libs/feather-icons/dist/feather.min.js +13 -0
- ascript/windows/tools/web/libs/feather-icons/dist/icons.json +1 -0
- ascript/windows/tools/web/libs/jquery/core.js +399 -0
- ascript/windows/tools/web/libs/jquery/jquery.js +10598 -0
- ascript/windows/tools/web/libs/jquery/jquery.min.js +4 -0
- ascript/windows/tools/web/libs/jquery/jquery.min.js.zip +0 -0
- ascript/windows/tools/web/libs/jquery/jquery.slim.js +8495 -0
- ascript/windows/tools/web/libs/jquery/jquery.slim.min.js +2 -0
- ascript/windows/tools/web/libs/jquery-menu/jquery.contextMenu.js +2134 -0
- ascript/windows/tools/web/libs/jquery-menu/jquery.contextMenu.min.css +16 -0
- ascript/windows/tools/web/libs/jquery-zTree/css/zTreeStyle.css +97 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/1_close.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/1_open.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/2.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/3.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/4.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/5.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/6.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/7.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/8.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/diy/9.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/line_conn.gif +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/loading.gif +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/tree-node-btn.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/zTreeStandard.gif +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/img/zTreeStandard.png +0 -0
- ascript/windows/tools/web/libs/jquery-zTree/js/jquery.ztree.all.min.js +3 -0
- ascript/windows/tools/web/libs/treeview/css/jquery.treeview.css +79 -0
- ascript/windows/tools/web/libs/treeview/img/file.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/ico_loading.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/icon4.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/icon5.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/icon6.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/py.png +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-black-line.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-black.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-default-line.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-default.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-famfamfam-line.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-famfamfam.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-gray-line.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-gray.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-red-line.gif +0 -0
- ascript/windows/tools/web/libs/treeview/img/treeview-red.gif +0 -0
- ascript/windows/tools/web/libs/treeview/js/jquery.treeview.edit.js +37 -0
- ascript/windows/tools/web/libs/treeview/js/jquery.treeview.js +250 -0
- ascript/windows/tools/web/license_window.html +255 -0
- ascript/windows/tools/web/plugs/a.html +653 -0
- ascript/windows/tools/web/plugs/demo.html +52 -0
- ascript/windows/tools/web/plugs/find_colors.html +629 -0
- ascript/windows/tools/web/plugs/find_images.html +699 -0
- ascript/windows/tools/web/plugs/rapidocr.html +954 -0
- ascript/windows/tools/web/vtree.html +496 -0
- ascript/windows/tools/webview/assets/index-HymBPl-I.css +1 -0
- ascript/windows/tools/webview/assets/index-PqA_m8tL.js +17 -0
- ascript/windows/tools/webview/index.html +13 -0
- ascript/windows/ui/__init__.py +6 -0
- ascript/windows/ui/app_store_window.py +272 -0
- ascript/windows/ui/draw_window.py +231 -0
- ascript/windows/ui/flot_test.py +297 -0
- ascript/windows/ui/flot_window.py +488 -0
- ascript/windows/ui/license_window.py +111 -0
- ascript/windows/ui/web_window.py +466 -0
- ascript/windows/utils/__init__.py +0 -0
- ascript/windows/utils/node_utils.py +20 -0
- ascript/windows/utils/screen_utils.py +280 -0
- ascript/windows/window/Selector.py +1015 -0
- ascript/windows/window/Window.py +747 -0
- ascript/windows/window/__init__.py +5 -0
- ascript/windows/window/launcher.py +213 -0
- ascript/windows/window/uia_runtime.py +26 -0
- ascript-1.3.27.dist-info/METADATA +41 -0
- ascript-1.3.27.dist-info/RECORD +177 -0
- ascript-1.3.27.dist-info/WHEEL +5 -0
- ascript-1.3.27.dist-info/entry_points.txt +2 -0
- ascript-1.3.27.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
// ==========================================
|
|
2
|
+
// 1. 基础配置与常量
|
|
3
|
+
// ==========================================
|
|
4
|
+
const DEBUG_STORAGE_KEY = 'gp_debug_tools';
|
|
5
|
+
|
|
6
|
+
// 切换折叠状态
|
|
7
|
+
function toggleGroup(targetId, iconId) {
|
|
8
|
+
const el = document.getElementById(targetId);
|
|
9
|
+
const icon = document.getElementById(iconId);
|
|
10
|
+
|
|
11
|
+
if (el.classList.contains('show')) {
|
|
12
|
+
el.classList.remove('show');
|
|
13
|
+
icon.classList.replace('bi-chevron-down', 'bi-chevron-right');
|
|
14
|
+
} else {
|
|
15
|
+
el.classList.add('show');
|
|
16
|
+
icon.classList.replace('bi-chevron-right', 'bi-chevron-down');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ==========================================
|
|
21
|
+
// 2. 核心交互逻辑 (严格保持你原来的赋值方式)
|
|
22
|
+
// ==========================================
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 核心逻辑:处理插件点击与选中状态
|
|
26
|
+
*/
|
|
27
|
+
function handlePlugClick(element, plugData) {
|
|
28
|
+
// 1. 清除同组所有插件的选中状态
|
|
29
|
+
const allItems = document.querySelectorAll('.plug-item');
|
|
30
|
+
allItems.forEach(item => item.classList.remove('active'));
|
|
31
|
+
|
|
32
|
+
// 2. 给当前点击的元素添加选中样式
|
|
33
|
+
element.classList.add('active');
|
|
34
|
+
|
|
35
|
+
// 3. 执行你的 Iframe 加载逻辑
|
|
36
|
+
console.log("准备加载插件:", plugData.name);
|
|
37
|
+
loadIframeAction(plugData.entry_html, plugData.class_name);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 抽取出的 Iframe 加载方法 (严格对应你原有的 window.gp 赋值逻辑)
|
|
42
|
+
*/
|
|
43
|
+
function loadIframeAction(url, pluginId) {
|
|
44
|
+
const iframe = document.getElementById('gpiframe'); // 确保 ID 一致
|
|
45
|
+
if (iframe) {
|
|
46
|
+
// --- 保持你原来的逻辑开始 ---
|
|
47
|
+
if (window.gp && window.gp.iframe) {
|
|
48
|
+
window.gp.iframe.window = iframe.contentWindow;
|
|
49
|
+
}
|
|
50
|
+
iframe.src = url;
|
|
51
|
+
// --- 保持你原来的逻辑结束 ---
|
|
52
|
+
console.log(`Iframe 已切换至: ${url}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ==========================================
|
|
57
|
+
// 3. 渲染函数 (createPlugItem 保持不变,新增调试专用渲染)
|
|
58
|
+
// ==========================================
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 原有渲染函数
|
|
62
|
+
*/
|
|
63
|
+
function createPlugItem(plug, isCloud = false) {
|
|
64
|
+
const plugJson = JSON.stringify(plug).replace(/"/g, '"');
|
|
65
|
+
const iconPath = plug.icon;
|
|
66
|
+
|
|
67
|
+
const iconHtml = `
|
|
68
|
+
<div class="plug-icon-mask me-2 mt-1"
|
|
69
|
+
style="--icon-url: url('/${iconPath}');">
|
|
70
|
+
</div>`;
|
|
71
|
+
|
|
72
|
+
return `
|
|
73
|
+
<li class="plug-item list-group-item border-0 bg-transparent" onclick="handlePlugClick(this, ${plugJson})">
|
|
74
|
+
<div class="d-flex align-items-start text-body">
|
|
75
|
+
${iconHtml}
|
|
76
|
+
<div class="flex-grow-1 overflow-hidden">
|
|
77
|
+
<div class="plug-title text-truncate">${plug.name}</div>
|
|
78
|
+
<div class="plug-desc text-body-secondary small">${plug.description || '暂无描述'}</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</li>`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 调试条目渲染函数 (适配你的样式并加入删除按钮)
|
|
86
|
+
*/
|
|
87
|
+
function createDebugItem(plug) {
|
|
88
|
+
const plugJson = JSON.stringify(plug).replace(/"/g, '"');
|
|
89
|
+
return `
|
|
90
|
+
<li class="plug-item list-group-item border-0 bg-transparent position-relative" onclick="handlePlugClick(this, ${plugJson})">
|
|
91
|
+
<div class="d-flex align-items-start text-body">
|
|
92
|
+
<div class="me-2 mt-1 d-flex align-items-center justify-content-center bg-light rounded border"
|
|
93
|
+
style="width: 32px; height: 32px; flex-shrink: 0;">
|
|
94
|
+
<i class="bi bi-bug text-primary"></i>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="flex-grow-1 overflow-hidden">
|
|
97
|
+
<div class="plug-title text-truncate">${plug.name}</div>
|
|
98
|
+
<div class="plug-desc text-body-secondary small text-truncate">${plug.entry_html}</div>
|
|
99
|
+
</div>
|
|
100
|
+
<button class="btn btn-link btn-sm text-danger position-absolute end-0 top-0 mt-2 opacity-50"
|
|
101
|
+
onclick="event.stopPropagation(); deleteDebugPlug('${plug.id}')">
|
|
102
|
+
<i class="bi bi-x-circle"></i>
|
|
103
|
+
</button>
|
|
104
|
+
</div>
|
|
105
|
+
</li>`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ==========================================
|
|
109
|
+
// 4. 数据加载逻辑
|
|
110
|
+
// ==========================================
|
|
111
|
+
|
|
112
|
+
// 3. 加载本地系统工具
|
|
113
|
+
async function loadSystemPlugs() {
|
|
114
|
+
const plugs = await eel.ascript_plug_list()();
|
|
115
|
+
const container = document.getElementById('group_plug_system');
|
|
116
|
+
|
|
117
|
+
// 渲染数据
|
|
118
|
+
container.innerHTML = plugs.map(p => createPlugItem(p)).join('');
|
|
119
|
+
|
|
120
|
+
// 关键:如果折叠还是不工作,尝试手动实例化
|
|
121
|
+
const collapseElements = document.querySelectorAll('.collapse');
|
|
122
|
+
collapseElements.forEach(el => {
|
|
123
|
+
new bootstrap.Collapse(el, { toggle: false });
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 4. 模拟 AJAX 加载云端插件
|
|
128
|
+
function loadCloudPlugs() {
|
|
129
|
+
const cloudContainer = document.getElementById('cloud-group');
|
|
130
|
+
const fakeCloudData = [
|
|
131
|
+
{ name: "背景消除 (AI)", entry_html: "#", description: "云端算力支持" },
|
|
132
|
+
{ name: "图片高清化", entry_html: "#", description: "基于超分辨率模型" }
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
cloudContainer.innerHTML = fakeCloudData.map(p => {
|
|
137
|
+
return `
|
|
138
|
+
<li class="list-group-item list-group-item-action border-0 py-2 ps-3 text-muted" style="font-size: 14px;">
|
|
139
|
+
<i class="bi bi-cloud-arrow-down me-2"></i>
|
|
140
|
+
${p.name} <small class="badge bg-light text-dark">待下载</small>
|
|
141
|
+
</li>`;
|
|
142
|
+
}).join('');
|
|
143
|
+
}, 500);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ==========================================
|
|
147
|
+
// 5. 调试工具业务逻辑
|
|
148
|
+
// ==========================================
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 触发模态框显示
|
|
152
|
+
*/
|
|
153
|
+
function promptAddDebugPlug() {
|
|
154
|
+
const modal = new bootstrap.Modal(document.getElementById('addDebugModal'));
|
|
155
|
+
modal.show();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 调用 Python 接口选择文件夹
|
|
160
|
+
*/
|
|
161
|
+
async function handleSelectFolder() {
|
|
162
|
+
// 调用 Python 的 select_folder 函数
|
|
163
|
+
const path = await eel.select_folder()();
|
|
164
|
+
if (path) {
|
|
165
|
+
document.getElementById('dbg_root').value = path;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* 处理保存:拼接 URL 并存入 LocalStorage
|
|
171
|
+
*/
|
|
172
|
+
async function handleSaveDebugPlug() {
|
|
173
|
+
const name = document.getElementById('dbg_name').value.trim();
|
|
174
|
+
let root = document.getElementById('dbg_root').value.trim();
|
|
175
|
+
const file = document.getElementById('dbg_file').value.trim() || 'index.html';
|
|
176
|
+
|
|
177
|
+
if (!name || !root) {
|
|
178
|
+
alert("请填写名称并选择根目录");
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 统一处理 Windows 路径斜杠,防止转义问题
|
|
183
|
+
root = root.replace(/\\/g, '/');
|
|
184
|
+
|
|
185
|
+
// 使用 btoa 进行 Base64 编码 (处理中文需 encodeURIComponent)
|
|
186
|
+
const base64Root = btoa(encodeURIComponent(root));
|
|
187
|
+
const virtualUrl = `/external/${base64Root}/${file}`;
|
|
188
|
+
|
|
189
|
+
const newPlug = {
|
|
190
|
+
name: name,
|
|
191
|
+
entry_html: virtualUrl,
|
|
192
|
+
description: `本地目录: ${root}`,
|
|
193
|
+
id: 'debug_' + Date.now(),
|
|
194
|
+
class_name: 'debug-plugin'
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const list = JSON.parse(localStorage.getItem(DEBUG_STORAGE_KEY) || '[]');
|
|
198
|
+
list.push(newPlug);
|
|
199
|
+
localStorage.setItem(DEBUG_STORAGE_KEY, JSON.stringify(list));
|
|
200
|
+
|
|
201
|
+
renderDebugPlugs();
|
|
202
|
+
bootstrap.Modal.getInstance(document.getElementById('addDebugModal')).hide();
|
|
203
|
+
|
|
204
|
+
// 清空
|
|
205
|
+
document.getElementById('dbg_name').value = '';
|
|
206
|
+
document.getElementById('dbg_root').value = '';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* 删除调试插件
|
|
211
|
+
*/
|
|
212
|
+
function deleteDebugPlug(id) {
|
|
213
|
+
if (!confirm("确定删除该调试条目?")) return;
|
|
214
|
+
let list = JSON.parse(localStorage.getItem(DEBUG_STORAGE_KEY) || '[]');
|
|
215
|
+
list = list.filter(p => p.id !== id);
|
|
216
|
+
localStorage.setItem(DEBUG_STORAGE_KEY, JSON.stringify(list));
|
|
217
|
+
renderDebugPlugs();
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* 渲染调试工具列表
|
|
222
|
+
*/
|
|
223
|
+
function renderDebugPlugs() {
|
|
224
|
+
const list = JSON.parse(localStorage.getItem(DEBUG_STORAGE_KEY) || '[]');
|
|
225
|
+
const container = document.getElementById('group_plug_debug');
|
|
226
|
+
const wrapper = document.getElementById('debug_group_wrapper');
|
|
227
|
+
|
|
228
|
+
if (!container || !wrapper) return;
|
|
229
|
+
|
|
230
|
+
if (list.length === 0) {
|
|
231
|
+
wrapper.style.display = 'none';
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
wrapper.style.display = 'block';
|
|
236
|
+
container.innerHTML = list.map(p => createDebugItem(p)).join('');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ==========================================
|
|
240
|
+
// 6. 初始化
|
|
241
|
+
// ==========================================
|
|
242
|
+
window.onload = () => {
|
|
243
|
+
loadSystemPlugs();
|
|
244
|
+
loadCloudPlugs();
|
|
245
|
+
renderDebugPlugs(); // 页面加载时检查 LocalStorage
|
|
246
|
+
};
|