- Fixed bug on dragging templates
- Added multi user support on templates
This commit is contained in:
@@ -11,6 +11,10 @@ For what i know nobody did it, so i did it.
|
||||
Maybe you don't need it. I need it >.<
|
||||
|
||||
# Updates
|
||||
- 05-07-2024
|
||||
- Fixed bug on dragging templates
|
||||
- Added multi user support on templates
|
||||
|
||||
|
||||
- 04-06-2024
|
||||
- Fixed some bugs
|
||||
@@ -157,8 +161,11 @@ PS: Workflow Path
|
||||
- [x] Templates
|
||||
- [ ] Custom Shortcuts
|
||||
- [ ] Export and Import Settings
|
||||
- [ ] Touch Support
|
||||
|
||||
|
||||
### Known Issues:
|
||||
- After you drag a template onto the workflow, if you drag any other file from your PC that does not include a workflow, it will paste the last template you dragged again.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ var custom_templates = (function () {
|
||||
app.canvas.graph_mouse[1] = coord[1];
|
||||
app.canvas.pasteFromClipboard();
|
||||
localStorage.removeItem("litegrapheditor_clipboard");
|
||||
draggedElement.dataset.data = NaN;
|
||||
//draggedElement.dataset.data = NaN;
|
||||
});
|
||||
} else if (draggedElement.id === 'sidebarItem' && (event.target.classList.contains('sidebarCategory') || event.target.classList.contains('displayNamesList'))) {
|
||||
const ulElement = event.target.querySelector('ul');
|
||||
@@ -386,8 +386,18 @@ var custom_templates = (function () {
|
||||
|
||||
async function readComfyTemplates() {
|
||||
let comfy_templates = {};
|
||||
try {
|
||||
const response = await fetch('./userdata/comfy.templates.json');
|
||||
try {
|
||||
//multi user check
|
||||
//if Comfy.User local storage exists
|
||||
if (localStorage.getItem('Comfy.userId')) {
|
||||
headers = {
|
||||
'Comfy-User': localStorage.getItem('Comfy.userId')
|
||||
}
|
||||
} else {
|
||||
headers = {}
|
||||
}
|
||||
|
||||
const response = await fetch('./userdata/comfy.templates.json', { headers: headers });
|
||||
comfy_templates = await response.json();
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
|
||||
@@ -520,7 +520,7 @@ var custom_workflows = (function () {
|
||||
|
||||
|
||||
function createHtmlFromTree(tree, parentElement) {
|
||||
// Prima, crea le sottocartelle
|
||||
// Make i subfolder
|
||||
for (const key in tree) {
|
||||
if (key !== 'workflows') {
|
||||
const subfolderLi = document.createElement('li');
|
||||
@@ -541,7 +541,7 @@ var custom_workflows = (function () {
|
||||
}
|
||||
}
|
||||
|
||||
// Poi, crea i workflow
|
||||
// Then make workflows
|
||||
if (tree.workflows) {
|
||||
tree.workflows.forEach(workflow => {
|
||||
const workflowItem = document.createElement('li');
|
||||
@@ -550,6 +550,7 @@ var custom_workflows = (function () {
|
||||
workflowItem.dataset.nameworkflow = workflow.name;
|
||||
workflowItem.dataset.data = workflow.path;
|
||||
workflowItem.dataset.id = workflow.id;
|
||||
workflowItem.title = workflow.name;
|
||||
workflowItem.textContent = workflow.name;
|
||||
workflowItem.draggable = true;
|
||||
parentElement.appendChild(workflowItem);
|
||||
@@ -617,6 +618,7 @@ var custom_workflows = (function () {
|
||||
displayNameItem.classList.add("sidebarItem");
|
||||
displayNameItem.id = "sidebarWorkflowItem"
|
||||
displayNameItem.textContent = data[displayName].name;
|
||||
displayNameItem.title = data[displayName].name;
|
||||
displayNameItem.dataset.nameworkflow = data[displayName].name;
|
||||
displayNameItem.dataset.data = data[displayName].path;
|
||||
displayNameItem.dataset.id = displayName;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-n-sidebar"
|
||||
description = "A simple sidebar for ComfyUI."
|
||||
version = "1.2.1"
|
||||
version = "1.2.2"
|
||||
license = "LICENSE"
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user