From 1efaee2e2f4489e570f0320d288fff45cd9a27b3 Mon Sep 17 00:00:00 2001 From: Stefan Werfling Date: Sat, 3 Aug 2024 09:37:03 +0200 Subject: [PATCH] add menu item for user credential, fix domain map check --- .../inc/Pages/Credential/CredentialUsers.ts | 20 +++++++++++++++++-- frontend/src/inc/Pages/Domains.ts | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/frontend/src/inc/Pages/Credential/CredentialUsers.ts b/frontend/src/inc/Pages/Credential/CredentialUsers.ts index 7138f5c..ac6fc13 100644 --- a/frontend/src/inc/Pages/Credential/CredentialUsers.ts +++ b/frontend/src/inc/Pages/Credential/CredentialUsers.ts @@ -6,7 +6,7 @@ import { ContentColSize, ContentRow, IconFa, - LeftNavbarLink, + LeftNavbarLink, SidebarMenuItem, SidebarMenuTree, Table, Td, Th, @@ -28,7 +28,7 @@ export class CredentialUsers extends BasePage { * name * @protected */ - protected override _name: string = 'credential'; + protected override _name: string = 'credential_user'; /** * Credential @@ -113,6 +113,22 @@ export class CredentialUsers extends BasePage { * loadContent */ public override async loadContent(): Promise { + // Menu Tree --------------------------------------------------------------------------------------------------- + + const menuItem = this._wrapper.getMainSidebar().getSidebar().getMenu().getMenuItem('credential'); + + if (menuItem !== null) { + menuItem.setActiv(true); + + const menuTree = new SidebarMenuTree(menuItem); + + const pmenuItem = new SidebarMenuItem(menuTree); + pmenuItem.setActiv(true); + pmenuItem.setTitle(`User-List: ${this._credential.name}`); + } + + // ------------------------------------------------------------------------------------------------------------- + const row1 = new ContentRow(this._wrapper.getContentWrapper().getContent()); const card = new Card(new ContentCol(row1, ContentColSize.col12)); diff --git a/frontend/src/inc/Pages/Domains.ts b/frontend/src/inc/Pages/Domains.ts index 1cdc3a2..5859b8e 100644 --- a/frontend/src/inc/Pages/Domains.ts +++ b/frontend/src/inc/Pages/Domains.ts @@ -601,7 +601,7 @@ export class Domains extends BasePage { const row1 = new ContentRow(content); loadDomain(0, new ContentCol(row1, ContentColSize.col12)); - if (domainMap.size <= 1) { + if (domainMap.size <= 0) { const ib = new InfoBox(new ContentCol(row1, ContentColSize.col12), InfoBoxBg.none, InfoBoxMb.none); ib.setIcon(IconFa.info, InfoBoxBg.info); ib.getTextElement().append('None Domain exist, please add a new Domain!');