improve: better model downloading
improve: now skip_update_check is default
This commit is contained in:
@@ -111,6 +111,7 @@ async function install_custom_node(target, caller, mode) {
|
||||
async function updateComfyUI() {
|
||||
update_comfyui_button.innerText = "Updating ComfyUI...";
|
||||
update_comfyui_button.disabled = true;
|
||||
update_comfyui_button.style.backgroundColor = "gray";
|
||||
|
||||
try {
|
||||
const response = await api.fetchApi('/comfyui_manager/update_comfyui');
|
||||
@@ -140,12 +141,14 @@ async function updateComfyUI() {
|
||||
finally {
|
||||
update_comfyui_button.disabled = false;
|
||||
update_comfyui_button.innerText = "Update ComfyUI";
|
||||
update_comfyui_button.style.backgroundColor = "";
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUpdates() {
|
||||
async function fetchUpdates(update_check_checkbox) {
|
||||
fetch_updates_button.innerText = "Fetching updates...";
|
||||
fetch_updates_button.disabled = true;
|
||||
fetch_updates_button.style.backgroundColor = "gray";
|
||||
|
||||
try {
|
||||
var mode = "url";
|
||||
@@ -163,6 +166,7 @@ async function fetchUpdates() {
|
||||
if(response.status == 201) {
|
||||
app.ui.dialog.show('There is an updated extension available.');
|
||||
app.ui.dialog.element.style.zIndex = 9999;
|
||||
update_check_checkbox.checked = false;
|
||||
}
|
||||
else {
|
||||
app.ui.dialog.show('All extensions are already up-to-date with the latest versions.');
|
||||
@@ -172,13 +176,14 @@ async function fetchUpdates() {
|
||||
return true;
|
||||
}
|
||||
catch(exception) {
|
||||
app.ui.dialog.show(`Failed to update ComfyUI / ${exception}`);
|
||||
app.ui.dialog.show(`Failed to update custom nodes / ${exception}`);
|
||||
app.ui.dialog.element.style.zIndex = 9999;
|
||||
return false;
|
||||
}
|
||||
finally {
|
||||
fetch_updates_button.disabled = false;
|
||||
fetch_updates_button.innerText = "Fetch Updates";
|
||||
fetch_updates_button.style.backgroundColor = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +343,8 @@ class CustomNodesInstaller extends ComfyDialog {
|
||||
$el('br')]);
|
||||
msg.style.height = '100px';
|
||||
msg.style.verticalAlign = 'middle';
|
||||
msg.style.color = "var(--fg-color)";
|
||||
|
||||
this.element.appendChild(msg);
|
||||
|
||||
// invalidate
|
||||
@@ -1343,6 +1350,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
this.update_check_checkbox = $el("input",{type:'checkbox', id:"skip_update_check"},[])
|
||||
const uc_checkbox_text = $el("label",{},[" Skip update check"])
|
||||
uc_checkbox_text.style.color = "var(--fg-color)";
|
||||
this.update_check_checkbox.checked = true;
|
||||
|
||||
update_comfyui_button =
|
||||
$el("button", {
|
||||
@@ -1357,7 +1365,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
type: "button",
|
||||
textContent: "Fetch Updates",
|
||||
onclick:
|
||||
() => fetchUpdates()
|
||||
() => fetchUpdates(this.update_check_checkbox)
|
||||
});
|
||||
|
||||
let preview_combo = document.createElement("select");
|
||||
|
||||
Reference in New Issue
Block a user