diff --git a/web-plugin/index.js b/web-plugin/index.js index fc7dcb4..8f1e9a9 100644 --- a/web-plugin/index.js +++ b/web-plugin/index.js @@ -180,6 +180,7 @@ function showError(title, message) { } function createDynamicUIHtml(data) { + console.log(data); let html = '
'; const bgcolor = "var(--comfy-input-bg)"; @@ -212,33 +213,32 @@ function createDynamicUIHtml(data) { html += `
`; html += '

Models

'; - const modelSections = ["checkpoints", "ipadapter", "clip_vision"]; - modelSections.forEach((section) => { + + Object.entries(data.models).forEach(([section, items]) => { html += ` -
-

${ - section.charAt(0).toUpperCase() + section.slice(1) - }

- `; - data.models[section].forEach((item) => { +
+

${ + section.charAt(0).toUpperCase() + section.slice(1) + }

`; + items.forEach((item) => { html += `

${item.name}

`; }); html += "
"; }); html += "
"; - // Files - html += `
`; - html += - '

Files

'; - html += ` -
-

Images

- `; - data.files.images.forEach((image) => { - html += `

${image.name}

`; + Object.entries(data.files).forEach(([section, items]) => { + html += ` +
+

${ + section.charAt(0).toUpperCase() + section.slice(1) + }

`; + items.forEach((item) => { + html += `

${item.name}

`; + }); + html += "
"; }); - html += "
"; + html += "
"; html += "
"; return html;