File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/update_config/config.min.js
Back
define(["angular","jquery","lodash","cjt/util/locale","cjt/util/parse","uiBootstrap","cjt/directives/alert","cjt/directives/callout","cjt/directives/actionButtonDirective","cjt/directives/alertList","cjt/services/alertService","shared/js/update_config/services/updateConfigService"],(function(angular,$,_,LOCALE,PARSE){"use strict";var app=angular.module("whm.updateConfig",["whm.updateConfig.updateConfigurationService"]);app.controller("config",["$scope","updateConfigService","alertService",function($scope,updateConfigService,alertService){$scope.changeStagingDir=function(){$scope.stagingDir=$scope.stagingSelection;if(!/\/$/.test($scope.stagingSelection)){$scope.stagingDir+="/"}};$scope.stagingdirOnChange=function(){$scope.showStagingSubdir=toggleStagingSubdir();$scope.stagingSelection=getPartition()};function toggleStagingSubdir(){return!/^\/usr\/local\/cpanel\/?$/.test($scope.stagingDir)}$scope.submitForm=function($event){if($scope.isSaving){$event.preventDefault();return}$scope.isSaving=true};$scope.enableAutomaticUpdates=function(){return updateConfigService.enableAutomaticUpdates().then((function(result){$scope.autoUpdateEnabled=true;alertService.removeById("autoUpdateError");alertService.add({type:"success",message:LOCALE.maketext("The system saved your changes. To update now, click [output,url,_1,here,id,_2].","../scripts2/upcpform","update-now-link"),id:"autoUpdateSuccess"})})).catch((function(error){var errorMessage=LOCALE.maketext("The system failed to save your new settings: [_1]",_.escape(error));alertService.add({type:"danger",message:errorMessage,id:"autoUpdateError"})}))};$scope.toggleVersionDetails=function(){$scope.showVersionDetails=!$scope.showVersionDetails;if($scope.showVersionDetails){$scope.additionalInfoText=LOCALE.maketext("Hide Additional Details")}else{$scope.additionalInfoText=LOCALE.maketext("Show Additional Details")}};function getCustomTierExpirationStr(){$scope.customTierIsExpired=$scope.customTierExpiration&&$scope.customTierExpiration.getTime()<Date.now();return $scope.customTier&&$scope.customTierIsExpired?LOCALE.maketext("Support for this build ended on [_1].",$scope.customTierExpirationLocalized):LOCALE.maketext("Support for this build will end on [_1].",$scope.customTierExpirationLocalized)}function getPartition(){var partitions=PAGE.partitions;var normalizedStagingDir=$scope.stagingDir.replace(/(\/)+/g,"$1");if(!/\/$/.test(normalizedStagingDir)){normalizedStagingDir+="/"}var partitionMatches=[];var selectPartition="";var partitionPath;if(partitions.length>0){for(var i=0;i<partitions.length;i++){partitionPath=partitions[i].path;if(!/\/$/.test(partitionPath)){partitionPath+="/"}if(normalizedStagingDir.indexOf(partitionPath)===0){partitionMatches.push(partitions[i].path)}}}if(partitionMatches.length>0){selectPartition=partitionMatches.reduce((function(a,b){return a.length>b.length?a:b}))}return selectPartition}$scope.init=function(){$scope.loading=true;$scope.preventSumbit=PAGE.preventSumbit;$scope.saved=PAGE.saved;$scope.saveFailed=PAGE.save_failed;$scope.tiers=PAGE.flat_tiers;$scope.saveFailReason=PAGE.save_fail_reason;$scope.currentVersion=PAGE.current_version;$scope.currentMajorVersion=PAGE.current_major_version;$scope.currentMajorVersionNoEleven=parseInt($scope.currentVersion.split(".")[0]);$scope.isDevVersion=$scope.currentMajorVersionNoEleven%2!==0?true:false;$scope.customTier=PAGE.custom_tier;$scope.requiredFreeSpace=PAGE.required_free_space;$scope.hostname=PAGE.hostname;$scope.stagingDir=PAGE.upconf.staging_dir;$scope.stagingSelection=getPartition();$scope.showStagingSubdir=toggleStagingSubdir();$scope.tierSelection=$scope.customTier?$scope.customTier:PAGE.checked;$scope.isSaving=false;$scope.showVersionDetails=false;$scope.additionalInfoText=LOCALE.maketext("Show Additional Details");var customTierInfo=PAGE.custom_tier_info;if(customTierInfo){$scope.customTierLatestBuild=customTierInfo.latest_build;var customTierExpiration=Math.max(customTierInfo.latest_build_expiration,customTierInfo.main_build_expiration);if(customTierExpiration){$scope.customTierExpiration=new Date(customTierExpiration*1e3);$scope.customTierExpirationLocalized=LOCALE.datetime($scope.customTierExpiration);$scope.customTierExpiredWarningText=getCustomTierExpirationStr()}}if($scope.customTier&&!customTierInfo.main_build){$scope.customTierInvalidWarningText=LOCALE.maketext("“[_1]” is not a supported named release tier. Your server won’t receive updates without a valid tier.",$scope.customTier)}$scope.hasCustomTierWarning=Boolean($scope.customTierInvalidWarningText||$scope.customTierExpiredWarningText);$scope.upconf=PAGE.upconf;$scope.autoUpdateEnabled=PARSE.parsePerlBoolean($scope.upconf.auto_update_enabled);$scope.securityUpdates=$scope.upconf.security_updates!=="never";$scope.loading=false};$scope.init()}])}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings