improve: support restart button on Install via git url

This commit is contained in:
Dr.Lt.Data 2023-12-03 22:36:37 +09:00
parent 9e3fef11a4
commit 374fc2e37c
3 changed files with 13 additions and 4 deletions

View File

@ -17,7 +17,7 @@ import http.client
import re import re
import signal import signal
version = "V1.6.2" version = "V1.6.3"
print(f"### Loading: ComfyUI-Manager ({version})") print(f"### Loading: ComfyUI-Manager ({version})")

View File

@ -574,7 +574,7 @@ class ManagerMenuDialog extends ComfyDialog {
var url = prompt("Please enter the URL of the Git repository to install", ""); var url = prompt("Please enter the URL of the Git repository to install", "");
if (url !== null) { if (url !== null) {
install_via_git_url(url); install_via_git_url(url, self);
} }
} }
}), }),

View File

@ -80,7 +80,7 @@ function isValidURL(url) {
return pattern.test(url); return pattern.test(url);
} }
export async function install_via_git_url(url) { export async function install_via_git_url(url, manager_dialog) {
if(!url) { if(!url) {
return; return;
} }
@ -97,7 +97,16 @@ export async function install_via_git_url(url) {
const res = await api.fetchApi(`/customnode/install/git_url?url=${url}`); const res = await api.fetchApi(`/customnode/install/git_url?url=${url}`);
if(res.status == 200) { if(res.status == 200) {
app.ui.dialog.show(`'${url}' is installed<BR>To apply the installed/disabled/enabled custom node, please restart ComfyUI.`); app.ui.dialog.show(`'${url}' is installed<BR>To apply the installed custom node, please <button id='cm-reboot-button'><font size='3px'>RESTART</font></button> ComfyUI.`);
const rebootButton = document.getElementById('cm-reboot-button');
const self = this;
rebootButton.onclick = function() {
if(rebootAPI()) {
manager_dialog.close();
}
};
app.ui.dialog.element.style.zIndex = 10010; app.ui.dialog.element.style.zIndex = 10010;
} }
else { else {