feat(config): add aowow url to config file

This commit is contained in:
Axel Cocat 2022-01-06 22:29:11 +01:00
parent 73916950b7
commit 1a682409a8
7 changed files with 20 additions and 7 deletions

View file

@ -1,4 +1,5 @@
{ {
"aowowUrl": "https://wotlkdb.com",
"realms": [ "realms": [
{ {
"name": "AzerothCore", "name": "AzerothCore",

View file

@ -41,6 +41,7 @@ export class Armory {
} }
console.log("Starting server..."); console.log("Starting server...");
app.locals.aowow = this.config.aowowUrl;
app.engine(".html", handlebarsEngine({ app.engine(".html", handlebarsEngine({
extname: "html", extname: "html",
partialsDir: path.join(process.cwd(), "static", "partials"), partialsDir: path.join(process.cwd(), "static", "partials"),
@ -62,7 +63,7 @@ export class Armory {
const indexController = new IndexController(this); const indexController = new IndexController(this);
app.get("/", indexController.index.bind(indexController)); app.get("/", indexController.index.bind(indexController));
const charsController = new CharacterController(this); const charsController = new CharacterController(this);
await charsController.load(); await charsController.load();
app.get("/character/:realm/:name", charsController.character.bind(charsController)); app.get("/character/:realm/:name", charsController.character.bind(charsController));

View file

@ -15,6 +15,7 @@ export interface IRealmConfig {
} }
export class Config { export class Config {
public aowowUrl: string;
public realms: IRealmConfig[]; public realms: IRealmConfig[];
public worldDatabase: IDatabaseConfig; public worldDatabase: IDatabaseConfig;

View file

@ -1,7 +1,18 @@
<link rel="stylesheet" href="/css/character.css"> <link rel="stylesheet" href="/css/character.css">
<style>
.iconlarge .border {
background-image: url("{{aowow}}/static/images/Icon/large/border/default.png");
}
.iconlarge a {
background: url("{{aowow}}/static/images/Icon/large/hilite/default.png") no-repeat 62px 0;
}
</style>
<script type="application/javascript" src="/js/viewer.min.js"></script> <script type="application/javascript" src="/js/viewer.min.js"></script>
<script type="application/javascript" src="https://wotlkdb.com/static/widgets/power.js"></script> <script type="application/javascript" src="{{aowow}}/static/widgets/power.js"></script>
<a href="/">Back to Armory</a><br><br>
<div style="display: flex; max-width: 580px; height: 580px;"> <div style="display: flex; max-width: 580px; height: 580px;">
<div id="equipment-col-left" style="flex: 12%;"></div> <div id="equipment-col-left" style="flex: 12%;"></div>
@ -128,8 +139,8 @@
.addClass("iconlarge"); .addClass("iconlarge");
$item.find(".inventory-slot").css("background-image", `url("/img/inventory-slot/${invSlot}.png")`); $item.find(".inventory-slot").css("background-image", `url("/img/inventory-slot/${invSlot}.png")`);
if (item !== undefined) { if (item !== undefined) {
$item.find(".icon").css("background-image", `url("https://wotlkdb.com/static/images/wow/icons/large/${icon}.jpg")`); $item.find(".icon").css("background-image", `url("{{aowow}}/static/images/wow/icons/large/${icon}.jpg")`);
$item.find("a").attr("href", `https://wotlkdb.com/?item=${item}`); $item.find("a").attr("href", `{{aowow}}/?item=${item}`);
$item.find("a").attr("rel", rel); $item.find("a").attr("rel", rel);
} }
$item.appendTo($(container)); $item.appendTo($(container));

View file

@ -30,7 +30,6 @@
.iconlarge .border { .iconlarge .border {
width: 68px; width: 68px;
height: 68px; height: 68px;
background-image: url("https://wotlkdb.com/static/images/Icon/large/border/default.png");
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
@ -40,7 +39,6 @@
.iconlarge a { .iconlarge a {
width: 62px; width: 62px;
height: 62px; height: 62px;
background: url("https://wotlkdb.com/static/images/Icon/large/hilite/default.png") no-repeat 62px 0;
position: absolute; position: absolute;
left: 3px; left: 3px;
top: 3px; top: 3px;

View file

@ -0,0 +1 @@
Armory

View file

@ -10,7 +10,7 @@
</head> </head>
<body> <body>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="application/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
{{{ body }}} {{{ body }}}
</body> </body>