+13
-12
@@ -241,18 +241,7 @@ def check_model_existence(metadata_path, config_manager, id_model=None):
|
||||
|
||||
|
||||
|
||||
|
||||
# If is different from ComfyUISidebar, change it
|
||||
if __package__ != "ComfyUI-N-Sidebar":
|
||||
RED = "\033[31m"
|
||||
END = '\33[0m'
|
||||
print(f"{RED}!!!{END}")
|
||||
print(f"{RED}!!!{END}")
|
||||
print(f"{RED}WARNING:'{__package__}' folder name is WRONG!!! Please rename it 'ComfyUI-N-Sidebar'.{END}")
|
||||
print(f"{RED}!!!{END}")
|
||||
print(f"{RED}!!!{END}")
|
||||
else:
|
||||
print("ComfyUI-N-Sidebar is loading...")
|
||||
print("ComfyUI-N-Sidebar is loading...")
|
||||
|
||||
|
||||
|
||||
@@ -299,6 +288,18 @@ for folder in folders:
|
||||
list_panels_array.append(folder)
|
||||
|
||||
|
||||
|
||||
@server.PromptServer.instance.routes.get("/sidebar/current" )
|
||||
async def s_get(request):
|
||||
#current directory
|
||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
current_dir_name = os.path.basename(current_dir)
|
||||
|
||||
return web.json_response(current_dir_name, content_type='application/json')
|
||||
|
||||
|
||||
|
||||
|
||||
@server.PromptServer.instance.routes.get("/sidebar/backup" )
|
||||
async def s_get(request):
|
||||
backup_path = file_path + ".bak"
|
||||
|
||||
@@ -760,8 +760,8 @@
|
||||
|
||||
/* Settings */
|
||||
#switch_settings{
|
||||
bottom: 5px;
|
||||
position: absolute;
|
||||
/*bottom: 5px;
|
||||
position: absolute;*/
|
||||
width: -moz-available; /* WebKit-based browsers will ignore this. */
|
||||
width: -webkit-fill-available; /* Mozilla-based browsers will ignore this. */
|
||||
width: fill-available;
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
<span class="searchCategoryIcon" title="Category Only">C</span>
|
||||
</div>
|
||||
<div id="sidebar_views">
|
||||
<div class="view_button right" id="switch_settings" data-tooltip="Settings">⚙</div>
|
||||
<div class="view_button right" id="switch_sidebar" data-tooltip="Toggle Sidebar"><i class="pi pi-bars"></i></div>
|
||||
|
||||
<div class="view_button right" id="switch_home" data-content="home" data-tooltip="Home"><i class="pi pi-home"></i></div>
|
||||
<div class="view_button" id="official_button"></div>
|
||||
<div class="view_button right" id="switch_settings" data-tooltip="Settings">⚙</div>
|
||||
|
||||
</div>
|
||||
<div class="content_sidebar" id="panel_home" data-expanded="false" data-content="panel_content_home">
|
||||
<div id="spacer"></div>
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
const cnPath="../extensions/ComfyUI-N-Sidebar/"
|
||||
|
||||
//load folder name
|
||||
|
||||
|
||||
function getNameFolderSync() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "sidebar/current", false); // false = sincrona (blasfemia)
|
||||
xhr.send(null);
|
||||
|
||||
if (xhr.status === 200) {
|
||||
return JSON.parse(xhr.responseText);
|
||||
} else {
|
||||
throw new Error("Errore nella richiesta");
|
||||
}
|
||||
}
|
||||
const nameFolder = getNameFolderSync();
|
||||
const cnPath = `../extensions/${nameFolder}/`;
|
||||
|
||||
function addSidebarStyles(cssPath) {
|
||||
const timestamp = new Date().getTime();
|
||||
const linkElement = document.createElement("link");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
let sbPosition = "left";
|
||||
let sbPosition = "right";
|
||||
let defaultSearchToggle = "fuzzy";
|
||||
let defaultSearchOrder = "comfyui";
|
||||
let current_path = null;
|
||||
@@ -510,6 +510,13 @@ async function settingsSetup(app,$el) {
|
||||
addDynamicCSSRule('.side-bar-panel', 'min-width', 'calc('+localStorage.getItem("sidebarWidth")+'px - 35px)');
|
||||
}
|
||||
|
||||
|
||||
if (localStorage.getItem("Comfy.Settings.Comfy.Sidebar.Location") === null ) {
|
||||
addDynamicCSSRule('.side-bar-panel', 'min-width', 'calc('+localStorage.getItem("sidebarWidth")+'px - 35px)');
|
||||
addDynamicCSSRule('.splitter-overlay', 'margin-left', '35px');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch(err){
|
||||
|
||||
@@ -452,7 +452,12 @@ function containsSpecialCharacters(name, level=0) {
|
||||
}
|
||||
|
||||
async function reloadCtxMenu() {
|
||||
const cnPath="../extensions/ComfyUI-N-Sidebar/"
|
||||
//load folder name
|
||||
var nameRequest = await fetch('sidebar/current');
|
||||
var nameFolder = await nameRequest.json();
|
||||
|
||||
const cnPath = `../extensions/${nameFolder}/`
|
||||
|
||||
const response3 = await fetch(cnPath +'settings.json');
|
||||
const settingsData = await response3.json();
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ import { GroupNodeConfig, GroupNodeHandler } from "../../../../extensions/core/g
|
||||
const gnc = GroupNodeConfig;
|
||||
//import {settingsSetup} from './functions/settings.jsb';
|
||||
console.time('execution time');
|
||||
const cnPath = "../extensions/ComfyUI-N-Sidebar/"
|
||||
//load folder name
|
||||
var nameRequest = await fetch('sidebar/current');
|
||||
var nameFolder = await nameRequest.json();
|
||||
const cnPath = `../extensions/${nameFolder}/`
|
||||
function jsloader(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try{
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-n-sidebar"
|
||||
description = "A simple sidebar for ComfyUI."
|
||||
version = "1.5.8"
|
||||
version = "1.6.0"
|
||||
license = { file = "LICENSE" }
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user