feat(webui): guild view #2752
@ -33,7 +33,8 @@ export const getGuildController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                ...guild.toObject(),
 | 
					                ...guild.toObject(),
 | 
				
			||||||
                Members: members
 | 
					                Members: members
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            res.status(400).end();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    res.end();
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -59,7 +59,7 @@
 | 
				
			|||||||
                        <li class="nav-item">
 | 
					                        <li class="nav-item">
 | 
				
			||||||
                            <a class="nav-link" href="/webui/inventory" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_inventory"></a>
 | 
					                            <a class="nav-link" href="/webui/inventory" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_inventory"></a>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        <li class="nav-item">
 | 
					                        <li class="nav-item d-none" id="nav-guildView">
 | 
				
			||||||
                            <a class="nav-link" href="/webui/guildView" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_guildView"></a>
 | 
					                            <a class="nav-link" href="/webui/guildView" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_guildView"></a>
 | 
				
			||||||
                        </li>
 | 
					                        </li>
 | 
				
			||||||
                        <li class="nav-item">
 | 
					                        <li class="nav-item">
 | 
				
			||||||
 | 
				
			|||||||
@ -151,7 +151,7 @@ function doLogout() {
 | 
				
			|||||||
function renameAccount(taken_name) {
 | 
					function renameAccount(taken_name) {
 | 
				
			||||||
    const newname = window.prompt(
 | 
					    const newname = window.prompt(
 | 
				
			||||||
        (taken_name ? loc("code_changeNameRetry").split("|NAME|").join(taken_name) + " " : "") +
 | 
					        (taken_name ? loc("code_changeNameRetry").split("|NAME|").join(taken_name) + " " : "") +
 | 
				
			||||||
        loc("code_changeNameConfirm")
 | 
					            loc("code_changeNameConfirm")
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    if (newname) {
 | 
					    if (newname) {
 | 
				
			||||||
        revalidateAuthz().then(() => {
 | 
					        revalidateAuthz().then(() => {
 | 
				
			||||||
@ -653,7 +653,12 @@ function updateInventory() {
 | 
				
			|||||||
    req.done(data => {
 | 
					    req.done(data => {
 | 
				
			||||||
        window.itemListPromise.then(itemMap => {
 | 
					        window.itemListPromise.then(itemMap => {
 | 
				
			||||||
            window.didInitialInventoryUpdate = true;
 | 
					            window.didInitialInventoryUpdate = true;
 | 
				
			||||||
            if (data.GuildId.$oid) window.guildId = data.GuildId.$oid;
 | 
					            if (data.GuildId.$oid) {
 | 
				
			||||||
 | 
					                window.guildId = data.GuildId.$oid;
 | 
				
			||||||
 | 
					                document.getElementById("nav-guildView").classList.remove("d-none");
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                document.getElementById("nav-guildView").classList.add("d-none");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            const modularWeapons = [
 | 
					            const modularWeapons = [
 | 
				
			||||||
                "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary",
 | 
					                "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary",
 | 
				
			||||||
@ -1790,7 +1795,9 @@ function updateInventory() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                                let userAlliancePermisssions;
 | 
					                                let userAlliancePermisssions;
 | 
				
			||||||
                                if (userGuildMember && userGuildMember.Rank <= 1) {
 | 
					                                if (userGuildMember && userGuildMember.Rank <= 1) {
 | 
				
			||||||
                                    userAlliancePermisssions = allianceData.Clans.find(c => c._id.$oid === guildId).Permissions;
 | 
					                                    userAlliancePermisssions = allianceData.Clans.find(
 | 
				
			||||||
 | 
					                                        c => c._id.$oid === guildId
 | 
				
			||||||
 | 
					                                    ).Permissions;
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                document.getElementById("Alliance-list").innerHTML = "";
 | 
					                                document.getElementById("Alliance-list").innerHTML = "";
 | 
				
			||||||
                                allianceData.Clans.forEach(clan => {
 | 
					                                allianceData.Clans.forEach(clan => {
 | 
				
			||||||
@ -1807,7 +1814,11 @@ function updateInventory() {
 | 
				
			|||||||
                                        const td = document.createElement("td");
 | 
					                                        const td = document.createElement("td");
 | 
				
			||||||
                                        td.classList = "text-end text-nowrap";
 | 
					                                        td.classList = "text-end text-nowrap";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                        if (!(clan.Permissions & 1) && userAlliancePermisssions && userAlliancePermisssions & 1) {
 | 
					                                        if (
 | 
				
			||||||
 | 
					                                            !(clan.Permissions & 1) &&
 | 
				
			||||||
 | 
					                                            userAlliancePermisssions &&
 | 
				
			||||||
 | 
					                                            userAlliancePermisssions & 1
 | 
				
			||||||
 | 
					                                        ) {
 | 
				
			||||||
                                            const a = document.createElement("a");
 | 
					                                            const a = document.createElement("a");
 | 
				
			||||||
                                            a.href = "#";
 | 
					                                            a.href = "#";
 | 
				
			||||||
                                            a.onclick = function (event) {
 | 
					                                            a.onclick = function (event) {
 | 
				
			||||||
@ -1871,13 +1882,13 @@ function changeGuildRank(guildId, targetId, rankChange) {
 | 
				
			|||||||
    revalidateAuthz().then(() => {
 | 
					    revalidateAuthz().then(() => {
 | 
				
			||||||
        const req = $.get(
 | 
					        const req = $.get(
 | 
				
			||||||
            "/api/changeGuildRank.php?" +
 | 
					            "/api/changeGuildRank.php?" +
 | 
				
			||||||
            window.authz +
 | 
					                window.authz +
 | 
				
			||||||
            "&guildId=" +
 | 
					                "&guildId=" +
 | 
				
			||||||
            guildId +
 | 
					                guildId +
 | 
				
			||||||
            "&targetId=" +
 | 
					                "&targetId=" +
 | 
				
			||||||
            targetId +
 | 
					                targetId +
 | 
				
			||||||
            "&rankChange=" +
 | 
					                "&rankChange=" +
 | 
				
			||||||
            rankChange
 | 
					                rankChange
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        req.done(() => {
 | 
					        req.done(() => {
 | 
				
			||||||
            updateInventory();
 | 
					            updateInventory();
 | 
				
			||||||
@ -2440,9 +2451,9 @@ function maxRankAllEquipment(categories) {
 | 
				
			|||||||
                    data[category].forEach(item => {
 | 
					                    data[category].forEach(item => {
 | 
				
			||||||
                        const maxXP =
 | 
					                        const maxXP =
 | 
				
			||||||
                            category === "Suits" ||
 | 
					                            category === "Suits" ||
 | 
				
			||||||
                                category === "SpaceSuits" ||
 | 
					                            category === "SpaceSuits" ||
 | 
				
			||||||
                                category === "Sentinels" ||
 | 
					                            category === "Sentinels" ||
 | 
				
			||||||
                                category === "Hoverboards"
 | 
					                            category === "Hoverboards"
 | 
				
			||||||
                                ? 1_600_000
 | 
					                                ? 1_600_000
 | 
				
			||||||
                                : 800_000;
 | 
					                                : 800_000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3177,13 +3188,13 @@ function doPushArchonCrystalUpgrade() {
 | 
				
			|||||||
    revalidateAuthz().then(() => {
 | 
					    revalidateAuthz().then(() => {
 | 
				
			||||||
        $.get(
 | 
					        $.get(
 | 
				
			||||||
            "/custom/pushArchonCrystalUpgrade?" +
 | 
					            "/custom/pushArchonCrystalUpgrade?" +
 | 
				
			||||||
            window.authz +
 | 
					                window.authz +
 | 
				
			||||||
            "&oid=" +
 | 
					                "&oid=" +
 | 
				
			||||||
            urlParams.get("itemId") +
 | 
					                urlParams.get("itemId") +
 | 
				
			||||||
            "&type=" +
 | 
					                "&type=" +
 | 
				
			||||||
            uniqueName +
 | 
					                uniqueName +
 | 
				
			||||||
            "&count=" +
 | 
					                "&count=" +
 | 
				
			||||||
            $("#archon-crystal-add-count").val()
 | 
					                $("#archon-crystal-add-count").val()
 | 
				
			||||||
        ).done(function () {
 | 
					        ).done(function () {
 | 
				
			||||||
            $("[list='datalist-archonCrystalUpgrades']").val("");
 | 
					            $("[list='datalist-archonCrystalUpgrades']").val("");
 | 
				
			||||||
            updateInventory();
 | 
					            updateInventory();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user