mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +08:00
improve: support restart button on Install via git url
This commit is contained in:
parent
9e3fef11a4
commit
374fc2e37c
@ -17,7 +17,7 @@ import http.client
|
||||
import re
|
||||
import signal
|
||||
|
||||
version = "V1.6.2"
|
||||
version = "V1.6.3"
|
||||
print(f"### Loading: ComfyUI-Manager ({version})")
|
||||
|
||||
|
||||
|
||||
@ -574,7 +574,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
var url = prompt("Please enter the URL of the Git repository to install", "");
|
||||
|
||||
if (url !== null) {
|
||||
install_via_git_url(url);
|
||||
install_via_git_url(url, self);
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
13
js/common.js
13
js/common.js
@ -80,7 +80,7 @@ function isValidURL(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) {
|
||||
return;
|
||||
}
|
||||
@ -97,7 +97,16 @@ export async function install_via_git_url(url) {
|
||||
const res = await api.fetchApi(`/customnode/install/git_url?url=${url}`);
|
||||
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user