@aiyiran/myclaw 1.0.229 → 1.0.230
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.
- package/assets/myclaw-inject.js +36 -0
- package/package.json +1 -1
package/assets/myclaw-inject.js
CHANGED
|
@@ -783,6 +783,42 @@
|
|
|
783
783
|
addGroup.appendChild(addRow);
|
|
784
784
|
form.appendChild(addGroup);
|
|
785
785
|
|
|
786
|
+
// ── 快捷命令按钮 ──
|
|
787
|
+
var quickGroup = document.createElement("div");
|
|
788
|
+
quickGroup.style.cssText = "display:flex;flex-direction:column;gap:8px;padding-top:6px;border-top:1px solid #3d3d5c;";
|
|
789
|
+
|
|
790
|
+
var quickLabel = document.createElement("div");
|
|
791
|
+
quickLabel.textContent = "\u5FEB\u6377\u547D\u4EE4";
|
|
792
|
+
quickLabel.style.cssText = "font-size:13px;font-weight:bold;color:#f59e0b;";
|
|
793
|
+
quickGroup.appendChild(quickLabel);
|
|
794
|
+
|
|
795
|
+
var quickRow = document.createElement("div");
|
|
796
|
+
quickRow.style.cssText = "display:flex;gap:8px;flex-wrap:wrap;";
|
|
797
|
+
|
|
798
|
+
function makeQuickBtn(label, cmd, color) {
|
|
799
|
+
var b = document.createElement("button");
|
|
800
|
+
b.textContent = label;
|
|
801
|
+
b.style.cssText = "padding:8px 14px;background:" + color + ";border:none;border-radius:4px;color:#fff;font-size:12px;font-family:monospace;cursor:pointer;transition:opacity 0.15s;white-space:nowrap;";
|
|
802
|
+
b.onmouseenter = function () { b.style.opacity = "0.8"; };
|
|
803
|
+
b.onmouseleave = function () { b.style.opacity = "1"; };
|
|
804
|
+
b.onclick = function () {
|
|
805
|
+
b.disabled = true;
|
|
806
|
+
b.textContent = "\u6267\u884C\u4E2D...";
|
|
807
|
+
runCommand(cmd);
|
|
808
|
+
setTimeout(function () {
|
|
809
|
+
b.disabled = false;
|
|
810
|
+
b.textContent = label;
|
|
811
|
+
}, 2000);
|
|
812
|
+
};
|
|
813
|
+
return b;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
quickRow.appendChild(makeQuickBtn("\u516D\u53F7\u5347\u7EA7", "mc up", "#8b5cf6"));
|
|
817
|
+
quickRow.appendChild(makeQuickBtn("\u4E8C\u53F7\u91CD\u542F", "mc restart", "#ef4444"));
|
|
818
|
+
quickRow.appendChild(makeQuickBtn("\u4E09\u53F7\u65B0\u4F19\u4F34", "mc tui", "#3b82f6"));
|
|
819
|
+
quickGroup.appendChild(quickRow);
|
|
820
|
+
form.appendChild(quickGroup);
|
|
821
|
+
|
|
786
822
|
box.appendChild(header);
|
|
787
823
|
box.appendChild(form);
|
|
788
824
|
overlay.appendChild(box);
|