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