mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
added a flag to hide settings (#5263)
Added an optional flag in settings.yml to hide the settings button in no login servers. When hidden, users can no longer: - Open the Settings modal at all (gear button is hidden) - Change General preferences (tool picker mode, hide unavailable tools/conversions, auto‑unzip and file limit) - Configure keyboard shortcuts (Hotkeys / Keyboard Shortcuts section) - Use the in‑app update checker UI (see current/latest version, check for updates, view update details) - Note: When enableLogin === true, the flag is ignored and the Settings button remains visible. --------- Co-authored-by: Anthony Stirling <[email protected]> Co-authored-by: Reece Browne <[email protected]>
This commit is contained in:
co-authored by
Anthony Stirling
Reece Browne
parent
69b035c6e1
commit
1b0a1e938e
@@ -393,6 +393,7 @@ public class ApplicationProperties {
|
|||||||
private boolean googlevisibility;
|
private boolean googlevisibility;
|
||||||
private boolean showUpdate;
|
private boolean showUpdate;
|
||||||
private boolean showUpdateOnlyAdmin;
|
private boolean showUpdateOnlyAdmin;
|
||||||
|
private boolean showSettingsWhenNoLogin = true;
|
||||||
private boolean customHTMLFiles;
|
private boolean customHTMLFiles;
|
||||||
private String tessdataDir;
|
private String tessdataDir;
|
||||||
private boolean enableAlphaFunctionality;
|
private boolean enableAlphaFunctionality;
|
||||||
|
|||||||
+3
@@ -84,6 +84,9 @@ public class ConfigController {
|
|||||||
boolean enableLogin =
|
boolean enableLogin =
|
||||||
applicationProperties.getSecurity().isEnableLogin() && userService != null;
|
applicationProperties.getSecurity().isEnableLogin() && userService != null;
|
||||||
configData.put("enableLogin", enableLogin);
|
configData.put("enableLogin", enableLogin);
|
||||||
|
configData.put(
|
||||||
|
"showSettingsWhenNoLogin",
|
||||||
|
applicationProperties.getSystem().isShowSettingsWhenNoLogin());
|
||||||
|
|
||||||
// Mail settings - check both SMTP enabled AND invites enabled
|
// Mail settings - check both SMTP enabled AND invites enabled
|
||||||
boolean smtpEnabled = applicationProperties.getMail().isEnabled();
|
boolean smtpEnabled = applicationProperties.getMail().isEnabled();
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ system:
|
|||||||
enableAlphaFunctionality: false # set to enable functionality which might need more testing before it fully goes live (this feature might make no changes)
|
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
|
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'
|
showUpdateOnlyAdmin: false # only admins can see when a new update is available, depending on showUpdate it must be set to 'true'
|
||||||
|
showSettingsWhenNoLogin: true # set to 'false' to hide settings button when login is disabled (enableLogin: false). Only applies when login is disabled.
|
||||||
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template HTML files
|
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template HTML files
|
||||||
tessdataDir: "" # 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.
|
tessdataDir: "" # 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
|
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
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ repositories {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = 'stirling.software'
|
group = 'stirling.software'
|
||||||
version = '2.1.5'
|
version = '2.2.0'
|
||||||
|
|
||||||
configurations.configureEach {
|
configurations.configureEach {
|
||||||
exclude group: 'commons-logging', module: 'commons-logging'
|
exclude group: 'commons-logging', module: 'commons-logging'
|
||||||
|
|||||||
@@ -173,6 +173,12 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
|||||||
// onClick: () => setActiveButton('activity')
|
// onClick: () => setActiveButton('activity')
|
||||||
//},
|
//},
|
||||||
|
|
||||||
|
// Determine if settings button should be hidden
|
||||||
|
// Hide when login is disabled AND showSettingsWhenNoLogin is false
|
||||||
|
const shouldHideSettingsButton =
|
||||||
|
config?.enableLogin === false &&
|
||||||
|
config?.showSettingsWhenNoLogin === false;
|
||||||
|
|
||||||
const bottomButtons: ButtonConfig[] = [
|
const bottomButtons: ButtonConfig[] = [
|
||||||
{
|
{
|
||||||
id: 'help',
|
id: 'help',
|
||||||
@@ -185,17 +191,17 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
|||||||
// This will be overridden by the wrapper logic
|
// This will be overridden by the wrapper logic
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
...(shouldHideSettingsButton ? [] : [{
|
||||||
id: 'config',
|
id: 'config',
|
||||||
name: t("quickAccess.settings", "Settings"),
|
name: t("quickAccess.settings", "Settings"),
|
||||||
icon: <LocalIcon icon="settings-rounded" width="1.25rem" height="1.25rem" />,
|
icon: <LocalIcon icon="settings-rounded" width="1.25rem" height="1.25rem" />,
|
||||||
size: 'md',
|
size: 'md' as const,
|
||||||
type: 'modal',
|
type: 'modal' as const,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
navigate('/settings/overview');
|
navigate('/settings/overview');
|
||||||
setConfigModalOpen(true);
|
setConfigModalOpen(true);
|
||||||
}
|
}
|
||||||
}
|
} as ButtonConfig])
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export interface AppConfig {
|
|||||||
defaultLocale?: string;
|
defaultLocale?: string;
|
||||||
logoStyle?: 'modern' | 'classic';
|
logoStyle?: 'modern' | 'classic';
|
||||||
enableLogin?: boolean;
|
enableLogin?: boolean;
|
||||||
|
showSettingsWhenNoLogin?: boolean;
|
||||||
enableEmailInvites?: boolean;
|
enableEmailInvites?: boolean;
|
||||||
isAdmin?: boolean;
|
isAdmin?: boolean;
|
||||||
enableAlphaFunctionality?: boolean;
|
enableAlphaFunctionality?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user