This commit is contained in:
Zengtudor 2025-05-10 23:45:50 +08:00
parent baafc2a29d
commit 51c5428a61

View File

@ -71,31 +71,7 @@
<script script type="module">
// TODO: async getEnvString() will be implemented elsewhere
// async function refreshEnvTable() {
// try {
// // 调用 getEnvString 函数并解析返回值
// const envString = await window.getEnvString();
// console.log("Environment String:", envString);
// const env = JSON.parse(envString);
// // 清空表格内容
// const tableBody = document.querySelector("#envTable tbody");
// tableBody.innerHTML = "";
// // 填充表格
// for (const [key, value] of Object.entries(env)) {
// const row = document.createElement("tr");
// row.innerHTML = `
// <td data-label="Key">${key}</td>
// <td data-label="Value">${value}</td>
// `;
// tableBody.appendChild(row);
// }
// } catch (error) {
// console.error("Failed to refresh environment table:", error);
// }
// }
setTimeout(async function refreshEnvTable() {
async function refreshEnvTable() {
try {
// 调用 getEnvString 函数并解析返回值
const env = await window.getEnvString();
@ -117,7 +93,10 @@
} catch (error) {
console.error("Failed to refresh environment table:", error);
}
}, 1000);
}
document.addEventListener('DOMContentLoaded', async () => {
await refreshEnvTable();
});
// 页面加载时刷新表格
// document.addEventListener("DOMContentLoaded", refreshEnvTable);
</script>