From 90f1cb70d34980abf3d9e785c8c3543de2aad017 Mon Sep 17 00:00:00 2001 From: nrbdev Date: Wed, 15 Jan 2025 09:49:30 -0500 Subject: [PATCH 1/3] feat: bulk max rank weapons and warframes --- static/webui/index.html | 8 +++-- static/webui/script.js | 80 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/static/webui/index.html b/static/webui/index.html index 81cbdb1e..aa5c831c 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -110,9 +110,11 @@
Bulk Actions
-
- - +
+ + + +
diff --git a/static/webui/script.js b/static/webui/script.js index 84b1a8c7..a6b87312 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -605,6 +605,46 @@ function addMissingWarframes() { } } +function maxRankAllWarframes() { + const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1"); + + req.done(data => { + window.itemListPromise.then(itemMap => { + const batchData = { Suits: [], SpecialItems: [] }; + + data.Suits.forEach(item => { + if (item.XP < 1_600_000) { + batchData.Suits.push({ + ItemId: { $oid: item.ItemId.$oid }, + XP: 1_600_000 - item.XP + }); + } + + if ("exalted" in itemMap[item.ItemType]) { + for (const exaltedType of itemMap[item.ItemType].exalted) { + const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType); + if (exaltedItem) { + const exaltedCap = itemMap[exaltedType]?.type == "weapons" ? 800_000 : 1_600_000; + if (exaltedItem.XP < exaltedCap) { + batchData.SpecialItems.push({ + ItemId: { $oid: exaltedItem.ItemId.$oid }, + XP: exaltedCap + }); + } + } + } + } + }); + + if (batchData.Suits.length > 0 || batchData.SpecialItems.length > 0) { + return sendBatchGearExp(batchData); + } + + alert("No Warframes to rank up."); + }); + }); +} + function addMissingWeapons() { const requests = []; document.querySelectorAll("#datalist-weapons option").forEach(elm => { @@ -620,6 +660,34 @@ function addMissingWeapons() { } } +function maxRankAllWeapons() { + const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1"); + + req.done(data => { + const batchData = {}; + + ["LongGuns", "Pistols", "Melee"].forEach(category => { + data[category].forEach(item => { + if (item.XP < 800_000) { + if (!batchData[category]) { + batchData[category] = []; + } + batchData[category].push({ + ItemId: { $oid: item.ItemId.$oid }, + XP: 800_000 - item.XP + }); + } + }); + }); + + if (Object.keys(batchData).length > 0) { + return sendBatchGearExp(batchData); + } + + alert("No weapons to rank up."); + }); +} + function addGearExp(category, oid, xp) { const data = {}; data[category] = [ @@ -641,6 +709,18 @@ function addGearExp(category, oid, xp) { }); } +function sendBatchGearExp(data) { + revalidateAuthz(() => { + $.post({ + url: "/api/missionInventoryUpdate.php?" + window.authz, + contentType: "text/plain", + data: JSON.stringify(data) + }).done(() => { + updateInventory(); + }); + }); +} + function renameGear(category, oid, name) { revalidateAuthz(() => { $.post({ -- 2.47.2 From b62a44cc9fdd944e4c2425256ae05b65c40977ca Mon Sep 17 00:00:00 2001 From: nrbdev Date: Wed, 15 Jan 2025 09:53:36 -0500 Subject: [PATCH 2/3] max width for item lists --- static/webui/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/webui/index.html b/static/webui/index.html index aa5c831c..50bb75ed 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -96,9 +96,9 @@
-
+
Warframes
-
+
@@ -119,9 +119,9 @@
-
+
Weapons
-
+
-- 2.47.2 From 7068d01ae4708cafffae600652ea43f16ba7796f Mon Sep 17 00:00:00 2001 From: Sainan Date: Wed, 15 Jan 2025 16:27:40 +0100 Subject: [PATCH 3/3] slight style improvement --- static/webui/index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/static/webui/index.html b/static/webui/index.html index 50bb75ed..114464ba 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -108,15 +108,6 @@
-
-
Bulk Actions
-
- - - - -
-
@@ -133,6 +124,15 @@
+
+
Bulk Actions
+
+ + + + +
+

-- 2.47.2