feat: restart ComfyUI when update/install

This commit is contained in:
Dr.Lt.Data
2023-11-26 18:36:56 +09:00
parent a1e497dc92
commit de85111a40
7 changed files with 105 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
import { app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js"
import { ComfyDialog, $el } from "../../scripts/ui.js";
import { install_checked_custom_node, manager_instance } from "./common.js";
import { install_checked_custom_node, manager_instance, rebootAPI } from "./common.js";
async function getCustomNodes() {
var mode = "url";
@@ -105,8 +105,9 @@ export class CustomNodesInstaller extends ComfyDialog {
this.data = null;
}
constructor() {
constructor(app, manager_dialog) {
super();
this.manager_dialog = manager_dialog;
this.search_keyword = '';
this.element = $el("div.comfy-modal", { parent: document.body }, []);
}
@@ -244,8 +245,18 @@ export class CustomNodesInstaller extends ComfyDialog {
this.createBottomControls();
}
updateMessage(msg) {
updateMessage(msg, btn_id) {
this.message_box.innerHTML = msg;
if(btn_id) {
const rebootButton = document.getElementById(btn_id);
const self = this;
rebootButton.onclick = function() {
if(rebootAPI()) {
self.close();
self.manager_dialog.close();
}
};
}
}
invalidate_checks(is_checked, install_state) {