add feature flags for new pages

This commit is contained in:
smthbh 2025-06-21 16:28:23 -04:00
parent f63214264a
commit bf2672cc94
6 changed files with 38 additions and 8 deletions

View file

@ -23,3 +23,6 @@ ACORE_ARMORY_WORLD_DATABASE__USER="acore"
ACORE_ARMORY_WORLD_DATABASE__PASSWORD="acore" ACORE_ARMORY_WORLD_DATABASE__PASSWORD="acore"
ACORE_ARMORY_WORLD_DATABASE__DATABASE="acore_world" ACORE_ARMORY_WORLD_DATABASE__DATABASE="acore_world"
ACORE_ARMORY_DB_QUERY_TIMEOUT=10000 ACORE_ARMORY_DB_QUERY_TIMEOUT=10000
ACORE_ARMORY_FEATURE_FLAGS__ENABLE_QUESTS_PAGE=1
ACORE_ARMORY_FEATURE_FLAGS__ENABLE_SKILLS_PAGE=1
ACORE_ARMORY_FEATURE_FLAGS__ENABLE_REPUTATION_PAGE=1

View file

@ -33,5 +33,10 @@
"password": "acore", "password": "acore",
"database": "acore_world" "database": "acore_world"
}, },
"dbQueryTimeout": 10000 "dbQueryTimeout": 10000,
"featureFlags": {
"enableQuestsPage": true,
"enableReputationPage": true,
"enableSkillsPage": true
}
} }

View file

@ -191,13 +191,19 @@ export class Armory {
await charsController.load(); await charsController.load();
app.get("/character/:realm/:name", this.wrapRoute(charsController.character.bind(charsController))); app.get("/character/:realm/:name", this.wrapRoute(charsController.character.bind(charsController)));
app.get("/character/:realm/:name/talents", this.wrapRoute(charsController.talents.bind(charsController))); app.get("/character/:realm/:name/talents", this.wrapRoute(charsController.talents.bind(charsController)));
app.get("/character/:realm/:name/skills", this.wrapRoute(charsController.skills.bind(charsController))); if (this.config.featureFlags.enableSkillsPage) {
app.get("/character/:realm/:name/skills", this.wrapRoute(charsController.skills.bind(charsController)));
}
app.get("/character/:realm/:name/achievements", this.wrapRoute(charsController.achievements.bind(charsController))); app.get("/character/:realm/:name/achievements", this.wrapRoute(charsController.achievements.bind(charsController)));
app.get("/character/:realm/:character/achievements/data", this.wrapRoute(charsController.achievementsData.bind(charsController))); app.get("/character/:realm/:character/achievements/data", this.wrapRoute(charsController.achievementsData.bind(charsController)));
app.get("/character/:realm/:name/pvp", this.wrapRoute(charsController.pvp.bind(charsController))); app.get("/character/:realm/:name/pvp", this.wrapRoute(charsController.pvp.bind(charsController)));
app.get("/character/:realm/:name/reputation", this.wrapRoute(charsController.reputation.bind(charsController))); if (this.config.featureFlags.enableReputationPage) {
app.get("/character/:realm/:name/quests", this.wrapRoute(charsController.quests.bind(charsController))); app.get("/character/:realm/:name/reputation", this.wrapRoute(charsController.reputation.bind(charsController)));
app.get("/character/:realm/:name/quests/compare/:otherRealm/:otherName", this.wrapRoute(charsController.questsCompare.bind(charsController))); }
if (this.config.featureFlags.enableQuestsPage) {
app.get("/character/:realm/:name/quests", this.wrapRoute(charsController.quests.bind(charsController)));
app.get("/character/:realm/:name/quests/compare/:otherRealm/:otherName", this.wrapRoute(charsController.questsCompare.bind(charsController)));
}
const guildsController = new GuildController(this); const guildsController = new GuildController(this);
app.get("/guild/:realm/:name", this.wrapRoute(guildsController.guild.bind(guildsController))); app.get("/guild/:realm/:name", this.wrapRoute(guildsController.guild.bind(guildsController)));

View file

@ -23,6 +23,12 @@ export interface IIframeModeConfig {
url: string; url: string;
} }
export interface IFeatureFlags {
enableQuestsPage: boolean;
enableReputationPage: boolean;
enableSkillsPage: boolean;
}
export class Config { export class Config {
public aowowUrl: string; public aowowUrl: string;
public wowheadUrl: string; public wowheadUrl: string;
@ -37,6 +43,7 @@ export class Config {
public realms: IRealmConfig[]; public realms: IRealmConfig[];
public worldDatabase: IDatabaseConfig; public worldDatabase: IDatabaseConfig;
public dbQueryTimeout: number; public dbQueryTimeout: number;
public featureFlags: IFeatureFlags;
private static envPrefix = "ACORE_ARMORY"; private static envPrefix = "ACORE_ARMORY";
private static checkedMissingField = false; private static checkedMissingField = false;

View file

@ -789,6 +789,9 @@ export class CharacterController {
guild: charData.guild, guild: charData.guild,
zone: charData.zone, zone: charData.zone,
zoneName: this.getZoneName(charData.zone), zoneName: this.getZoneName(charData.zone),
enableQuestsPage: this.armory.config.featureFlags.enableQuestsPage,
enableSkillsPage: this.armory.config.featureFlags.enableSkillsPage,
enableReputationPage: this.armory.config.featureFlags.enableReputationPage
}; };
} }

View file

@ -3,9 +3,15 @@
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}">Character</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}">Character</a>&emsp;
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/talents">Talents</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/talents">Talents</a>&emsp;
{{#if enableSkillsPage}}
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/skills">Skills</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/skills">Skills</a>&emsp;
{{/if}}
{{#if enableReputationPage}}
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/reputation">Reputation</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/reputation">Reputation</a>&emsp;
{{/if}}
{{#if enableQuestsPage}}
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/quests">Quests</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/quests">Quests</a>&emsp;
{{/if}}
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/achievements">Achievements</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/achievements">Achievements</a>&emsp;
<a href="{{websiteRoot}}/character/{{realm}}/{{name}}/pvp">PvP</a>&emsp; <a href="{{websiteRoot}}/character/{{realm}}/{{name}}/pvp">PvP</a>&emsp;
<br> <br>
@ -23,11 +29,11 @@
<div class="char-realm">{{realm}}</div> <div class="char-realm">{{realm}}</div>
<div> <div>
{{#if online}} {{#if online}}
Online 🟢 Online 🟢
{{else}} {{else}}
Offline 🔴 Offline 🔴
{{/if}} {{/if}}
- <a href="{{wowhead}}/zone={{zone}}"> <a href="{{wowhead}}/zone={{zone}}">
{{#if zoneName}} {{#if zoneName}}
{{zoneName}} {{zoneName}}
{{/if}} {{/if}}