feat(character-header): add guild link
This commit is contained in:
parent
6ebaccc020
commit
08bb89568d
3 changed files with 16 additions and 9 deletions
|
|
@ -19,6 +19,7 @@ interface ICharacterData {
|
|||
facialStyle: number;
|
||||
playerFlags: number;
|
||||
online: number;
|
||||
guild: string;
|
||||
}
|
||||
|
||||
interface IEquipmentData {
|
||||
|
|
@ -278,6 +279,7 @@ export class CharacterController {
|
|||
class: ClassDisplayName[charData.class],
|
||||
level: charData.level,
|
||||
online: charData.online === 1,
|
||||
guild: charData.guild,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -286,10 +288,12 @@ export class CharacterController {
|
|||
}
|
||||
|
||||
private async getCharacterData(realm: IRealmConfig, character: string | number): Promise<ICharacterData> {
|
||||
const where = typeof character === "string" ? "LOWER(name) = LOWER(?)" : "guid = ?";
|
||||
const where = typeof character === "string" ? "LOWER(`characters`.`name`) = LOWER(?)" : "`characters`.`guid` = ?";
|
||||
const [rows, fields] = await this.armory.getCharactersDb(realm.name).query(`
|
||||
SELECT \`guid\`, \`name\`, \`race\`, \`class\`, \`gender\`, \`level\`, \`skin\`, \`face\`, \`hairStyle\`, \`hairColor\`, \`facialStyle\`, \`playerFlags\`, \`online\`
|
||||
SELECT \`characters\`.\`guid\`, \`characters\`.\`name\`, \`race\`, \`class\`, \`gender\`, \`level\`, \`skin\`, \`face\`, \`hairStyle\`, \`hairColor\`, \`facialStyle\`, \`playerFlags\`, \`online\`, \`guild\`.\`name\` AS \`guild\`
|
||||
FROM \`characters\`
|
||||
LEFT JOIN \`guild_member\` ON \`guild_member\`.\`guid\` = \`characters\`.\`guid\`
|
||||
LEFT JOIN \`guild\` ON \`guild\`.\`guildid\` = \`guild_member\`.\`guildid\`
|
||||
LEFT JOIN \`${realm.authDatabase}\`.\`account_access\` ON \`account_access\`.\`id\` = \`characters\`.\`account\`
|
||||
WHERE
|
||||
${where}
|
||||
|
|
|
|||
|
|
@ -2,3 +2,7 @@ html {
|
|||
/* Removes the vertical scrollbar caused by Bulma */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.char-name.title {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,17 +7,16 @@
|
|||
<br>
|
||||
<br>
|
||||
|
||||
<div class="char-name">
|
||||
<span class="char-name">{{name}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="char-name title is-size-3">{{name}}</div>
|
||||
{{#if guild}}
|
||||
<a class="guild-name title is-size-4" href="/guild/{{guild}}"><{{guild}}></a>
|
||||
{{/if}}
|
||||
<div class="is-size-5">
|
||||
Level <span class="char-level">{{level}}</span>
|
||||
<span class="char-race">{{race}}</span>
|
||||
<span class="char-class">{{class}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="char-realm">{{realm}}</span>
|
||||
</div>
|
||||
<div class="char-realm">{{realm}}</div>
|
||||
<div>
|
||||
{{#if online}}
|
||||
Online 🟢
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue