feat(webui): change server config through UI #294
@ -1,8 +1,8 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import configFile from "@/config.json";
|
import configFile from "@/config.json";
|
||||||
|
|
||||||
const getConfigData: RequestHandler = (_req, res) => {
|
const getConfigDataController: RequestHandler = (_req, res) => {
|
||||||
res.json(configFile);
|
res.json(configFile);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getConfigData };
|
export { getConfigDataController };
|
@ -3,7 +3,7 @@ import path from "path";
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
const rootDir = path.join(__dirname, "../../..");
|
const rootDir = path.join(__dirname, "../../..");
|
||||||
|
|
||||||
const updateConfigData: RequestHandler = (req) => {
|
const updateConfigDataController: RequestHandler = (req) => {
|
||||||
const updateSettingsData = req.body;
|
const updateSettingsData = req.body;
|
||||||
|
|
||||||
fs.writeFile(path.join(rootDir, "config.json"), updateSettingsData, function(err:any) {
|
fs.writeFile(path.join(rootDir, "config.json"), updateSettingsData, function(err:any) {
|
||||||
@ -13,4 +13,4 @@ const updateConfigData: RequestHandler = (req) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export { updateConfigData };
|
export { updateConfigDataController };
|
@ -2,8 +2,8 @@ import express from "express";
|
|||||||
import { getItemListsController } from "@/src/controllers/custom/getItemListsController";
|
import { getItemListsController } from "@/src/controllers/custom/getItemListsController";
|
||||||
import { createAccountController } from "@/src/controllers/custom/createAccountController";
|
import { createAccountController } from "@/src/controllers/custom/createAccountController";
|
||||||
import { addItemController } from "@/src/controllers/custom/addItemController";
|
import { addItemController } from "@/src/controllers/custom/addItemController";
|
||||||
import { getConfigData } from "@/src/controllers/custom/getConfigData";
|
import { getConfigDataController } from "@/src/controllers/custom/getConfigDataController";
|
||||||
import { updateConfigData } from "@/src/controllers/custom/updateConfigData";
|
import { updateConfigDataController } from "@/src/controllers/custom/updateConfigDataController";
|
||||||
|
|
||||||
const customRouter = express.Router();
|
const customRouter = express.Router();
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ customRouter.get("/getItemLists", getItemListsController);
|
|||||||
customRouter.post("/createAccount", createAccountController);
|
customRouter.post("/createAccount", createAccountController);
|
||||||
customRouter.post("/addItem", addItemController);
|
customRouter.post("/addItem", addItemController);
|
||||||
|
|
||||||
customRouter.get("/config", getConfigData);
|
customRouter.get("/config", getConfigDataController);
|
||||||
customRouter.post("/config", updateConfigData);
|
customRouter.post("/config", updateConfigDataController);
|
||||||
|
|
||||||
export { customRouter };
|
export { customRouter };
|
@ -94,62 +94,6 @@
|
|||||||
<button class="btn btn-primary" type="submit">Login</button>
|
<button class="btn btn-primary" type="submit">Login</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div data-route="/webui/settings" data-title="Settings | OpenWF WebUI">
|
|
||||||
<div class="card mb-4">
|
|
||||||
<h5 class="card-header">Change Settings</h5>
|
|
||||||
<form class="card-body" onsubmit="doChangeSettings();return false;">
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="skipStoryModeChoice" />
|
|
||||||
<label label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="skipTutorial" />
|
|
||||||
<label label class="form-check-label" for="skipTutorial">Skip Tutorial?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllScans" />
|
|
||||||
<label label class="form-check-label" for="unlockAllScans">Unlock All Scans?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllMissions" />
|
|
||||||
<label label class="form-check-label" for="unlockAllMissions">Unlock All Missions?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllQuests" />
|
|
||||||
<label label class="form-check-label" for="unlockAllQuests">Unlock All Quests?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="completeAllQuests" />
|
|
||||||
<label label class="form-check-label" for="completeAllQuests">Complete All Quests?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="infiniteResources" />
|
|
||||||
<label label class="form-check-label" for="infiniteResources">Infinite Credits and Platinum?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockallShipFeatures" />
|
|
||||||
<label label class="form-check-label" for="unlockallShipFeatures">Unlock All Ship Features?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllShipDecorations" />
|
|
||||||
<label label class="form-check-label" for="unlockAllShipDecorations">Unlock All Ship Decorations?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllFlavourItems" />
|
|
||||||
<label label class="form-check-label" for="unlockAllFlavourItems">Unlock All Accessories?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" value="" id="unlockAllSkins" />
|
|
||||||
<label label class="form-check-label" for="unlockAllSkins">Unlock All Skins?</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<label label class="form-check-label" for="spoofMasteryRank">Spoofed Mastery Rank (-1 to disable)</label>
|
|
||||||
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" value="" />
|
|
||||||
</div>
|
|
||||||
<button class="btn btn-primary" type="submit">Save Settings</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
|
<div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
|
||||||
<p id="refresh-note" class="mb-4">
|
<p id="refresh-note" class="mb-4">
|
||||||
Note: Changes made here will only be reflected in-game when the game re-downloads your inventory.
|
Note: Changes made here will only be reflected in-game when the game re-downloads your inventory.
|
||||||
@ -259,6 +203,62 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div data-route="/webui/settings" data-title="Settings | OpenWF WebUI">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">Change Settings</h5>
|
||||||
|
<form class="card-body" onsubmit="doChangeSettings();return false;">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="skipStoryModeChoice" />
|
||||||
|
<label label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="skipTutorial" />
|
||||||
|
<label label class="form-check-label" for="skipTutorial">Skip Tutorial?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllScans" />
|
||||||
|
<label label class="form-check-label" for="unlockAllScans">Unlock All Scans?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllMissions" />
|
||||||
|
<label label class="form-check-label" for="unlockAllMissions">Unlock All Missions?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllQuests" />
|
||||||
|
<label label class="form-check-label" for="unlockAllQuests">Unlock All Quests?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="completeAllQuests" />
|
||||||
|
<label label class="form-check-label" for="completeAllQuests">Complete All Quests?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="infiniteResources" />
|
||||||
|
<label label class="form-check-label" for="infiniteResources">Infinite Credits and Platinum?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockallShipFeatures" />
|
||||||
|
<label label class="form-check-label" for="unlockallShipFeatures">Unlock All Ship Features?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllShipDecorations" />
|
||||||
|
<label label class="form-check-label" for="unlockAllShipDecorations">Unlock All Ship Decorations?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllFlavourItems" />
|
||||||
|
<label label class="form-check-label" for="unlockAllFlavourItems">Unlock All Accessories?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="unlockAllSkins" />
|
||||||
|
<label label class="form-check-label" for="unlockAllSkins">Unlock All Skins?</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<label label class="form-check-label" for="spoofMasteryRank">Spoofed Mastery Rank (-1 to disable)</label>
|
||||||
|
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" value="" />
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-primary" type="submit">Save Settings</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<datalist id="datalist-warframes"></datalist>
|
<datalist id="datalist-warframes"></datalist>
|
||||||
|
@ -15,6 +15,7 @@ function loginFromLocalStorage() {
|
|||||||
window.accountId = data.id;
|
window.accountId = data.id;
|
||||||
window.authz = "accountId=" + data.id + "&nonce=" + data.Nonce;
|
window.authz = "accountId=" + data.id + "&nonce=" + data.Nonce;
|
||||||
updateInventory();
|
updateInventory();
|
||||||
|
fetchSettings();
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
logout();
|
logout();
|
||||||
@ -95,15 +96,17 @@ window.itemListPromise = new Promise(resolve => {
|
|||||||
"/Lotus/Weapons/Tenno/Rifle/LotusRifle": { name: "Rifle" },
|
"/Lotus/Weapons/Tenno/Rifle/LotusRifle": { name: "Rifle" },
|
||||||
"/Lotus/Weapons/Tenno/Shotgun/LotusShotgun": { name: "Shotgun" },
|
"/Lotus/Weapons/Tenno/Shotgun/LotusShotgun": { name: "Shotgun" },
|
||||||
// Missing in data sources
|
// Missing in data sources
|
||||||
"/Lotus/Upgrades/CosmeticEnhancers/Peculiars/CyoteMod": { name: "Traumatic Peculiar" },
|
"/Lotus/Upgrades/CosmeticEnhancers/Peculiars/CyoteMod": { name: "Traumatic Peculiar" }
|
||||||
"/Lotus/Weapons/Tenno/Grimoire/TnGrimoire": { name: "Grimoire" }
|
|
||||||
};
|
};
|
||||||
for (const [type, items] of Object.entries(data)) {
|
for (const [type, items] of Object.entries(data)) {
|
||||||
if (type != "badItems") {
|
if (type != "badItems") {
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
if (item.uniqueName in data.badItems) {
|
if (item.uniqueName in data.badItems) {
|
||||||
item.name += " (Imposter)";
|
item.name += " (Imposter)";
|
||||||
} else if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/") {
|
} else if (
|
||||||
|
item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/" &&
|
||||||
|
item.uniqueName.substr(0, 18) != "/Lotus/StoreItems/"
|
||||||
|
) {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.setAttribute("data-key", item.uniqueName);
|
option.setAttribute("data-key", item.uniqueName);
|
||||||
option.value = item.name;
|
option.value = item.name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user