WebUI Add Scroll & Mods Count
This commit is contained in:
parent
3c99b748dc
commit
923b4f3c42
@ -217,11 +217,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xxl-6">
|
<div class="col-xxl-6">
|
||||||
<div class="card mb-3">
|
<div class="card mb-3" style="height: 480px;">
|
||||||
<h5 class="card-header">Mods</h5>
|
<h5 class="card-header">Mods</h5>
|
||||||
<div class="card-body">
|
<div class="card-body overflow-auto">
|
||||||
<form class="input-group mb-3" onsubmit="doAcquireMod();return false;">
|
<form class="input-group mb-3" onsubmit="doAcquireMod();return false;">
|
||||||
<input class="form-control" id="mod-to-acquire" list="datalist-mods" />
|
<input class="form-control" id="mod-to-acquire" list="datalist-mods" placeholder="Enter mod name" />
|
||||||
|
<input class="form-control" type="number" id="mod-count" placeholder="Count" min="1" value="1" />
|
||||||
<button class="btn btn-primary" type="submit">Add</button>
|
<button class="btn btn-primary" type="submit">Add</button>
|
||||||
</form>
|
</form>
|
||||||
<table class="table table-hover w-100">
|
<table class="table table-hover w-100">
|
||||||
@ -229,6 +230,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<h5 class="card-header">Bulk Actions</h5>
|
<h5 class="card-header">Bulk Actions</h5>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
@ -898,10 +898,19 @@ function setFingerprint(ItemType, ItemId, fingerprint) {
|
|||||||
|
|
||||||
function doAcquireMod() {
|
function doAcquireMod() {
|
||||||
const uniqueName = getKey(document.getElementById("mod-to-acquire"));
|
const uniqueName = getKey(document.getElementById("mod-to-acquire"));
|
||||||
|
const modCount = parseInt(document.getElementById("mod-count").value, 10);
|
||||||
|
|
||||||
if (!uniqueName) {
|
if (!uniqueName) {
|
||||||
$("#mod-to-acquire").addClass("is-invalid").focus();
|
$("#mod-to-acquire").addClass("is-invalid").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(modCount) || modCount < 1) {
|
||||||
|
alert("Please enter a valid count.");
|
||||||
|
document.getElementById("mod-count").focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
revalidateAuthz(() => {
|
revalidateAuthz(() => {
|
||||||
$.post({
|
$.post({
|
||||||
url: "/api/missionInventoryUpdate.php?" + window.authz,
|
url: "/api/missionInventoryUpdate.php?" + window.authz,
|
||||||
@ -910,17 +919,22 @@ function doAcquireMod() {
|
|||||||
RawUpgrades: [
|
RawUpgrades: [
|
||||||
{
|
{
|
||||||
ItemType: uniqueName,
|
ItemType: uniqueName,
|
||||||
ItemCount: 1
|
ItemCount: modCount
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
document.getElementById("mod-to-acquire").value = "";
|
document.getElementById("mod-to-acquire").value = "";
|
||||||
|
document.getElementById("mod-count").value = "1";
|
||||||
updateInventory();
|
updateInventory();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#mod-to-acquire").on("input", () => {
|
||||||
|
$("#mod-to-acquire").removeClass("is-invalid");
|
||||||
|
});
|
||||||
|
|
||||||
const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
|
const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
|
||||||
|
|
||||||
function doChangeSettings() {
|
function doChangeSettings() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user