mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 00:53:19 +08:00
feat(Footer): 添加开发模式下的服务器信息显示逻辑
在页脚组件中添加开发模式检测逻辑,当检测到开发模式时,显示本地存储中配置的开发服务器信息,而不是常规服务器信息
This commit is contained in:
@@ -80,7 +80,7 @@ try {
|
||||
div.appendChild(valueSpan);
|
||||
|
||||
const iconImg = document.createElement('img');
|
||||
iconImg.className = 'server-icon h-5 ml-1 hidden';
|
||||
iconImg.className = 'server-icon h-4 ml-1 hidden';
|
||||
iconImg.alt = 'Server Icon';
|
||||
div.appendChild(iconImg);
|
||||
|
||||
@@ -133,6 +133,19 @@ try {
|
||||
const containers = document.querySelectorAll('.server-info-container');
|
||||
if (containers.length === 0) return;
|
||||
|
||||
// Check for Dev Mode
|
||||
const isDevMode = localStorage.getItem("dev-mode") === "true";
|
||||
if (isDevMode) {
|
||||
const devServer = localStorage.getItem("dev-server");
|
||||
containers.forEach(container => {
|
||||
container.innerHTML = '';
|
||||
const elements = createServerEntry({ text: 'Dev Node' });
|
||||
container.appendChild(elements.div);
|
||||
updateEntryDisplay(elements, devServer);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
window.__serverInfoCache = window.__serverInfoCache || {};
|
||||
const cache = window.__serverInfoCache;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user