mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 02:12:58 +08:00
fix: log file permission issue when reboot on windows
enhance: pretty conflict nodes message
This commit is contained in:
parent
2f1ab1a327
commit
86fe6b317e
10
__init__.py
10
__init__.py
@ -15,8 +15,9 @@ import ssl
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
import http.client
|
import http.client
|
||||||
import re
|
import re
|
||||||
|
import signal
|
||||||
|
|
||||||
version = "V1.5"
|
version = "V1.5.1"
|
||||||
print(f"### Loading: ComfyUI-Manager ({version})")
|
print(f"### Loading: ComfyUI-Manager ({version})")
|
||||||
|
|
||||||
|
|
||||||
@ -1479,7 +1480,12 @@ async def get_notice(request):
|
|||||||
|
|
||||||
@server.PromptServer.instance.routes.get("/manager/reboot")
|
@server.PromptServer.instance.routes.get("/manager/reboot")
|
||||||
def restart(self):
|
def restart(self):
|
||||||
return os.execv(sys.executable, ['python'] + sys.argv)
|
try:
|
||||||
|
sys.stdout.close_log()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return os.execv(sys.executable, [sys.executable] + sys.argv)
|
||||||
|
|
||||||
|
|
||||||
@server.PromptServer.instance.routes.get("/manager/share_option")
|
@server.PromptServer.instance.routes.get("/manager/share_option")
|
||||||
|
|||||||
@ -38,7 +38,15 @@ docStyle.innerHTML = `
|
|||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
.cm-conflicted-nodes-text {
|
||||||
|
background-color: #CCCC55 !important;
|
||||||
|
color: #AA3333 !important;
|
||||||
|
font-size: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
document.head.appendChild(docStyle);
|
document.head.appendChild(docStyle);
|
||||||
@ -240,7 +248,7 @@ async function updateAll(update_check_checkbox, manager_dialog) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(response1.status == 201 || response2.status == 201) {
|
if(response1.status == 201 || response2.status == 201) {
|
||||||
app.ui.dialog.show("ComfyUI and all extensions have been updated to the latest version.<BR>To apply the updated custom node, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI.");
|
app.ui.dialog.show("ComfyUI and all extensions have been updated to the latest version.<BR>To apply the updated custom node, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI. And refresh browser.");
|
||||||
|
|
||||||
const rebootButton = document.getElementById('cm-reboot-button');
|
const rebootButton = document.getElementById('cm-reboot-button');
|
||||||
rebootButton.onclick = function() {
|
rebootButton.onclick = function() {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export async function install_checked_custom_node(grid_rows, target_i, caller, m
|
|||||||
}
|
}
|
||||||
|
|
||||||
await caller.invalidateControl();
|
await caller.invalidateControl();
|
||||||
caller.updateMessage("<BR>To apply the installed/updated/disabled/enabled custom node, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI.", 'cm-reboot-button');
|
caller.updateMessage("<BR>To apply the installed/updated/disabled/enabled custom node, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI. And refresh browser.", 'cm-reboot-button');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -452,7 +452,7 @@ export class CustomNodesInstaller extends ComfyDialog {
|
|||||||
|
|
||||||
let conflicts = this.conflict_mappings[data.files[0]];
|
let conflicts = this.conflict_mappings[data.files[0]];
|
||||||
if(conflicts) {
|
if(conflicts) {
|
||||||
let buf = '<BR><BR><FONT color="#AA3333"><B>Conflicted Nodes:</B><BR>';
|
let buf = '<p class="cm-conflicted-nodes-text"><B><font color="BLACK">Conflicted Nodes:</FONT></B><BR>';
|
||||||
for(let k in conflicts) {
|
for(let k in conflicts) {
|
||||||
let node_name = conflicts[k][0];
|
let node_name = conflicts[k][0];
|
||||||
|
|
||||||
@ -464,13 +464,13 @@ export class CustomNodesInstaller extends ComfyDialog {
|
|||||||
extension_name = extension_name.slice(0, -4);
|
extension_name = extension_name.slice(0, -4);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf += `${node_name} [${extension_name}], `;
|
buf += `<B>${node_name}</B> [${extension_name}], `;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(buf.endsWith(', ')) {
|
if(buf.endsWith(', ')) {
|
||||||
buf = buf.slice(0, -2);
|
buf = buf.slice(0, -2);
|
||||||
}
|
}
|
||||||
buf += "</FONT>";
|
buf += "</p>";
|
||||||
data4.innerHTML += buf;
|
data4.innerHTML += buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ async function restore_snapshot(target) {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
await SnapshotManager.instance.invalidateControl();
|
await SnapshotManager.instance.invalidateControl();
|
||||||
SnapshotManager.instance.updateMessage("<BR>To apply the snapshot, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI.", 'cm-reboot-button');
|
SnapshotManager.instance.updateMessage("<BR>To apply the snapshot, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI. And refresh browser.", 'cm-reboot-button');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,9 +174,16 @@ try:
|
|||||||
def reconfigure(self, *args, **kwargs):
|
def reconfigure(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def close_log():
|
# You can close through sys.stderr.close_log()
|
||||||
|
def close_log(self):
|
||||||
|
sys.stderr = original_stderr
|
||||||
|
sys.stdout = original_stdout
|
||||||
log_file.close()
|
log_file.close()
|
||||||
|
|
||||||
|
def close_log():
|
||||||
|
sys.stderr = original_stderr
|
||||||
|
sys.stdout = original_stdout
|
||||||
|
log_file.close()
|
||||||
|
|
||||||
sys.stdout = ComfyUIManagerLogger(True)
|
sys.stdout = ComfyUIManagerLogger(True)
|
||||||
sys.stderr = ComfyUIManagerLogger(False)
|
sys.stderr = ComfyUIManagerLogger(False)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user