File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/mod_security/views/vendorListController.min.js
Back
define(["angular","cjt/util/locale","uiBootstrap","cjt/directives/actionButtonDirective","cjt/directives/responsiveSortDirective","cjt/decorators/paginationDecorator","cjt/directives/autoFocus","cjt/directives/spinnerDirective","cjt/services/alertService","app/services/vendorService","cjt/io/whm-v1-querystring-service"],(function(angular,LOCALE){var app=angular.module("App");var controller=app.controller("vendorListController",["$scope","$location","$anchorScroll","$routeParams","$timeout","vendorService","alertService","spinnerAPI","queryService","PAGE",function($scope,$location,$anchorScroll,$routeParams,$timeout,vendorService,alertService,spinnerAPI,queryService,PAGE){$scope.loadEditVendorView=function(vendor,force){var args={id:vendor.vendor_id};if(typeof force!=="undefined"&&force===true){args["force"]=true.toString()}$scope.loadView("vendors/edit",args)};$scope.clearFilter=function(){$scope.meta.filterValue="";$scope.activeSearch=false;$scope.filteredData=false;queryService.query.clearSearch();return $scope.selectPage(1)};$scope.startFilter=function(){$scope.activeSearch=true;$scope.filteredData=false;queryService.query.clearSearch();queryService.query.addSearchField("*","contains",$scope.meta.filterValue);return $scope.selectPage(1).then((function(){$scope.filteredData=true}))};$scope.selectPage=function(page){if(page&&angular.isNumber(page)){$scope.meta.pageNumber=page}queryService.query.updatePagination($scope.meta.pageNumber,$scope.meta.pageSize);return $scope.fetch()};$scope.sortList=function(meta,defaultSort){queryService.query.clearSort();queryService.query.addSortField(meta.sortBy,meta.sortType,meta.sortDirection);if(!defaultSort){$scope.fetch()}};$scope.triggerToggleSearch=function(event){if(event.keyCode===27){$scope.toggleSearch(true)}if(event.keyCode===13){$scope.toggleSearch()}};$scope.toggleSearch=function(isClick){var filter=$scope.meta.filterValue;if(!filter&&($scope.activeSearch||$scope.filteredData)){return $scope.clearFilter()}else if(isClick&&$scope.activeSearch){return $scope.clearFilter()}else if(filter){return $scope.startFilter()}};$scope.fetch=function(){spinnerAPI.start("loadingSpinner");return vendorService.fetchList($scope.meta).then((function(results){$scope.vendors=results.items;$scope.totalItems=results.totalItems;$scope.totalPages=results.totalPages}),(function(error){alertService.add({type:"danger",message:error,id:"errorFetch"})})).then((function(){$scope.loading=false;spinnerAPI.stop("loadingSpinner")}))};$scope.setVenderStatus=function(vendor){spinnerAPI.start("loadingSpinner");if(vendor.enabled){return vendorService.enableVendor(vendor.vendor_id).then((function(result){vendor.enabled=true;if(vendor.in_use===0){$scope.loadEditVendorView(vendor,true)}else{alertService.add({type:"success",message:LOCALE.maketext("You have successfully enabled the vendor: [_1]",vendor.name),id:"enableSuccess"})}}),(function(error){alertService.add({type:"danger",message:error,id:"enableFailed"});vendor.enabled=false})).then((function(){spinnerAPI.stop("loadingSpinner")}))}else{return vendorService.disableVendor(vendor.vendor_id).then((function(result){vendor.enabled=false;alertService.add({type:"success",message:LOCALE.maketext("You have successfully disabled the vendor: [_1]",vendor.name),id:"disableSuccess"})}),(function(error){alertService.add({type:"danger",message:error,id:"disableFailed"})})).then((function(){spinnerAPI.stop("loadingSpinner")}))}};$scope.setVenderUpdate=function(vendor){spinnerAPI.start("loadingSpinner");if(vendor.update){return vendorService.enableVendorUpdates(vendor.vendor_id).then((function(result){vendor.update=true;alertService.add({type:"success",message:LOCALE.maketext("You have successfully enabled automatic updates for the vendor: [_1]",vendor.name),id:"enableUpdatesSuccess"})}),(function(error){alertService.add({type:"danger",message:error,id:"enableUpdatesFailed"})})).then((function(){spinnerAPI.stop("loadingSpinner")}))}else{return vendorService.disableVendorUpdates(vendor.vendor_id).then((function(result){vendor.update=false;alertService.add({type:"success",message:LOCALE.maketext("You have successfully disabled automatic updates for the vendor: [_1]",vendor.name),id:"disableUpdatesSuccess"})}),(function(error){alertService.add({type:"danger",message:error,id:"disableUpdatesFailed"})})).then((function(){spinnerAPI.stop("loadingSpinner")}))}};$scope.install=function(vendor){vendor.installing=true;return vendorService.saveVendor(vendor.installed_from).then((function(){vendor.installed=true;alertService.add({type:"success",message:LOCALE.maketext("You have successfully installed the vendor: [_1]",vendor.name),id:"installSuccess"});spinnerAPI.stop("loadingSpinner");return $scope.fetch()}),(function(error){alertService.add({type:"danger",message:LOCALE.maketext("The system experienced the following error when it attempted to install the “[_1]” vendor: [_2]",vendor.name,error),id:"installFailed"});throw error})).finally((function(){delete vendor.installing}))};$scope.delete=function(vendor){vendor.deleting=true;return vendorService.deleteVendor(vendor.vendor_id).then((function(){alertService.add({type:"success",message:LOCALE.maketext("You have successfully removed the vendor: [_1]",vendor.name),id:"deleteSuccess"});return $scope.fetch()}),(function(error){delete vendor.deleting;alertService.add({type:"danger",message:LOCALE.maketext("The system experienced the following error when it attempted to remove the vendor [_1]: [_2]",vendor.name,error),id:"deleteFailed"});throw error}))};$scope.isDeleting=function(vendor){return vendor.deleting};$scope.showDeleteConfirm=function(vendor){if(vendor.is_pkg){window.location.assign("../../scripts7/EasyApache4/review?uninstall="+vendor.is_pkg);return true}if($scope.lastConfirm){delete $scope.lastConfirm.deleteConfirm;delete $scope.lastConfirm.installConfirm}vendor.deleteConfirm=true;$scope.lastConfirm=vendor};$scope.hideDeleteConfirm=function(vendor){delete vendor.deleteConfirm};$scope.canShowDeleteConfirm=function(vendor){return!!vendor.deleteConfirm};$scope.isVendorInstalled=function(vendor){return vendor.installed};$scope.isInstalling=function(vendor){return vendor.installing};$scope.showInstallConfirm=function(vendor){if($scope.lastConfirm){delete $scope.lastConfirm.deleteConfirm;delete $scope.lastConfirm.installConfirm}vendor.installConfirm=true;$scope.lastConfirm=vendor};$scope.hideInstallConfirm=function(vendor){delete vendor.installConfirm};$scope.canShowInstallConfirm=function(vendor){return!!vendor.installConfirm};$scope.shouldShowDialog=function(vendor){return $scope.canShowDeleteConfirm(vendor)||$scope.canShowInstallConfirm(vendor)};$scope.loading=true;$scope.vendors=[];$scope.totalPages=0;$scope.totalItems=0;$scope.activeSearch=false;$scope.filteredData=false;$scope.lastConfirm=null;var hasPaging=queryService.route.hasPaging();var pageSize=queryService.DEFAULT_PAGE_SIZE;var page=1;if(hasPaging){pageSize=queryService.route.getPageSize();page=queryService.route.getPage()}var sorting=queryService.route.getSortProperties("enabled","","asc");var hasFilter=queryService.route.hasSearch();var filterRules=queryService.route.getSearch();$scope.meta={filterBy:hasFilter?filterRules[0].field:"*",filterCompare:hasFilter?filterRules[0].type:"contains",filterValue:hasFilter?filterRules[0].value:"",pageSize:hasPaging?pageSize:queryService.DEFAULT_PAGE_SIZE,pageNumber:hasPaging?page:1,sortDirection:sorting.direction,sortBy:sorting.field,sortType:sorting.type,pageSizes:queryService.DEFAULT_PAGE_SIZES};$scope.$watch("meta.filterValue",(function(oldValue,newValue){if(oldValue===newValue){return}$scope.activeSearch=false}));$scope.$watch("meta.pageSize",(function(oldValue,newValue){if(oldValue===newValue){return}$scope.selectPage(1)}));$scope.activeSearch=$scope.filteredData=$scope.meta.filterValue?true:false;$scope.isInstalled=PAGE.installed;$scope.exception=queryService.prefetch.failed(PAGE.vendors)?queryService.prefetch.getMetaMessage(PAGE.vendors):"";if(app.firstLoad.vendors&&PAGE.vendors){app.firstLoad.vendors=false;$scope.loading=false;var results=vendorService.prepareList(PAGE.vendors);$scope.vendors=results.items;$scope.totalItems=results.totalItems;$scope.totalPages=results.totalPages}else{$timeout((function(){$scope.selectPage(1)}))}}]);return controller}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.05 |
proxy
|
phpinfo
|
Settings