This commit is contained in:
Jan Prochazka 2024-07-30 13:29:39 +02:00
parent 4346147bfc
commit f345c80144
2 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ export function getPredefinedPermissions(predefinedRoleName: string) {
return ['*', '~widgets/*', 'widgets/admin'];
case 'logged-user':
return ['*', '~widgets/admin', '~admin/*'];
case 'anonymouse-user':
case 'anonymous-user':
return ['*', '~widgets/admin', '~admin/*'];
default:
return null;

View File

@ -7,7 +7,7 @@ import { getSettings, useConfig, useSettings } from './utility/metadataLoaders';
import _ from 'lodash';
import { safeJsonParse } from 'dbgate-tools';
import { apiCall } from './utility/api';
import { getOpenedTabsStorageName } from './utility/pageDefs';
import { getOpenedTabsStorageName, isAdminPage } from './utility/pageDefs';
export interface TabDefinition {
title: string;
@ -73,7 +73,7 @@ function subscribeCssVariable(store, transform, cssVariable) {
store.subscribe(value => document.documentElement.style.setProperty(cssVariable, transform(value)));
}
export const selectedWidget = writableWithStorage('database', 'selectedWidget');
export const selectedWidget = writableWithStorage('database', isAdminPage() ? 'selectedAdminWidget' : 'selectedWidget');
export const lockedDatabaseMode = writableWithStorage<boolean>(false, 'lockedDatabaseMode');
export const visibleWidgetSideBar = writableWithStorage(true, 'visibleWidgetSideBar');
export const visibleSelectedWidget = derived(