mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-12 10:35:03 +00:00
Moved GoogleDrive settings to EEAppConfig. Bean now passing config as an object
This commit is contained in:
parent
542b2dda52
commit
8438413935
@ -11,6 +11,7 @@ import stirling.software.SPDF.EE.KeygenLicenseVerifier.License;
|
||||
import stirling.software.SPDF.model.ApplicationProperties;
|
||||
import stirling.software.SPDF.model.ApplicationProperties.EnterpriseEdition;
|
||||
import stirling.software.SPDF.model.ApplicationProperties.Premium;
|
||||
import stirling.software.SPDF.model.ApplicationProperties.Premium.ProFeatures.GoogleDrive;
|
||||
|
||||
@Configuration
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
@ -43,6 +44,17 @@ public class EEAppConfig {
|
||||
return applicationProperties.getPremium().getProFeatures().isSsoAutoLogin();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveEnabled")
|
||||
public boolean googleDriveEnabled() {
|
||||
return runningProOrHigher()
|
||||
&& applicationProperties.getPremium().getProFeatures().getGoogleDrive().isEnabled();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveConfig")
|
||||
public GoogleDrive googleDriveConfig() {
|
||||
return applicationProperties.getPremium().getProFeatures().getGoogleDrive();
|
||||
}
|
||||
|
||||
// TODO: Remove post migration
|
||||
public void migrateEnterpriseSettingsToPremium(ApplicationProperties applicationProperties) {
|
||||
EnterpriseEdition enterpriseEdition = applicationProperties.getEnterpriseEdition();
|
||||
|
@ -195,25 +195,4 @@ public class AppConfig {
|
||||
public String uuid() {
|
||||
return applicationProperties.getAutomaticallyGenerated().getUUID();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveEnabled")
|
||||
public boolean googleDriveEnabled() {
|
||||
return applicationProperties.getPremium().isEnabled()
|
||||
&& applicationProperties.getPremium().getProFeatures().getGoogleDrive().isEnabled();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveClientId")
|
||||
public String googleDriveClientId() {
|
||||
return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getClientId();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveApiKey")
|
||||
public String googleDriveApiKey() {
|
||||
return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getApiKey();
|
||||
}
|
||||
|
||||
@Bean(name = "GoogleDriveAppId")
|
||||
public String googleDriveAppId() {
|
||||
return applicationProperties.getPremium().getProFeatures().getGoogleDrive().getAppId();
|
||||
}
|
||||
}
|
||||
|
@ -268,9 +268,9 @@
|
||||
<script async defer src="https://accounts.google.com/gsi/client" onload="gisLoaded()"></script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const CLIENT_ID = /*[[${@GoogleDriveClientId}]]*/ null;
|
||||
const API_KEY = /*[[${@GoogleDriveApiKey}]]*/ null;
|
||||
const APP_ID = /*[[${@GoogleDriveAppId}]]*/ null;
|
||||
const CLIENT_ID = /*[[${@GoogleDriveConfig.getClientId()}]]*/ null;
|
||||
const API_KEY = /*[[${@GoogleDriveConfig.getApiKey()}]]*/ null;
|
||||
const APP_ID = /*[[${@GoogleDriveConfig.getAppId()}]]*/ null;
|
||||
|
||||
</script>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user