From 1a682409a8dda05f413f6b7af02064793953cb8b Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Thu, 6 Jan 2022 22:29:11 +0100 Subject: [PATCH] feat(config): add aowow url to config file --- config.default.json | 1 + src/armory/Armory.ts | 3 ++- src/armory/Config.ts | 1 + static/character.html | 17 ++++++++++++++--- static/css/character.css | 2 -- static/index.html | 1 + static/layout.html | 2 +- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/config.default.json b/config.default.json index b4e5990..a555c18 100644 --- a/config.default.json +++ b/config.default.json @@ -1,4 +1,5 @@ { + "aowowUrl": "https://wotlkdb.com", "realms": [ { "name": "AzerothCore", diff --git a/src/armory/Armory.ts b/src/armory/Armory.ts index a3fe21e..86608fc 100644 --- a/src/armory/Armory.ts +++ b/src/armory/Armory.ts @@ -41,6 +41,7 @@ export class Armory { } console.log("Starting server..."); + app.locals.aowow = this.config.aowowUrl; app.engine(".html", handlebarsEngine({ extname: "html", partialsDir: path.join(process.cwd(), "static", "partials"), @@ -62,7 +63,7 @@ export class Armory { const indexController = new IndexController(this); app.get("/", indexController.index.bind(indexController)); - + const charsController = new CharacterController(this); await charsController.load(); app.get("/character/:realm/:name", charsController.character.bind(charsController)); diff --git a/src/armory/Config.ts b/src/armory/Config.ts index 783673b..b984cbf 100644 --- a/src/armory/Config.ts +++ b/src/armory/Config.ts @@ -15,6 +15,7 @@ export interface IRealmConfig { } export class Config { + public aowowUrl: string; public realms: IRealmConfig[]; public worldDatabase: IDatabaseConfig; diff --git a/static/character.html b/static/character.html index 3728cd2..d9063c0 100644 --- a/static/character.html +++ b/static/character.html @@ -1,7 +1,18 @@ + - + + +Back to Armory

@@ -128,8 +139,8 @@ .addClass("iconlarge"); $item.find(".inventory-slot").css("background-image", `url("/img/inventory-slot/${invSlot}.png")`); if (item !== undefined) { - $item.find(".icon").css("background-image", `url("https://wotlkdb.com/static/images/wow/icons/large/${icon}.jpg")`); - $item.find("a").attr("href", `https://wotlkdb.com/?item=${item}`); + $item.find(".icon").css("background-image", `url("{{aowow}}/static/images/wow/icons/large/${icon}.jpg")`); + $item.find("a").attr("href", `{{aowow}}/?item=${item}`); $item.find("a").attr("rel", rel); } $item.appendTo($(container)); diff --git a/static/css/character.css b/static/css/character.css index da4cc53..ee9c1d4 100644 --- a/static/css/character.css +++ b/static/css/character.css @@ -30,7 +30,6 @@ .iconlarge .border { width: 68px; height: 68px; - background-image: url("https://wotlkdb.com/static/images/Icon/large/border/default.png"); position: absolute; left: 0; top: 0; @@ -40,7 +39,6 @@ .iconlarge a { width: 62px; height: 62px; - background: url("https://wotlkdb.com/static/images/Icon/large/hilite/default.png") no-repeat 62px 0; position: absolute; left: 3px; top: 3px; diff --git a/static/index.html b/static/index.html index e69de29..a8d97b6 100644 --- a/static/index.html +++ b/static/index.html @@ -0,0 +1 @@ +Armory diff --git a/static/layout.html b/static/layout.html index a9daa11..9bdf4ef 100644 --- a/static/layout.html +++ b/static/layout.html @@ -10,7 +10,7 @@ - + {{{ body }}}