mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-18 20:04:17 +01:00
Merge 798b0e31fc into 3529849bca
This commit is contained in:
commit
7d89ac8db0
@ -392,6 +392,7 @@ public class ApplicationProperties {
|
||||
private Boolean googlevisibility;
|
||||
private boolean showUpdate;
|
||||
private Boolean showUpdateOnlyAdmin;
|
||||
private Boolean hideSettingsForNonAdmins;
|
||||
private boolean customHTMLFiles;
|
||||
private String tessdataDir;
|
||||
private Boolean enableAlphaFunctionality;
|
||||
|
||||
@ -84,6 +84,9 @@ public class ConfigController {
|
||||
boolean enableLogin =
|
||||
applicationProperties.getSecurity().getEnableLogin() && userService != null;
|
||||
configData.put("enableLogin", enableLogin);
|
||||
configData.put(
|
||||
"hideSettingsForNonAdmins",
|
||||
applicationProperties.getSystem().getHideSettingsForNonAdmins());
|
||||
|
||||
// Mail settings - check both SMTP enabled AND invites enabled
|
||||
boolean smtpEnabled = applicationProperties.getMail().isEnabled();
|
||||
|
||||
@ -125,6 +125,7 @@ system:
|
||||
enableAlphaFunctionality: false # set to enable functionality which might need more testing before it fully goes live (this feature might make no changes)
|
||||
showUpdate: false # see when a new update is available
|
||||
showUpdateOnlyAdmin: false # only admins can see when a new update is available, depending on showUpdate it must be set to 'true'
|
||||
hideSettingsForNonAdmins: false # set to 'true' to hide settings button for non-admins when login is disabled (enableLogin: false)
|
||||
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template HTML files
|
||||
tessdataDir: /usr/share/tessdata # path to the directory containing the Tessdata files. This setting is relevant for Windows systems. For Windows users, this path should be adjusted to point to the appropriate directory where the Tessdata files are stored.
|
||||
enableAnalytics: null # Master toggle for analytics: set to 'true' to enable all analytics, 'false' to disable all analytics, or leave as 'null' to prompt admin on first launch
|
||||
|
||||
@ -173,6 +173,13 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
||||
// onClick: () => setActiveButton('activity')
|
||||
//},
|
||||
|
||||
// Determine if settings button should be hidden
|
||||
// Only hide when login is disabled AND hideSettingsForNonAdmins is true AND user is not admin
|
||||
const shouldHideSettingsButton =
|
||||
config?.enableLogin === false &&
|
||||
config?.hideSettingsForNonAdmins === true &&
|
||||
config?.isAdmin !== true;
|
||||
|
||||
const bottomButtons: ButtonConfig[] = [
|
||||
{
|
||||
id: 'help',
|
||||
@ -185,17 +192,17 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
||||
// This will be overridden by the wrapper logic
|
||||
},
|
||||
},
|
||||
{
|
||||
...(shouldHideSettingsButton ? [] : [{
|
||||
id: 'config',
|
||||
name: t("quickAccess.settings", "Settings"),
|
||||
icon: <LocalIcon icon="settings-rounded" width="1.25rem" height="1.25rem" />,
|
||||
size: 'md',
|
||||
type: 'modal',
|
||||
size: 'md' as const,
|
||||
type: 'modal' as const,
|
||||
onClick: () => {
|
||||
navigate('/settings/overview');
|
||||
setConfigModalOpen(true);
|
||||
}
|
||||
}
|
||||
} as ButtonConfig])
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@ -23,6 +23,7 @@ export interface AppConfig {
|
||||
defaultLocale?: string;
|
||||
logoStyle?: 'modern' | 'classic';
|
||||
enableLogin?: boolean;
|
||||
hideSettingsForNonAdmins?: boolean;
|
||||
enableEmailInvites?: boolean;
|
||||
isAdmin?: boolean;
|
||||
enableAlphaFunctionality?: boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user