环境管理对话框中,重命名、删除按钮改为图标

This commit is contained in:
yinjun.chen1
2026-09-16 17:42:19 +08:00
parent f676cd120f
commit a0a22685d2
+6 -4
View File
@@ -595,8 +595,9 @@ document.addEventListener("DOMContentLoaded", () => {
actions.className = "env-manage-actions";
const editBtn = document.createElement("button");
editBtn.className = "btn-edit";
editBtn.textContent = t("renameBtn");
editBtn.className = "btn-icon";
editBtn.title = t("renameBtn");
editBtn.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>';
editBtn.addEventListener("click", async () => {
const newName = await openEnvModal("rename", env.name);
if (!newName) return;
@@ -611,8 +612,9 @@ document.addEventListener("DOMContentLoaded", () => {
});
const delBtn = document.createElement("button");
delBtn.className = "btn-danger";
delBtn.textContent = t("deleteBtn");
delBtn.className = "btn-icon";
delBtn.title = t("deleteBtn");
delBtn.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>';
delBtn.addEventListener("click", async () => {
if (environments.length <= 1) {
showToast(t("toastKeepOneEnv"));