feat(web): determine initial UI view from URL and wire selected view to appdash; add interface and web README files; bump various dependencies
This commit is contained in:
@@ -100,10 +100,19 @@ export const configStatePart = await appState.getStatePart<IConfigState>(
|
||||
}
|
||||
);
|
||||
|
||||
// Determine initial view from URL path
|
||||
const getInitialView = (): string => {
|
||||
const path = typeof window !== 'undefined' ? window.location.pathname : '/';
|
||||
const validViews = ['overview', 'network', 'emails', 'logs', 'configuration', 'security'];
|
||||
const segments = path.split('/').filter(Boolean);
|
||||
const view = segments[0];
|
||||
return validViews.includes(view) ? view : 'overview';
|
||||
};
|
||||
|
||||
export const uiStatePart = await appState.getStatePart<IUiState>(
|
||||
'ui',
|
||||
{
|
||||
activeView: 'overview',
|
||||
activeView: getInitialView(),
|
||||
sidebarCollapsed: false,
|
||||
autoRefresh: true,
|
||||
refreshInterval: 1000, // 1 second
|
||||
|
||||
Reference in New Issue
Block a user