modified: apply new front's confirm api

This commit is contained in:
Dr.Lt.Data 2025-01-02 02:23:21 +09:00
parent ad632de6da
commit a148bb5aeb
8 changed files with 28 additions and 11 deletions

View File

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global
from manager_util import PIPFixer, StrictVersion
version = [2, 56]
version = [2, 56, 1]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')

View File

@ -41,7 +41,7 @@ docStyle.innerHTML = `
width: 1000px;
height: 520px;
box-sizing: content-box;
z-index: 10000;
z-index: 1000;
overflow-y: auto;
}
@ -49,7 +49,7 @@ docStyle.innerHTML = `
width: 400px;
height: 25px;
box-sizing: border-box;
z-index: 10000;
z-index: 1000;
margin-top: 10px;
margin-bottom: 5px;
}

View File

@ -512,7 +512,7 @@ export class ShareDialogChooser extends ComfyDialog {
}
show() {
this.element.style.display = "block";
this.element.style.zIndex = 10001;
this.element.style.zIndex = 1100;
}
}
export class ShareDialog extends ComfyDialog {

View File

@ -3,7 +3,7 @@ import { api } from "../../scripts/api.js";
import { $el, ComfyDialog } from "../../scripts/ui.js";
export function customConfirm(message, confirmMessage, cancelMessage) {
function internalCustomConfirm(message, confirmMessage, cancelMessage) {
return new Promise((resolve) => {
// transparent bg
const modalOverlay = document.createElement('div');
@ -16,7 +16,7 @@ export function customConfirm(message, confirmMessage, cancelMessage) {
modalOverlay.style.display = 'flex';
modalOverlay.style.alignItems = 'center';
modalOverlay.style.justifyContent = 'center';
modalOverlay.style.zIndex = '1000000';
modalOverlay.style.zIndex = '1100';
// Modal window container (dark bg)
const modalDialog = document.createElement('div');
@ -96,13 +96,30 @@ export function customConfirm(message, confirmMessage, cancelMessage) {
export function show_message(msg) {
app.ui.dialog.show(msg);
app.ui.dialog.element.style.zIndex = 10010;
app.ui.dialog.element.style.zIndex = 1100;
}
export async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export async function customConfirm(message) {
try {
let res = await
window['app'].extensionManager.dialog
.confirm({
title: 'Confirm',
message: message
});
return res;
}
catch {
let res = await internalCustomConfirm(message);
return res;
}
}
export function rebootAPI() {
if ('electronAPI' in window) {
window.electronAPI.restartApp();

View File

@ -456,7 +456,7 @@ export class ComponentBuilderDialog extends ComfyDialog {
this.invalidateControl();
this.element.style.display = "block";
this.element.style.zIndex = 10001;
this.element.style.zIndex = 1100;
this.element.style.width = "500px";
this.element.style.height = "480px";
}

View File

@ -10,7 +10,7 @@ import TG from "./turbogrid.esm.js";
const pageCss = `
.cmm-manager {
--grid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
z-index: 10001;
z-index: 1100;
width: 80%;
height: 80%;
display: flex;

View File

@ -291,7 +291,7 @@ export class SnapshotManager extends ComfyDialog {
try {
this.invalidateControl();
this.element.style.display = "block";
this.element.style.zIndex = 10001;
this.element.style.zIndex = 1100;
}
catch(exception) {
app.ui.dialog.show(`Failed to get external model list. / ${exception}`);

View File

@ -1,7 +1,7 @@
[project]
name = "comfyui-manager"
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
version = "2.56"
version = "2.56.1"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]