Open syllebra opened 1 month ago
This is the compatible code in logout.js:
` async setup() { await new Promise(resolve => setTimeout(resolve, 500)); // Delay for 0.5 second before appending the Logout button to the menu, ensuring it is added last.
function logout(){
let workflowData = localStorage.getItem('workflow'); // Save the workflow data
localStorage.clear(); // Clear all items in localStorage
localStorage.setItem('workflow', workflowData); // Restore the workflow data
sessionStorage.clear(); // If you use sessionStorage
window.location.href = "/logout";
}
// Old interface
const menu = document.querySelector(".comfy-menu");
if(menu)
{
const logoutButton = document.createElement("button");
logoutButton.textContent = "Logout";
logoutButton.onclick = () => {logout()}
menu.append(logoutButton);
}
// New interface
const side_tb = document.querySelector(".side-tool-bar-end");
const params_button = document.querySelector(".pi-cog");
if(side_tb && params_button)
{
const logoutButton = params_button.parentElement.cloneNode(true);
logoutButton.id = "bxRebootButtonNew";
let shuticon = logoutButton.querySelector(".pi-cog");
shuticon.classList.remove("pi-cog");
shuticon.classList.add("pi-sign-out");
side_tb.append(logoutButton);
logoutButton.onclick = () => {logout()}
}
},`
I made a fork to change UI but can't make PR as I removed parts I don't personnaly use.... https://github.com/syllebra/BilboX-ComfyUI-Login
Hi, syllebra, thanks. But I've just update to the latest version and I saw the Logout button right over there. Am I missing something?
Did you activate the new UI in the settings?
Thanks. I saw it.
Hello and thank you for this extension.
A tiny small issue occurs when we use the new UI: logout button is not visible anymore. I had to do it for my custom node too, it's not very much. If I find time I will mak a PR.
Good luck!