update
This commit is contained in:
@@ -27,10 +27,10 @@ export class OpsDashboard extends DeesElement {
|
||||
};
|
||||
|
||||
@state() private uiState: appstate.IUiState = {
|
||||
activeView: 'dashboard',
|
||||
activeView: 'overview',
|
||||
sidebarCollapsed: false,
|
||||
autoRefresh: true,
|
||||
refreshInterval: 30000,
|
||||
refreshInterval: 1000,
|
||||
theme: 'light',
|
||||
};
|
||||
|
||||
@@ -87,9 +87,6 @@ export class OpsDashboard extends DeesElement {
|
||||
{
|
||||
name: 'Network',
|
||||
element: OpsViewNetwork,
|
||||
action: () => {
|
||||
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, 'network');
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Emails',
|
||||
@@ -108,14 +105,6 @@ export class OpsDashboard extends DeesElement {
|
||||
element: OpsViewSecurity,
|
||||
},
|
||||
]}
|
||||
.userMenuItems=${[
|
||||
{
|
||||
name: 'Logout',
|
||||
action: async () => {
|
||||
await appstate.loginStatePart.dispatchAction(appstate.logoutAction, null);
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
</dees-simple-appdash>
|
||||
</dees-simple-login>
|
||||
@@ -133,10 +122,15 @@ export class OpsDashboard extends DeesElement {
|
||||
// Handle view changes
|
||||
const appDash = this.shadowRoot.querySelector('dees-simple-appdash');
|
||||
if (appDash) {
|
||||
appDash.addEventListener('viewSwitch', (e: CustomEvent) => {
|
||||
const viewName = e.detail.tabName;
|
||||
appDash.addEventListener('view-select', (e: CustomEvent) => {
|
||||
const viewName = e.detail.view.name;
|
||||
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, viewName.toLowerCase());
|
||||
});
|
||||
|
||||
// Handle logout event
|
||||
appDash.addEventListener('logout', async () => {
|
||||
await appstate.loginStatePart.dispatchAction(appstate.logoutAction, null);
|
||||
});
|
||||
}
|
||||
|
||||
// Handle initial state
|
||||
@@ -175,8 +169,4 @@ export class OpsDashboard extends DeesElement {
|
||||
form.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private async logout() {
|
||||
await appstate.loginStatePart.dispatchAction(appstate.logoutAction, null);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user