@aiyiran/myclaw 1.1.40 → 1.1.42
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.
|
@@ -2182,6 +2182,7 @@
|
|
|
2182
2182
|
// ═══ 作品模板列表弹框 ═══
|
|
2183
2183
|
// 使用通用文件接口 GET /api/file?path=(路径相对 .openclaw 根)
|
|
2184
2184
|
var TEMPLATE_ROOT = 'skills/yiran-playground-template-use';
|
|
2185
|
+
var TEMPLATE_CDN_BASE = 'https://cdn.yiranlaoshi.com/myclaw/live/yiran/skills/yiran-playground-template-use/templates';
|
|
2185
2186
|
|
|
2186
2187
|
function openTemplateModal() {
|
|
2187
2188
|
if (document.querySelector('#myclaw-template-modal')) return;
|
|
@@ -2422,9 +2423,7 @@
|
|
|
2422
2423
|
rightHeader.appendChild(infoSpan);
|
|
2423
2424
|
rightHeader.appendChild(openNewBtn);
|
|
2424
2425
|
rightHeader.appendChild(useBtn);
|
|
2425
|
-
previewIframe.src =
|
|
2426
|
-
+ encodeURIComponent(TEMPLATE_ROOT + '/templates/' + tpl['文件夹名'] + '/__student-view__.html')
|
|
2427
|
-
+ '&t=' + Date.now();
|
|
2426
|
+
previewIframe.src = TEMPLATE_CDN_BASE + '/' + encodeURIComponent(tpl['文件夹名']) + '/__student-view__.html?t=' + Date.now();
|
|
2428
2427
|
}
|
|
2429
2428
|
|
|
2430
2429
|
row.onclick = setActive;
|
|
@@ -2463,14 +2462,16 @@
|
|
|
2463
2462
|
}
|
|
2464
2463
|
|
|
2465
2464
|
// ── 并行:加载本地 index + 检查 CDN 更新 ──────────────────────────────
|
|
2465
|
+
var _pollTimer = null; // 提到外层,doSync 守卫用
|
|
2466
|
+
|
|
2466
2467
|
function doSync() {
|
|
2468
|
+
// 轮询进行中时点击无效,避免重复起 timer
|
|
2469
|
+
if (_pollTimer) return;
|
|
2467
2470
|
headSyncBtn.disabled = true;
|
|
2468
2471
|
headSyncBtn.style.opacity = '0.5';
|
|
2469
2472
|
syncStatus.style.color = 'rgba(205,214,244,0.4)';
|
|
2470
2473
|
syncStatus.textContent = '⟳ 检查更新...';
|
|
2471
2474
|
|
|
2472
|
-
// 轮询句柄,用于清理
|
|
2473
|
-
var _pollTimer = null;
|
|
2474
2475
|
var _pollDeadline = Date.now() + 10 * 60 * 1000; // 最多轮询 10 分钟
|
|
2475
2476
|
|
|
2476
2477
|
function _reloadList(onDone) {
|