mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-01-19 10:30:18 +08:00
convert spaces to tabs
This commit is contained in:
parent
c826501e3c
commit
bae9531dc7
94
js/common.js
94
js/common.js
@ -95,61 +95,61 @@ function internalCustomConfirm(message, confirmMessage, cancelMessage) {
|
||||
}
|
||||
|
||||
export function addReportButton(dialogEl, options = {}) {
|
||||
const contentEl = dialogEl.querySelector(".comfy-modal-content");
|
||||
const closeBtnEl = contentEl?.querySelector("button");
|
||||
if (!contentEl || !closeBtnEl) return;
|
||||
const contentEl = dialogEl.querySelector(".comfy-modal-content");
|
||||
const closeBtnEl = contentEl?.querySelector("button");
|
||||
if (!contentEl || !closeBtnEl) return;
|
||||
|
||||
const { msg, errorSubtype, extraFields = [] } = options;
|
||||
const { msg, errorSubtype, extraFields = [] } = options;
|
||||
|
||||
const button = document.createElement("button");
|
||||
button.textContent = "Report Error";
|
||||
button.style.marginBottom = "0.25rem"; // mt-1
|
||||
const button = document.createElement("button");
|
||||
button.textContent = "Report Error";
|
||||
button.style.marginBottom = "0.25rem"; // mt-1
|
||||
|
||||
const cleanText = (text) => (text ? text.replace(/[\r\n\t\s]/g, " ") : text);
|
||||
const cleanText = (text) => (text ? text.replace(/[\r\n\t\s]/g, " ") : text);
|
||||
|
||||
button.addEventListener("click", () => {
|
||||
window["app"].extensionManager.dialog.showIssueReportDialog({
|
||||
title: "Report Manager Issue",
|
||||
subtitle: "Please describe the issue you are experiencing",
|
||||
panelProps: {
|
||||
errorType: "ManagerError",
|
||||
exceptionMessage: cleanText(msg),
|
||||
tags: {
|
||||
errorSubtype: cleanText(errorSubtype),
|
||||
isElectron: "electronAPI" in window,
|
||||
},
|
||||
defaultFields: ["Logs", "SystemStats"],
|
||||
extraFields: [
|
||||
{
|
||||
label: "ComfyUI-Manager Version",
|
||||
value: "ManagerVersion", // unique ID for the field
|
||||
getData: async () =>
|
||||
(await api.fetchApi(`/manager/version`)).text(),
|
||||
},
|
||||
...extraFields,
|
||||
],
|
||||
},
|
||||
});
|
||||
button.remove();
|
||||
});
|
||||
button.addEventListener("click", () => {
|
||||
window["app"].extensionManager.dialog.showIssueReportDialog({
|
||||
title: "Report Manager Issue",
|
||||
subtitle: "Please describe the issue you are experiencing",
|
||||
panelProps: {
|
||||
errorType: "ManagerError",
|
||||
exceptionMessage: cleanText(msg),
|
||||
tags: {
|
||||
errorSubtype: cleanText(errorSubtype),
|
||||
isElectron: "electronAPI" in window,
|
||||
},
|
||||
defaultFields: ["Logs", "SystemStats"],
|
||||
extraFields: [
|
||||
{
|
||||
label: "ComfyUI-Manager Version",
|
||||
value: "ManagerVersion", // unique ID for the field
|
||||
getData: async () =>
|
||||
(await api.fetchApi(`/manager/version`)).text(),
|
||||
},
|
||||
...extraFields,
|
||||
],
|
||||
},
|
||||
});
|
||||
button.remove();
|
||||
});
|
||||
|
||||
closeBtnEl.addEventListener("click", () => button.remove(), {
|
||||
once: true,
|
||||
passive: true,
|
||||
});
|
||||
contentEl.insertBefore(button, closeBtnEl);
|
||||
closeBtnEl.addEventListener("click", () => button.remove(), {
|
||||
once: true,
|
||||
passive: true,
|
||||
});
|
||||
contentEl.insertBefore(button, closeBtnEl);
|
||||
}
|
||||
|
||||
export function show_message(msg, errorReportOptions) {
|
||||
app.ui.dialog.show(msg);
|
||||
if (errorReportOptions) {
|
||||
try {
|
||||
addReportButton(app.ui.dialog.element, errorReportOptions);
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
app.ui.dialog.element.style.zIndex = 1100;
|
||||
app.ui.dialog.show(msg);
|
||||
if (errorReportOptions) {
|
||||
try {
|
||||
addReportButton(app.ui.dialog.element, errorReportOptions);
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
app.ui.dialog.element.style.zIndex = 1100;
|
||||
}
|
||||
|
||||
export async function sleep(ms) {
|
||||
|
||||
@ -1471,17 +1471,17 @@ export class CustomNodesManager {
|
||||
|
||||
if (errorMsg) {
|
||||
self.showError(errorMsg);
|
||||
show_message("Installation Error:\n"+errorMsg, {
|
||||
show_message("Installation Error:\n"+errorMsg, {
|
||||
msg: `Installation Error: ${errorMsg}`,
|
||||
errorSubtype: `node${label}Error`,
|
||||
extraFields: [
|
||||
{
|
||||
label: `${label} Error Trace`,
|
||||
value: `${label}ErrorsTrace`,
|
||||
getData: () => errorMsg,
|
||||
},
|
||||
],
|
||||
});
|
||||
errorSubtype: `node${label}Error`,
|
||||
extraFields: [
|
||||
{
|
||||
label: `${label} Error Trace`,
|
||||
value: `${label}ErrorsTrace`,
|
||||
getData: () => errorMsg,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
self.showStatus(`${label} ${result.length} custom node(s) successfully`);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user