Skip to content

Commit

Permalink
monitors move to comfyui-menu-push
Browse files Browse the repository at this point in the history
  • Loading branch information
crystian committed Sep 24, 2024
1 parent c05f5bf commit 23028b1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@author: Crystian
@title: Crystools
@nickname: Crystools
@version: 1.18.2
@version: 1.18.3
@project: "https://github.com/crystian/ComfyUI-Crystools",
@description: Plugins for multiples uses, mainly for debugging, you need them! IG: https://www.instagram.com/crystian.ia
"""
Expand Down
2 changes: 1 addition & 1 deletion core/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.18.2"
version = "1.18.3"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-crystools"
description = "With this suit, you can see the resources monitor, progress bar & time elapsed, metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!\nThis provides better nodes to load/save images, previews, etc, and see \"hidden\" data without loading a new workflow."
version = "1.18.2"
version = "1.18.3"
license = { file = "LICENSE" }
dependencies = ["deepdiff", "torch", "numpy", "Pillow", "pynvml", "py-cpuinfo"]

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.2
1.18.3
18 changes: 12 additions & 6 deletions web/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,21 +509,27 @@ class CrystoolsMonitor {
if (document.getElementById('ProgressBarUI')) {
document.getElementById('ProgressBarUI').style.display = 'flex';
}
if (parentElement && this.monitorUI.htmlRoot) {
parentElement.insertAdjacentElement('afterend', this.monitorUI.htmlRoot);
}
else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}
break;
case NewMenuOptions.Top:
case NewMenuOptions.Bottom:
if (document.getElementById('ProgressBarUI')) {
document.getElementById('ProgressBarUI').style.display = 'none';
}
parentElement = document.getElementsByClassName('comfyui-menu-push')[0];
if (parentElement && this.monitorUI.htmlRoot) {
parentElement.appendChild(this.monitorUI.htmlRoot);
}
else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}
break;
}
if (parentElement && this.monitorUI.htmlRoot) {
parentElement.insertAdjacentElement('afterend', this.monitorUI.htmlRoot);
}
else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}
}
});
Object.defineProperty(this, "updateAllWidget", {
Expand Down
21 changes: 13 additions & 8 deletions web/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class CrystoolsMonitor {
});
};

// eslint-disable-next-line complexity
moveMonitor = (position: NewMenuOptions): void => {
let parentElement: Element | null | undefined;

Expand All @@ -416,7 +417,13 @@ class CrystoolsMonitor {
document.getElementById('ProgressBarUI').style.display = 'flex';

}
if (parentElement && this.monitorUI.htmlRoot) {
parentElement.insertAdjacentElement('afterend', this.monitorUI.htmlRoot);
} else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}
break;

case NewMenuOptions.Top:
case NewMenuOptions.Bottom:
// TODO remove this
Expand All @@ -425,17 +432,15 @@ class CrystoolsMonitor {
document.getElementById('ProgressBarUI').style.display = 'none';
}
parentElement = document.getElementsByClassName('comfyui-menu-push')[0];

if (parentElement && this.monitorUI.htmlRoot) {
parentElement.appendChild(this.monitorUI.htmlRoot);
} else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}
break;
}

if (parentElement && this.monitorUI.htmlRoot) {
// console.log('moveMonitor1', parentElement);
// console.log('moveMonitor2', this.monitorUI.htmlRoot);
parentElement.insertAdjacentElement('afterend', this.monitorUI.htmlRoot);

} else {
console.error('Crystools: parentElement to move monitors not found!', parentElement);
}

};

Expand Down

0 comments on commit 23028b1

Please sign in to comment.