client GlobalUI: use display name for navigation items

This commit is contained in:
Starbeamrainbowlabs 2022-03-11 01:39:45 +00:00
parent 658c6ca7f6
commit 00722e6b76
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -35,16 +35,19 @@ class GlobalUI {
const result = document.createDocumentFragment(); const result = document.createDocumentFragment();
for(const table_name of status.tables) { for(const table_name of status.tables) {
console.log(`[nav] new dynamic item ${table_name}, def`, tabledefs[table_name]); console.log(`[nav] new dynamic item ${table_name}, def`, tabledefs[table_name]);
const icondef = typeof tabledefs[table_name] === "undefined" let icondef = `question-circle`;
? "question-circle" let display_name = table_name;
: tabledefs[table_name].icon; if(typeof tabledefs[table_name] !== "undefined") {
icondef = tabledefs[table_name].icon;
display_name = tabledefs[table_name].name;
}
const emel_icon = forkawesome_emel(icondef); const emel_icon = forkawesome_emel(icondef);
console.log(`emel_icon`, emel_icon); console.log(`emel_icon`, emel_icon);
result.append(this.emel(`li>a[href="?"]>${emel_icon}+span{?}`, { result.append(this.emel(`li>a[href="?"]>${emel_icon}+span{?}`, {
placeholders: [ placeholders: [
`#table/${table_name}`, `#table/${table_name}`,
table_name display_name
] ]
})); }));
} }