From 48ff846b8c7f85f44f9d2a53f4611f962b37ffd6 Mon Sep 17 00:00:00 2001 From: Sainan Date: Thu, 20 Jun 2024 20:23:55 +0200 Subject: [PATCH 1/2] fix(webui): invalid input indicator on "Add Items" never disappears --- static/webui/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 0090d427..6c8837f2 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -535,8 +535,8 @@ function doAcquireMiscItems() { }); } -$("#miscitem-name").on("input", () => { - $("#miscitem-name").removeClass("is-invalid"); +$("#miscitem-type").on("input", () => { + $("#miscitem-type").removeClass("is-invalid"); }); function doAcquireRiven() { -- 2.47.2 From b72c3131fe6d2a2cae70a2df81dec4668dd2ef93 Mon Sep 17 00:00:00 2001 From: Sainan Date: Thu, 20 Jun 2024 20:43:50 +0200 Subject: [PATCH 2/2] feat(webui): acquiring gear items via "Add Items" --- .../custom/getItemListsController.ts | 18 +++++++++++++++--- static/webui/script.js | 7 ++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index 574ec8d7..1f9417bf 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -1,7 +1,13 @@ import { RequestHandler } from "express"; import { MinItem, items, getEnglishString } from "@/src/services/itemDataService"; import badItems from "@/static/json/exclude-mods.json"; -import { ExportArcanes, ExportResources, ExportWarframes, ExportWeapons } from "warframe-public-export-plus"; +import { + ExportArcanes, + ExportGear, + ExportResources, + ExportWarframes, + ExportWeapons +} from "warframe-public-export-plus"; interface ListedItem { uniqueName: string; @@ -31,7 +37,7 @@ const getItemListsController: RequestHandler = (_req, res) => { }); } else if (!item.excludeFromCodex) { miscitems.push({ - uniqueName, + uniqueName: "MiscItems:" + uniqueName, name: getEnglishString(item.name) }); } @@ -39,7 +45,13 @@ const getItemListsController: RequestHandler = (_req, res) => { } for (const [uniqueName, item] of Object.entries(ExportResources)) { miscitems.push({ - uniqueName, + uniqueName: "MiscItems:" + uniqueName, + name: getEnglishString(item.name) + }); + } + for (const [uniqueName, item] of Object.entries(ExportGear)) { + miscitems.push({ + uniqueName: "Consumables:" + uniqueName, name: getEnglishString(item.name) }); } diff --git a/static/webui/script.js b/static/webui/script.js index 6c8837f2..f7d79962 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -512,17 +512,18 @@ function disposeOfItems(category, type, count) { } function doAcquireMiscItems() { - const uniqueName = getKey(document.getElementById("miscitem-type")); - if (!uniqueName) { + const data = getKey(document.getElementById("miscitem-type")); + if (!data) { $("#miscitem-type").addClass("is-invalid").focus(); return; } + const [category, uniqueName] = data.split(":"); revalidateAuthz(() => { $.post({ url: "/api/missionInventoryUpdate.php?" + window.authz, contentType: "text/plain", data: JSON.stringify({ - MiscItems: [ + [category]: [ { ItemType: uniqueName, ItemCount: parseInt($("#miscitem-count").val()) -- 2.47.2