fix ui switch

This commit is contained in:
xbol0 2023-08-09 06:39:54 +00:00
parent c1da0d6cc1
commit 6411a1dd17
3 changed files with 17 additions and 7 deletions

View File

@ -13,8 +13,13 @@ export default {
"ui.close_btn": "Close",
"ui.queue_size": "Queue size: ",
"ui.extra_options": "Extra options",
"ui.extra.batch_count": "Batch count",
"ui.settings.title": "Settings",
"ui.list.view.prefix": "View ",
"ui.list.clear.prefix": "Clear ",
"ui.list.queue": "Queue",
"ui.list.history": "History",
"ui.canvas_menu_add_node": "Add Node",
"ui.canvas_menu_add_group": "Add Group",

View File

@ -13,8 +13,13 @@ export default {
"ui.close_btn": "关闭",
"ui.queue_size": "队列数量: ",
"ui.extra_options": "额外选项",
"ui.extra.batch_count": "批次数量",
"ui.settings.title": "设置",
"ui.list.view.prefix": "查看",
"ui.list.clear.prefix": "清除",
"ui.list.queue": "队列",
"ui.list.history": "历史",
"ui.canvas_menu_add_node": "添加节点",
"ui.canvas_menu_add_group": "添加组",

View File

@ -480,13 +480,13 @@ class ComfyList {
]),
$el("div.comfy-list-actions", [
$el("button", {
textContent: "Clear " + this.#text,
textContent: i18next.t("ui.list.clear.prefix") + this.#text,
onclick: async () => {
await api.clearItems(this.#type);
await this.load();
},
}),
$el("button", { textContent: "Refresh", onclick: () => this.load() }),
$el("button", { textContent: i18next.t("ui.refresh_btn"), onclick: () => this.load() }),
])
);
}
@ -499,14 +499,14 @@ class ComfyList {
async show() {
this.element.style.display = "block";
this.button.textContent = "Close";
this.button.textContent = i18next.t("ui.close_btn");
await this.load();
}
hide() {
this.element.style.display = "none";
this.button.textContent = "View " + this.#text;
this.button.textContent = i18next.t("ui.list.view.prefix") + this.#text;
}
toggle() {
@ -528,8 +528,8 @@ export class ComfyUI {
this.batchCount = 1;
this.lastQueueSize = 0;
this.queue = new ComfyList("Queue");
this.history = new ComfyList("History");
this.queue = new ComfyList(i18next.t("ui.list.queue"));
this.history = new ComfyList(i18next.t("ui.list.history"));
api.addEventListener("status", () => {
this.queue.update();
@ -617,7 +617,7 @@ export class ComfyUI {
]),
]),
$el("div", { id: "extraOptions", style: { width: "100%", display: "none" } }, [
$el("label", { innerHTML: "Batch count" }, [
$el("label", { innerHTML: i18next.t("ui.extra.batch_count") }, [
$el("input", {
id: "batchCountInputNumber",
type: "number",