define(["exports","./../../modules/viewmanager/basesettingsview.js","./../../modules/loading/loading.js","./../../modules/formhelper.js"],function(_exports,_basesettingsview,_loading,_formhelper){function DatabaseView(view,params){_basesettingsview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",function(e){_loading.default.show();var view=e.target.closest("form").closest(".view"),apiClient=this.getApiClient();return apiClient.getServerConfiguration().then(function(config){config.OptimizeDatabaseOnShutdown=view.querySelector(".chkOptimizeOnShutdown").checked,config.VacuumDatabaseOnStartup=view.querySelector(".chkVacuum").checked,config.DatabaseCacheSizeMB=view.querySelector(".txtCacheSize").value,config.DatabaseAnalysisLimit=view.querySelector(".txtAnalysisLimit").value,apiClient.updateServerConfiguration(config).then(_formhelper.default.handleConfigurationSavedResponse)}),e.preventDefault(),e.stopPropagation(),!1}.bind(this))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(DatabaseView.prototype,_basesettingsview.default.prototype),DatabaseView.prototype.loadSettingsInternal=function(){return(instance=this).getApiClient().getServerConfiguration().then(function(config){var view=instance.view;view.querySelector(".chkOptimizeOnShutdown").checked=config.OptimizeDatabaseOnShutdown||!1,view.querySelector(".chkVacuum").checked=config.VacuumDatabaseOnStartup||!1,view.querySelector(".txtCacheSize").value=config.DatabaseCacheSizeMB||96,view.querySelector(".txtAnalysisLimit").value=config.DatabaseAnalysisLimit||400});var instance};_exports.default=DatabaseView});